aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-02-02 03:43:20 -0500
committerIngo Molnar <mingo@kernel.org>2014-02-02 03:43:20 -0500
commit65370bdf881e20907e7a53abab9b8c0bc5f60a6b (patch)
tree0d32a494e873b7b92dbfab0e67ffeef597ee8108 /include/net
parente207552e64ea053a33e856828ad7915484911d06 (diff)
parent5cb480f6b488128140c940abff3c36f524a334a8 (diff)
Merge branch 'linus' into core/locking
Refresh the topic. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/Space.h31
-rw-r--r--include/net/act_api.h63
-rw-r--r--include/net/addrconf.h16
-rw-r--r--include/net/arp.h1
-rw-r--r--include/net/bluetooth/bluetooth.h3
-rw-r--r--include/net/bluetooth/hci.h10
-rw-r--r--include/net/bluetooth/hci_core.h7
-rw-r--r--include/net/bluetooth/l2cap.h46
-rw-r--r--include/net/cfg80211.h323
-rw-r--r--include/net/cipso_ipv4.h5
-rw-r--r--include/net/cls_cgroup.h40
-rw-r--r--include/net/codel.h4
-rw-r--r--include/net/dcbevent.h3
-rw-r--r--include/net/dcbnl.h3
-rw-r--r--include/net/dn_dev.h2
-rw-r--r--include/net/dst.h5
-rw-r--r--include/net/flow.h3
-rw-r--r--include/net/genetlink.h4
-rw-r--r--include/net/gre.h3
-rw-r--r--include/net/if_inet6.h2
-rw-r--r--include/net/inet_timewait_sock.h6
-rw-r--r--include/net/inetpeer.h1
-rw-r--r--include/net/ip.h42
-rw-r--r--include/net/ip6_fib.h2
-rw-r--r--include/net/ip6_route.h34
-rw-r--r--include/net/ip6_tunnel.h2
-rw-r--r--include/net/ip_tunnels.h10
-rw-r--r--include/net/ipv6.h26
-rw-r--r--include/net/irda/discovery.h4
-rw-r--r--include/net/irda/ircomm_core.h4
-rw-r--r--include/net/irda/ircomm_event.h4
-rw-r--r--include/net/irda/ircomm_lmp.h4
-rw-r--r--include/net/irda/ircomm_param.h4
-rw-r--r--include/net/irda/ircomm_ttp.h4
-rw-r--r--include/net/irda/ircomm_tty.h4
-rw-r--r--include/net/irda/ircomm_tty_attach.h4
-rw-r--r--include/net/irda/irda_device.h4
-rw-r--r--include/net/irda/irlap_event.h4
-rw-r--r--include/net/irda/irlap_frame.h4
-rw-r--r--include/net/irda/parameters.h4
-rw-r--r--include/net/irda/qos.h4
-rw-r--r--include/net/llc.h1
-rw-r--r--include/net/mac80211.h138
-rw-r--r--include/net/mip6.h3
-rw-r--r--include/net/neighbour.h83
-rw-r--r--include/net/netfilter/ipv4/nf_conntrack_ipv4.h2
-rw-r--r--include/net/netfilter/ipv4/nf_reject.h128
-rw-r--r--include/net/netfilter/ipv6/nf_reject.h171
-rw-r--r--include/net/netfilter/nf_conntrack_l3proto.h1
-rw-r--r--include/net/netfilter/nf_queue.h62
-rw-r--r--include/net/netfilter/nf_tables.h47
-rw-r--r--include/net/netfilter/nf_tables_ipv4.h5
-rw-r--r--include/net/netfilter/nf_tables_ipv6.h3
-rw-r--r--include/net/netlabel.h5
-rw-r--r--include/net/netns/conntrack.h33
-rw-r--r--include/net/netns/ipv4.h2
-rw-r--r--include/net/netns/ipv6.h2
-rw-r--r--include/net/netns/nftables.h1
-rw-r--r--include/net/netns/xfrm.h6
-rw-r--r--include/net/netprio_cgroup.h18
-rw-r--r--include/net/nfc/digital.h10
-rw-r--r--include/net/nfc/hci.h4
-rw-r--r--include/net/nfc/llc.h4
-rw-r--r--include/net/nfc/nci.h3
-rw-r--r--include/net/nfc/nci_core.h5
-rw-r--r--include/net/nfc/nfc.h4
-rw-r--r--include/net/ping.h16
-rw-r--r--include/net/pkt_cls.h67
-rw-r--r--include/net/pkt_sched.h1
-rw-r--r--include/net/protocol.h10
-rw-r--r--include/net/red.h5
-rw-r--r--include/net/regulatory.h84
-rw-r--r--include/net/route.h27
-rw-r--r--include/net/rtnetlink.h17
-rw-r--r--include/net/sch_generic.h4
-rw-r--r--include/net/sctp/auth.h5
-rw-r--r--include/net/sctp/checksum.h5
-rw-r--r--include/net/sctp/command.h5
-rw-r--r--include/net/sctp/constants.h5
-rw-r--r--include/net/sctp/sctp.h32
-rw-r--r--include/net/sctp/sm.h5
-rw-r--r--include/net/sctp/structs.h65
-rw-r--r--include/net/sctp/tsnmap.h5
-rw-r--r--include/net/sctp/ulpevent.h5
-rw-r--r--include/net/sctp/ulpqueue.h5
-rw-r--r--include/net/sock.h26
-rw-r--r--include/net/tc_act/tc_skbedit.h3
-rw-r--r--include/net/tcp.h11
-rw-r--r--include/net/transp_v6.h9
-rw-r--r--include/net/vxlan.h1
-rw-r--r--include/net/xfrm.h36
91 files changed, 1440 insertions, 504 deletions
diff --git a/include/net/Space.h b/include/net/Space.h
new file mode 100644
index 000000000000..8a32771e4215
--- /dev/null
+++ b/include/net/Space.h
@@ -0,0 +1,31 @@
1/* A unified ethernet device probe. This is the easiest way to have every
2 * ethernet adaptor have the name "eth[0123...]".
3 */
4
5struct net_device *hp100_probe(int unit);
6struct net_device *ultra_probe(int unit);
7struct net_device *wd_probe(int unit);
8struct net_device *ne_probe(int unit);
9struct net_device *fmv18x_probe(int unit);
10struct net_device *i82596_probe(int unit);
11struct net_device *ni65_probe(int unit);
12struct net_device *sonic_probe(int unit);
13struct net_device *smc_init(int unit);
14struct net_device *atarilance_probe(int unit);
15struct net_device *sun3lance_probe(int unit);
16struct net_device *sun3_82586_probe(int unit);
17struct net_device *apne_probe(int unit);
18struct net_device *cs89x0_probe(int unit);
19struct net_device *mvme147lance_probe(int unit);
20struct net_device *tc515_probe(int unit);
21struct net_device *lance_probe(int unit);
22struct net_device *mac8390_probe(int unit);
23struct net_device *mac89x0_probe(int unit);
24struct net_device *cops_probe(int unit);
25struct net_device *ltpc_probe(void);
26
27/* Fibre Channel adapters */
28int iph5526_probe(struct net_device *dev);
29
30/* SBNI adapters */
31int sbni_probe(int unit);
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 9e90fdff470d..788d8378e587 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -9,7 +9,7 @@
9#include <net/pkt_sched.h> 9#include <net/pkt_sched.h>
10 10
11struct tcf_common { 11struct tcf_common {
12 struct tcf_common *tcfc_next; 12 struct hlist_node tcfc_head;
13 u32 tcfc_index; 13 u32 tcfc_index;
14 int tcfc_refcnt; 14 int tcfc_refcnt;
15 int tcfc_bindcnt; 15 int tcfc_bindcnt;
@@ -22,7 +22,7 @@ struct tcf_common {
22 spinlock_t tcfc_lock; 22 spinlock_t tcfc_lock;
23 struct rcu_head tcfc_rcu; 23 struct rcu_head tcfc_rcu;
24}; 24};
25#define tcf_next common.tcfc_next 25#define tcf_head common.tcfc_head
26#define tcf_index common.tcfc_index 26#define tcf_index common.tcfc_index
27#define tcf_refcnt common.tcfc_refcnt 27#define tcf_refcnt common.tcfc_refcnt
28#define tcf_bindcnt common.tcfc_bindcnt 28#define tcf_bindcnt common.tcfc_bindcnt
@@ -36,9 +36,10 @@ struct tcf_common {
36#define tcf_rcu common.tcfc_rcu 36#define tcf_rcu common.tcfc_rcu
37 37
38struct tcf_hashinfo { 38struct tcf_hashinfo {
39 struct tcf_common **htab; 39 struct hlist_head *htab;
40 unsigned int hmask; 40 unsigned int hmask;
41 rwlock_t *lock; 41 spinlock_t lock;
42 u32 index;
42}; 43};
43 44
44static inline unsigned int tcf_hash(u32 index, unsigned int hmask) 45static inline unsigned int tcf_hash(u32 index, unsigned int hmask)
@@ -46,33 +47,47 @@ static inline unsigned int tcf_hash(u32 index, unsigned int hmask)
46 return index & hmask; 47 return index & hmask;
47} 48}
48 49
50static inline int tcf_hashinfo_init(struct tcf_hashinfo *hf, unsigned int mask)
51{
52 int i;
53
54 spin_lock_init(&hf->lock);
55 hf->index = 0;
56 hf->hmask = mask;
57 hf->htab = kzalloc((mask + 1) * sizeof(struct hlist_head),
58 GFP_KERNEL);
59 if (!hf->htab)
60 return -ENOMEM;
61 for (i = 0; i < mask + 1; i++)
62 INIT_HLIST_HEAD(&hf->htab[i]);
63 return 0;
64}
65
66static inline void tcf_hashinfo_destroy(struct tcf_hashinfo *hf)
67{
68 kfree(hf->htab);
69}
70
49#ifdef CONFIG_NET_CLS_ACT 71#ifdef CONFIG_NET_CLS_ACT
50 72
51#define ACT_P_CREATED 1 73#define ACT_P_CREATED 1
52#define ACT_P_DELETED 1 74#define ACT_P_DELETED 1
53 75
54struct tcf_act_hdr {
55 struct tcf_common common;
56};
57
58struct tc_action { 76struct tc_action {
59 void *priv; 77 void *priv;
60 const struct tc_action_ops *ops; 78 const struct tc_action_ops *ops;
61 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ 79 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */
62 __u32 order; 80 __u32 order;
63 struct tc_action *next; 81 struct list_head list;
64}; 82};
65 83
66#define TCA_CAP_NONE 0
67struct tc_action_ops { 84struct tc_action_ops {
68 struct tc_action_ops *next; 85 struct list_head head;
69 struct tcf_hashinfo *hinfo; 86 struct tcf_hashinfo *hinfo;
70 char kind[IFNAMSIZ]; 87 char kind[IFNAMSIZ];
71 __u32 type; /* TBD to match kind */ 88 __u32 type; /* TBD to match kind */
72 __u32 capab; /* capabilities includes 4 bit version */
73 struct module *owner; 89 struct module *owner;
74 int (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *); 90 int (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *);
75 int (*get_stats)(struct sk_buff *, struct tc_action *);
76 int (*dump)(struct sk_buff *, struct tc_action *, int, int); 91 int (*dump)(struct sk_buff *, struct tc_action *, int, int);
77 int (*cleanup)(struct tc_action *, int bind); 92 int (*cleanup)(struct tc_action *, int bind);
78 int (*lookup)(struct tc_action *, u32); 93 int (*lookup)(struct tc_action *, u32);
@@ -82,34 +97,30 @@ struct tc_action_ops {
82 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *); 97 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *);
83}; 98};
84 99
85struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo); 100int tcf_hash_search(struct tc_action *a, u32 index);
86void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo); 101void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo);
87int tcf_hash_release(struct tcf_common *p, int bind, 102int tcf_hash_release(struct tcf_common *p, int bind,
88 struct tcf_hashinfo *hinfo); 103 struct tcf_hashinfo *hinfo);
89int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb, 104u32 tcf_hash_new_index(struct tcf_hashinfo *hinfo);
90 int type, struct tc_action *a);
91u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo);
92int tcf_hash_search(struct tc_action *a, u32 index);
93struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, 105struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a,
94 int bind, struct tcf_hashinfo *hinfo); 106 int bind);
95struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est, 107struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est,
96 struct tc_action *a, int size, 108 struct tc_action *a, int size,
97 int bind, u32 *idx_gen, 109 int bind);
98 struct tcf_hashinfo *hinfo);
99void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo); 110void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
100 111
101int tcf_register_action(struct tc_action_ops *a); 112int tcf_register_action(struct tc_action_ops *a);
102int tcf_unregister_action(struct tc_action_ops *a); 113int tcf_unregister_action(struct tc_action_ops *a);
103void tcf_action_destroy(struct tc_action *a, int bind); 114void tcf_action_destroy(struct list_head *actions, int bind);
104int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, 115int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions,
105 struct tcf_result *res); 116 struct tcf_result *res);
106struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla, 117int tcf_action_init(struct net *net, struct nlattr *nla,
107 struct nlattr *est, char *n, int ovr, 118 struct nlattr *est, char *n, int ovr,
108 int bind); 119 int bind, struct list_head *);
109struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla, 120struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
110 struct nlattr *est, char *n, int ovr, 121 struct nlattr *est, char *n, int ovr,
111 int bind); 122 int bind);
112int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); 123int tcf_action_dump(struct sk_buff *skb, struct list_head *, int, int);
113int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); 124int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
114int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); 125int 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); 126int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int);
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 86505bfa5d2c..50e39a8822b4 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -81,9 +81,9 @@ int ipv6_dev_get_saddr(struct net *net, const struct net_device *dev,
81 const struct in6_addr *daddr, unsigned int srcprefs, 81 const struct in6_addr *daddr, unsigned int srcprefs,
82 struct in6_addr *saddr); 82 struct in6_addr *saddr);
83int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr, 83int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr,
84 unsigned char banned_flags); 84 u32 banned_flags);
85int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr, 85int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
86 unsigned char banned_flags); 86 u32 banned_flags);
87int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2); 87int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2);
88void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr); 88void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr);
89void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr); 89void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr);
@@ -205,8 +205,9 @@ void ipv6_sock_ac_close(struct sock *sk);
205int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); 205int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr);
206int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); 206int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
207bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, 207bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
208 const struct in6_addr *addr); 208 const struct in6_addr *addr);
209 209bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev,
210 const struct in6_addr *addr);
210 211
211/* Device notifier */ 212/* Device notifier */
212int register_inet6addr_notifier(struct notifier_block *nb); 213int register_inet6addr_notifier(struct notifier_block *nb);
@@ -248,6 +249,13 @@ static inline struct inet6_dev *in6_dev_get(const struct net_device *dev)
248 return idev; 249 return idev;
249} 250}
250 251
252static inline struct neigh_parms *__in6_dev_nd_parms_get_rcu(const struct net_device *dev)
253{
254 struct inet6_dev *idev = __in6_dev_get(dev);
255
256 return idev ? idev->nd_parms : NULL;
257}
258
251void in6_dev_finish_destroy(struct inet6_dev *idev); 259void in6_dev_finish_destroy(struct inet6_dev *idev);
252 260
253static inline void in6_dev_put(struct inet6_dev *idev) 261static inline void in6_dev_put(struct inet6_dev *idev)
diff --git a/include/net/arp.h b/include/net/arp.h
index 7509d9da4e36..73c49864076b 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -62,6 +62,5 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
62 const unsigned char *src_hw, 62 const unsigned char *src_hw,
63 const unsigned char *target_hw); 63 const unsigned char *target_hw);
64void arp_xmit(struct sk_buff *skb); 64void arp_xmit(struct sk_buff *skb);
65int arp_invalidate(struct net_device *dev, __be32 ip);
66 65
67#endif /* _ARP_H */ 66#endif /* _ARP_H */
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 2a628b28249f..f4f9ee466791 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -115,6 +115,9 @@ struct bt_voice {
115#define BT_VOICE_TRANSPARENT 0x0003 115#define BT_VOICE_TRANSPARENT 0x0003
116#define BT_VOICE_CVSD_16BIT 0x0060 116#define BT_VOICE_CVSD_16BIT 0x0060
117 117
118#define BT_SNDMTU 12
119#define BT_RCVMTU 13
120
118__printf(1, 2) 121__printf(1, 2)
119int bt_info(const char *fmt, ...); 122int bt_info(const char *fmt, ...);
120__printf(1, 2) 123__printf(1, 2)
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 1784c48699f0..66c1cd87bfe7 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -83,7 +83,8 @@
83enum { 83enum {
84 HCI_QUIRK_RESET_ON_CLOSE, 84 HCI_QUIRK_RESET_ON_CLOSE,
85 HCI_QUIRK_RAW_DEVICE, 85 HCI_QUIRK_RAW_DEVICE,
86 HCI_QUIRK_FIXUP_BUFFER_SIZE 86 HCI_QUIRK_FIXUP_BUFFER_SIZE,
87 HCI_QUIRK_BROKEN_STORED_LINK_KEY,
87}; 88};
88 89
89/* HCI device flags */ 90/* HCI device flags */
@@ -131,6 +132,7 @@ enum {
131 HCI_PERIODIC_INQ, 132 HCI_PERIODIC_INQ,
132 HCI_FAST_CONNECTABLE, 133 HCI_FAST_CONNECTABLE,
133 HCI_BREDR_ENABLED, 134 HCI_BREDR_ENABLED,
135 HCI_6LOWPAN_ENABLED,
134}; 136};
135 137
136/* A mask for the flags that are supposed to remain when a reset happens 138/* A mask for the flags that are supposed to remain when a reset happens
@@ -275,6 +277,12 @@ enum {
275#define LMP_EXTFEATURES 0x80 277#define LMP_EXTFEATURES 0x80
276 278
277/* Extended LMP features */ 279/* Extended LMP features */
280#define LMP_CSB_MASTER 0x01
281#define LMP_CSB_SLAVE 0x02
282#define LMP_SYNC_TRAIN 0x04
283#define LMP_SYNC_SCAN 0x08
284
285/* Host features */
278#define LMP_HOST_SSP 0x01 286#define LMP_HOST_SSP 0x01
279#define LMP_HOST_LE 0x02 287#define LMP_HOST_LE 0x02
280#define LMP_HOST_LE_BREDR 0x04 288#define LMP_HOST_LE_BREDR 0x04
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index f8555ad7b104..f2f0cf5865c4 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -448,6 +448,7 @@ enum {
448 HCI_CONN_SSP_ENABLED, 448 HCI_CONN_SSP_ENABLED,
449 HCI_CONN_POWER_SAVE, 449 HCI_CONN_POWER_SAVE,
450 HCI_CONN_REMOTE_OOB, 450 HCI_CONN_REMOTE_OOB,
451 HCI_CONN_6LOWPAN,
451}; 452};
452 453
453static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) 454static inline bool hci_conn_ssp_enabled(struct hci_conn *conn)
@@ -798,6 +799,12 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
798#define lmp_transp_capable(dev) ((dev)->features[0][2] & LMP_TRANSPARENT) 799#define lmp_transp_capable(dev) ((dev)->features[0][2] & LMP_TRANSPARENT)
799 800
800/* ----- Extended LMP capabilities ----- */ 801/* ----- Extended LMP capabilities ----- */
802#define lmp_csb_master_capable(dev) ((dev)->features[2][0] & LMP_CSB_MASTER)
803#define lmp_csb_slave_capable(dev) ((dev)->features[2][0] & LMP_CSB_SLAVE)
804#define lmp_sync_train_capable(dev) ((dev)->features[2][0] & LMP_SYNC_TRAIN)
805#define lmp_sync_scan_capable(dev) ((dev)->features[2][0] & LMP_SYNC_SCAN)
806
807/* ----- Host capabilities ----- */
801#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP) 808#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP)
802#define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) 809#define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE))
803#define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) 810#define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR))
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index c853b16de4ef..dbc4a89984ca 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -112,6 +112,9 @@ struct l2cap_conninfo {
112#define L2CAP_MOVE_CHAN_CFM_RSP 0x11 112#define L2CAP_MOVE_CHAN_CFM_RSP 0x11
113#define L2CAP_CONN_PARAM_UPDATE_REQ 0x12 113#define L2CAP_CONN_PARAM_UPDATE_REQ 0x12
114#define L2CAP_CONN_PARAM_UPDATE_RSP 0x13 114#define L2CAP_CONN_PARAM_UPDATE_RSP 0x13
115#define L2CAP_LE_CONN_REQ 0x14
116#define L2CAP_LE_CONN_RSP 0x15
117#define L2CAP_LE_CREDITS 0x16
115 118
116/* L2CAP extended feature mask */ 119/* L2CAP extended feature mask */
117#define L2CAP_FEAT_FLOWCTL 0x00000001 120#define L2CAP_FEAT_FLOWCTL 0x00000001
@@ -133,6 +136,7 @@ struct l2cap_conninfo {
133#define L2CAP_FC_L2CAP 0x02 136#define L2CAP_FC_L2CAP 0x02
134#define L2CAP_FC_CONNLESS 0x04 137#define L2CAP_FC_CONNLESS 0x04
135#define L2CAP_FC_A2MP 0x08 138#define L2CAP_FC_A2MP 0x08
139#define L2CAP_FC_6LOWPAN 0x3e /* reserved and temporary value */
136 140
137/* L2CAP Control Field bit masks */ 141/* L2CAP Control Field bit masks */
138#define L2CAP_CTRL_SAR 0xC000 142#define L2CAP_CTRL_SAR 0xC000
@@ -249,6 +253,7 @@ struct l2cap_conn_rsp {
249#define L2CAP_CID_SMP 0x0006 253#define L2CAP_CID_SMP 0x0006
250#define L2CAP_CID_DYN_START 0x0040 254#define L2CAP_CID_DYN_START 0x0040
251#define L2CAP_CID_DYN_END 0xffff 255#define L2CAP_CID_DYN_END 0xffff
256#define L2CAP_CID_LE_DYN_END 0x007f
252 257
253/* connect/create channel results */ 258/* connect/create channel results */
254#define L2CAP_CR_SUCCESS 0x0000 259#define L2CAP_CR_SUCCESS 0x0000
@@ -257,6 +262,10 @@ struct l2cap_conn_rsp {
257#define L2CAP_CR_SEC_BLOCK 0x0003 262#define L2CAP_CR_SEC_BLOCK 0x0003
258#define L2CAP_CR_NO_MEM 0x0004 263#define L2CAP_CR_NO_MEM 0x0004
259#define L2CAP_CR_BAD_AMP 0x0005 264#define L2CAP_CR_BAD_AMP 0x0005
265#define L2CAP_CR_AUTHENTICATION 0x0005
266#define L2CAP_CR_AUTHORIZATION 0x0006
267#define L2CAP_CR_BAD_KEY_SIZE 0x0007
268#define L2CAP_CR_ENCRYPTION 0x0008
260 269
261/* connect/create channel status */ 270/* connect/create channel status */
262#define L2CAP_CS_NO_INFO 0x0000 271#define L2CAP_CS_NO_INFO 0x0000
@@ -321,6 +330,12 @@ struct l2cap_conf_rfc {
321#define L2CAP_MODE_ERTM 0x03 330#define L2CAP_MODE_ERTM 0x03
322#define L2CAP_MODE_STREAMING 0x04 331#define L2CAP_MODE_STREAMING 0x04
323 332
333/* Unlike the above this one doesn't actually map to anything that would
334 * ever be sent over the air. Therefore, use a value that's unlikely to
335 * ever be used in the BR/EDR configuration phase.
336 */
337#define L2CAP_MODE_LE_FLOWCTL 0x80
338
324struct l2cap_conf_efs { 339struct l2cap_conf_efs {
325 __u8 id; 340 __u8 id;
326 __u8 stype; 341 __u8 stype;
@@ -423,6 +438,30 @@ struct l2cap_conn_param_update_rsp {
423#define L2CAP_CONN_PARAM_ACCEPTED 0x0000 438#define L2CAP_CONN_PARAM_ACCEPTED 0x0000
424#define L2CAP_CONN_PARAM_REJECTED 0x0001 439#define L2CAP_CONN_PARAM_REJECTED 0x0001
425 440
441#define L2CAP_LE_MAX_CREDITS 10
442#define L2CAP_LE_DEFAULT_MPS 230
443
444struct l2cap_le_conn_req {
445 __le16 psm;
446 __le16 scid;
447 __le16 mtu;
448 __le16 mps;
449 __le16 credits;
450} __packed;
451
452struct l2cap_le_conn_rsp {
453 __le16 dcid;
454 __le16 mtu;
455 __le16 mps;
456 __le16 credits;
457 __le16 result;
458} __packed;
459
460struct l2cap_le_credits {
461 __le16 cid;
462 __le16 credits;
463} __packed;
464
426/* ----- L2CAP channels and connections ----- */ 465/* ----- L2CAP channels and connections ----- */
427struct l2cap_seq_list { 466struct l2cap_seq_list {
428 __u16 head; 467 __u16 head;
@@ -477,6 +516,9 @@ struct l2cap_chan {
477 __u16 monitor_timeout; 516 __u16 monitor_timeout;
478 __u16 mps; 517 __u16 mps;
479 518
519 __u16 tx_credits;
520 __u16 rx_credits;
521
480 __u8 tx_state; 522 __u8 tx_state;
481 __u8 rx_state; 523 __u8 rx_state;
482 524
@@ -553,6 +595,7 @@ struct l2cap_ops {
553 void (*ready) (struct l2cap_chan *chan); 595 void (*ready) (struct l2cap_chan *chan);
554 void (*defer) (struct l2cap_chan *chan); 596 void (*defer) (struct l2cap_chan *chan);
555 void (*resume) (struct l2cap_chan *chan); 597 void (*resume) (struct l2cap_chan *chan);
598 void (*suspend) (struct l2cap_chan *chan);
556 void (*set_shutdown) (struct l2cap_chan *chan); 599 void (*set_shutdown) (struct l2cap_chan *chan);
557 long (*get_sndtimeo) (struct l2cap_chan *chan); 600 long (*get_sndtimeo) (struct l2cap_chan *chan);
558 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, 601 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
@@ -654,6 +697,7 @@ enum {
654 FLAG_EXT_CTRL, 697 FLAG_EXT_CTRL,
655 FLAG_EFS_ENABLE, 698 FLAG_EFS_ENABLE,
656 FLAG_DEFER_SETUP, 699 FLAG_DEFER_SETUP,
700 FLAG_LE_CONN_REQ_SENT,
657}; 701};
658 702
659enum { 703enum {
@@ -809,11 +853,13 @@ static inline long l2cap_chan_no_get_sndtimeo(struct l2cap_chan *chan)
809} 853}
810 854
811extern bool disable_ertm; 855extern bool disable_ertm;
856extern bool enable_lecoc;
812 857
813int l2cap_init_sockets(void); 858int l2cap_init_sockets(void);
814void l2cap_cleanup_sockets(void); 859void l2cap_cleanup_sockets(void);
815bool l2cap_is_socket(struct socket *sock); 860bool l2cap_is_socket(struct socket *sock);
816 861
862void __l2cap_le_connect_rsp_defer(struct l2cap_chan *chan);
817void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); 863void __l2cap_connect_rsp_defer(struct l2cap_chan *chan);
818 864
819int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm); 865int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm);
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 3eae46cb1acf..b1f84b05c67e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -91,9 +91,8 @@ enum ieee80211_band {
91 * Channel flags set by the regulatory control code. 91 * Channel flags set by the regulatory control code.
92 * 92 *
93 * @IEEE80211_CHAN_DISABLED: This channel is disabled. 93 * @IEEE80211_CHAN_DISABLED: This channel is disabled.
94 * @IEEE80211_CHAN_PASSIVE_SCAN: Only passive scanning is permitted 94 * @IEEE80211_CHAN_NO_IR: do not initiate radiation, this includes
95 * on this channel. 95 * sending probe requests or beaconing.
96 * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel.
97 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel. 96 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
98 * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel 97 * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel
99 * is not permitted. 98 * is not permitted.
@@ -113,8 +112,8 @@ enum ieee80211_band {
113 */ 112 */
114enum ieee80211_channel_flags { 113enum ieee80211_channel_flags {
115 IEEE80211_CHAN_DISABLED = 1<<0, 114 IEEE80211_CHAN_DISABLED = 1<<0,
116 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1, 115 IEEE80211_CHAN_NO_IR = 1<<1,
117 IEEE80211_CHAN_NO_IBSS = 1<<2, 116 /* hole at 1<<2 */
118 IEEE80211_CHAN_RADAR = 1<<3, 117 IEEE80211_CHAN_RADAR = 1<<3,
119 IEEE80211_CHAN_NO_HT40PLUS = 1<<4, 118 IEEE80211_CHAN_NO_HT40PLUS = 1<<4,
120 IEEE80211_CHAN_NO_HT40MINUS = 1<<5, 119 IEEE80211_CHAN_NO_HT40MINUS = 1<<5,
@@ -748,6 +747,8 @@ enum station_parameters_apply_mask {
748 * @supported_channels_len: number of supported channels 747 * @supported_channels_len: number of supported channels
749 * @supported_oper_classes: supported oper classes in IEEE 802.11 format 748 * @supported_oper_classes: supported oper classes in IEEE 802.11 format
750 * @supported_oper_classes_len: number of supported operating classes 749 * @supported_oper_classes_len: number of supported operating classes
750 * @opmode_notif: operating mode field from Operating Mode Notification
751 * @opmode_notif_used: information if operating mode field is used
751 */ 752 */
752struct station_parameters { 753struct station_parameters {
753 const u8 *supported_rates; 754 const u8 *supported_rates;
@@ -771,6 +772,8 @@ struct station_parameters {
771 u8 supported_channels_len; 772 u8 supported_channels_len;
772 const u8 *supported_oper_classes; 773 const u8 *supported_oper_classes;
773 u8 supported_oper_classes_len; 774 u8 supported_oper_classes_len;
775 u8 opmode_notif;
776 bool opmode_notif_used;
774}; 777};
775 778
776/** 779/**
@@ -1763,7 +1766,8 @@ enum wiphy_params_flags {
1763struct cfg80211_bitrate_mask { 1766struct cfg80211_bitrate_mask {
1764 struct { 1767 struct {
1765 u32 legacy; 1768 u32 legacy;
1766 u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; 1769 u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
1770 u16 vht_mcs[NL80211_VHT_NSS_MAX];
1767 } control[IEEE80211_NUM_BANDS]; 1771 } control[IEEE80211_NUM_BANDS];
1768}; 1772};
1769/** 1773/**
@@ -1945,6 +1949,73 @@ struct cfg80211_update_ft_ies_params {
1945}; 1949};
1946 1950
1947/** 1951/**
1952 * struct cfg80211_mgmt_tx_params - mgmt tx parameters
1953 *
1954 * This structure provides information needed to transmit a mgmt frame
1955 *
1956 * @chan: channel to use
1957 * @offchan: indicates wether off channel operation is required
1958 * @wait: duration for ROC
1959 * @buf: buffer to transmit
1960 * @len: buffer length
1961 * @no_cck: don't use cck rates for this frame
1962 * @dont_wait_for_ack: tells the low level not to wait for an ack
1963 */
1964struct cfg80211_mgmt_tx_params {
1965 struct ieee80211_channel *chan;
1966 bool offchan;
1967 unsigned int wait;
1968 const u8 *buf;
1969 size_t len;
1970 bool no_cck;
1971 bool dont_wait_for_ack;
1972};
1973
1974/**
1975 * struct cfg80211_dscp_exception - DSCP exception
1976 *
1977 * @dscp: DSCP value that does not adhere to the user priority range definition
1978 * @up: user priority value to which the corresponding DSCP value belongs
1979 */
1980struct cfg80211_dscp_exception {
1981 u8 dscp;
1982 u8 up;
1983};
1984
1985/**
1986 * struct cfg80211_dscp_range - DSCP range definition for user priority
1987 *
1988 * @low: lowest DSCP value of this user priority range, inclusive
1989 * @high: highest DSCP value of this user priority range, inclusive
1990 */
1991struct cfg80211_dscp_range {
1992 u8 low;
1993 u8 high;
1994};
1995
1996/* QoS Map Set element length defined in IEEE Std 802.11-2012, 8.4.2.97 */
1997#define IEEE80211_QOS_MAP_MAX_EX 21
1998#define IEEE80211_QOS_MAP_LEN_MIN 16
1999#define IEEE80211_QOS_MAP_LEN_MAX \
2000 (IEEE80211_QOS_MAP_LEN_MIN + 2 * IEEE80211_QOS_MAP_MAX_EX)
2001
2002/**
2003 * struct cfg80211_qos_map - QoS Map Information
2004 *
2005 * This struct defines the Interworking QoS map setting for DSCP values
2006 *
2007 * @num_des: number of DSCP exceptions (0..21)
2008 * @dscp_exception: optionally up to maximum of 21 DSCP exceptions from
2009 * the user priority DSCP range definition
2010 * @up: DSCP range definition for a particular user priority
2011 */
2012struct cfg80211_qos_map {
2013 u8 num_des;
2014 struct cfg80211_dscp_exception dscp_exception[IEEE80211_QOS_MAP_MAX_EX];
2015 struct cfg80211_dscp_range up[8];
2016};
2017
2018/**
1948 * struct cfg80211_ops - backend description for wireless configuration 2019 * struct cfg80211_ops - backend description for wireless configuration
1949 * 2020 *
1950 * This struct is registered by fullmac card drivers and/or wireless stacks 2021 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -2186,6 +2257,8 @@ struct cfg80211_update_ft_ies_params {
2186 * @set_coalesce: Set coalesce parameters. 2257 * @set_coalesce: Set coalesce parameters.
2187 * 2258 *
2188 * @channel_switch: initiate channel-switch procedure (with CSA) 2259 * @channel_switch: initiate channel-switch procedure (with CSA)
2260 *
2261 * @set_qos_map: Set QoS mapping information to the driver
2189 */ 2262 */
2190struct cfg80211_ops { 2263struct cfg80211_ops {
2191 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 2264 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2342,9 +2415,8 @@ struct cfg80211_ops {
2342 u64 cookie); 2415 u64 cookie);
2343 2416
2344 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, 2417 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
2345 struct ieee80211_channel *chan, bool offchan, 2418 struct cfg80211_mgmt_tx_params *params,
2346 unsigned int wait, const u8 *buf, size_t len, 2419 u64 *cookie);
2347 bool no_cck, bool dont_wait_for_ack, u64 *cookie);
2348 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, 2420 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
2349 struct wireless_dev *wdev, 2421 struct wireless_dev *wdev,
2350 u64 cookie); 2422 u64 cookie);
@@ -2428,6 +2500,9 @@ struct cfg80211_ops {
2428 int (*channel_switch)(struct wiphy *wiphy, 2500 int (*channel_switch)(struct wiphy *wiphy,
2429 struct net_device *dev, 2501 struct net_device *dev,
2430 struct cfg80211_csa_settings *params); 2502 struct cfg80211_csa_settings *params);
2503 int (*set_qos_map)(struct wiphy *wiphy,
2504 struct net_device *dev,
2505 struct cfg80211_qos_map *qos_map);
2431}; 2506};
2432 2507
2433/* 2508/*
@@ -2438,27 +2513,6 @@ struct cfg80211_ops {
2438/** 2513/**
2439 * enum wiphy_flags - wiphy capability flags 2514 * enum wiphy_flags - wiphy capability flags
2440 * 2515 *
2441 * @WIPHY_FLAG_CUSTOM_REGULATORY: tells us the driver for this device
2442 * has its own custom regulatory domain and cannot identify the
2443 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
2444 * we will disregard the first regulatory hint (when the
2445 * initiator is %REGDOM_SET_BY_CORE).
2446 * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will
2447 * ignore regulatory domain settings until it gets its own regulatory
2448 * domain via its regulatory_hint() unless the regulatory hint is
2449 * from a country IE. After its gets its own regulatory domain it will
2450 * only allow further regulatory domain settings to further enhance
2451 * compliance. For example if channel 13 and 14 are disabled by this
2452 * regulatory domain no user regulatory domain can enable these channels
2453 * at a later time. This can be used for devices which do not have
2454 * calibration information guaranteed for frequencies or settings
2455 * outside of its regulatory domain. If used in combination with
2456 * WIPHY_FLAG_CUSTOM_REGULATORY the inspected country IE power settings
2457 * will be followed.
2458 * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure
2459 * that passive scan flags and beaconing flags may not be lifted by
2460 * cfg80211 due to regulatory beacon hints. For more information on beacon
2461 * hints read the documenation for regulatory_hint_found_beacon()
2462 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this 2516 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
2463 * wiphy at all 2517 * wiphy at all
2464 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled 2518 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
@@ -2497,9 +2551,9 @@ struct cfg80211_ops {
2497 * beaconing mode (AP, IBSS, Mesh, ...). 2551 * beaconing mode (AP, IBSS, Mesh, ...).
2498 */ 2552 */
2499enum wiphy_flags { 2553enum wiphy_flags {
2500 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 2554 /* use hole at 0 */
2501 WIPHY_FLAG_STRICT_REGULATORY = BIT(1), 2555 /* use hole at 1 */
2502 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), 2556 /* use hole at 2 */
2503 WIPHY_FLAG_NETNS_OK = BIT(3), 2557 WIPHY_FLAG_NETNS_OK = BIT(3),
2504 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), 2558 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
2505 WIPHY_FLAG_4ADDR_AP = BIT(5), 2559 WIPHY_FLAG_4ADDR_AP = BIT(5),
@@ -2676,6 +2730,34 @@ struct wiphy_coalesce_support {
2676}; 2730};
2677 2731
2678/** 2732/**
2733 * enum wiphy_vendor_command_flags - validation flags for vendor commands
2734 * @WIPHY_VENDOR_CMD_NEED_WDEV: vendor command requires wdev
2735 * @WIPHY_VENDOR_CMD_NEED_NETDEV: vendor command requires netdev
2736 * @WIPHY_VENDOR_CMD_NEED_RUNNING: interface/wdev must be up & running
2737 * (must be combined with %_WDEV or %_NETDEV)
2738 */
2739enum wiphy_vendor_command_flags {
2740 WIPHY_VENDOR_CMD_NEED_WDEV = BIT(0),
2741 WIPHY_VENDOR_CMD_NEED_NETDEV = BIT(1),
2742 WIPHY_VENDOR_CMD_NEED_RUNNING = BIT(2),
2743};
2744
2745/**
2746 * struct wiphy_vendor_command - vendor command definition
2747 * @info: vendor command identifying information, as used in nl80211
2748 * @flags: flags, see &enum wiphy_vendor_command_flags
2749 * @doit: callback for the operation, note that wdev is %NULL if the
2750 * flags didn't ask for a wdev and non-%NULL otherwise; the data
2751 * pointer may be %NULL if userspace provided no data at all
2752 */
2753struct wiphy_vendor_command {
2754 struct nl80211_vendor_cmd_info info;
2755 u32 flags;
2756 int (*doit)(struct wiphy *wiphy, struct wireless_dev *wdev,
2757 const void *data, int data_len);
2758};
2759
2760/**
2679 * struct wiphy - wireless hardware description 2761 * struct wiphy - wireless hardware description
2680 * @reg_notifier: the driver's regulatory notification callback, 2762 * @reg_notifier: the driver's regulatory notification callback,
2681 * note that if your driver uses wiphy_apply_custom_regulatory() 2763 * note that if your driver uses wiphy_apply_custom_regulatory()
@@ -2721,6 +2803,8 @@ struct wiphy_coalesce_support {
2721 * @software_iftypes: bitmask of software interface types, these are not 2803 * @software_iftypes: bitmask of software interface types, these are not
2722 * subject to any restrictions since they are purely managed in SW. 2804 * subject to any restrictions since they are purely managed in SW.
2723 * @flags: wiphy flags, see &enum wiphy_flags 2805 * @flags: wiphy flags, see &enum wiphy_flags
2806 * @regulatory_flags: wiphy regulatory flags, see
2807 * &enum ieee80211_regulatory_flags
2724 * @features: features advertised to nl80211, see &enum nl80211_feature_flags. 2808 * @features: features advertised to nl80211, see &enum nl80211_feature_flags.
2725 * @bss_priv_size: each BSS struct has private data allocated with it, 2809 * @bss_priv_size: each BSS struct has private data allocated with it,
2726 * this variable determines its size 2810 * this variable determines its size
@@ -2786,6 +2870,11 @@ struct wiphy_coalesce_support {
2786 * @extended_capabilities_mask: mask of the valid values 2870 * @extended_capabilities_mask: mask of the valid values
2787 * @extended_capabilities_len: length of the extended capabilities 2871 * @extended_capabilities_len: length of the extended capabilities
2788 * @coalesce: packet coalescing support information 2872 * @coalesce: packet coalescing support information
2873 *
2874 * @vendor_commands: array of vendor commands supported by the hardware
2875 * @n_vendor_commands: number of vendor commands
2876 * @vendor_events: array of vendor events supported by the hardware
2877 * @n_vendor_events: number of vendor events
2789 */ 2878 */
2790struct wiphy { 2879struct wiphy {
2791 /* assign these fields before you register the wiphy */ 2880 /* assign these fields before you register the wiphy */
@@ -2809,7 +2898,7 @@ struct wiphy {
2809 2898
2810 u16 max_acl_mac_addrs; 2899 u16 max_acl_mac_addrs;
2811 2900
2812 u32 flags, features; 2901 u32 flags, regulatory_flags, features;
2813 2902
2814 u32 ap_sme_capa; 2903 u32 ap_sme_capa;
2815 2904
@@ -2897,6 +2986,10 @@ struct wiphy {
2897 2986
2898 const struct wiphy_coalesce_support *coalesce; 2987 const struct wiphy_coalesce_support *coalesce;
2899 2988
2989 const struct wiphy_vendor_command *vendor_commands;
2990 const struct nl80211_vendor_cmd_info *vendor_events;
2991 int n_vendor_commands, n_vendor_events;
2992
2900 char priv[0] __aligned(NETDEV_ALIGN); 2993 char priv[0] __aligned(NETDEV_ALIGN);
2901}; 2994};
2902 2995
@@ -3388,9 +3481,11 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
3388/** 3481/**
3389 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame 3482 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame
3390 * @skb: the data frame 3483 * @skb: the data frame
3484 * @qos_map: Interworking QoS mapping or %NULL if not in use
3391 * Return: The 802.1p/1d tag. 3485 * Return: The 802.1p/1d tag.
3392 */ 3486 */
3393unsigned int cfg80211_classify8021d(struct sk_buff *skb); 3487unsigned int cfg80211_classify8021d(struct sk_buff *skb,
3488 struct cfg80211_qos_map *qos_map);
3394 3489
3395/** 3490/**
3396 * cfg80211_find_ie - find information element in data 3491 * cfg80211_find_ie - find information element in data
@@ -3472,6 +3567,9 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3472 * custom regulatory domain will be trusted completely and as such previous 3567 * custom regulatory domain will be trusted completely and as such previous
3473 * default channel settings will be disregarded. If no rule is found for a 3568 * default channel settings will be disregarded. If no rule is found for a
3474 * channel on the regulatory domain the channel will be disabled. 3569 * channel on the regulatory domain the channel will be disabled.
3570 * Drivers using this for a wiphy should also set the wiphy flag
3571 * WIPHY_FLAG_CUSTOM_REGULATORY or cfg80211 will set it for the wiphy
3572 * that called this helper.
3475 */ 3573 */
3476void wiphy_apply_custom_regulatory(struct wiphy *wiphy, 3574void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
3477 const struct ieee80211_regdomain *regd); 3575 const struct ieee80211_regdomain *regd);
@@ -3838,6 +3936,121 @@ void wiphy_rfkill_start_polling(struct wiphy *wiphy);
3838 */ 3936 */
3839void wiphy_rfkill_stop_polling(struct wiphy *wiphy); 3937void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
3840 3938
3939/**
3940 * DOC: Vendor commands
3941 *
3942 * Occasionally, there are special protocol or firmware features that
3943 * can't be implemented very openly. For this and similar cases, the
3944 * vendor command functionality allows implementing the features with
3945 * (typically closed-source) userspace and firmware, using nl80211 as
3946 * the configuration mechanism.
3947 *
3948 * A driver supporting vendor commands must register them as an array
3949 * in struct wiphy, with handlers for each one, each command has an
3950 * OUI and sub command ID to identify it.
3951 *
3952 * Note that this feature should not be (ab)used to implement protocol
3953 * features that could openly be shared across drivers. In particular,
3954 * it must never be required to use vendor commands to implement any
3955 * "normal" functionality that higher-level userspace like connection
3956 * managers etc. need.
3957 */
3958
3959struct sk_buff *__cfg80211_alloc_reply_skb(struct wiphy *wiphy,
3960 enum nl80211_commands cmd,
3961 enum nl80211_attrs attr,
3962 int approxlen);
3963
3964struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy,
3965 enum nl80211_commands cmd,
3966 enum nl80211_attrs attr,
3967 int vendor_event_idx,
3968 int approxlen, gfp_t gfp);
3969
3970void __cfg80211_send_event_skb(struct sk_buff *skb, gfp_t gfp);
3971
3972/**
3973 * cfg80211_vendor_cmd_alloc_reply_skb - allocate vendor command reply
3974 * @wiphy: the wiphy
3975 * @approxlen: an upper bound of the length of the data that will
3976 * be put into the skb
3977 *
3978 * This function allocates and pre-fills an skb for a reply to
3979 * a vendor command. Since it is intended for a reply, calling
3980 * it outside of a vendor command's doit() operation is invalid.
3981 *
3982 * The returned skb is pre-filled with some identifying data in
3983 * a way that any data that is put into the skb (with skb_put(),
3984 * nla_put() or similar) will end up being within the
3985 * %NL80211_ATTR_VENDOR_DATA attribute, so all that needs to be done
3986 * with the skb is adding data for the corresponding userspace tool
3987 * which can then read that data out of the vendor data attribute.
3988 * You must not modify the skb in any other way.
3989 *
3990 * When done, call cfg80211_vendor_cmd_reply() with the skb and return
3991 * its error code as the result of the doit() operation.
3992 *
3993 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3994 */
3995static inline struct sk_buff *
3996cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, int approxlen)
3997{
3998 return __cfg80211_alloc_reply_skb(wiphy, NL80211_CMD_VENDOR,
3999 NL80211_ATTR_VENDOR_DATA, approxlen);
4000}
4001
4002/**
4003 * cfg80211_vendor_cmd_reply - send the reply skb
4004 * @skb: The skb, must have been allocated with
4005 * cfg80211_vendor_cmd_alloc_reply_skb()
4006 *
4007 * Since calling this function will usually be the last thing
4008 * before returning from the vendor command doit() you should
4009 * return the error code. Note that this function consumes the
4010 * skb regardless of the return value.
4011 *
4012 * Return: An error code or 0 on success.
4013 */
4014int cfg80211_vendor_cmd_reply(struct sk_buff *skb);
4015
4016/**
4017 * cfg80211_vendor_event_alloc - allocate vendor-specific event skb
4018 * @wiphy: the wiphy
4019 * @event_idx: index of the vendor event in the wiphy's vendor_events
4020 * @approxlen: an upper bound of the length of the data that will
4021 * be put into the skb
4022 * @gfp: allocation flags
4023 *
4024 * This function allocates and pre-fills an skb for an event on the
4025 * vendor-specific multicast group.
4026 *
4027 * When done filling the skb, call cfg80211_vendor_event() with the
4028 * skb to send the event.
4029 *
4030 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
4031 */
4032static inline struct sk_buff *
4033cfg80211_vendor_event_alloc(struct wiphy *wiphy, int approxlen,
4034 int event_idx, gfp_t gfp)
4035{
4036 return __cfg80211_alloc_event_skb(wiphy, NL80211_CMD_VENDOR,
4037 NL80211_ATTR_VENDOR_DATA,
4038 event_idx, approxlen, gfp);
4039}
4040
4041/**
4042 * cfg80211_vendor_event - send the event
4043 * @skb: The skb, must have been allocated with cfg80211_vendor_event_alloc()
4044 * @gfp: allocation flags
4045 *
4046 * This function sends the given @skb, which must have been allocated
4047 * by cfg80211_vendor_event_alloc(), as an event. It always consumes it.
4048 */
4049static inline void cfg80211_vendor_event(struct sk_buff *skb, gfp_t gfp)
4050{
4051 __cfg80211_send_event_skb(skb, gfp);
4052}
4053
3841#ifdef CONFIG_NL80211_TESTMODE 4054#ifdef CONFIG_NL80211_TESTMODE
3842/** 4055/**
3843 * DOC: Test mode 4056 * DOC: Test mode
@@ -3873,8 +4086,12 @@ void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
3873 * 4086 *
3874 * Return: An allocated and pre-filled skb. %NULL if any errors happen. 4087 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3875 */ 4088 */
3876struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, 4089static inline struct sk_buff *
3877 int approxlen); 4090cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, int approxlen)
4091{
4092 return __cfg80211_alloc_reply_skb(wiphy, NL80211_CMD_TESTMODE,
4093 NL80211_ATTR_TESTDATA, approxlen);
4094}
3878 4095
3879/** 4096/**
3880 * cfg80211_testmode_reply - send the reply skb 4097 * cfg80211_testmode_reply - send the reply skb
@@ -3888,7 +4105,10 @@ struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy,
3888 * 4105 *
3889 * Return: An error code or 0 on success. 4106 * Return: An error code or 0 on success.
3890 */ 4107 */
3891int cfg80211_testmode_reply(struct sk_buff *skb); 4108static inline int cfg80211_testmode_reply(struct sk_buff *skb)
4109{
4110 return cfg80211_vendor_cmd_reply(skb);
4111}
3892 4112
3893/** 4113/**
3894 * cfg80211_testmode_alloc_event_skb - allocate testmode event 4114 * cfg80211_testmode_alloc_event_skb - allocate testmode event
@@ -3911,8 +4131,13 @@ int cfg80211_testmode_reply(struct sk_buff *skb);
3911 * 4131 *
3912 * Return: An allocated and pre-filled skb. %NULL if any errors happen. 4132 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3913 */ 4133 */
3914struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, 4134static inline struct sk_buff *
3915 int approxlen, gfp_t gfp); 4135cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, int approxlen, gfp_t gfp)
4136{
4137 return __cfg80211_alloc_event_skb(wiphy, NL80211_CMD_TESTMODE,
4138 NL80211_ATTR_TESTDATA, -1,
4139 approxlen, gfp);
4140}
3916 4141
3917/** 4142/**
3918 * cfg80211_testmode_event - send the event 4143 * cfg80211_testmode_event - send the event
@@ -3924,7 +4149,10 @@ struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy,
3924 * by cfg80211_testmode_alloc_event_skb(), as an event. It always 4149 * by cfg80211_testmode_alloc_event_skb(), as an event. It always
3925 * consumes it. 4150 * consumes it.
3926 */ 4151 */
3927void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp); 4152static inline void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp)
4153{
4154 __cfg80211_send_event_skb(skb, gfp);
4155}
3928 4156
3929#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd), 4157#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd),
3930#define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd), 4158#define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd),
@@ -4146,6 +4374,7 @@ void cfg80211_radar_event(struct wiphy *wiphy,
4146/** 4374/**
4147 * cfg80211_cac_event - Channel availability check (CAC) event 4375 * cfg80211_cac_event - Channel availability check (CAC) event
4148 * @netdev: network device 4376 * @netdev: network device
4377 * @chandef: chandef for the current channel
4149 * @event: type of event 4378 * @event: type of event
4150 * @gfp: context flags 4379 * @gfp: context flags
4151 * 4380 *
@@ -4154,6 +4383,7 @@ void cfg80211_radar_event(struct wiphy *wiphy,
4154 * also by full-MAC drivers. 4383 * also by full-MAC drivers.
4155 */ 4384 */
4156void cfg80211_cac_event(struct net_device *netdev, 4385void cfg80211_cac_event(struct net_device *netdev,
4386 const struct cfg80211_chan_def *chandef,
4157 enum nl80211_radar_event event, gfp_t gfp); 4387 enum nl80211_radar_event event, gfp_t gfp);
4158 4388
4159 4389
@@ -4279,7 +4509,8 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
4279 * @dev: the device which switched channels 4509 * @dev: the device which switched channels
4280 * @chandef: the new channel definition 4510 * @chandef: the new channel definition
4281 * 4511 *
4282 * Acquires wdev_lock, so must only be called from sleepable driver context! 4512 * Caller must acquire wdev_lock, therefore must only be called from sleepable
4513 * driver context!
4283 */ 4514 */
4284void cfg80211_ch_switch_notify(struct net_device *dev, 4515void cfg80211_ch_switch_notify(struct net_device *dev,
4285 struct cfg80211_chan_def *chandef); 4516 struct cfg80211_chan_def *chandef);
@@ -4409,6 +4640,14 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
4409 */ 4640 */
4410void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp); 4641void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp);
4411 4642
4643/**
4644 * ieee80211_get_num_supported_channels - get number of channels device has
4645 * @wiphy: the wiphy
4646 *
4647 * Return: the number of channels supported by the device.
4648 */
4649unsigned int ieee80211_get_num_supported_channels(struct wiphy *wiphy);
4650
4412/* Logging, debugging and troubleshooting/diagnostic helpers. */ 4651/* Logging, debugging and troubleshooting/diagnostic helpers. */
4413 4652
4414/* wiphy_printk helpers, similar to dev_printk */ 4653/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index a8c2ef6d3b93..a6fd939f202d 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -26,8 +26,7 @@
26 * the GNU General Public License for more details. 26 * the GNU General Public License for more details.
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, see <http://www.gnu.org/licenses/>.
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 * 30 *
32 */ 31 */
33 32
@@ -304,7 +303,7 @@ static inline int cipso_v4_validate(const struct sk_buff *skb,
304 303
305 for (opt_iter = 6; opt_iter < opt_len;) { 304 for (opt_iter = 6; opt_iter < opt_len;) {
306 tag_len = opt[opt_iter + 1]; 305 tag_len = opt[opt_iter + 1];
307 if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) { 306 if ((tag_len == 0) || (tag_len > (opt_len - opt_iter))) {
308 err_offset = opt_iter + 1; 307 err_offset = opt_iter + 1;
309 goto out; 308 goto out;
310 } 309 }
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index 33d03b648646..9cf2d5ef38d9 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -16,17 +16,16 @@
16#include <linux/cgroup.h> 16#include <linux/cgroup.h>
17#include <linux/hardirq.h> 17#include <linux/hardirq.h>
18#include <linux/rcupdate.h> 18#include <linux/rcupdate.h>
19#include <net/sock.h>
19 20
20#if IS_ENABLED(CONFIG_NET_CLS_CGROUP) 21#ifdef CONFIG_CGROUP_NET_CLASSID
21struct cgroup_cls_state 22struct cgroup_cls_state {
22{
23 struct cgroup_subsys_state css; 23 struct cgroup_subsys_state css;
24 u32 classid; 24 u32 classid;
25}; 25};
26 26
27void sock_update_classid(struct sock *sk); 27struct cgroup_cls_state *task_cls_state(struct task_struct *p);
28 28
29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP)
30static inline u32 task_cls_classid(struct task_struct *p) 29static inline u32 task_cls_classid(struct task_struct *p)
31{ 30{
32 u32 classid; 31 u32 classid;
@@ -41,33 +40,18 @@ static inline u32 task_cls_classid(struct task_struct *p)
41 40
42 return classid; 41 return classid;
43} 42}
44#elif IS_MODULE(CONFIG_NET_CLS_CGROUP)
45static inline u32 task_cls_classid(struct task_struct *p)
46{
47 struct cgroup_subsys_state *css;
48 u32 classid = 0;
49
50 if (in_interrupt())
51 return 0;
52
53 rcu_read_lock();
54 css = task_css(p, net_cls_subsys_id);
55 if (css)
56 classid = container_of(css,
57 struct cgroup_cls_state, css)->classid;
58 rcu_read_unlock();
59 43
60 return classid;
61}
62#endif
63#else /* !CGROUP_NET_CLS_CGROUP */
64static inline void sock_update_classid(struct sock *sk) 44static inline void sock_update_classid(struct sock *sk)
65{ 45{
66} 46 u32 classid;
67 47
68static inline u32 task_cls_classid(struct task_struct *p) 48 classid = task_cls_classid(current);
49 if (classid != sk->sk_classid)
50 sk->sk_classid = classid;
51}
52#else /* !CONFIG_CGROUP_NET_CLASSID */
53static inline void sock_update_classid(struct sock *sk)
69{ 54{
70 return 0;
71} 55}
72#endif /* CGROUP_NET_CLS_CGROUP */ 56#endif /* CONFIG_CGROUP_NET_CLASSID */
73#endif /* _NET_CLS_CGROUP_H */ 57#endif /* _NET_CLS_CGROUP_H */
diff --git a/include/net/codel.h b/include/net/codel.h
index 3b04ff5f6f8d..fe0eab32ce76 100644
--- a/include/net/codel.h
+++ b/include/net/codel.h
@@ -46,7 +46,6 @@
46#include <linux/skbuff.h> 46#include <linux/skbuff.h>
47#include <net/pkt_sched.h> 47#include <net/pkt_sched.h>
48#include <net/inet_ecn.h> 48#include <net/inet_ecn.h>
49#include <linux/reciprocal_div.h>
50 49
51/* Controlling Queue Delay (CoDel) algorithm 50/* Controlling Queue Delay (CoDel) algorithm
52 * ========================================= 51 * =========================================
@@ -211,10 +210,9 @@ static codel_time_t codel_control_law(codel_time_t t,
211 codel_time_t interval, 210 codel_time_t interval,
212 u32 rec_inv_sqrt) 211 u32 rec_inv_sqrt)
213{ 212{
214 return t + reciprocal_divide(interval, rec_inv_sqrt << REC_INV_SQRT_SHIFT); 213 return t + reciprocal_scale(interval, rec_inv_sqrt << REC_INV_SQRT_SHIFT);
215} 214}
216 215
217
218static bool codel_should_drop(const struct sk_buff *skb, 216static bool codel_should_drop(const struct sk_buff *skb,
219 struct Qdisc *sch, 217 struct Qdisc *sch,
220 struct codel_vars *vars, 218 struct codel_vars *vars,
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h
index d2f3041c0dfa..aec07c8a660a 100644
--- a/include/net/dcbevent.h
+++ b/include/net/dcbevent.h
@@ -11,8 +11,7 @@
11 * more details. 11 * more details.
12 * 12 *
13 * You should have received a copy of the GNU General Public License along with 13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 14 * this program; if not, see <http://www.gnu.org/licenses/>.
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 15 *
17 * Author: John Fastabend <john.r.fastabend@intel.com> 16 * Author: John Fastabend <john.r.fastabend@intel.com>
18 */ 17 */
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index fc5d5dcebb00..a975edf21b22 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -11,8 +11,7 @@
11 * more details. 11 * more details.
12 * 12 *
13 * You should have received a copy of the GNU General Public License along with 13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 14 * this program; if not, see <http://www.gnu.org/licenses/>.
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 15 *
17 * Author: Lucy Liu <lucy.liu@intel.com> 16 * Author: Lucy Liu <lucy.liu@intel.com>
18 */ 17 */
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h
index 20b5ab06032d..197886cd7bdd 100644
--- a/include/net/dn_dev.h
+++ b/include/net/dn_dev.h
@@ -9,7 +9,7 @@ struct dn_ifaddr {
9 struct dn_dev *ifa_dev; 9 struct dn_dev *ifa_dev;
10 __le16 ifa_local; 10 __le16 ifa_local;
11 __le16 ifa_address; 11 __le16 ifa_address;
12 __u8 ifa_flags; 12 __u32 ifa_flags;
13 __u8 ifa_scope; 13 __u8 ifa_scope;
14 char ifa_label[IFNAMSIZ]; 14 char ifa_label[IFNAMSIZ];
15 struct rcu_head rcu; 15 struct rcu_head rcu;
diff --git a/include/net/dst.h b/include/net/dst.h
index 44995c13e941..77eb53fabfb0 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -322,12 +322,11 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
322 skb->dev = dev; 322 skb->dev = dev;
323 323
324 /* 324 /*
325 * Clear rxhash so that we can recalulate the hash for the 325 * Clear hash so that we can recalulate the hash for the
326 * encapsulated packet, unless we have already determine the hash 326 * encapsulated packet, unless we have already determine the hash
327 * over the L4 4-tuple. 327 * over the L4 4-tuple.
328 */ 328 */
329 if (!skb->l4_rxhash) 329 skb_clear_hash_if_not_l4(skb);
330 skb->rxhash = 0;
331 skb_set_queue_mapping(skb, 0); 330 skb_set_queue_mapping(skb, 0);
332 skb_scrub_packet(skb, !net_eq(net, dev_net(dev))); 331 skb_scrub_packet(skb, !net_eq(net, dev_net(dev)));
333} 332}
diff --git a/include/net/flow.h b/include/net/flow.h
index 65ce471d2ab5..d23e7fa2042e 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -20,8 +20,7 @@ struct flowi_common {
20 __u8 flowic_proto; 20 __u8 flowic_proto;
21 __u8 flowic_flags; 21 __u8 flowic_flags;
22#define FLOWI_FLAG_ANYSRC 0x01 22#define FLOWI_FLAG_ANYSRC 0x01
23#define FLOWI_FLAG_CAN_SLEEP 0x02 23#define FLOWI_FLAG_KNOWN_NH 0x02
24#define FLOWI_FLAG_KNOWN_NH 0x04
25 __u32 flowic_secid; 24 __u32 flowic_secid;
26}; 25};
27 26
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 1b177ed803b7..93695f0e22a5 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -73,6 +73,7 @@ struct genl_family {
73 * @attrs: netlink attributes 73 * @attrs: netlink attributes
74 * @_net: network namespace 74 * @_net: network namespace
75 * @user_ptr: user pointers 75 * @user_ptr: user pointers
76 * @dst_sk: destination socket
76 */ 77 */
77struct genl_info { 78struct genl_info {
78 u32 snd_seq; 79 u32 snd_seq;
@@ -85,6 +86,7 @@ struct genl_info {
85 struct net * _net; 86 struct net * _net;
86#endif 87#endif
87 void * user_ptr[2]; 88 void * user_ptr[2];
89 struct sock * dst_sk;
88}; 90};
89 91
90static inline struct net *genl_info_net(struct genl_info *info) 92static inline struct net *genl_info_net(struct genl_info *info)
@@ -177,6 +179,8 @@ void genl_notify(struct genl_family *family,
177 struct sk_buff *skb, struct net *net, u32 portid, 179 struct sk_buff *skb, struct net *net, u32 portid,
178 u32 group, struct nlmsghdr *nlh, gfp_t flags); 180 u32 group, struct nlmsghdr *nlh, gfp_t flags);
179 181
182struct sk_buff *genlmsg_new_unicast(size_t payload, struct genl_info *info,
183 gfp_t flags);
180void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, 184void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq,
181 struct genl_family *family, int flags, u8 cmd); 185 struct genl_family *family, int flags, u8 cmd);
182 186
diff --git a/include/net/gre.h b/include/net/gre.h
index dcd9ae3270d3..70046a0b0b89 100644
--- a/include/net/gre.h
+++ b/include/net/gre.h
@@ -33,9 +33,6 @@ struct gre_cisco_protocol {
33int gre_cisco_register(struct gre_cisco_protocol *proto); 33int gre_cisco_register(struct gre_cisco_protocol *proto);
34int gre_cisco_unregister(struct gre_cisco_protocol *proto); 34int gre_cisco_unregister(struct gre_cisco_protocol *proto);
35 35
36int gre_offload_init(void);
37void gre_offload_exit(void);
38
39void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, 36void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi,
40 int hdr_len); 37 int hdr_len);
41 38
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 65bb13035598..9650a3ffd2d2 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -50,8 +50,8 @@ struct inet6_ifaddr {
50 50
51 int state; 51 int state;
52 52
53 __u32 flags;
53 __u8 dad_probes; 54 __u8 dad_probes;
54 __u8 flags;
55 55
56 __u16 scope; 56 __u16 scope;
57 57
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 71c6e264e5b5..61474ea02152 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -133,9 +133,9 @@ struct inet_timewait_sock {
133 /* And these are ours. */ 133 /* And these are ours. */
134 unsigned int tw_ipv6only : 1, 134 unsigned int tw_ipv6only : 1,
135 tw_transparent : 1, 135 tw_transparent : 1,
136 tw_pad : 6, /* 6 bits hole */ 136 tw_flowlabel : 20,
137 tw_tos : 8, 137 tw_pad : 2, /* 2 bits hole */
138 tw_pad2 : 16; /* 16 bits hole */ 138 tw_tos : 8;
139 kmemcheck_bitfield_end(flags); 139 kmemcheck_bitfield_end(flags);
140 u32 tw_ttd; 140 u32 tw_ttd;
141 struct inet_bind_bucket *tw_tb; 141 struct inet_bind_bucket *tw_tb;
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index f4e127af4e17..6efe73c79c52 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -163,7 +163,6 @@ void inet_putpeer(struct inet_peer *p);
163bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); 163bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout);
164 164
165void inetpeer_invalidate_tree(struct inet_peer_base *); 165void inetpeer_invalidate_tree(struct inet_peer_base *);
166void inetpeer_invalidate_family(int family);
167 166
168/* 167/*
169 * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, 168 * temporary check to make sure we dont access rid, ip_id_count, tcp_ts,
diff --git a/include/net/ip.h b/include/net/ip.h
index 5a25f36fe3a7..23be0fd37937 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -63,6 +63,7 @@ struct ipcm_cookie {
63}; 63};
64 64
65#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) 65#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb))
66#define PKTINFO_SKB_CB(skb) ((struct in_pktinfo *)((skb)->cb))
66 67
67struct ip_ra_chain { 68struct ip_ra_chain {
68 struct ip_ra_chain __rcu *next; 69 struct ip_ra_chain __rcu *next;
@@ -90,7 +91,7 @@ struct packet_type;
90struct rtable; 91struct rtable;
91struct sockaddr; 92struct sockaddr;
92 93
93int igmp_mc_proc_init(void); 94int igmp_mc_init(void);
94 95
95/* 96/*
96 * Functions provided by ip.c 97 * Functions provided by ip.c
@@ -177,12 +178,6 @@ void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
177 __be32 saddr, const struct ip_reply_arg *arg, 178 __be32 saddr, const struct ip_reply_arg *arg,
178 unsigned int len); 179 unsigned int len);
179 180
180struct ipv4_config {
181 int log_martians;
182 int no_pmtu_disc;
183};
184
185extern struct ipv4_config ipv4_config;
186#define IP_INC_STATS(net, field) SNMP_INC_STATS64((net)->mib.ip_statistics, field) 181#define IP_INC_STATS(net, field) SNMP_INC_STATS64((net)->mib.ip_statistics, field)
187#define IP_INC_STATS_BH(net, field) SNMP_INC_STATS64_BH((net)->mib.ip_statistics, field) 182#define IP_INC_STATS_BH(net, field) SNMP_INC_STATS64_BH((net)->mib.ip_statistics, field)
188#define IP_ADD_STATS(net, field, val) SNMP_ADD_STATS64((net)->mib.ip_statistics, field, val) 183#define IP_ADD_STATS(net, field, val) SNMP_ADD_STATS64((net)->mib.ip_statistics, field, val)
@@ -269,6 +264,39 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
269 !(dst_metric_locked(dst, RTAX_MTU))); 264 !(dst_metric_locked(dst, RTAX_MTU)));
270} 265}
271 266
267static inline bool ip_sk_accept_pmtu(const struct sock *sk)
268{
269 return inet_sk(sk)->pmtudisc != IP_PMTUDISC_INTERFACE;
270}
271
272static inline bool ip_sk_use_pmtu(const struct sock *sk)
273{
274 return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE;
275}
276
277static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst,
278 bool forwarding)
279{
280 struct net *net = dev_net(dst->dev);
281
282 if (net->ipv4.sysctl_ip_fwd_use_pmtu ||
283 dst_metric_locked(dst, RTAX_MTU) ||
284 !forwarding)
285 return dst_mtu(dst);
286
287 return min(dst->dev->mtu, IP_MAX_MTU);
288}
289
290static inline unsigned int ip_skb_dst_mtu(const struct sk_buff *skb)
291{
292 if (!skb->sk || ip_sk_use_pmtu(skb->sk)) {
293 bool forwarding = IPCB(skb)->flags & IPSKB_FORWARDED;
294 return ip_dst_mtu_maybe_forward(skb_dst(skb), forwarding);
295 } else {
296 return min(skb_dst(skb)->dev->mtu, IP_MAX_MTU);
297 }
298}
299
272void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); 300void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more);
273 301
274static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk) 302static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk)
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 2182525e4d74..aca0c2709fd6 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -282,7 +282,7 @@ struct fib6_node *fib6_locate(struct fib6_node *root,
282 const struct in6_addr *saddr, int src_len); 282 const struct in6_addr *saddr, int src_len);
283 283
284void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg), 284void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg),
285 int prune, void *arg); 285 void *arg);
286 286
287int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info); 287int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info);
288 288
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 733747ce163c..017badb1aec7 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -51,26 +51,6 @@ static inline unsigned int rt6_flags2srcprefs(int flags)
51 return (flags >> 3) & 7; 51 return (flags >> 3) & 7;
52} 52}
53 53
54void rt6_bind_peer(struct rt6_info *rt, int create);
55
56static inline struct inet_peer *__rt6_get_peer(struct rt6_info *rt, int create)
57{
58 if (rt6_has_peer(rt))
59 return rt6_peer_ptr(rt);
60
61 rt6_bind_peer(rt, create);
62 return (rt6_has_peer(rt) ? rt6_peer_ptr(rt) : NULL);
63}
64
65static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt)
66{
67 return __rt6_get_peer(rt, 0);
68}
69
70static inline struct inet_peer *rt6_get_peer_create(struct rt6_info *rt)
71{
72 return __rt6_get_peer(rt, 1);
73}
74 54
75void ip6_route_input(struct sk_buff *skb); 55void ip6_route_input(struct sk_buff *skb);
76 56
@@ -172,16 +152,28 @@ static inline bool ipv6_unicast_destination(const struct sk_buff *skb)
172 return rt->rt6i_flags & RTF_LOCAL; 152 return rt->rt6i_flags & RTF_LOCAL;
173} 153}
174 154
155static inline bool ipv6_anycast_destination(const struct sk_buff *skb)
156{
157 struct rt6_info *rt = (struct rt6_info *) skb_dst(skb);
158
159 return rt->rt6i_flags & RTF_ANYCAST;
160}
161
175int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); 162int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
176 163
177static inline int ip6_skb_dst_mtu(struct sk_buff *skb) 164static inline int ip6_skb_dst_mtu(struct sk_buff *skb)
178{ 165{
179 struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; 166 struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL;
180 167
181 return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ? 168 return (np && np->pmtudisc >= IPV6_PMTUDISC_PROBE) ?
182 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); 169 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb));
183} 170}
184 171
172static inline bool ip6_sk_accept_pmtu(const struct sock *sk)
173{
174 return inet6_sk(sk)->pmtudisc != IPV6_PMTUDISC_INTERFACE;
175}
176
185static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt) 177static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt)
186{ 178{
187 return &rt->rt6i_gateway; 179 return &rt->rt6i_gateway;
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 6d1549c4893c..a5593dab6af7 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -79,7 +79,7 @@ static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
79 err = ip6_local_out(skb); 79 err = ip6_local_out(skb);
80 80
81 if (net_xmit_eval(err) == 0) { 81 if (net_xmit_eval(err) == 0) {
82 struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats); 82 struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
83 u64_stats_update_begin(&tstats->syncp); 83 u64_stats_update_begin(&tstats->syncp);
84 tstats->tx_bytes += pkt_len; 84 tstats->tx_bytes += pkt_len;
85 tstats->tx_packets++; 85 tstats->tx_packets++;
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index 732f8c6ae975..48ed75c21260 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -38,6 +38,10 @@ struct ip_tunnel_prl_entry {
38 struct rcu_head rcu_head; 38 struct rcu_head rcu_head;
39}; 39};
40 40
41struct ip_tunnel_dst {
42 struct dst_entry __rcu *dst;
43};
44
41struct ip_tunnel { 45struct ip_tunnel {
42 struct ip_tunnel __rcu *next; 46 struct ip_tunnel __rcu *next;
43 struct hlist_node hash_node; 47 struct hlist_node hash_node;
@@ -54,6 +58,8 @@ struct ip_tunnel {
54 int hlen; /* Precalculated header length */ 58 int hlen; /* Precalculated header length */
55 int mlink; 59 int mlink;
56 60
61 struct ip_tunnel_dst __percpu *dst_cache;
62
57 struct ip_tunnel_parm parms; 63 struct ip_tunnel_parm parms;
58 64
59 /* for SIT */ 65 /* for SIT */
@@ -155,10 +161,10 @@ struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb, bool gre_csum,
155 161
156static inline void iptunnel_xmit_stats(int err, 162static inline void iptunnel_xmit_stats(int err,
157 struct net_device_stats *err_stats, 163 struct net_device_stats *err_stats,
158 struct pcpu_tstats __percpu *stats) 164 struct pcpu_sw_netstats __percpu *stats)
159{ 165{
160 if (err > 0) { 166 if (err > 0) {
161 struct pcpu_tstats *tstats = this_cpu_ptr(stats); 167 struct pcpu_sw_netstats *tstats = this_cpu_ptr(stats);
162 168
163 u64_stats_update_begin(&tstats->syncp); 169 u64_stats_update_begin(&tstats->syncp);
164 tstats->tx_bytes += err; 170 tstats->tx_bytes += err;
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 488316e339a1..4f541f11ce63 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -238,6 +238,8 @@ struct ip6_flowlabel {
238 238
239#define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) 239#define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF)
240#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) 240#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF)
241#define IPV6_TCLASS_MASK (IPV6_FLOWINFO_MASK & ~IPV6_FLOWLABEL_MASK)
242#define IPV6_TCLASS_SHIFT 20
241 243
242struct ipv6_fl_socklist { 244struct ipv6_fl_socklist {
243 struct ipv6_fl_socklist __rcu *next; 245 struct ipv6_fl_socklist __rcu *next;
@@ -251,7 +253,8 @@ struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions *opt_space,
251 struct ipv6_txoptions *fopt); 253 struct ipv6_txoptions *fopt);
252void fl6_free_socklist(struct sock *sk); 254void fl6_free_socklist(struct sock *sk);
253int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen); 255int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen);
254int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq); 256int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq,
257 int flags);
255int ip6_flowlabel_init(void); 258int ip6_flowlabel_init(void);
256void ip6_flowlabel_cleanup(void); 259void ip6_flowlabel_cleanup(void);
257 260
@@ -266,9 +269,6 @@ void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info);
266int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, 269int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
267 struct icmp6hdr *thdr, int len); 270 struct icmp6hdr *thdr, int len);
268 271
269struct dst_entry *icmpv6_route_lookup(struct net *net, struct sk_buff *skb,
270 struct sock *sk, struct flowi6 *fl6);
271
272int ip6_ra_control(struct sock *sk, int sel); 272int ip6_ra_control(struct sock *sk, int sel);
273 273
274int ipv6_parse_hopopts(struct sk_buff *skb); 274int ipv6_parse_hopopts(struct sk_buff *skb);
@@ -678,6 +678,15 @@ static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr)
678 return *(__be32 *)hdr & IPV6_FLOWINFO_MASK; 678 return *(__be32 *)hdr & IPV6_FLOWINFO_MASK;
679} 679}
680 680
681static inline __be32 ip6_flowlabel(const struct ipv6hdr *hdr)
682{
683 return *(__be32 *)hdr & IPV6_FLOWLABEL_MASK;
684}
685
686static inline u8 ip6_tclass(__be32 flowinfo)
687{
688 return ntohl(flowinfo & IPV6_TCLASS_MASK) >> IPV6_TCLASS_SHIFT;
689}
681/* 690/*
682 * Prototypes exported by ipv6 691 * Prototypes exported by ipv6
683 */ 692 */
@@ -712,11 +721,9 @@ void ip6_flush_pending_frames(struct sock *sk);
712 721
713int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6); 722int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6);
714struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, 723struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
715 const struct in6_addr *final_dst, 724 const struct in6_addr *final_dst);
716 bool can_sleep);
717struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, 725struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
718 const struct in6_addr *final_dst, 726 const struct in6_addr *final_dst);
719 bool can_sleep);
720struct dst_entry *ip6_blackhole_route(struct net *net, 727struct dst_entry *ip6_blackhole_route(struct net *net,
721 struct dst_entry *orig_dst); 728 struct dst_entry *orig_dst);
722 729
@@ -776,6 +783,8 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
776 char __user *optval, int __user *optlen); 783 char __user *optval, int __user *optlen);
777 784
778int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); 785int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len);
786int ip6_datagram_connect_v6_only(struct sock *sk, struct sockaddr *addr,
787 int addr_len);
779 788
780int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, 789int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len,
781 int *addr_len); 790 int *addr_len);
@@ -835,7 +844,6 @@ static inline int snmp6_unregister_dev(struct inet6_dev *idev) { return 0; }
835 844
836#ifdef CONFIG_SYSCTL 845#ifdef CONFIG_SYSCTL
837extern struct ctl_table ipv6_route_table_template[]; 846extern struct ctl_table ipv6_route_table_template[];
838extern struct ctl_table ipv6_icmp_table_template[];
839 847
840struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); 848struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
841struct ctl_table *ipv6_route_sysctl_init(struct net *net); 849struct ctl_table *ipv6_route_sysctl_init(struct net *net);
diff --git a/include/net/irda/discovery.h b/include/net/irda/discovery.h
index 0ce93398720d..63ae32530567 100644
--- a/include/net/irda/discovery.h
+++ b/include/net/irda/discovery.h
@@ -23,9 +23,7 @@
23 * GNU General Public License for more details. 23 * GNU General Public License for more details.
24 * 24 *
25 * You should have received a copy of the GNU General Public License 25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software 26 * along with this program; if not, see <http://www.gnu.org/licenses/>.
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 * MA 02111-1307 USA
29 * 27 *
30 ********************************************************************/ 28 ********************************************************************/
31 29
diff --git a/include/net/irda/ircomm_core.h b/include/net/irda/ircomm_core.h
index 69b610acd2df..2a580ce9edad 100644
--- a/include/net/irda/ircomm_core.h
+++ b/include/net/irda/ircomm_core.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_event.h b/include/net/irda/ircomm_event.h
index bc0c6f31f1c6..5bbc32998d57 100644
--- a/include/net/irda/ircomm_event.h
+++ b/include/net/irda/ircomm_event.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_lmp.h b/include/net/irda/ircomm_lmp.h
index ae02106be590..5042a5021a04 100644
--- a/include/net/irda/ircomm_lmp.h
+++ b/include/net/irda/ircomm_lmp.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_param.h b/include/net/irda/ircomm_param.h
index e6678800c41f..1f67432321c4 100644
--- a/include/net/irda/ircomm_param.h
+++ b/include/net/irda/ircomm_param.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_ttp.h b/include/net/irda/ircomm_ttp.h
index 403081ed725c..c5627288bca3 100644
--- a/include/net/irda/ircomm_ttp.h
+++ b/include/net/irda/ircomm_ttp.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h
index 0224402260a7..8d4f588974bc 100644
--- a/include/net/irda/ircomm_tty.h
+++ b/include/net/irda/ircomm_tty.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_tty_attach.h b/include/net/irda/ircomm_tty_attach.h
index 0a63bbb972d7..20dcbdf258cf 100644
--- a/include/net/irda/ircomm_tty_attach.h
+++ b/include/net/irda/ircomm_tty_attach.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index 11417475a6c3..664bf8178412 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -24,9 +24,7 @@
24 * GNU General Public License for more details. 24 * GNU General Public License for more details.
25 * 25 *
26 * You should have received a copy of the GNU General Public License 26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software 27 * along with this program; if not, see <http://www.gnu.org/licenses/>.
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 * 28 *
31 ********************************************************************/ 29 ********************************************************************/
32 30
diff --git a/include/net/irda/irlap_event.h b/include/net/irda/irlap_event.h
index f9d88da97af2..e4325fee1267 100644
--- a/include/net/irda/irlap_event.h
+++ b/include/net/irda/irlap_event.h
@@ -25,9 +25,7 @@
25 * GNU General Public License for more details. 25 * GNU General Public License for more details.
26 * 26 *
27 * You should have received a copy of the GNU General Public License 27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software 28 * along with this program; if not, see <http://www.gnu.org/licenses/>.
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 * MA 02111-1307 USA
31 * 29 *
32 ********************************************************************/ 30 ********************************************************************/
33 31
diff --git a/include/net/irda/irlap_frame.h b/include/net/irda/irlap_frame.h
index 57173ae398ae..cbc12a926e5f 100644
--- a/include/net/irda/irlap_frame.h
+++ b/include/net/irda/irlap_frame.h
@@ -24,9 +24,7 @@
24 * GNU General Public License for more details. 24 * GNU General Public License for more details.
25 * 25 *
26 * You should have received a copy of the GNU General Public License 26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software 27 * along with this program; if not, see <http://www.gnu.org/licenses/>.
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 * 28 *
31 ********************************************************************/ 29 ********************************************************************/
32 30
diff --git a/include/net/irda/parameters.h b/include/net/irda/parameters.h
index c0d938847bd3..42713c931d1f 100644
--- a/include/net/irda/parameters.h
+++ b/include/net/irda/parameters.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 * Michel Dänzer <daenzer@debian.org>, 10/2001 27 * Michel Dänzer <daenzer@debian.org>, 10/2001
30 * - simplify irda_pv_t to avoid endianness issues 28 * - simplify irda_pv_t to avoid endianness issues
diff --git a/include/net/irda/qos.h b/include/net/irda/qos.h
index cc577dc0a0ef..05a5a249956f 100644
--- a/include/net/irda/qos.h
+++ b/include/net/irda/qos.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/llc.h b/include/net/llc.h
index 68490cbc8a65..e8e61d4fb458 100644
--- a/include/net/llc.h
+++ b/include/net/llc.h
@@ -93,7 +93,6 @@ struct hlist_nulls_head *llc_sk_laddr_hash(struct llc_sap *sap,
93#define LLC_DEST_CONN 2 /* Type 2 goes here */ 93#define LLC_DEST_CONN 2 /* Type 2 goes here */
94 94
95extern struct list_head llc_sap_list; 95extern struct list_head llc_sap_list;
96extern spinlock_t llc_sap_list_lock;
97 96
98int llc_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, 97int llc_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
99 struct net_device *orig_dev); 98 struct net_device *orig_dev);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7ceed99a05bc..f4ab2fb4d50c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -154,12 +154,14 @@ struct ieee80211_low_level_stats {
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, 155 * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel,
156 * this is used only with channel switching with CSA 156 * this is used only with channel switching with CSA
157 * @IEEE80211_CHANCTX_CHANGE_MIN_WIDTH: The min required channel width changed
157 */ 158 */
158enum ieee80211_chanctx_change { 159enum ieee80211_chanctx_change {
159 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), 160 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
160 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), 161 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
161 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), 162 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2),
162 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3), 163 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3),
164 IEEE80211_CHANCTX_CHANGE_MIN_WIDTH = BIT(4),
163}; 165};
164 166
165/** 167/**
@@ -169,6 +171,7 @@ enum ieee80211_chanctx_change {
169 * that contains it is visible in mac80211 only. 171 * that contains it is visible in mac80211 only.
170 * 172 *
171 * @def: the channel definition 173 * @def: the channel definition
174 * @min_def: the minimum channel definition currently required.
172 * @rx_chains_static: The number of RX chains that must always be 175 * @rx_chains_static: The number of RX chains that must always be
173 * active on the channel to receive MIMO transmissions 176 * active on the channel to receive MIMO transmissions
174 * @rx_chains_dynamic: The number of RX chains that must be enabled 177 * @rx_chains_dynamic: The number of RX chains that must be enabled
@@ -180,6 +183,7 @@ enum ieee80211_chanctx_change {
180 */ 183 */
181struct ieee80211_chanctx_conf { 184struct ieee80211_chanctx_conf {
182 struct cfg80211_chan_def def; 185 struct cfg80211_chan_def def;
186 struct cfg80211_chan_def min_def;
183 187
184 u8 rx_chains_static, rx_chains_dynamic; 188 u8 rx_chains_static, rx_chains_dynamic;
185 189
@@ -1159,6 +1163,19 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
1159} 1163}
1160 1164
1161/** 1165/**
1166 * wdev_to_ieee80211_vif - return a vif struct from a wdev
1167 * @wdev: the wdev to get the vif for
1168 *
1169 * This can be used by mac80211 drivers with direct cfg80211 APIs
1170 * (like the vendor commands) that get a wdev.
1171 *
1172 * Note that this function may return %NULL if the given wdev isn't
1173 * associated with a vif that the driver knows about (e.g. monitor
1174 * or AP_VLAN interfaces.)
1175 */
1176struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
1177
1178/**
1162 * enum ieee80211_key_flags - key flags 1179 * enum ieee80211_key_flags - key flags
1163 * 1180 *
1164 * These flags are used for communication about keys between the driver 1181 * These flags are used for communication about keys between the driver
@@ -1229,6 +1246,36 @@ struct ieee80211_key_conf {
1229}; 1246};
1230 1247
1231/** 1248/**
1249 * struct ieee80211_cipher_scheme - cipher scheme
1250 *
1251 * This structure contains a cipher scheme information defining
1252 * the secure packet crypto handling.
1253 *
1254 * @cipher: a cipher suite selector
1255 * @iftype: a cipher iftype bit mask indicating an allowed cipher usage
1256 * @hdr_len: a length of a security header used the cipher
1257 * @pn_len: a length of a packet number in the security header
1258 * @pn_off: an offset of pn from the beginning of the security header
1259 * @key_idx_off: an offset of key index byte in the security header
1260 * @key_idx_mask: a bit mask of key_idx bits
1261 * @key_idx_shift: a bit shift needed to get key_idx
1262 * key_idx value calculation:
1263 * (sec_header_base[key_idx_off] & key_idx_mask) >> key_idx_shift
1264 * @mic_len: a mic length in bytes
1265 */
1266struct ieee80211_cipher_scheme {
1267 u32 cipher;
1268 u16 iftype;
1269 u8 hdr_len;
1270 u8 pn_len;
1271 u8 pn_off;
1272 u8 key_idx_off;
1273 u8 key_idx_mask;
1274 u8 key_idx_shift;
1275 u8 mic_len;
1276};
1277
1278/**
1232 * enum set_key_cmd - key command 1279 * enum set_key_cmd - key command
1233 * 1280 *
1234 * Used with the set_key() callback in &struct ieee80211_ops, this 1281 * Used with the set_key() callback in &struct ieee80211_ops, this
@@ -1566,7 +1613,8 @@ enum ieee80211_hw_flags {
1566 * @extra_tx_headroom: headroom to reserve in each transmit skb 1613 * @extra_tx_headroom: headroom to reserve in each transmit skb
1567 * for use by the driver (e.g. for transmit headers.) 1614 * for use by the driver (e.g. for transmit headers.)
1568 * 1615 *
1569 * @channel_change_time: time (in microseconds) it takes to change channels. 1616 * @extra_beacon_tailroom: tailroom to reserve in each beacon tx skb.
1617 * Can be used by drivers to add extra IEs.
1570 * 1618 *
1571 * @max_signal: Maximum value for signal (rssi) in RX information, used 1619 * @max_signal: Maximum value for signal (rssi) in RX information, used
1572 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB 1620 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB
@@ -1636,6 +1684,10 @@ enum ieee80211_hw_flags {
1636 * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may 1684 * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may
1637 * deliver to a WMM STA during any Service Period triggered by the WMM STA. 1685 * deliver to a WMM STA during any Service Period triggered by the WMM STA.
1638 * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values. 1686 * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values.
1687 *
1688 * @n_cipher_schemes: a size of an array of cipher schemes definitions.
1689 * @cipher_schemes: a pointer to an array of cipher scheme definitions
1690 * supported by HW.
1639 */ 1691 */
1640struct ieee80211_hw { 1692struct ieee80211_hw {
1641 struct ieee80211_conf conf; 1693 struct ieee80211_conf conf;
@@ -1644,7 +1696,7 @@ struct ieee80211_hw {
1644 void *priv; 1696 void *priv;
1645 u32 flags; 1697 u32 flags;
1646 unsigned int extra_tx_headroom; 1698 unsigned int extra_tx_headroom;
1647 int channel_change_time; 1699 unsigned int extra_beacon_tailroom;
1648 int vif_data_size; 1700 int vif_data_size;
1649 int sta_data_size; 1701 int sta_data_size;
1650 int chanctx_data_size; 1702 int chanctx_data_size;
@@ -1663,6 +1715,8 @@ struct ieee80211_hw {
1663 netdev_features_t netdev_features; 1715 netdev_features_t netdev_features;
1664 u8 uapsd_queues; 1716 u8 uapsd_queues;
1665 u8 uapsd_max_sp_len; 1717 u8 uapsd_max_sp_len;
1718 u8 n_cipher_schemes;
1719 const struct ieee80211_cipher_scheme *cipher_schemes;
1666}; 1720};
1667 1721
1668/** 1722/**
@@ -2065,6 +2119,11 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
2065 * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP) 2119 * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP)
2066 * and also take care of the EOSP and MORE_DATA bits in the frame. 2120 * and also take care of the EOSP and MORE_DATA bits in the frame.
2067 * The driver may also use ieee80211_sta_eosp() in this case. 2121 * The driver may also use ieee80211_sta_eosp() in this case.
2122 *
2123 * Note that if the driver ever buffers frames other than QoS-data
2124 * frames, it must take care to never send a non-QoS-data frame as
2125 * the last frame in a service period, adding a QoS-nulldata frame
2126 * after a non-QoS-data frame if needed.
2068 */ 2127 */
2069 2128
2070/** 2129/**
@@ -2358,9 +2417,6 @@ enum ieee80211_roc_type {
2358 * See the section "Frame filtering" for more information. 2417 * See the section "Frame filtering" for more information.
2359 * This callback must be implemented and can sleep. 2418 * This callback must be implemented and can sleep.
2360 * 2419 *
2361 * @set_multicast_list: Configure the device's interface specific RX multicast
2362 * filter. This callback is optional. This callback must be atomic.
2363 *
2364 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit 2420 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit
2365 * must be set or cleared for a given STA. Must be atomic. 2421 * must be set or cleared for a given STA. Must be atomic.
2366 * 2422 *
@@ -2445,7 +2501,11 @@ enum ieee80211_roc_type {
2445 * AP, IBSS/WDS/mesh peer etc. This callback can sleep. 2501 * AP, IBSS/WDS/mesh peer etc. This callback can sleep.
2446 * 2502 *
2447 * @sta_remove: Notifies low level driver about removal of an associated 2503 * @sta_remove: Notifies low level driver about removal of an associated
2448 * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. 2504 * station, AP, IBSS/WDS/mesh peer etc. Note that after the callback
2505 * returns it isn't safe to use the pointer, not even RCU protected;
2506 * no RCU grace period is guaranteed between returning here and freeing
2507 * the station. See @sta_pre_rcu_remove if needed.
2508 * This callback can sleep.
2449 * 2509 *
2450 * @sta_add_debugfs: Drivers can use this callback to add debugfs files 2510 * @sta_add_debugfs: Drivers can use this callback to add debugfs files
2451 * when a station is added to mac80211's station list. This callback 2511 * when a station is added to mac80211's station list. This callback
@@ -2464,7 +2524,17 @@ enum ieee80211_roc_type {
2464 * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.) 2524 * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.)
2465 * This callback is mutually exclusive with @sta_add/@sta_remove. 2525 * This callback is mutually exclusive with @sta_add/@sta_remove.
2466 * It must not fail for down transitions but may fail for transitions 2526 * It must not fail for down transitions but may fail for transitions
2467 * up the list of states. 2527 * up the list of states. Also note that after the callback returns it
2528 * isn't safe to use the pointer, not even RCU protected - no RCU grace
2529 * period is guaranteed between returning here and freeing the station.
2530 * See @sta_pre_rcu_remove if needed.
2531 * The callback can sleep.
2532 *
2533 * @sta_pre_rcu_remove: Notify driver about station removal before RCU
2534 * synchronisation. This is useful if a driver needs to have station
2535 * pointers protected using RCU, it can then use this call to clear
2536 * the pointers instead of waiting for an RCU grace period to elapse
2537 * in @sta_state.
2468 * The callback can sleep. 2538 * The callback can sleep.
2469 * 2539 *
2470 * @sta_rc_update: Notifies the driver of changes to the bitrates that can be 2540 * @sta_rc_update: Notifies the driver of changes to the bitrates that can be
@@ -2724,10 +2794,6 @@ struct ieee80211_ops {
2724 unsigned int changed_flags, 2794 unsigned int changed_flags,
2725 unsigned int *total_flags, 2795 unsigned int *total_flags,
2726 u64 multicast); 2796 u64 multicast);
2727 void (*set_multicast_list)(struct ieee80211_hw *hw,
2728 struct ieee80211_vif *vif, bool allmulti,
2729 struct netdev_hw_addr_list *mc_list);
2730
2731 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 2797 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
2732 bool set); 2798 bool set);
2733 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, 2799 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
@@ -2781,6 +2847,9 @@ struct ieee80211_ops {
2781 struct ieee80211_sta *sta, 2847 struct ieee80211_sta *sta,
2782 enum ieee80211_sta_state old_state, 2848 enum ieee80211_sta_state old_state,
2783 enum ieee80211_sta_state new_state); 2849 enum ieee80211_sta_state new_state);
2850 void (*sta_pre_rcu_remove)(struct ieee80211_hw *hw,
2851 struct ieee80211_vif *vif,
2852 struct ieee80211_sta *sta);
2784 void (*sta_rc_update)(struct ieee80211_hw *hw, 2853 void (*sta_rc_update)(struct ieee80211_hw *hw,
2785 struct ieee80211_vif *vif, 2854 struct ieee80211_vif *vif,
2786 struct ieee80211_sta *sta, 2855 struct ieee80211_sta *sta,
@@ -4585,4 +4654,51 @@ bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw,
4585 struct ieee80211_vif *vif, struct sk_buff *skb, 4654 struct ieee80211_vif *vif, struct sk_buff *skb,
4586 int band, struct ieee80211_sta **sta); 4655 int band, struct ieee80211_sta **sta);
4587 4656
4657/**
4658 * struct ieee80211_noa_data - holds temporary data for tracking P2P NoA state
4659 *
4660 * @next_tsf: TSF timestamp of the next absent state change
4661 * @has_next_tsf: next absent state change event pending
4662 *
4663 * @absent: descriptor bitmask, set if GO is currently absent
4664 *
4665 * private:
4666 *
4667 * @count: count fields from the NoA descriptors
4668 * @desc: adjusted data from the NoA
4669 */
4670struct ieee80211_noa_data {
4671 u32 next_tsf;
4672 bool has_next_tsf;
4673
4674 u8 absent;
4675
4676 u8 count[IEEE80211_P2P_NOA_DESC_MAX];
4677 struct {
4678 u32 start;
4679 u32 duration;
4680 u32 interval;
4681 } desc[IEEE80211_P2P_NOA_DESC_MAX];
4682};
4683
4684/**
4685 * ieee80211_parse_p2p_noa - initialize NoA tracking data from P2P IE
4686 *
4687 * @attr: P2P NoA IE
4688 * @data: NoA tracking data
4689 * @tsf: current TSF timestamp
4690 *
4691 * Return: number of successfully parsed descriptors
4692 */
4693int ieee80211_parse_p2p_noa(const struct ieee80211_p2p_noa_attr *attr,
4694 struct ieee80211_noa_data *data, u32 tsf);
4695
4696/**
4697 * ieee80211_update_p2p_noa - get next pending P2P GO absent state change
4698 *
4699 * @data: NoA tracking data
4700 * @tsf: current TSF timestamp
4701 */
4702void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf);
4703
4588#endif /* MAC80211_H */ 4704#endif /* MAC80211_H */
diff --git a/include/net/mip6.h b/include/net/mip6.h
index 26ba99b5a4b1..0386b618908c 100644
--- a/include/net/mip6.h
+++ b/include/net/mip6.h
@@ -13,8 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 17 */
19/* 18/*
20 * Authors: 19 * Authors:
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 536501a3e58d..7277caf3743d 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -21,6 +21,7 @@
21#include <linux/skbuff.h> 21#include <linux/skbuff.h>
22#include <linux/rcupdate.h> 22#include <linux/rcupdate.h>
23#include <linux/seq_file.h> 23#include <linux/seq_file.h>
24#include <linux/bitmap.h>
24 25
25#include <linux/err.h> 26#include <linux/err.h>
26#include <linux/sysctl.h> 27#include <linux/sysctl.h>
@@ -37,6 +38,32 @@
37 38
38struct neighbour; 39struct neighbour;
39 40
41enum {
42 NEIGH_VAR_MCAST_PROBES,
43 NEIGH_VAR_UCAST_PROBES,
44 NEIGH_VAR_APP_PROBES,
45 NEIGH_VAR_RETRANS_TIME,
46 NEIGH_VAR_BASE_REACHABLE_TIME,
47 NEIGH_VAR_DELAY_PROBE_TIME,
48 NEIGH_VAR_GC_STALETIME,
49 NEIGH_VAR_QUEUE_LEN_BYTES,
50 NEIGH_VAR_PROXY_QLEN,
51 NEIGH_VAR_ANYCAST_DELAY,
52 NEIGH_VAR_PROXY_DELAY,
53 NEIGH_VAR_LOCKTIME,
54#define NEIGH_VAR_DATA_MAX (NEIGH_VAR_LOCKTIME + 1)
55 /* Following are used as a second way to access one of the above */
56 NEIGH_VAR_QUEUE_LEN, /* same data as NEIGH_VAR_QUEUE_LEN_BYTES */
57 NEIGH_VAR_RETRANS_TIME_MS, /* same data as NEIGH_VAR_RETRANS_TIME */
58 NEIGH_VAR_BASE_REACHABLE_TIME_MS, /* same data as NEIGH_VAR_BASE_REACHABLE_TIME */
59 /* Following are used by "default" only */
60 NEIGH_VAR_GC_INTERVAL,
61 NEIGH_VAR_GC_THRESH1,
62 NEIGH_VAR_GC_THRESH2,
63 NEIGH_VAR_GC_THRESH3,
64 NEIGH_VAR_MAX
65};
66
40struct neigh_parms { 67struct neigh_parms {
41#ifdef CONFIG_NET_NS 68#ifdef CONFIG_NET_NS
42 struct net *net; 69 struct net *net;
@@ -53,22 +80,35 @@ struct neigh_parms {
53 atomic_t refcnt; 80 atomic_t refcnt;
54 struct rcu_head rcu_head; 81 struct rcu_head rcu_head;
55 82
56 int base_reachable_time;
57 int retrans_time;
58 int gc_staletime;
59 int reachable_time; 83 int reachable_time;
60 int delay_probe_time; 84 int data[NEIGH_VAR_DATA_MAX];
61 85 DECLARE_BITMAP(data_state, NEIGH_VAR_DATA_MAX);
62 int queue_len_bytes;
63 int ucast_probes;
64 int app_probes;
65 int mcast_probes;
66 int anycast_delay;
67 int proxy_delay;
68 int proxy_qlen;
69 int locktime;
70}; 86};
71 87
88static inline void neigh_var_set(struct neigh_parms *p, int index, int val)
89{
90 set_bit(index, p->data_state);
91 p->data[index] = val;
92}
93
94#define NEIGH_VAR(p, attr) ((p)->data[NEIGH_VAR_ ## attr])
95
96/* In ndo_neigh_setup, NEIGH_VAR_INIT should be used.
97 * In other cases, NEIGH_VAR_SET should be used.
98 */
99#define NEIGH_VAR_INIT(p, attr, val) (NEIGH_VAR(p, attr) = val)
100#define NEIGH_VAR_SET(p, attr, val) neigh_var_set(p, NEIGH_VAR_ ## attr, val)
101
102static inline void neigh_parms_data_state_setall(struct neigh_parms *p)
103{
104 bitmap_fill(p->data_state, NEIGH_VAR_DATA_MAX);
105}
106
107static inline void neigh_parms_data_state_cleanall(struct neigh_parms *p)
108{
109 bitmap_zero(p->data_state, NEIGH_VAR_DATA_MAX);
110}
111
72struct neigh_statistics { 112struct neigh_statistics {
73 unsigned long allocs; /* number of allocated neighs */ 113 unsigned long allocs; /* number of allocated neighs */
74 unsigned long destroys; /* number of destroyed neighs */ 114 unsigned long destroys; /* number of destroyed neighs */
@@ -180,6 +220,11 @@ struct neigh_table {
180 struct pneigh_entry **phash_buckets; 220 struct pneigh_entry **phash_buckets;
181}; 221};
182 222
223static inline int neigh_parms_family(struct neigh_parms *p)
224{
225 return p->tbl->family;
226}
227
183#define NEIGH_PRIV_ALIGN sizeof(long long) 228#define NEIGH_PRIV_ALIGN sizeof(long long)
184#define NEIGH_ENTRY_SIZE(size) ALIGN((size), NEIGH_PRIV_ALIGN) 229#define NEIGH_ENTRY_SIZE(size) ALIGN((size), NEIGH_PRIV_ALIGN)
185 230
@@ -212,6 +257,7 @@ static inline struct neighbour *neigh_create(struct neigh_table *tbl,
212void neigh_destroy(struct neighbour *neigh); 257void neigh_destroy(struct neighbour *neigh);
213int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb); 258int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb);
214int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags); 259int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags);
260void __neigh_set_probe_once(struct neighbour *neigh);
215void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); 261void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
216int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); 262int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
217int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb); 263int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb);
@@ -274,8 +320,17 @@ void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *,
274void *neigh_seq_next(struct seq_file *, void *, loff_t *); 320void *neigh_seq_next(struct seq_file *, void *, loff_t *);
275void neigh_seq_stop(struct seq_file *, void *); 321void neigh_seq_stop(struct seq_file *, void *);
276 322
323int neigh_proc_dointvec(struct ctl_table *ctl, int write,
324 void __user *buffer, size_t *lenp, loff_t *ppos);
325int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write,
326 void __user *buffer,
327 size_t *lenp, loff_t *ppos);
328int neigh_proc_dointvec_ms_jiffies(struct ctl_table *ctl, int write,
329 void __user *buffer,
330 size_t *lenp, loff_t *ppos);
331
277int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, 332int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
278 char *p_name, proc_handler *proc_handler); 333 proc_handler *proc_handler);
279void neigh_sysctl_unregister(struct neigh_parms *p); 334void neigh_sysctl_unregister(struct neigh_parms *p);
280 335
281static inline void __neigh_parms_put(struct neigh_parms *parms) 336static inline void __neigh_parms_put(struct neigh_parms *parms)
diff --git a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
index 6c3d12e2949f..981c327374da 100644
--- a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
+++ b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
@@ -19,6 +19,4 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp;
19int nf_conntrack_ipv4_compat_init(void); 19int nf_conntrack_ipv4_compat_init(void);
20void nf_conntrack_ipv4_compat_fini(void); 20void nf_conntrack_ipv4_compat_fini(void);
21 21
22void need_ipv4_conntrack(void);
23
24#endif /*_NF_CONNTRACK_IPV4_H*/ 22#endif /*_NF_CONNTRACK_IPV4_H*/
diff --git a/include/net/netfilter/ipv4/nf_reject.h b/include/net/netfilter/ipv4/nf_reject.h
new file mode 100644
index 000000000000..931fbf812171
--- /dev/null
+++ b/include/net/netfilter/ipv4/nf_reject.h
@@ -0,0 +1,128 @@
1#ifndef _IPV4_NF_REJECT_H
2#define _IPV4_NF_REJECT_H
3
4#include <net/ip.h>
5#include <net/tcp.h>
6#include <net/route.h>
7#include <net/dst.h>
8
9static inline void nf_send_unreach(struct sk_buff *skb_in, int code)
10{
11 icmp_send(skb_in, ICMP_DEST_UNREACH, code, 0);
12}
13
14/* Send RST reply */
15static void nf_send_reset(struct sk_buff *oldskb, int hook)
16{
17 struct sk_buff *nskb;
18 const struct iphdr *oiph;
19 struct iphdr *niph;
20 const struct tcphdr *oth;
21 struct tcphdr _otcph, *tcph;
22
23 /* IP header checks: fragment. */
24 if (ip_hdr(oldskb)->frag_off & htons(IP_OFFSET))
25 return;
26
27 oth = skb_header_pointer(oldskb, ip_hdrlen(oldskb),
28 sizeof(_otcph), &_otcph);
29 if (oth == NULL)
30 return;
31
32 /* No RST for RST. */
33 if (oth->rst)
34 return;
35
36 if (skb_rtable(oldskb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))
37 return;
38
39 /* Check checksum */
40 if (nf_ip_checksum(oldskb, hook, ip_hdrlen(oldskb), IPPROTO_TCP))
41 return;
42 oiph = ip_hdr(oldskb);
43
44 nskb = alloc_skb(sizeof(struct iphdr) + sizeof(struct tcphdr) +
45 LL_MAX_HEADER, GFP_ATOMIC);
46 if (!nskb)
47 return;
48
49 skb_reserve(nskb, LL_MAX_HEADER);
50
51 skb_reset_network_header(nskb);
52 niph = (struct iphdr *)skb_put(nskb, sizeof(struct iphdr));
53 niph->version = 4;
54 niph->ihl = sizeof(struct iphdr) / 4;
55 niph->tos = 0;
56 niph->id = 0;
57 niph->frag_off = htons(IP_DF);
58 niph->protocol = IPPROTO_TCP;
59 niph->check = 0;
60 niph->saddr = oiph->daddr;
61 niph->daddr = oiph->saddr;
62
63 skb_reset_transport_header(nskb);
64 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr));
65 memset(tcph, 0, sizeof(*tcph));
66 tcph->source = oth->dest;
67 tcph->dest = oth->source;
68 tcph->doff = sizeof(struct tcphdr) / 4;
69
70 if (oth->ack)
71 tcph->seq = oth->ack_seq;
72 else {
73 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin +
74 oldskb->len - ip_hdrlen(oldskb) -
75 (oth->doff << 2));
76 tcph->ack = 1;
77 }
78
79 tcph->rst = 1;
80 tcph->check = ~tcp_v4_check(sizeof(struct tcphdr), niph->saddr,
81 niph->daddr, 0);
82 nskb->ip_summed = CHECKSUM_PARTIAL;
83 nskb->csum_start = (unsigned char *)tcph - nskb->head;
84 nskb->csum_offset = offsetof(struct tcphdr, check);
85
86 /* ip_route_me_harder expects skb->dst to be set */
87 skb_dst_set_noref(nskb, skb_dst(oldskb));
88
89 nskb->protocol = htons(ETH_P_IP);
90 if (ip_route_me_harder(nskb, RTN_UNSPEC))
91 goto free_nskb;
92
93 niph->ttl = ip4_dst_hoplimit(skb_dst(nskb));
94
95 /* "Never happens" */
96 if (nskb->len > dst_mtu(skb_dst(nskb)))
97 goto free_nskb;
98
99 nf_ct_attach(nskb, oldskb);
100
101#ifdef CONFIG_BRIDGE_NETFILTER
102 /* If we use ip_local_out for bridged traffic, the MAC source on
103 * the RST will be ours, instead of the destination's. This confuses
104 * some routers/firewalls, and they drop the packet. So we need to
105 * build the eth header using the original destination's MAC as the
106 * source, and send the RST packet directly.
107 */
108 if (oldskb->nf_bridge) {
109 struct ethhdr *oeth = eth_hdr(oldskb);
110 nskb->dev = oldskb->nf_bridge->physindev;
111 niph->tot_len = htons(nskb->len);
112 ip_send_check(niph);
113 if (dev_hard_header(nskb, nskb->dev, ntohs(nskb->protocol),
114 oeth->h_source, oeth->h_dest, nskb->len) < 0)
115 goto free_nskb;
116 dev_queue_xmit(nskb);
117 } else
118#endif
119 ip_local_out(nskb);
120
121 return;
122
123 free_nskb:
124 kfree_skb(nskb);
125}
126
127
128#endif /* _IPV4_NF_REJECT_H */
diff --git a/include/net/netfilter/ipv6/nf_reject.h b/include/net/netfilter/ipv6/nf_reject.h
new file mode 100644
index 000000000000..710d17ed70b4
--- /dev/null
+++ b/include/net/netfilter/ipv6/nf_reject.h
@@ -0,0 +1,171 @@
1#ifndef _IPV6_NF_REJECT_H
2#define _IPV6_NF_REJECT_H
3
4#include <net/ipv6.h>
5#include <net/ip6_route.h>
6#include <net/ip6_fib.h>
7#include <net/ip6_checksum.h>
8#include <linux/netfilter_ipv6.h>
9
10static inline void
11nf_send_unreach6(struct net *net, struct sk_buff *skb_in, unsigned char code,
12 unsigned int hooknum)
13{
14 if (hooknum == NF_INET_LOCAL_OUT && skb_in->dev == NULL)
15 skb_in->dev = net->loopback_dev;
16
17 icmpv6_send(skb_in, ICMPV6_DEST_UNREACH, code, 0);
18}
19
20/* Send RST reply */
21static void nf_send_reset6(struct net *net, struct sk_buff *oldskb, int hook)
22{
23 struct sk_buff *nskb;
24 struct tcphdr otcph, *tcph;
25 unsigned int otcplen, hh_len;
26 int tcphoff, needs_ack;
27 const struct ipv6hdr *oip6h = ipv6_hdr(oldskb);
28 struct ipv6hdr *ip6h;
29#define DEFAULT_TOS_VALUE 0x0U
30 const __u8 tclass = DEFAULT_TOS_VALUE;
31 struct dst_entry *dst = NULL;
32 u8 proto;
33 __be16 frag_off;
34 struct flowi6 fl6;
35
36 if ((!(ipv6_addr_type(&oip6h->saddr) & IPV6_ADDR_UNICAST)) ||
37 (!(ipv6_addr_type(&oip6h->daddr) & IPV6_ADDR_UNICAST))) {
38 pr_debug("addr is not unicast.\n");
39 return;
40 }
41
42 proto = oip6h->nexthdr;
43 tcphoff = ipv6_skip_exthdr(oldskb, ((u8*)(oip6h+1) - oldskb->data), &proto, &frag_off);
44
45 if ((tcphoff < 0) || (tcphoff > oldskb->len)) {
46 pr_debug("Cannot get TCP header.\n");
47 return;
48 }
49
50 otcplen = oldskb->len - tcphoff;
51
52 /* IP header checks: fragment, too short. */
53 if (proto != IPPROTO_TCP || otcplen < sizeof(struct tcphdr)) {
54 pr_debug("proto(%d) != IPPROTO_TCP, "
55 "or too short. otcplen = %d\n",
56 proto, otcplen);
57 return;
58 }
59
60 if (skb_copy_bits(oldskb, tcphoff, &otcph, sizeof(struct tcphdr)))
61 BUG();
62
63 /* No RST for RST. */
64 if (otcph.rst) {
65 pr_debug("RST is set\n");
66 return;
67 }
68
69 /* Check checksum. */
70 if (nf_ip6_checksum(oldskb, hook, tcphoff, IPPROTO_TCP)) {
71 pr_debug("TCP checksum is invalid\n");
72 return;
73 }
74
75 memset(&fl6, 0, sizeof(fl6));
76 fl6.flowi6_proto = IPPROTO_TCP;
77 fl6.saddr = oip6h->daddr;
78 fl6.daddr = oip6h->saddr;
79 fl6.fl6_sport = otcph.dest;
80 fl6.fl6_dport = otcph.source;
81 security_skb_classify_flow(oldskb, flowi6_to_flowi(&fl6));
82 dst = ip6_route_output(net, NULL, &fl6);
83 if (dst == NULL || dst->error) {
84 dst_release(dst);
85 return;
86 }
87 dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
88 if (IS_ERR(dst))
89 return;
90
91 hh_len = (dst->dev->hard_header_len + 15)&~15;
92 nskb = alloc_skb(hh_len + 15 + dst->header_len + sizeof(struct ipv6hdr)
93 + sizeof(struct tcphdr) + dst->trailer_len,
94 GFP_ATOMIC);
95
96 if (!nskb) {
97 net_dbg_ratelimited("cannot alloc skb\n");
98 dst_release(dst);
99 return;
100 }
101
102 skb_dst_set(nskb, dst);
103
104 skb_reserve(nskb, hh_len + dst->header_len);
105
106 skb_put(nskb, sizeof(struct ipv6hdr));
107 skb_reset_network_header(nskb);
108 ip6h = ipv6_hdr(nskb);
109 ip6_flow_hdr(ip6h, tclass, 0);
110 ip6h->hop_limit = ip6_dst_hoplimit(dst);
111 ip6h->nexthdr = IPPROTO_TCP;
112 ip6h->saddr = oip6h->daddr;
113 ip6h->daddr = oip6h->saddr;
114
115 skb_reset_transport_header(nskb);
116 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr));
117 /* Truncate to length (no data) */
118 tcph->doff = sizeof(struct tcphdr)/4;
119 tcph->source = otcph.dest;
120 tcph->dest = otcph.source;
121
122 if (otcph.ack) {
123 needs_ack = 0;
124 tcph->seq = otcph.ack_seq;
125 tcph->ack_seq = 0;
126 } else {
127 needs_ack = 1;
128 tcph->ack_seq = htonl(ntohl(otcph.seq) + otcph.syn + otcph.fin
129 + otcplen - (otcph.doff<<2));
130 tcph->seq = 0;
131 }
132
133 /* Reset flags */
134 ((u_int8_t *)tcph)[13] = 0;
135 tcph->rst = 1;
136 tcph->ack = needs_ack;
137 tcph->window = 0;
138 tcph->urg_ptr = 0;
139 tcph->check = 0;
140
141 /* Adjust TCP checksum */
142 tcph->check = csum_ipv6_magic(&ipv6_hdr(nskb)->saddr,
143 &ipv6_hdr(nskb)->daddr,
144 sizeof(struct tcphdr), IPPROTO_TCP,
145 csum_partial(tcph,
146 sizeof(struct tcphdr), 0));
147
148 nf_ct_attach(nskb, oldskb);
149
150#ifdef CONFIG_BRIDGE_NETFILTER
151 /* If we use ip6_local_out for bridged traffic, the MAC source on
152 * the RST will be ours, instead of the destination's. This confuses
153 * some routers/firewalls, and they drop the packet. So we need to
154 * build the eth header using the original destination's MAC as the
155 * source, and send the RST packet directly.
156 */
157 if (oldskb->nf_bridge) {
158 struct ethhdr *oeth = eth_hdr(oldskb);
159 nskb->dev = oldskb->nf_bridge->physindev;
160 nskb->protocol = htons(ETH_P_IPV6);
161 ip6h->payload_len = htons(sizeof(struct tcphdr));
162 if (dev_hard_header(nskb, nskb->dev, ntohs(nskb->protocol),
163 oeth->h_source, oeth->h_dest, nskb->len) < 0)
164 return;
165 dev_queue_xmit(nskb);
166 } else
167#endif
168 ip6_local_out(nskb);
169}
170
171#endif /* _IPV6_NF_REJECT_H */
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h
index 3efab704b7eb..adc1fa3dd7ab 100644
--- a/include/net/netfilter/nf_conntrack_l3proto.h
+++ b/include/net/netfilter/nf_conntrack_l3proto.h
@@ -87,7 +87,6 @@ int nf_ct_l3proto_register(struct nf_conntrack_l3proto *proto);
87void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto); 87void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto);
88 88
89struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); 89struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto);
90void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p);
91 90
92/* Existing built-in protocols */ 91/* Existing built-in protocols */
93extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; 92extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic;
diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h
index c1d5b3e34a21..84a53d780306 100644
--- a/include/net/netfilter/nf_queue.h
+++ b/include/net/netfilter/nf_queue.h
@@ -1,6 +1,10 @@
1#ifndef _NF_QUEUE_H 1#ifndef _NF_QUEUE_H
2#define _NF_QUEUE_H 2#define _NF_QUEUE_H
3 3
4#include <linux/ip.h>
5#include <linux/ipv6.h>
6#include <linux/jhash.h>
7
4/* Each queued (to userspace) skbuff has one of these. */ 8/* Each queued (to userspace) skbuff has one of these. */
5struct nf_queue_entry { 9struct nf_queue_entry {
6 struct list_head list; 10 struct list_head list;
@@ -33,4 +37,62 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
33bool nf_queue_entry_get_refs(struct nf_queue_entry *entry); 37bool nf_queue_entry_get_refs(struct nf_queue_entry *entry);
34void nf_queue_entry_release_refs(struct nf_queue_entry *entry); 38void nf_queue_entry_release_refs(struct nf_queue_entry *entry);
35 39
40static inline void init_hashrandom(u32 *jhash_initval)
41{
42 while (*jhash_initval == 0)
43 *jhash_initval = prandom_u32();
44}
45
46static inline u32 hash_v4(const struct sk_buff *skb, u32 jhash_initval)
47{
48 const struct iphdr *iph = ip_hdr(skb);
49
50 /* packets in either direction go into same queue */
51 if ((__force u32)iph->saddr < (__force u32)iph->daddr)
52 return jhash_3words((__force u32)iph->saddr,
53 (__force u32)iph->daddr, iph->protocol, jhash_initval);
54
55 return jhash_3words((__force u32)iph->daddr,
56 (__force u32)iph->saddr, iph->protocol, jhash_initval);
57}
58
59#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
60static inline u32 hash_v6(const struct sk_buff *skb, u32 jhash_initval)
61{
62 const struct ipv6hdr *ip6h = ipv6_hdr(skb);
63 u32 a, b, c;
64
65 if ((__force u32)ip6h->saddr.s6_addr32[3] <
66 (__force u32)ip6h->daddr.s6_addr32[3]) {
67 a = (__force u32) ip6h->saddr.s6_addr32[3];
68 b = (__force u32) ip6h->daddr.s6_addr32[3];
69 } else {
70 b = (__force u32) ip6h->saddr.s6_addr32[3];
71 a = (__force u32) ip6h->daddr.s6_addr32[3];
72 }
73
74 if ((__force u32)ip6h->saddr.s6_addr32[1] <
75 (__force u32)ip6h->daddr.s6_addr32[1])
76 c = (__force u32) ip6h->saddr.s6_addr32[1];
77 else
78 c = (__force u32) ip6h->daddr.s6_addr32[1];
79
80 return jhash_3words(a, b, c, jhash_initval);
81}
82#endif
83
84static inline u32
85nfqueue_hash(const struct sk_buff *skb, u16 queue, u16 queues_total, u8 family,
86 u32 jhash_initval)
87{
88 if (family == NFPROTO_IPV4)
89 queue += ((u64) hash_v4(skb, jhash_initval) * queues_total) >> 32;
90#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
91 else if (family == NFPROTO_IPV6)
92 queue += ((u64) hash_v6(skb, jhash_initval) * queues_total) >> 32;
93#endif
94
95 return queue;
96}
97
36#endif /* _NF_QUEUE_H */ 98#endif /* _NF_QUEUE_H */
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 5a91abfc0c30..57c8ff7955df 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -13,9 +13,10 @@ struct nft_pktinfo {
13 struct sk_buff *skb; 13 struct sk_buff *skb;
14 const struct net_device *in; 14 const struct net_device *in;
15 const struct net_device *out; 15 const struct net_device *out;
16 u8 hooknum; 16 const struct nf_hook_ops *ops;
17 u8 nhoff; 17 u8 nhoff;
18 u8 thoff; 18 u8 thoff;
19 u8 tprot;
19 /* for x_tables compatibility */ 20 /* for x_tables compatibility */
20 struct xt_action_param xt; 21 struct xt_action_param xt;
21}; 22};
@@ -29,7 +30,8 @@ static inline void nft_set_pktinfo(struct nft_pktinfo *pkt,
29 pkt->skb = skb; 30 pkt->skb = skb;
30 pkt->in = pkt->xt.in = in; 31 pkt->in = pkt->xt.in = in;
31 pkt->out = pkt->xt.out = out; 32 pkt->out = pkt->xt.out = out;
32 pkt->hooknum = pkt->xt.hooknum = ops->hooknum; 33 pkt->ops = ops;
34 pkt->xt.hooknum = ops->hooknum;
33 pkt->xt.family = ops->pf; 35 pkt->xt.family = ops->pf;
34} 36}
35 37
@@ -421,6 +423,8 @@ struct nft_stats {
421 u64 pkts; 423 u64 pkts;
422}; 424};
423 425
426#define NFT_HOOK_OPS_MAX 2
427
424/** 428/**
425 * struct nft_base_chain - nf_tables base chain 429 * struct nft_base_chain - nf_tables base chain
426 * 430 *
@@ -431,8 +435,8 @@ struct nft_stats {
431 * @chain: the chain 435 * @chain: the chain
432 */ 436 */
433struct nft_base_chain { 437struct nft_base_chain {
434 struct nf_hook_ops ops; 438 struct nf_hook_ops ops[NFT_HOOK_OPS_MAX];
435 enum nft_chain_type type; 439 const struct nf_chain_type *type;
436 u8 policy; 440 u8 policy;
437 struct nft_stats __percpu *stats; 441 struct nft_stats __percpu *stats;
438 struct nft_chain chain; 442 struct nft_chain chain;
@@ -443,8 +447,8 @@ static inline struct nft_base_chain *nft_base_chain(const struct nft_chain *chai
443 return container_of(chain, struct nft_base_chain, chain); 447 return container_of(chain, struct nft_base_chain, chain);
444} 448}
445 449
446unsigned int nft_do_chain_pktinfo(struct nft_pktinfo *pkt, 450unsigned int nft_do_chain(struct nft_pktinfo *pkt,
447 const struct nf_hook_ops *ops); 451 const struct nf_hook_ops *ops);
448 452
449/** 453/**
450 * struct nft_table - nf_tables table 454 * struct nft_table - nf_tables table
@@ -475,6 +479,8 @@ struct nft_table {
475 * @nhooks: number of hooks in this family 479 * @nhooks: number of hooks in this family
476 * @owner: module owner 480 * @owner: module owner
477 * @tables: used internally 481 * @tables: used internally
482 * @nops: number of hook ops in this family
483 * @hook_ops_init: initialization function for chain hook ops
478 * @hooks: hookfn overrides for packet validation 484 * @hooks: hookfn overrides for packet validation
479 */ 485 */
480struct nft_af_info { 486struct nft_af_info {
@@ -483,23 +489,36 @@ struct nft_af_info {
483 unsigned int nhooks; 489 unsigned int nhooks;
484 struct module *owner; 490 struct module *owner;
485 struct list_head tables; 491 struct list_head tables;
492 unsigned int nops;
493 void (*hook_ops_init)(struct nf_hook_ops *,
494 unsigned int);
486 nf_hookfn *hooks[NF_MAX_HOOKS]; 495 nf_hookfn *hooks[NF_MAX_HOOKS];
487}; 496};
488 497
489int nft_register_afinfo(struct net *, struct nft_af_info *); 498int nft_register_afinfo(struct net *, struct nft_af_info *);
490void nft_unregister_afinfo(struct nft_af_info *); 499void nft_unregister_afinfo(struct nft_af_info *);
491 500
501/**
502 * struct nf_chain_type - nf_tables chain type info
503 *
504 * @name: name of the type
505 * @type: numeric identifier
506 * @family: address family
507 * @owner: module owner
508 * @hook_mask: mask of valid hooks
509 * @hooks: hookfn overrides
510 */
492struct nf_chain_type { 511struct nf_chain_type {
493 unsigned int hook_mask; 512 const char *name;
494 const char *name; 513 enum nft_chain_type type;
495 enum nft_chain_type type; 514 int family;
496 nf_hookfn *fn[NF_MAX_HOOKS]; 515 struct module *owner;
497 struct module *me; 516 unsigned int hook_mask;
498 int family; 517 nf_hookfn *hooks[NF_MAX_HOOKS];
499}; 518};
500 519
501int nft_register_chain_type(struct nf_chain_type *); 520int nft_register_chain_type(const struct nf_chain_type *);
502void nft_unregister_chain_type(struct nf_chain_type *); 521void nft_unregister_chain_type(const struct nf_chain_type *);
503 522
504int nft_register_expr(struct nft_expr_type *); 523int nft_register_expr(struct nft_expr_type *);
505void nft_unregister_expr(struct nft_expr_type *); 524void nft_unregister_expr(struct nft_expr_type *);
diff --git a/include/net/netfilter/nf_tables_ipv4.h b/include/net/netfilter/nf_tables_ipv4.h
index 1be1c2c197ee..cba143fbd2e4 100644
--- a/include/net/netfilter/nf_tables_ipv4.h
+++ b/include/net/netfilter/nf_tables_ipv4.h
@@ -15,9 +15,12 @@ nft_set_pktinfo_ipv4(struct nft_pktinfo *pkt,
15 15
16 nft_set_pktinfo(pkt, ops, skb, in, out); 16 nft_set_pktinfo(pkt, ops, skb, in, out);
17 17
18 pkt->xt.thoff = ip_hdrlen(pkt->skb);
19 ip = ip_hdr(pkt->skb); 18 ip = ip_hdr(pkt->skb);
19 pkt->tprot = ip->protocol;
20 pkt->xt.thoff = ip_hdrlen(pkt->skb);
20 pkt->xt.fragoff = ntohs(ip->frag_off) & IP_OFFSET; 21 pkt->xt.fragoff = ntohs(ip->frag_off) & IP_OFFSET;
21} 22}
22 23
24extern struct nft_af_info nft_af_ipv4;
25
23#endif 26#endif
diff --git a/include/net/netfilter/nf_tables_ipv6.h b/include/net/netfilter/nf_tables_ipv6.h
index 4a9b88a65963..74d976137658 100644
--- a/include/net/netfilter/nf_tables_ipv6.h
+++ b/include/net/netfilter/nf_tables_ipv6.h
@@ -21,10 +21,13 @@ nft_set_pktinfo_ipv6(struct nft_pktinfo *pkt,
21 if (protohdr < 0) 21 if (protohdr < 0)
22 return -1; 22 return -1;
23 23
24 pkt->tprot = protohdr;
24 pkt->xt.thoff = thoff; 25 pkt->xt.thoff = thoff;
25 pkt->xt.fragoff = frag_off; 26 pkt->xt.fragoff = frag_off;
26 27
27 return 0; 28 return 0;
28} 29}
29 30
31extern struct nft_af_info nft_af_ipv6;
32
30#endif 33#endif
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 2c95d55f7914..4fe018c48ed9 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -22,8 +22,7 @@
22 * the GNU General Public License for more details. 22 * the GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 * 26 *
28 */ 27 */
29 28
@@ -111,7 +110,7 @@ struct cipso_v4_doi;
111struct netlbl_audit { 110struct netlbl_audit {
112 u32 secid; 111 u32 secid;
113 kuid_t loginuid; 112 kuid_t loginuid;
114 u32 sessionid; 113 unsigned int sessionid;
115}; 114};
116 115
117/* 116/*
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index c9c0c538b68b..fbcc7fa536dc 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -65,6 +65,23 @@ struct nf_ip_net {
65struct netns_ct { 65struct netns_ct {
66 atomic_t count; 66 atomic_t count;
67 unsigned int expect_count; 67 unsigned int expect_count;
68#ifdef CONFIG_SYSCTL
69 struct ctl_table_header *sysctl_header;
70 struct ctl_table_header *acct_sysctl_header;
71 struct ctl_table_header *tstamp_sysctl_header;
72 struct ctl_table_header *event_sysctl_header;
73 struct ctl_table_header *helper_sysctl_header;
74#endif
75 char *slabname;
76 unsigned int sysctl_log_invalid; /* Log invalid packets */
77 unsigned int sysctl_events_retry_timeout;
78 int sysctl_events;
79 int sysctl_acct;
80 int sysctl_auto_assign_helper;
81 bool auto_assign_helper_warned;
82 int sysctl_tstamp;
83 int sysctl_checksum;
84
68 unsigned int htable_size; 85 unsigned int htable_size;
69 struct kmem_cache *nf_conntrack_cachep; 86 struct kmem_cache *nf_conntrack_cachep;
70 struct hlist_nulls_head *hash; 87 struct hlist_nulls_head *hash;
@@ -75,14 +92,6 @@ struct netns_ct {
75 struct ip_conntrack_stat __percpu *stat; 92 struct ip_conntrack_stat __percpu *stat;
76 struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; 93 struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
77 struct nf_exp_event_notifier __rcu *nf_expect_event_cb; 94 struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
78 int sysctl_events;
79 unsigned int sysctl_events_retry_timeout;
80 int sysctl_acct;
81 int sysctl_tstamp;
82 int sysctl_checksum;
83 unsigned int sysctl_log_invalid; /* Log invalid packets */
84 int sysctl_auto_assign_helper;
85 bool auto_assign_helper_warned;
86 struct nf_ip_net nf_ct_proto; 95 struct nf_ip_net nf_ct_proto;
87#if defined(CONFIG_NF_CONNTRACK_LABELS) 96#if defined(CONFIG_NF_CONNTRACK_LABELS)
88 unsigned int labels_used; 97 unsigned int labels_used;
@@ -92,13 +101,5 @@ struct netns_ct {
92 struct hlist_head *nat_bysource; 101 struct hlist_head *nat_bysource;
93 unsigned int nat_htable_size; 102 unsigned int nat_htable_size;
94#endif 103#endif
95#ifdef CONFIG_SYSCTL
96 struct ctl_table_header *sysctl_header;
97 struct ctl_table_header *acct_sysctl_header;
98 struct ctl_table_header *tstamp_sysctl_header;
99 struct ctl_table_header *event_sysctl_header;
100 struct ctl_table_header *helper_sysctl_header;
101#endif
102 char *slabname;
103}; 104};
104#endif 105#endif
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index ee520cba2ec2..80f500a29498 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -69,6 +69,8 @@ struct netns_ipv4 {
69 struct local_ports sysctl_local_ports; 69 struct local_ports sysctl_local_ports;
70 70
71 int sysctl_tcp_ecn; 71 int sysctl_tcp_ecn;
72 int sysctl_ip_no_pmtu_disc;
73 int sysctl_ip_fwd_use_pmtu;
72 74
73 kgid_t sysctl_ping_group_range[2]; 75 kgid_t sysctl_ping_group_range[2];
74 76
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 0fb2401197c5..21edaf1f7916 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -27,7 +27,9 @@ struct netns_sysctl_ipv6 {
27 int ip6_rt_gc_elasticity; 27 int ip6_rt_gc_elasticity;
28 int ip6_rt_mtu_expires; 28 int ip6_rt_mtu_expires;
29 int ip6_rt_min_advmss; 29 int ip6_rt_min_advmss;
30 int flowlabel_consistency;
30 int icmpv6_time; 31 int icmpv6_time;
32 int anycast_src_echo_reply;
31}; 33};
32 34
33struct netns_ipv6 { 35struct netns_ipv6 {
diff --git a/include/net/netns/nftables.h b/include/net/netns/nftables.h
index 15d056d534e3..26a394cb91a8 100644
--- a/include/net/netns/nftables.h
+++ b/include/net/netns/nftables.h
@@ -10,6 +10,7 @@ struct netns_nftables {
10 struct list_head commit_list; 10 struct list_head commit_list;
11 struct nft_af_info *ipv4; 11 struct nft_af_info *ipv4;
12 struct nft_af_info *ipv6; 12 struct nft_af_info *ipv6;
13 struct nft_af_info *inet;
13 struct nft_af_info *arp; 14 struct nft_af_info *arp;
14 struct nft_af_info *bridge; 15 struct nft_af_info *bridge;
15 u8 gencursor; 16 u8 gencursor;
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h
index 5299e69a32af..1006a265beb3 100644
--- a/include/net/netns/xfrm.h
+++ b/include/net/netns/xfrm.h
@@ -33,8 +33,6 @@ struct netns_xfrm {
33 struct hlist_head state_gc_list; 33 struct hlist_head state_gc_list;
34 struct work_struct state_gc_work; 34 struct work_struct state_gc_work;
35 35
36 wait_queue_head_t km_waitq;
37
38 struct list_head policy_all; 36 struct list_head policy_all;
39 struct hlist_head *policy_byidx; 37 struct hlist_head *policy_byidx;
40 unsigned int policy_idx_hmask; 38 unsigned int policy_idx_hmask;
@@ -59,6 +57,10 @@ struct netns_xfrm {
59#if IS_ENABLED(CONFIG_IPV6) 57#if IS_ENABLED(CONFIG_IPV6)
60 struct dst_ops xfrm6_dst_ops; 58 struct dst_ops xfrm6_dst_ops;
61#endif 59#endif
60 spinlock_t xfrm_state_lock;
61 spinlock_t xfrm_policy_sk_bundle_lock;
62 rwlock_t xfrm_policy_lock;
63 struct mutex xfrm_cfg_mutex;
62}; 64};
63 65
64#endif 66#endif
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index 099d02782e22..dafc09f0fdbc 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -13,12 +13,12 @@
13 13
14#ifndef _NETPRIO_CGROUP_H 14#ifndef _NETPRIO_CGROUP_H
15#define _NETPRIO_CGROUP_H 15#define _NETPRIO_CGROUP_H
16
16#include <linux/cgroup.h> 17#include <linux/cgroup.h>
17#include <linux/hardirq.h> 18#include <linux/hardirq.h>
18#include <linux/rcupdate.h> 19#include <linux/rcupdate.h>
19 20
20 21#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
21#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
22struct netprio_map { 22struct netprio_map {
23 struct rcu_head rcu; 23 struct rcu_head rcu;
24 u32 priomap_len; 24 u32 priomap_len;
@@ -27,8 +27,7 @@ struct netprio_map {
27 27
28void 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_CGROUP_NET_PRIO)
31
32static inline u32 task_netprioidx(struct task_struct *p) 31static inline u32 task_netprioidx(struct task_struct *p)
33{ 32{
34 struct cgroup_subsys_state *css; 33 struct cgroup_subsys_state *css;
@@ -40,9 +39,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
40 rcu_read_unlock(); 39 rcu_read_unlock();
41 return idx; 40 return idx;
42} 41}
43 42#elif IS_MODULE(CONFIG_CGROUP_NET_PRIO)
44#elif IS_MODULE(CONFIG_NETPRIO_CGROUP)
45
46static inline u32 task_netprioidx(struct task_struct *p) 43static inline u32 task_netprioidx(struct task_struct *p)
47{ 44{
48 struct cgroup_subsys_state *css; 45 struct cgroup_subsys_state *css;
@@ -56,9 +53,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
56 return idx; 53 return idx;
57} 54}
58#endif 55#endif
59 56#else /* !CONFIG_CGROUP_NET_PRIO */
60#else /* !CONFIG_NETPRIO_CGROUP */
61
62static inline u32 task_netprioidx(struct task_struct *p) 57static inline u32 task_netprioidx(struct task_struct *p)
63{ 58{
64 return 0; 59 return 0;
@@ -66,6 +61,5 @@ static inline u32 task_netprioidx(struct task_struct *p)
66 61
67#define sock_update_netprioidx(sk) 62#define sock_update_netprioidx(sk)
68 63
69#endif /* CONFIG_NETPRIO_CGROUP */ 64#endif /* CONFIG_CGROUP_NET_PRIO */
70
71#endif /* _NET_CLS_CGROUP_H */ 65#endif /* _NET_CLS_CGROUP_H */
diff --git a/include/net/nfc/digital.h b/include/net/nfc/digital.h
index 36acecd5f06c..81af21e9bcd4 100644
--- a/include/net/nfc/digital.h
+++ b/include/net/nfc/digital.h
@@ -122,6 +122,16 @@ typedef void (*nfc_digital_cmd_complete_t)(struct nfc_digital_dev *ddev,
122 * switch_rf to turn the radio on. A call to in|tg_configure_hw must turn 122 * switch_rf to turn the radio on. A call to in|tg_configure_hw must turn
123 * the device radio on. 123 * the device radio on.
124 * @abort_cmd: Discard the last sent command. 124 * @abort_cmd: Discard the last sent command.
125 *
126 * Notes: Asynchronous functions have a timeout parameter. It is the driver
127 * responsibility to call the digital stack back through the
128 * nfc_digital_cmd_complete_t callback when no RF respsonse has been
129 * received within the specified time (in milliseconds). In that case the
130 * driver must set the resp sk_buff to ERR_PTR(-ETIMEDOUT).
131 * Since the digital stack serializes commands to be sent, it's mandatory
132 * for the driver to handle the timeout correctly. Otherwise the stack
133 * would not be able to send new commands, waiting for the reply of the
134 * current one.
125 */ 135 */
126struct nfc_digital_ops { 136struct nfc_digital_ops {
127 int (*in_configure_hw)(struct nfc_digital_dev *ddev, int type, 137 int (*in_configure_hw)(struct nfc_digital_dev *ddev, int type,
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index 2eca2960ca9c..03c4650b548c 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -12,9 +12,7 @@
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the 15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 * Free Software Foundation, Inc.,
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */ 16 */
19 17
20#ifndef __NET_HCI_H 18#ifndef __NET_HCI_H
diff --git a/include/net/nfc/llc.h b/include/net/nfc/llc.h
index 400ab7ae749d..c25fbdee0d61 100644
--- a/include/net/nfc/llc.h
+++ b/include/net/nfc/llc.h
@@ -13,9 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */ 17 */
20 18
21#ifndef __NFC_LLC_H_ 19#ifndef __NFC_LLC_H_
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h
index e5aa5acafea0..fbfa4e471abb 100644
--- a/include/net/nfc/nci.h
+++ b/include/net/nfc/nci.h
@@ -20,8 +20,7 @@
20 * GNU General Public License for more details. 20 * GNU General Public License for more details.
21 * 21 *
22 * You should have received a copy of the GNU General Public License 22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software 23 * along with this program; if not, see <http://www.gnu.org/licenses/>.
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * 24 *
26 */ 25 */
27 26
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index 6126f1f992b4..1f9a0f5272fe 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -21,8 +21,7 @@
21 * GNU General Public License for more details. 21 * GNU General Public License for more details.
22 * 22 *
23 * You should have received a copy of the GNU General Public License 23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software 24 * along with this program; if not, see <http://www.gnu.org/licenses/>.
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * 25 *
27 */ 26 */
28 27
@@ -68,6 +67,7 @@ struct nci_ops {
68 int (*open)(struct nci_dev *ndev); 67 int (*open)(struct nci_dev *ndev);
69 int (*close)(struct nci_dev *ndev); 68 int (*close)(struct nci_dev *ndev);
70 int (*send)(struct nci_dev *ndev, struct sk_buff *skb); 69 int (*send)(struct nci_dev *ndev, struct sk_buff *skb);
70 int (*setup)(struct nci_dev *ndev);
71}; 71};
72 72
73#define NCI_MAX_SUPPORTED_RF_INTERFACES 4 73#define NCI_MAX_SUPPORTED_RF_INTERFACES 4
@@ -154,6 +154,7 @@ void nci_free_device(struct nci_dev *ndev);
154int nci_register_device(struct nci_dev *ndev); 154int nci_register_device(struct nci_dev *ndev);
155void nci_unregister_device(struct nci_dev *ndev); 155void nci_unregister_device(struct nci_dev *ndev);
156int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb); 156int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb);
157int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val);
157 158
158static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, 159static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev,
159 unsigned int len, 160 unsigned int len,
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 82fc4e43fc6e..e80894bca1d0 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -16,9 +16,7 @@
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the 19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */ 20 */
23 21
24#ifndef __NET_NFC_H 22#ifndef __NET_NFC_H
diff --git a/include/net/ping.h b/include/net/ping.h
index 90f48417b03d..026479b61a2d 100644
--- a/include/net/ping.h
+++ b/include/net/ping.h
@@ -33,8 +33,12 @@
33struct pingv6_ops { 33struct pingv6_ops {
34 int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len, 34 int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len,
35 int *addr_len); 35 int *addr_len);
36 int (*ip6_datagram_recv_ctl)(struct sock *sk, struct msghdr *msg, 36 void (*ip6_datagram_recv_common_ctl)(struct sock *sk,
37 struct sk_buff *skb); 37 struct msghdr *msg,
38 struct sk_buff *skb);
39 void (*ip6_datagram_recv_specific_ctl)(struct sock *sk,
40 struct msghdr *msg,
41 struct sk_buff *skb);
38 int (*icmpv6_err_convert)(u8 type, u8 code, int *err); 42 int (*icmpv6_err_convert)(u8 type, u8 code, int *err);
39 void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err, 43 void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err,
40 __be16 port, u32 info, u8 *payload); 44 __be16 port, u32 info, u8 *payload);
@@ -42,11 +46,6 @@ struct pingv6_ops {
42 const struct net_device *dev, int strict); 46 const struct net_device *dev, int strict);
43}; 47};
44 48
45struct ping_table {
46 struct hlist_nulls_head hash[PING_HTABLE_SIZE];
47 rwlock_t lock;
48};
49
50struct ping_iter_state { 49struct ping_iter_state {
51 struct seq_net_private p; 50 struct seq_net_private p;
52 int bucket; 51 int bucket;
@@ -54,7 +53,6 @@ struct ping_iter_state {
54}; 53};
55 54
56extern struct proto ping_prot; 55extern struct proto ping_prot;
57extern struct ping_table ping_table;
58#if IS_ENABLED(CONFIG_IPV6) 56#if IS_ENABLED(CONFIG_IPV6)
59extern struct pingv6_ops pingv6_ops; 57extern struct pingv6_ops pingv6_ops;
60#endif 58#endif
@@ -81,8 +79,6 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
81 size_t len, int noblock, int flags, int *addr_len); 79 size_t len, int noblock, int flags, int *addr_len);
82int ping_common_sendmsg(int family, struct msghdr *msg, size_t len, 80int ping_common_sendmsg(int family, struct msghdr *msg, size_t len,
83 void *user_icmph, size_t icmph_len); 81 void *user_icmph, size_t icmph_len);
84int ping_v4_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
85 size_t len);
86int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 82int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
87 size_t len); 83 size_t len);
88int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); 84int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 2ebef77a2f9a..a2441fb1428f 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -62,18 +62,26 @@ tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r)
62 62
63struct tcf_exts { 63struct tcf_exts {
64#ifdef CONFIG_NET_CLS_ACT 64#ifdef CONFIG_NET_CLS_ACT
65 struct tc_action *action; 65 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */
66 struct list_head actions;
66#endif 67#endif
67}; 68 /* Map to export classifier specific extension TLV types to the
68 69 * generic extensions API. Unsupported extensions must be set to 0.
69/* Map to export classifier specific extension TLV types to the 70 */
70 * generic extensions API. Unsupported extensions must be set to 0.
71 */
72struct tcf_ext_map {
73 int action; 71 int action;
74 int police; 72 int police;
75}; 73};
76 74
75static inline void tcf_exts_init(struct tcf_exts *exts, int action, int police)
76{
77#ifdef CONFIG_NET_CLS_ACT
78 exts->type = 0;
79 INIT_LIST_HEAD(&exts->actions);
80#endif
81 exts->action = action;
82 exts->police = police;
83}
84
77/** 85/**
78 * tcf_exts_is_predicative - check if a predicative extension is present 86 * tcf_exts_is_predicative - check if a predicative extension is present
79 * @exts: tc filter extensions handle 87 * @exts: tc filter extensions handle
@@ -85,7 +93,7 @@ static inline int
85tcf_exts_is_predicative(struct tcf_exts *exts) 93tcf_exts_is_predicative(struct tcf_exts *exts)
86{ 94{
87#ifdef CONFIG_NET_CLS_ACT 95#ifdef CONFIG_NET_CLS_ACT
88 return !!exts->action; 96 return !list_empty(&exts->actions);
89#else 97#else
90 return 0; 98 return 0;
91#endif 99#endif
@@ -120,23 +128,20 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
120 struct tcf_result *res) 128 struct tcf_result *res)
121{ 129{
122#ifdef CONFIG_NET_CLS_ACT 130#ifdef CONFIG_NET_CLS_ACT
123 if (exts->action) 131 if (!list_empty(&exts->actions))
124 return tcf_action_exec(skb, exts->action, res); 132 return tcf_action_exec(skb, &exts->actions, res);
125#endif 133#endif
126 return 0; 134 return 0;
127} 135}
128 136
129int tcf_exts_validate(struct net *net, struct tcf_proto *tp, 137int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
130 struct nlattr **tb, struct nlattr *rate_tlv, 138 struct nlattr **tb, struct nlattr *rate_tlv,
131 struct tcf_exts *exts, 139 struct tcf_exts *exts);
132 const struct tcf_ext_map *map);
133void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); 140void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts);
134void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, 141void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
135 struct tcf_exts *src); 142 struct tcf_exts *src);
136int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts, 143int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts);
137 const struct tcf_ext_map *map); 144int 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);
140 145
141/** 146/**
142 * struct tcf_pkt_info - packet information 147 * struct tcf_pkt_info - packet information
@@ -333,27 +338,27 @@ static inline int tcf_valid_offset(const struct sk_buff *skb,
333#include <net/net_namespace.h> 338#include <net/net_namespace.h>
334 339
335static inline int 340static inline int
336tcf_change_indev(struct tcf_proto *tp, char *indev, struct nlattr *indev_tlv) 341tcf_change_indev(struct net *net, struct nlattr *indev_tlv)
337{ 342{
343 char indev[IFNAMSIZ];
344 struct net_device *dev;
345
338 if (nla_strlcpy(indev, indev_tlv, IFNAMSIZ) >= IFNAMSIZ) 346 if (nla_strlcpy(indev, indev_tlv, IFNAMSIZ) >= IFNAMSIZ)
339 return -EINVAL; 347 return -EINVAL;
340 return 0; 348 dev = __dev_get_by_name(net, indev);
349 if (!dev)
350 return -ENODEV;
351 return dev->ifindex;
341} 352}
342 353
343static inline int 354static inline bool
344tcf_match_indev(struct sk_buff *skb, char *indev) 355tcf_match_indev(struct sk_buff *skb, int ifindex)
345{ 356{
346 struct net_device *dev; 357 if (!ifindex)
347 358 return true;
348 if (indev[0]) { 359 if (!skb->skb_iif)
349 if (!skb->skb_iif) 360 return false;
350 return 0; 361 return ifindex == skb->skb_iif;
351 dev = __dev_get_by_index(dev_net(skb->dev), skb->skb_iif);
352 if (!dev || strcmp(indev, dev->name))
353 return 0;
354 }
355
356 return 1;
357} 362}
358#endif /* CONFIG_NET_CLS_IND */ 363#endif /* CONFIG_NET_CLS_IND */
359 364
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 59ec3cd15d68..891d80d2c4d2 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -88,6 +88,7 @@ int unregister_qdisc(struct Qdisc_ops *qops);
88void qdisc_get_default(char *id, size_t len); 88void qdisc_get_default(char *id, size_t len);
89int qdisc_set_default(const char *id); 89int qdisc_set_default(const char *id);
90 90
91void qdisc_list_add(struct Qdisc *q);
91void qdisc_list_del(struct Qdisc *q); 92void qdisc_list_del(struct Qdisc *q);
92struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); 93struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle);
93struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); 94struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle);
diff --git a/include/net/protocol.h b/include/net/protocol.h
index fbf7676c9a02..a7e986b08147 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -43,7 +43,12 @@ struct net_protocol {
43 int (*handler)(struct sk_buff *skb); 43 int (*handler)(struct sk_buff *skb);
44 void (*err_handler)(struct sk_buff *skb, u32 info); 44 void (*err_handler)(struct sk_buff *skb, u32 info);
45 unsigned int no_policy:1, 45 unsigned int no_policy:1,
46 netns_ok:1; 46 netns_ok:1,
47 /* does the protocol do more stringent
48 * icmp tag validation than simple
49 * socket lookup?
50 */
51 icmp_strict_tag_validation:1;
47}; 52};
48 53
49#if IS_ENABLED(CONFIG_IPV6) 54#if IS_ENABLED(CONFIG_IPV6)
@@ -103,6 +108,9 @@ int inet_del_offload(const struct net_offload *prot, unsigned char num);
103void inet_register_protosw(struct inet_protosw *p); 108void inet_register_protosw(struct inet_protosw *p);
104void inet_unregister_protosw(struct inet_protosw *p); 109void inet_unregister_protosw(struct inet_protosw *p);
105 110
111int udp_add_offload(struct udp_offload *prot);
112void udp_del_offload(struct udp_offload *prot);
113
106#if IS_ENABLED(CONFIG_IPV6) 114#if IS_ENABLED(CONFIG_IPV6)
107int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num); 115int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num);
108int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num); 116int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num);
diff --git a/include/net/red.h b/include/net/red.h
index ef46058d35bf..76e0b5f922c6 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -130,7 +130,8 @@ struct red_parms {
130 u32 qth_max; /* Max avg length threshold: Wlog scaled */ 130 u32 qth_max; /* Max avg length threshold: Wlog scaled */
131 u32 Scell_max; 131 u32 Scell_max;
132 u32 max_P; /* probability, [0 .. 1.0] 32 scaled */ 132 u32 max_P; /* probability, [0 .. 1.0] 32 scaled */
133 u32 max_P_reciprocal; /* reciprocal_value(max_P / qth_delta) */ 133 /* reciprocal_value(max_P / qth_delta) */
134 struct reciprocal_value max_P_reciprocal;
134 u32 qth_delta; /* max_th - min_th */ 135 u32 qth_delta; /* max_th - min_th */
135 u32 target_min; /* min_th + 0.4*(max_th - min_th) */ 136 u32 target_min; /* min_th + 0.4*(max_th - min_th) */
136 u32 target_max; /* min_th + 0.6*(max_th - min_th) */ 137 u32 target_max; /* min_th + 0.6*(max_th - min_th) */
@@ -303,7 +304,7 @@ static inline unsigned long red_calc_qavg(const struct red_parms *p,
303 304
304static inline u32 red_random(const struct red_parms *p) 305static inline u32 red_random(const struct red_parms *p)
305{ 306{
306 return reciprocal_divide(net_random(), p->max_P_reciprocal); 307 return reciprocal_divide(prandom_u32(), p->max_P_reciprocal);
307} 308}
308 309
309static inline int red_mark_probability(const struct red_parms *p, 310static inline int red_mark_probability(const struct red_parms *p,
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index f17ed590d64a..b07cdc9fa454 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -38,17 +38,17 @@ enum environment_cap {
38 * 38 *
39 * @rcu_head: RCU head struct used to free the request 39 * @rcu_head: RCU head struct used to free the request
40 * @wiphy_idx: this is set if this request's initiator is 40 * @wiphy_idx: this is set if this request's initiator is
41 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This 41 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This
42 * can be used by the wireless core to deal with conflicts 42 * can be used by the wireless core to deal with conflicts
43 * and potentially inform users of which devices specifically 43 * and potentially inform users of which devices specifically
44 * cased the conflicts. 44 * cased the conflicts.
45 * @initiator: indicates who sent this request, could be any of 45 * @initiator: indicates who sent this request, could be any of
46 * of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*) 46 * of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*)
47 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested 47 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested
48 * regulatory domain. We have a few special codes: 48 * regulatory domain. We have a few special codes:
49 * 00 - World regulatory domain 49 * 00 - World regulatory domain
50 * 99 - built by driver but a specific alpha2 cannot be determined 50 * 99 - built by driver but a specific alpha2 cannot be determined
51 * 98 - result of an intersection between two regulatory domains 51 * 98 - result of an intersection between two regulatory domains
52 * 97 - regulatory domain has not yet been configured 52 * 97 - regulatory domain has not yet been configured
53 * @dfs_region: If CRDA responded with a regulatory domain that requires 53 * @dfs_region: If CRDA responded with a regulatory domain that requires
54 * DFS master operation on a known DFS region (NL80211_DFS_*), 54 * DFS master operation on a known DFS region (NL80211_DFS_*),
@@ -59,8 +59,8 @@ enum environment_cap {
59 * of hint passed. This could be any of the %NL80211_USER_REG_HINT_* 59 * of hint passed. This could be any of the %NL80211_USER_REG_HINT_*
60 * types. 60 * types.
61 * @intersect: indicates whether the wireless core should intersect 61 * @intersect: indicates whether the wireless core should intersect
62 * the requested regulatory domain with the presently set regulatory 62 * the requested regulatory domain with the presently set regulatory
63 * domain. 63 * domain.
64 * @processed: indicates whether or not this requests has already been 64 * @processed: indicates whether or not this requests has already been
65 * processed. When the last request is processed it means that the 65 * processed. When the last request is processed it means that the
66 * currently regulatory domain set on cfg80211 is updated from 66 * currently regulatory domain set on cfg80211 is updated from
@@ -68,9 +68,9 @@ enum environment_cap {
68 * the last request is not yet processed we must yield until it 68 * the last request is not yet processed we must yield until it
69 * is processed before processing any new requests. 69 * is processed before processing any new requests.
70 * @country_ie_checksum: checksum of the last processed and accepted 70 * @country_ie_checksum: checksum of the last processed and accepted
71 * country IE 71 * country IE
72 * @country_ie_env: lets us know if the AP is telling us we are outdoor, 72 * @country_ie_env: lets us know if the AP is telling us we are outdoor,
73 * indoor, or if it doesn't matter 73 * indoor, or if it doesn't matter
74 * @list: used to insert into the reg_requests_list linked list 74 * @list: used to insert into the reg_requests_list linked list
75 */ 75 */
76struct regulatory_request { 76struct regulatory_request {
@@ -79,13 +79,67 @@ struct regulatory_request {
79 enum nl80211_reg_initiator initiator; 79 enum nl80211_reg_initiator initiator;
80 enum nl80211_user_reg_hint_type user_reg_hint_type; 80 enum nl80211_user_reg_hint_type user_reg_hint_type;
81 char alpha2[2]; 81 char alpha2[2];
82 u8 dfs_region; 82 enum nl80211_dfs_regions dfs_region;
83 bool intersect; 83 bool intersect;
84 bool processed; 84 bool processed;
85 enum environment_cap country_ie_env; 85 enum environment_cap country_ie_env;
86 struct list_head list; 86 struct list_head list;
87}; 87};
88 88
89/**
90 * enum ieee80211_regulatory_flags - device regulatory flags
91 *
92 * @REGULATORY_CUSTOM_REG: tells us the driver for this device
93 * has its own custom regulatory domain and cannot identify the
94 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
95 * we will disregard the first regulatory hint (when the
96 * initiator is %REGDOM_SET_BY_CORE). Drivers that use
97 * wiphy_apply_custom_regulatory() should have this flag set
98 * or the regulatory core will set it for the wiphy.
99 * If you use regulatory_hint() *after* using
100 * wiphy_apply_custom_regulatory() the wireless core will
101 * clear the REGULATORY_CUSTOM_REG for your wiphy as it would be
102 * implied that the device somehow gained knowledge of its region.
103 * @REGULATORY_STRICT_REG: tells us that the wiphy for this device
104 * has regulatory domain that it wishes to be considered as the
105 * superset for regulatory rules. After this device gets its regulatory
106 * domain programmed further regulatory hints shall only be considered
107 * for this device to enhance regulatory compliance, forcing the
108 * device to only possibly use subsets of the original regulatory
109 * rules. For example if channel 13 and 14 are disabled by this
110 * device's regulatory domain no user specified regulatory hint which
111 * has these channels enabled would enable them for this wiphy,
112 * the device's original regulatory domain will be trusted as the
113 * base. You can program the superset of regulatory rules for this
114 * wiphy with regulatory_hint() for cards programmed with an
115 * ISO3166-alpha2 country code. wiphys that use regulatory_hint()
116 * will have their wiphy->regd programmed once the regulatory
117 * domain is set, and all other regulatory hints will be ignored
118 * until their own regulatory domain gets programmed.
119 * @REGULATORY_DISABLE_BEACON_HINTS: enable this if your driver needs to
120 * ensure that passive scan flags and beaconing flags may not be lifted by
121 * cfg80211 due to regulatory beacon hints. For more information on beacon
122 * hints read the documenation for regulatory_hint_found_beacon()
123 * @REGULATORY_COUNTRY_IE_FOLLOW_POWER: for devices that have a preference
124 * that even though they may have programmed their own custom power
125 * setting prior to wiphy registration, they want to ensure their channel
126 * power settings are updated for this connection with the power settings
127 * derived from the regulatory domain. The regulatory domain used will be
128 * based on the ISO3166-alpha2 from country IE provided through
129 * regulatory_hint_country_ie()
130 * @REGULATORY_COUNTRY_IE_IGNORE: for devices that have a preference to ignore
131 * all country IE information processed by the regulatory core. This will
132 * override %REGULATORY_COUNTRY_IE_FOLLOW_POWER as all country IEs will
133 * be ignored.
134 */
135enum ieee80211_regulatory_flags {
136 REGULATORY_CUSTOM_REG = BIT(0),
137 REGULATORY_STRICT_REG = BIT(1),
138 REGULATORY_DISABLE_BEACON_HINTS = BIT(2),
139 REGULATORY_COUNTRY_IE_FOLLOW_POWER = BIT(3),
140 REGULATORY_COUNTRY_IE_IGNORE = BIT(4),
141};
142
89struct ieee80211_freq_range { 143struct ieee80211_freq_range {
90 u32 start_freq_khz; 144 u32 start_freq_khz;
91 u32 end_freq_khz; 145 u32 end_freq_khz;
@@ -107,7 +161,7 @@ struct ieee80211_regdomain {
107 struct rcu_head rcu_head; 161 struct rcu_head rcu_head;
108 u32 n_reg_rules; 162 u32 n_reg_rules;
109 char alpha2[2]; 163 char alpha2[2];
110 u8 dfs_region; 164 enum nl80211_dfs_regions dfs_region;
111 struct ieee80211_reg_rule reg_rules[]; 165 struct ieee80211_reg_rule reg_rules[];
112}; 166};
113 167
diff --git a/include/net/route.h b/include/net/route.h
index f68c167280a7..9d1f423d5944 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -36,6 +36,9 @@
36#include <linux/cache.h> 36#include <linux/cache.h>
37#include <linux/security.h> 37#include <linux/security.h>
38 38
39/* IPv4 datagram length is stored into 16bit field (tot_len) */
40#define IP_MAX_MTU 0xFFFFU
41
39#define RTO_ONLINK 0x01 42#define RTO_ONLINK 0x01
40 43
41#define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) 44#define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE))
@@ -239,14 +242,12 @@ static inline char rt_tos2priority(u8 tos)
239static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 src, 242static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 src,
240 u32 tos, int oif, u8 protocol, 243 u32 tos, int oif, u8 protocol,
241 __be16 sport, __be16 dport, 244 __be16 sport, __be16 dport,
242 struct sock *sk, bool can_sleep) 245 struct sock *sk)
243{ 246{
244 __u8 flow_flags = 0; 247 __u8 flow_flags = 0;
245 248
246 if (inet_sk(sk)->transparent) 249 if (inet_sk(sk)->transparent)
247 flow_flags |= FLOWI_FLAG_ANYSRC; 250 flow_flags |= FLOWI_FLAG_ANYSRC;
248 if (can_sleep)
249 flow_flags |= FLOWI_FLAG_CAN_SLEEP;
250 251
251 flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE, 252 flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE,
252 protocol, flow_flags, dst, src, dport, sport); 253 protocol, flow_flags, dst, src, dport, sport);
@@ -256,13 +257,13 @@ static inline struct rtable *ip_route_connect(struct flowi4 *fl4,
256 __be32 dst, __be32 src, u32 tos, 257 __be32 dst, __be32 src, u32 tos,
257 int oif, u8 protocol, 258 int oif, u8 protocol,
258 __be16 sport, __be16 dport, 259 __be16 sport, __be16 dport,
259 struct sock *sk, bool can_sleep) 260 struct sock *sk)
260{ 261{
261 struct net *net = sock_net(sk); 262 struct net *net = sock_net(sk);
262 struct rtable *rt; 263 struct rtable *rt;
263 264
264 ip_route_connect_init(fl4, dst, src, tos, oif, protocol, 265 ip_route_connect_init(fl4, dst, src, tos, oif, protocol,
265 sport, dport, sk, can_sleep); 266 sport, dport, sk);
266 267
267 if (!dst || !src) { 268 if (!dst || !src) {
268 rt = __ip_route_output_key(net, fl4); 269 rt = __ip_route_output_key(net, fl4);
@@ -313,20 +314,4 @@ static inline int ip4_dst_hoplimit(const struct dst_entry *dst)
313 return hoplimit; 314 return hoplimit;
314} 315}
315 316
316static inline bool ip_sk_accept_pmtu(const struct sock *sk)
317{
318 return inet_sk(sk)->pmtudisc != IP_PMTUDISC_INTERFACE;
319}
320
321static inline bool ip_sk_use_pmtu(const struct sock *sk)
322{
323 return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE;
324}
325
326static inline int ip_skb_dst_mtu(const struct sk_buff *skb)
327{
328 return (!skb->sk || ip_sk_use_pmtu(skb->sk)) ?
329 dst_mtu(skb_dst(skb)) : skb_dst(skb)->dev->mtu;
330}
331
332#endif /* _ROUTE_H */ 317#endif /* _ROUTE_H */
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index bb13a182fba6..661e45d38051 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -79,6 +79,20 @@ struct rtnl_link_ops {
79 const struct net_device *dev); 79 const struct net_device *dev);
80 unsigned int (*get_num_tx_queues)(void); 80 unsigned int (*get_num_tx_queues)(void);
81 unsigned int (*get_num_rx_queues)(void); 81 unsigned int (*get_num_rx_queues)(void);
82
83 int slave_maxtype;
84 const struct nla_policy *slave_policy;
85 int (*slave_validate)(struct nlattr *tb[],
86 struct nlattr *data[]);
87 int (*slave_changelink)(struct net_device *dev,
88 struct net_device *slave_dev,
89 struct nlattr *tb[],
90 struct nlattr *data[]);
91 size_t (*get_slave_size)(const struct net_device *dev,
92 const struct net_device *slave_dev);
93 int (*fill_slave_info)(struct sk_buff *skb,
94 const struct net_device *dev,
95 const struct net_device *slave_dev);
82}; 96};
83 97
84int __rtnl_link_register(struct rtnl_link_ops *ops); 98int __rtnl_link_register(struct rtnl_link_ops *ops);
@@ -115,10 +129,9 @@ struct rtnl_af_ops {
115 const struct nlattr *attr); 129 const struct nlattr *attr);
116}; 130};
117 131
118int __rtnl_af_register(struct rtnl_af_ops *ops);
119void __rtnl_af_unregister(struct rtnl_af_ops *ops); 132void __rtnl_af_unregister(struct rtnl_af_ops *ops);
120 133
121int rtnl_af_register(struct rtnl_af_ops *ops); 134void rtnl_af_register(struct rtnl_af_ops *ops);
122void rtnl_af_unregister(struct rtnl_af_ops *ops); 135void rtnl_af_unregister(struct rtnl_af_ops *ops);
123 136
124struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); 137struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index d0a6321c302e..d062f81c692f 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -185,7 +185,7 @@ struct tcf_result {
185}; 185};
186 186
187struct tcf_proto_ops { 187struct tcf_proto_ops {
188 struct tcf_proto_ops *next; 188 struct list_head head;
189 char kind[IFNAMSIZ]; 189 char kind[IFNAMSIZ];
190 190
191 int (*classify)(struct sk_buff *, 191 int (*classify)(struct sk_buff *,
@@ -204,7 +204,7 @@ struct tcf_proto_ops {
204 void (*walk)(struct tcf_proto*, struct tcf_walker *arg); 204 void (*walk)(struct tcf_proto*, struct tcf_walker *arg);
205 205
206 /* rtnetlink specific */ 206 /* rtnetlink specific */
207 int (*dump)(struct tcf_proto*, unsigned long, 207 int (*dump)(struct net*, struct tcf_proto*, unsigned long,
208 struct sk_buff *skb, struct tcmsg*); 208 struct sk_buff *skb, struct tcmsg*);
209 209
210 struct module *owner; 210 struct module *owner;
diff --git a/include/net/sctp/auth.h b/include/net/sctp/auth.h
index aa80bef3c9d5..f2d58aa37a6f 100644
--- a/include/net/sctp/auth.h
+++ b/include/net/sctp/auth.h
@@ -16,9 +16,8 @@
16 * See the GNU General Public License for more details. 16 * See the GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with GNU CC; see the file COPYING. If not, write to 19 * along with GNU CC; see the file COPYING. If not, see
20 * the Free Software Foundation, 59 Temple Place - Suite 330, 20 * <http://www.gnu.org/licenses/>.
21 * Boston, MA 02111-1307, USA.
22 * 21 *
23 * Please send any bug reports or fixes you make to the 22 * Please send any bug reports or fixes you make to the
24 * email address(es): 23 * email address(es):
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index 6bd44fe94c26..4a5b9a306c69 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -19,9 +19,8 @@
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, see
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * <http://www.gnu.org/licenses/>.
24 * Boston, MA 02111-1307, USA.
25 * 24 *
26 * Please send any bug reports or fixes you make to the 25 * Please send any bug reports or fixes you make to the
27 * email address(es): 26 * email address(es):
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 832f2191489c..4b7cd695e431 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -19,9 +19,8 @@
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, see
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * <http://www.gnu.org/licenses/>.
24 * Boston, MA 02111-1307, USA.
25 * 24 *
26 * Please send any bug reports or fixes you make to the 25 * Please send any bug reports or fixes you make to the
27 * email address(es): 26 * email address(es):
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index 2f0a565a0fd5..307728f622ef 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -19,9 +19,8 @@
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, see
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * <http://www.gnu.org/licenses/>.
24 * Boston, MA 02111-1307, USA.
25 * 24 *
26 * Please send any bug reports or fixes you make to the 25 * Please send any bug reports or fixes you make to the
27 * email address(es): 26 * email address(es):
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index c5fe80697f8d..a3353f45ef94 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -21,9 +21,8 @@
21 * See the GNU General Public License for more details. 21 * See the GNU General Public License for more details.
22 * 22 *
23 * You should have received a copy of the GNU General Public License 23 * You should have received a copy of the GNU General Public License
24 * along with GNU CC; see the file COPYING. If not, write to 24 * along with GNU CC; see the file COPYING. If not, see
25 * the Free Software Foundation, 59 Temple Place - Suite 330, 25 * <http://www.gnu.org/licenses/>.
26 * Boston, MA 02111-1307, USA.
27 * 26 *
28 * Please send any bug reports or fixes you make to the 27 * Please send any bug reports or fixes you make to the
29 * email address(es): 28 * email address(es):
@@ -171,25 +170,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
171 * Section: Macros, externs, and inlines 170 * Section: Macros, externs, and inlines
172 */ 171 */
173 172
174/* spin lock wrappers. */
175#define sctp_spin_lock_irqsave(lock, flags) spin_lock_irqsave(lock, flags)
176#define sctp_spin_unlock_irqrestore(lock, flags) \
177 spin_unlock_irqrestore(lock, flags)
178#define sctp_local_bh_disable() local_bh_disable()
179#define sctp_local_bh_enable() local_bh_enable()
180#define sctp_spin_lock(lock) spin_lock(lock)
181#define sctp_spin_unlock(lock) spin_unlock(lock)
182#define sctp_write_lock(lock) write_lock(lock)
183#define sctp_write_unlock(lock) write_unlock(lock)
184#define sctp_read_lock(lock) read_lock(lock)
185#define sctp_read_unlock(lock) read_unlock(lock)
186
187/* sock lock wrappers. */
188#define sctp_lock_sock(sk) lock_sock(sk)
189#define sctp_release_sock(sk) release_sock(sk)
190#define sctp_bh_lock_sock(sk) bh_lock_sock(sk)
191#define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk)
192
193/* SCTP SNMP MIB stats handlers */ 173/* SCTP SNMP MIB stats handlers */
194#define SCTP_INC_STATS(net, field) SNMP_INC_STATS((net)->sctp.sctp_statistics, field) 174#define SCTP_INC_STATS(net, field) SNMP_INC_STATS((net)->sctp.sctp_statistics, field)
195#define SCTP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->sctp.sctp_statistics, field) 175#define SCTP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->sctp.sctp_statistics, field)
@@ -354,13 +334,13 @@ static inline void sctp_skb_list_tail(struct sk_buff_head *list,
354{ 334{
355 unsigned long flags; 335 unsigned long flags;
356 336
357 sctp_spin_lock_irqsave(&head->lock, flags); 337 spin_lock_irqsave(&head->lock, flags);
358 sctp_spin_lock(&list->lock); 338 spin_lock(&list->lock);
359 339
360 skb_queue_splice_tail_init(list, head); 340 skb_queue_splice_tail_init(list, head);
361 341
362 sctp_spin_unlock(&list->lock); 342 spin_unlock(&list->lock);
363 sctp_spin_unlock_irqrestore(&head->lock, flags); 343 spin_unlock_irqrestore(&head->lock, flags);
364} 344}
365 345
366/** 346/**
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 4ef75af340b6..7f4eeb340a54 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -21,9 +21,8 @@
21 * See the GNU General Public License for more details. 21 * See the GNU General Public License for more details.
22 * 22 *
23 * You should have received a copy of the GNU General Public License 23 * You should have received a copy of the GNU General Public License
24 * along with GNU CC; see the file COPYING. If not, write to 24 * along with GNU CC; see the file COPYING. If not, see
25 * the Free Software Foundation, 59 Temple Place - Suite 330, 25 * <http://www.gnu.org/licenses/>.
26 * Boston, MA 02111-1307, USA.
27 * 26 *
28 * Please send any bug reports or fixes you make to the 27 * Please send any bug reports or fixes you make to the
29 * email addresses: 28 * email addresses:
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 0a248b323d87..d992ca3145fe 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -19,9 +19,8 @@
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, see
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * <http://www.gnu.org/licenses/>.
24 * Boston, MA 02111-1307, USA.
25 * 24 *
26 * Please send any bug reports or fixes you make to the 25 * Please send any bug reports or fixes you make to the
27 * email addresses: 26 * email addresses:
@@ -650,7 +649,6 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
650 struct iovec *data); 649 struct iovec *data);
651void sctp_chunk_free(struct sctp_chunk *); 650void sctp_chunk_free(struct sctp_chunk *);
652void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); 651void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data);
653void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data);
654struct sctp_chunk *sctp_chunkify(struct sk_buff *, 652struct sctp_chunk *sctp_chunkify(struct sk_buff *,
655 const struct sctp_association *, 653 const struct sctp_association *,
656 struct sock *); 654 struct sock *);
@@ -1358,12 +1356,6 @@ struct sctp_association {
1358 1356
1359 /* This is all information about our peer. */ 1357 /* This is all information about our peer. */
1360 struct { 1358 struct {
1361 /* rwnd
1362 *
1363 * Peer Rwnd : Current calculated value of the peer's rwnd.
1364 */
1365 __u32 rwnd;
1366
1367 /* transport_addr_list 1359 /* transport_addr_list
1368 * 1360 *
1369 * Peer : A list of SCTP transport addresses that the 1361 * Peer : A list of SCTP transport addresses that the
@@ -1381,6 +1373,12 @@ struct sctp_association {
1381 */ 1373 */
1382 struct list_head transport_addr_list; 1374 struct list_head transport_addr_list;
1383 1375
1376 /* rwnd
1377 *
1378 * Peer Rwnd : Current calculated value of the peer's rwnd.
1379 */
1380 __u32 rwnd;
1381
1384 /* transport_count 1382 /* transport_count
1385 * 1383 *
1386 * Peer : A count of the number of peer addresses 1384 * Peer : A count of the number of peer addresses
@@ -1463,6 +1461,20 @@ struct sctp_association {
1463 */ 1461 */
1464 struct sctp_tsnmap tsn_map; 1462 struct sctp_tsnmap tsn_map;
1465 1463
1464 /* This mask is used to disable sending the ASCONF chunk
1465 * with specified parameter to peer.
1466 */
1467 __be16 addip_disabled_mask;
1468
1469 /* These are capabilities which our peer advertised. */
1470 __u8 ecn_capable:1, /* Can peer do ECN? */
1471 ipv4_address:1, /* Peer understands IPv4 addresses? */
1472 ipv6_address:1, /* Peer understands IPv6 addresses? */
1473 hostname_address:1, /* Peer understands DNS addresses? */
1474 asconf_capable:1, /* Does peer support ADDIP? */
1475 prsctp_capable:1, /* Can peer do PR-SCTP? */
1476 auth_capable:1; /* Is peer doing SCTP-AUTH? */
1477
1466 /* Ack State : This flag indicates if the next received 1478 /* Ack State : This flag indicates if the next received
1467 * : packet is to be responded to with a 1479 * : packet is to be responded to with a
1468 * : SACK. This is initializedto 0. When a packet 1480 * : SACK. This is initializedto 0. When a packet
@@ -1477,25 +1489,11 @@ struct sctp_association {
1477 __u32 sack_cnt; 1489 __u32 sack_cnt;
1478 __u32 sack_generation; 1490 __u32 sack_generation;
1479 1491
1480 /* These are capabilities which our peer advertised. */
1481 __u8 ecn_capable:1, /* Can peer do ECN? */
1482 ipv4_address:1, /* Peer understands IPv4 addresses? */
1483 ipv6_address:1, /* Peer understands IPv6 addresses? */
1484 hostname_address:1, /* Peer understands DNS addresses? */
1485 asconf_capable:1, /* Does peer support ADDIP? */
1486 prsctp_capable:1, /* Can peer do PR-SCTP? */
1487 auth_capable:1; /* Is peer doing SCTP-AUTH? */
1488
1489 __u32 adaptation_ind; /* Adaptation Code point. */ 1492 __u32 adaptation_ind; /* Adaptation Code point. */
1490 1493
1491 /* This mask is used to disable sending the ASCONF chunk
1492 * with specified parameter to peer.
1493 */
1494 __be16 addip_disabled_mask;
1495
1496 struct sctp_inithdr_host i; 1494 struct sctp_inithdr_host i;
1497 int cookie_len;
1498 void *cookie; 1495 void *cookie;
1496 int cookie_len;
1499 1497
1500 /* ADDIP Section 4.2 Upon reception of an ASCONF Chunk. 1498 /* ADDIP Section 4.2 Upon reception of an ASCONF Chunk.
1501 * C1) ... "Peer-Serial-Number'. This value MUST be initialized to the 1499 * C1) ... "Peer-Serial-Number'. This value MUST be initialized to the
@@ -1527,14 +1525,14 @@ struct sctp_association {
1527 */ 1525 */
1528 sctp_state_t state; 1526 sctp_state_t state;
1529 1527
1530 /* The cookie life I award for any cookie. */
1531 ktime_t cookie_life;
1532
1533 /* Overall : The overall association error count. 1528 /* Overall : The overall association error count.
1534 * Error Count : [Clear this any time I get something.] 1529 * Error Count : [Clear this any time I get something.]
1535 */ 1530 */
1536 int overall_error_count; 1531 int overall_error_count;
1537 1532
1533 /* The cookie life I award for any cookie. */
1534 ktime_t cookie_life;
1535
1538 /* These are the association's initial, max, and min RTO values. 1536 /* These are the association's initial, max, and min RTO values.
1539 * These values will be initialized by system defaults, but can 1537 * These values will be initialized by system defaults, but can
1540 * be modified via the SCTP_RTOINFO socket option. 1538 * be modified via the SCTP_RTOINFO socket option.
@@ -1589,10 +1587,9 @@ struct sctp_association {
1589 /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ 1587 /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */
1590 __u32 param_flags; 1588 __u32 param_flags;
1591 1589
1590 __u32 sackfreq;
1592 /* SACK delay timeout */ 1591 /* SACK delay timeout */
1593 unsigned long sackdelay; 1592 unsigned long sackdelay;
1594 __u32 sackfreq;
1595
1596 1593
1597 unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES]; 1594 unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES];
1598 struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES]; 1595 struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES];
@@ -1600,12 +1597,12 @@ struct sctp_association {
1600 /* Transport to which SHUTDOWN chunk was last sent. */ 1597 /* Transport to which SHUTDOWN chunk was last sent. */
1601 struct sctp_transport *shutdown_last_sent_to; 1598 struct sctp_transport *shutdown_last_sent_to;
1602 1599
1603 /* How many times have we resent a SHUTDOWN */
1604 int shutdown_retries;
1605
1606 /* Transport to which INIT chunk was last sent. */ 1600 /* Transport to which INIT chunk was last sent. */
1607 struct sctp_transport *init_last_sent_to; 1601 struct sctp_transport *init_last_sent_to;
1608 1602
1603 /* How many times have we resent a SHUTDOWN */
1604 int shutdown_retries;
1605
1609 /* Next TSN : The next TSN number to be assigned to a new 1606 /* Next TSN : The next TSN number to be assigned to a new
1610 * : DATA chunk. This is sent in the INIT or INIT 1607 * : DATA chunk. This is sent in the INIT or INIT
1611 * : ACK chunk to the peer and incremented each 1608 * : ACK chunk to the peer and incremented each
@@ -1810,8 +1807,8 @@ struct sctp_association {
1810 * after reaching 4294967295. 1807 * after reaching 4294967295.
1811 */ 1808 */
1812 __u32 addip_serial; 1809 __u32 addip_serial;
1813 union sctp_addr *asconf_addr_del_pending;
1814 int src_out_of_asoc_ok; 1810 int src_out_of_asoc_ok;
1811 union sctp_addr *asconf_addr_del_pending;
1815 struct sctp_transport *new_transport; 1812 struct sctp_transport *new_transport;
1816 1813
1817 /* SCTP AUTH: list of the endpoint shared keys. These 1814 /* SCTP AUTH: list of the endpoint shared keys. These
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h
index 54bbbe547303..31b8dbaad45a 100644
--- a/include/net/sctp/tsnmap.h
+++ b/include/net/sctp/tsnmap.h
@@ -22,9 +22,8 @@
22 * See the GNU General Public License for more details. 22 * See the GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with GNU CC; see the file COPYING. If not, write to 25 * along with GNU CC; see the file COPYING. If not, see
26 * the Free Software Foundation, 59 Temple Place - Suite 330, 26 * <http://www.gnu.org/licenses/>.
27 * Boston, MA 02111-1307, USA.
28 * 27 *
29 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
30 * email address(es): 29 * email address(es):
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index 27b9f5c90153..daacb32b55b5 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -25,9 +25,8 @@
25 * See the GNU General Public License for more details. 25 * See the GNU General Public License for more details.
26 * 26 *
27 * You should have received a copy of the GNU General Public License 27 * You should have received a copy of the GNU General Public License
28 * along with GNU CC; see the file COPYING. If not, write to 28 * along with GNU CC; see the file COPYING. If not, see
29 * the Free Software Foundation, 59 Temple Place - Suite 330, 29 * <http://www.gnu.org/licenses/>.
30 * Boston, MA 02111-1307, USA.
31 * 30 *
32 * Please send any bug reports or fixes you make to the 31 * Please send any bug reports or fixes you make to the
33 * email address(es): 32 * email address(es):
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index b0cf5d54d717..e0dce07b8794 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -24,9 +24,8 @@
24 * See the GNU General Public License for more details. 24 * See the GNU General Public License for more details.
25 * 25 *
26 * You should have received a copy of the GNU General Public License 26 * You should have received a copy of the GNU General Public License
27 * along with GNU CC; see the file COPYING. If not, write to 27 * along with GNU CC; see the file COPYING. If not, see
28 * the Free Software Foundation, 59 Temple Place - Suite 330, 28 * <http://www.gnu.org/licenses/>.
29 * Boston, MA 02111-1307, USA.
30 * 29 *
31 * Please send any bug reports or fixes you make to the 30 * Please send any bug reports or fixes you make to the
32 * email addresses: 31 * email addresses:
diff --git a/include/net/sock.h b/include/net/sock.h
index 2ef3c3eca47a..5c3f7c3624aa 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -395,7 +395,7 @@ struct sock {
395 unsigned short sk_ack_backlog; 395 unsigned short sk_ack_backlog;
396 unsigned short sk_max_ack_backlog; 396 unsigned short sk_max_ack_backlog;
397 __u32 sk_priority; 397 __u32 sk_priority;
398#if IS_ENABLED(CONFIG_NETPRIO_CGROUP) 398#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
399 __u32 sk_cgrp_prioidx; 399 __u32 sk_cgrp_prioidx;
400#endif 400#endif
401 struct pid *sk_peer_pid; 401 struct pid *sk_peer_pid;
@@ -820,30 +820,44 @@ static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
820 return sk->sk_backlog_rcv(sk, skb); 820 return sk->sk_backlog_rcv(sk, skb);
821} 821}
822 822
823static inline void sock_rps_record_flow(const struct sock *sk) 823static inline void sock_rps_record_flow_hash(__u32 hash)
824{ 824{
825#ifdef CONFIG_RPS 825#ifdef CONFIG_RPS
826 struct rps_sock_flow_table *sock_flow_table; 826 struct rps_sock_flow_table *sock_flow_table;
827 827
828 rcu_read_lock(); 828 rcu_read_lock();
829 sock_flow_table = rcu_dereference(rps_sock_flow_table); 829 sock_flow_table = rcu_dereference(rps_sock_flow_table);
830 rps_record_sock_flow(sock_flow_table, sk->sk_rxhash); 830 rps_record_sock_flow(sock_flow_table, hash);
831 rcu_read_unlock(); 831 rcu_read_unlock();
832#endif 832#endif
833} 833}
834 834
835static inline void sock_rps_reset_flow(const struct sock *sk) 835static inline void sock_rps_reset_flow_hash(__u32 hash)
836{ 836{
837#ifdef CONFIG_RPS 837#ifdef CONFIG_RPS
838 struct rps_sock_flow_table *sock_flow_table; 838 struct rps_sock_flow_table *sock_flow_table;
839 839
840 rcu_read_lock(); 840 rcu_read_lock();
841 sock_flow_table = rcu_dereference(rps_sock_flow_table); 841 sock_flow_table = rcu_dereference(rps_sock_flow_table);
842 rps_reset_sock_flow(sock_flow_table, sk->sk_rxhash); 842 rps_reset_sock_flow(sock_flow_table, hash);
843 rcu_read_unlock(); 843 rcu_read_unlock();
844#endif 844#endif
845} 845}
846 846
847static inline void sock_rps_record_flow(const struct sock *sk)
848{
849#ifdef CONFIG_RPS
850 sock_rps_record_flow_hash(sk->sk_rxhash);
851#endif
852}
853
854static inline void sock_rps_reset_flow(const struct sock *sk)
855{
856#ifdef CONFIG_RPS
857 sock_rps_reset_flow_hash(sk->sk_rxhash);
858#endif
859}
860
847static inline void sock_rps_save_rxhash(struct sock *sk, 861static inline void sock_rps_save_rxhash(struct sock *sk,
848 const struct sk_buff *skb) 862 const struct sk_buff *skb)
849{ 863{
@@ -1535,8 +1549,6 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority);
1535 1549
1536struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force, 1550struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force,
1537 gfp_t priority); 1551 gfp_t priority);
1538struct sk_buff *sock_rmalloc(struct sock *sk, unsigned long size, int force,
1539 gfp_t priority);
1540void sock_wfree(struct sk_buff *skb); 1552void sock_wfree(struct sk_buff *skb);
1541void skb_orphan_partial(struct sk_buff *skb); 1553void skb_orphan_partial(struct sk_buff *skb);
1542void sock_rfree(struct sk_buff *skb); 1554void sock_rfree(struct sk_buff *skb);
diff --git a/include/net/tc_act/tc_skbedit.h b/include/net/tc_act/tc_skbedit.h
index e103fe02f375..dd5d86fab030 100644
--- a/include/net/tc_act/tc_skbedit.h
+++ b/include/net/tc_act/tc_skbedit.h
@@ -11,8 +11,7 @@
11 * more details. 11 * more details.
12 * 12 *
13 * You should have received a copy of the GNU General Public License along with 13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 14 * this program; if not, see <http://www.gnu.org/licenses/>.
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 15 *
17 * Author: Alexander Duyck <alexander.h.duyck@intel.com> 16 * Author: Alexander Duyck <alexander.h.duyck@intel.com>
18 */ 17 */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 70e55d200610..56fc366da6d5 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -282,6 +282,7 @@ extern int sysctl_tcp_limit_output_bytes;
282extern int sysctl_tcp_challenge_ack_limit; 282extern int sysctl_tcp_challenge_ack_limit;
283extern unsigned int sysctl_tcp_notsent_lowat; 283extern unsigned int sysctl_tcp_notsent_lowat;
284extern int sysctl_tcp_min_tso_segs; 284extern int sysctl_tcp_min_tso_segs;
285extern int sysctl_tcp_autocorking;
285 286
286extern atomic_long_t tcp_memory_allocated; 287extern atomic_long_t tcp_memory_allocated;
287extern struct percpu_counter tcp_sockets_allocated; 288extern struct percpu_counter tcp_sockets_allocated;
@@ -467,7 +468,6 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
467 struct tcp_fastopen_cookie *foc); 468 struct tcp_fastopen_cookie *foc);
468int tcp_disconnect(struct sock *sk, int flags); 469int tcp_disconnect(struct sock *sk, int flags);
469 470
470void tcp_connect_init(struct sock *sk);
471void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); 471void tcp_finish_connect(struct sock *sk, struct sk_buff *skb);
472int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size); 472int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size);
473void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb); 473void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb);
@@ -622,8 +622,6 @@ static inline u32 __tcp_set_rto(const struct tcp_sock *tp)
622 return (tp->srtt >> 3) + tp->rttvar; 622 return (tp->srtt >> 3) + tp->rttvar;
623} 623}
624 624
625void tcp_set_rto(struct sock *sk);
626
627static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) 625static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd)
628{ 626{
629 tp->pred_flags = htonl((tp->tcp_header_len << 26) | 627 tp->pred_flags = htonl((tp->tcp_header_len << 26) |
@@ -977,13 +975,6 @@ static inline u32 tcp_wnd_end(const struct tcp_sock *tp)
977} 975}
978bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight); 976bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight);
979 977
980static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss,
981 const struct sk_buff *skb)
982{
983 if (skb->len < mss)
984 tp->snd_sml = TCP_SKB_CB(skb)->end_seq;
985}
986
987static inline void tcp_check_probe_timer(struct sock *sk) 978static inline void tcp_check_probe_timer(struct sock *sk)
988{ 979{
989 const struct tcp_sock *tp = tcp_sk(sk); 980 const struct tcp_sock *tp = tcp_sk(sk);
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 48660e50ae90..b927413dde86 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -32,8 +32,13 @@ void tcpv6_exit(void);
32 32
33int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); 33int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
34 34
35int ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg, 35/* this does all the common and the specific ctl work */
36 struct sk_buff *skb); 36void ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
37 struct sk_buff *skb);
38void ip6_datagram_recv_common_ctl(struct sock *sk, struct msghdr *msg,
39 struct sk_buff *skb);
40void ip6_datagram_recv_specific_ctl(struct sock *sk, struct msghdr *msg,
41 struct sk_buff *skb);
37 42
38int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg, 43int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg,
39 struct flowi6 *fl6, struct ipv6_txoptions *opt, 44 struct flowi6 *fl6, struct ipv6_txoptions *opt,
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 6b6d180fb91a..5deef1ae78c9 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -21,6 +21,7 @@ struct vxlan_sock {
21 struct rcu_head rcu; 21 struct rcu_head rcu;
22 struct hlist_head vni_list[VNI_HASH_SIZE]; 22 struct hlist_head vni_list[VNI_HASH_SIZE];
23 atomic_t refcnt; 23 atomic_t refcnt;
24 struct udp_offload udp_offloads;
24}; 25};
25 26
26struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, 27struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 6b82fdf4ba71..afa5730fb3bd 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -53,7 +53,6 @@
53#define XFRM_INC_STATS_USER(net, field) ((void)(net)) 53#define XFRM_INC_STATS_USER(net, field) ((void)(net))
54#endif 54#endif
55 55
56extern struct mutex xfrm_cfg_mutex;
57 56
58/* Organization of SPD aka "XFRM rules" 57/* Organization of SPD aka "XFRM rules"
59 ------------------------------------ 58 ------------------------------------
@@ -681,7 +680,7 @@ struct xfrm_spi_skb_cb {
681struct xfrm_audit { 680struct xfrm_audit {
682 u32 secid; 681 u32 secid;
683 kuid_t loginuid; 682 kuid_t loginuid;
684 u32 sessionid; 683 unsigned int sessionid;
685}; 684};
686 685
687#ifdef CONFIG_AUDITSYSCALL 686#ifdef CONFIG_AUDITSYSCALL
@@ -699,7 +698,7 @@ static inline struct audit_buffer *xfrm_audit_start(const char *op)
699 return audit_buf; 698 return audit_buf;
700} 699}
701 700
702static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid, 701static inline void xfrm_audit_helper_usrinfo(kuid_t auid, unsigned int ses, u32 secid,
703 struct audit_buffer *audit_buf) 702 struct audit_buffer *audit_buf)
704{ 703{
705 char *secctx; 704 char *secctx;
@@ -716,13 +715,13 @@ static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid,
716} 715}
717 716
718void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid, 717void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid,
719 u32 ses, u32 secid); 718 unsigned int ses, u32 secid);
720void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid, 719void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid,
721 u32 ses, u32 secid); 720 unsigned int ses, u32 secid);
722void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid, 721void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid,
723 u32 ses, u32 secid); 722 unsigned int ses, u32 secid);
724void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid, 723void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid,
725 u32 ses, u32 secid); 724 unsigned int ses, u32 secid);
726void xfrm_audit_state_replay_overflow(struct xfrm_state *x, 725void xfrm_audit_state_replay_overflow(struct xfrm_state *x,
727 struct sk_buff *skb); 726 struct sk_buff *skb);
728void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb, 727void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb,
@@ -735,22 +734,22 @@ void xfrm_audit_state_icvfail(struct xfrm_state *x, struct sk_buff *skb,
735#else 734#else
736 735
737static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, 736static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result,
738 kuid_t auid, u32 ses, u32 secid) 737 kuid_t auid, unsigned int ses, u32 secid)
739{ 738{
740} 739}
741 740
742static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, 741static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result,
743 kuid_t auid, u32 ses, u32 secid) 742 kuid_t auid, unsigned int ses, u32 secid)
744{ 743{
745} 744}
746 745
747static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, 746static inline void xfrm_audit_state_add(struct xfrm_state *x, int result,
748 kuid_t auid, u32 ses, u32 secid) 747 kuid_t auid, unsigned int ses, u32 secid)
749{ 748{
750} 749}
751 750
752static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, 751static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result,
753 kuid_t auid, u32 ses, u32 secid) 752 kuid_t auid, unsigned int ses, u32 secid)
754{ 753{
755} 754}
756 755
@@ -1409,7 +1408,7 @@ static inline void xfrm_sysctl_fini(struct net *net)
1409void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); 1408void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto);
1410int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, 1409int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk,
1411 int (*func)(struct xfrm_state *, int, void*), void *); 1410 int (*func)(struct xfrm_state *, int, void*), void *);
1412void xfrm_state_walk_done(struct xfrm_state_walk *walk); 1411void xfrm_state_walk_done(struct xfrm_state_walk *walk, struct net *net);
1413struct xfrm_state *xfrm_state_alloc(struct net *net); 1412struct xfrm_state *xfrm_state_alloc(struct net *net);
1414struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr, 1413struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr,
1415 const xfrm_address_t *saddr, 1414 const xfrm_address_t *saddr,
@@ -1422,6 +1421,8 @@ struct xfrm_state *xfrm_stateonly_find(struct net *net, u32 mark,
1422 xfrm_address_t *saddr, 1421 xfrm_address_t *saddr,
1423 unsigned short family, 1422 unsigned short family,
1424 u8 mode, u8 proto, u32 reqid); 1423 u8 mode, u8 proto, u32 reqid);
1424struct xfrm_state *xfrm_state_lookup_byspi(struct net *net, __be32 spi,
1425 unsigned short family);
1425int xfrm_state_check_expire(struct xfrm_state *x); 1426int xfrm_state_check_expire(struct xfrm_state *x);
1426void xfrm_state_insert(struct xfrm_state *x); 1427void xfrm_state_insert(struct xfrm_state *x);
1427int xfrm_state_add(struct xfrm_state *x); 1428int xfrm_state_add(struct xfrm_state *x);
@@ -1436,12 +1437,12 @@ struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark,
1436 unsigned short family); 1437 unsigned short family);
1437#ifdef CONFIG_XFRM_SUB_POLICY 1438#ifdef CONFIG_XFRM_SUB_POLICY
1438int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n, 1439int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n,
1439 unsigned short family); 1440 unsigned short family, struct net *net);
1440int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n, 1441int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n,
1441 unsigned short family); 1442 unsigned short family);
1442#else 1443#else
1443static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, 1444static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src,
1444 int n, unsigned short family) 1445 int n, unsigned short family, struct net *net)
1445{ 1446{
1446 return -ENOSYS; 1447 return -ENOSYS;
1447} 1448}
@@ -1553,7 +1554,7 @@ void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type);
1553int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, 1554int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk,
1554 int (*func)(struct xfrm_policy *, int, int, void*), 1555 int (*func)(struct xfrm_policy *, int, int, void*),
1555 void *); 1556 void *);
1556void xfrm_policy_walk_done(struct xfrm_policy_walk *walk); 1557void xfrm_policy_walk_done(struct xfrm_policy_walk *walk, struct net *net);
1557int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); 1558int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
1558struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, 1559struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark,
1559 u8 type, int dir, 1560 u8 type, int dir,
@@ -1564,6 +1565,7 @@ struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir,
1564 u32 id, int delete, int *err); 1565 u32 id, int delete, int *err);
1565int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); 1566int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info);
1566u32 xfrm_get_acqseq(void); 1567u32 xfrm_get_acqseq(void);
1568int verify_spi_info(u8 proto, u32 min, u32 max);
1567int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 1569int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
1568struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark, 1570struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark,
1569 u8 mode, u32 reqid, u8 proto, 1571 u8 mode, u32 reqid, u8 proto,
@@ -1576,12 +1578,12 @@ int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
1576int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, 1578int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
1577 const struct xfrm_migrate *m, int num_bundles, 1579 const struct xfrm_migrate *m, int num_bundles,
1578 const struct xfrm_kmaddress *k); 1580 const struct xfrm_kmaddress *k);
1579struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m); 1581struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *net);
1580struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x, 1582struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x,
1581 struct xfrm_migrate *m); 1583 struct xfrm_migrate *m);
1582int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, 1584int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
1583 struct xfrm_migrate *m, int num_bundles, 1585 struct xfrm_migrate *m, int num_bundles,
1584 struct xfrm_kmaddress *k); 1586 struct xfrm_kmaddress *k, struct net *net);
1585#endif 1587#endif
1586 1588
1587int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); 1589int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);