aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 23:01:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 23:01:30 -0500
commitc5ce28df0e7c01a1de23c36ebdefcd803f2b6cbb (patch)
tree9830baf38832769e1cf621708889111bbe3c93df /include
parent29afc4e9a408f2304e09c6dd0dbcfbd2356d0faa (diff)
parent9399f0c51489ae8c16d6559b82a452fdc1895e91 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: 1) More iov_iter conversion work from Al Viro. [ The "crypto: switch af_alg_make_sg() to iov_iter" commit was wrong, and this pull actually adds an extra commit on top of the branch I'm pulling to fix that up, so that the pre-merge state is ok. - Linus ] 2) Various optimizations to the ipv4 forwarding information base trie lookup implementation. From Alexander Duyck. 3) Remove sock_iocb altogether, from CHristoph Hellwig. 4) Allow congestion control algorithm selection via routing metrics. From Daniel Borkmann. 5) Make ipv4 uncached route list per-cpu, from Eric Dumazet. 6) Handle rfs hash collisions more gracefully, also from Eric Dumazet. 7) Add xmit_more support to r8169, e1000, and e1000e drivers. From Florian Westphal. 8) Transparent Ethernet Bridging support for GRO, from Jesse Gross. 9) Add BPF packet actions to packet scheduler, from Jiri Pirko. 10) Add support for uniqu flow IDs to openvswitch, from Joe Stringer. 11) New NetCP ethernet driver, from Muralidharan Karicheri and Wingman Kwok. 12) More sanely handle out-of-window dupacks, which can result in serious ACK storms. From Neal Cardwell. 13) Various rhashtable bug fixes and enhancements, from Herbert Xu, Patrick McHardy, and Thomas Graf. 14) Support xmit_more in be2net, from Sathya Perla. 15) Group Policy extensions for vxlan, from Thomas Graf. 16) Remove Checksum Offload support for vxlan, from Tom Herbert. 17) Like ipv4, support lockless transmit over ipv6 UDP sockets. From Vlad Yasevich. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1494+1 commits) crypto: fix af_alg_make_sg() conversion to iov_iter ipv4: Namespecify TCP PMTU mechanism i40e: Fix for stats init function call in Rx setup tcp: don't include Fast Open option in SYN-ACK on pure SYN-data openvswitch: Only set TUNNEL_VXLAN_OPT if VXLAN-GBP metadata is set ipv6: Make __ipv6_select_ident static ipv6: Fix fragment id assignment on LE arches. bridge: Fix inability to add non-vlan fdb entry net: Mellanox: Delete unnecessary checks before the function call "vunmap" cxgb4: Add support in cxgb4 to get expansion rom version via ethtool ethtool: rename reserved1 memeber in ethtool_drvinfo for expansion ROM version net: dsa: Remove redundant phy_attach() IB/mlx4: Reset flow support for IB kernel ULPs IB/mlx4: Always use the correct port for mirrored multicast attachments net/bonding: Fix potential bad memory access during bonding events tipc: remove tipc_snprintf tipc: nl compat add noop and remove legacy nl framework tipc: convert legacy nl stats show to nl compat tipc: convert legacy nl net id get to nl compat tipc: convert legacy nl net id set to nl compat ...
Diffstat (limited to 'include')
-rw-r--r--include/clocksource/arm_arch_timer.h2
-rw-r--r--include/crypto/if_alg.h3
-rw-r--r--include/dt-bindings/clock/rk3288-cru.h3
-rw-r--r--include/linux/bcma/bcma.h1
-rw-r--r--include/linux/bcma/bcma_driver_pci.h2
-rw-r--r--include/linux/bcma/bcma_regs.h2
-rw-r--r--include/linux/bcma/bcma_soc.h2
-rw-r--r--include/linux/clocksource.h102
-rw-r--r--include/linux/etherdevice.h4
-rw-r--r--include/linux/fec.h1
-rw-r--r--include/linux/ieee80211.h27
-rw-r--r--include/linux/if_bridge.h18
-rw-r--r--include/linux/if_vlan.h14
-rw-r--r--include/linux/ipv6.h13
-rw-r--r--include/linux/list_nulls.h6
-rw-r--r--include/linux/mlx4/cmd.h16
-rw-r--r--include/linux/mlx4/device.h61
-rw-r--r--include/linux/mlx4/driver.h19
-rw-r--r--include/linux/mlx4/qp.h1
-rw-r--r--include/linux/mmc/sdio_ids.h6
-rw-r--r--include/linux/netdev_features.h6
-rw-r--r--include/linux/netdevice.h88
-rw-r--r--include/linux/phy.h12
-rw-r--r--include/linux/platform_data/irda-sa11x0.h20
-rw-r--r--include/linux/platform_data/st21nfca.h2
-rw-r--r--include/linux/platform_data/st21nfcb.h4
-rw-r--r--include/linux/rhashtable.h308
-rw-r--r--include/linux/skbuff.h44
-rw-r--r--include/linux/socket.h7
-rw-r--r--include/linux/spinlock.h8
-rw-r--r--include/linux/spinlock_api_smp.h2
-rw-r--r--include/linux/spinlock_api_up.h1
-rw-r--r--include/linux/ssb/ssb_regs.h1
-rw-r--r--include/linux/tcp.h6
-rw-r--r--include/linux/timecounter.h139
-rw-r--r--include/linux/types.h3
-rw-r--r--include/linux/udp.h16
-rw-r--r--include/linux/uio.h6
-rw-r--r--include/linux/vmw_vmci_api.h2
-rw-r--r--include/net/addrconf.h3
-rw-r--r--include/net/bluetooth/bluetooth.h2
-rw-r--r--include/net/bluetooth/hci.h83
-rw-r--r--include/net/bluetooth/hci_core.h52
-rw-r--r--include/net/bluetooth/l2cap.h1
-rw-r--r--include/net/bluetooth/mgmt.h4
-rw-r--r--include/net/bluetooth/rfcomm.h2
-rw-r--r--include/net/bond_3ad.h1
-rw-r--r--include/net/bonding.h18
-rw-r--r--include/net/cfg80211.h293
-rw-r--r--include/net/cfg802154.h10
-rw-r--r--include/net/genetlink.h21
-rw-r--r--include/net/geneve.h7
-rw-r--r--include/net/gro_cells.h29
-rw-r--r--include/net/ieee802154_netdev.h4
-rw-r--r--include/net/inet_connection_sock.h3
-rw-r--r--include/net/inet_sock.h29
-rw-r--r--include/net/ip.h7
-rw-r--r--include/net/ip6_fib.h10
-rw-r--r--include/net/ip6_tunnel.h1
-rw-r--r--include/net/ip_fib.h50
-rw-r--r--include/net/ip_tunnels.h6
-rw-r--r--include/net/ipv6.h21
-rw-r--r--include/net/mac80211.h100
-rw-r--r--include/net/mac802154.h5
-rw-r--r--include/net/net_namespace.h4
-rw-r--r--include/net/netfilter/nf_conntrack.h2
-rw-r--r--include/net/netlink.h10
-rw-r--r--include/net/netns/ipv4.h5
-rw-r--r--include/net/nfc/hci.h25
-rw-r--r--include/net/nfc/nci.h97
-rw-r--r--include/net/nfc/nci_core.h137
-rw-r--r--include/net/nfc/nfc.h27
-rw-r--r--include/net/nl802154.h45
-rw-r--r--include/net/ping.h2
-rw-r--r--include/net/pkt_sched.h12
-rw-r--r--include/net/regulatory.h19
-rw-r--r--include/net/route.h2
-rw-r--r--include/net/rtnetlink.h2
-rw-r--r--include/net/sock.h66
-rw-r--r--include/net/switchdev.h79
-rw-r--r--include/net/tc_act/tc_bpf.h25
-rw-r--r--include/net/tc_act/tc_connmark.h14
-rw-r--r--include/net/tcp.h72
-rw-r--r--include/net/udp_tunnel.h16
-rw-r--r--include/net/udplite.h3
-rw-r--r--include/net/vxlan.h103
-rw-r--r--include/trace/events/net.h8
-rw-r--r--include/uapi/linux/Kbuild1
-rw-r--r--include/uapi/linux/ethtool.h4
-rw-r--r--include/uapi/linux/if_bridge.h2
-rw-r--r--include/uapi/linux/if_link.h4
-rw-r--r--include/uapi/linux/in.h1
-rw-r--r--include/uapi/linux/ipv6.h7
-rw-r--r--include/uapi/linux/l2tp.h1
-rw-r--r--include/uapi/linux/libc-compat.h6
-rw-r--r--include/uapi/linux/neighbour.h1
-rw-r--r--include/uapi/linux/net_namespace.h23
-rw-r--r--include/uapi/linux/net_tstamp.h3
-rw-r--r--include/uapi/linux/nfc.h1
-rw-r--r--include/uapi/linux/nl80211.h207
-rw-r--r--include/uapi/linux/openvswitch.h53
-rw-r--r--include/uapi/linux/pkt_sched.h2
-rw-r--r--include/uapi/linux/rtnetlink.h8
-rw-r--r--include/uapi/linux/snmp.h6
-rw-r--r--include/uapi/linux/tc_act/Kbuild1
-rw-r--r--include/uapi/linux/tc_act/tc_bpf.h31
-rw-r--r--include/uapi/linux/tc_act/tc_connmark.h22
-rw-r--r--include/uapi/linux/tipc_config.h20
-rw-r--r--include/xen/page.h5
109 files changed, 2259 insertions, 665 deletions
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h
index 6d26b40cbf5d..9916d0e4eff5 100644
--- a/include/clocksource/arm_arch_timer.h
+++ b/include/clocksource/arm_arch_timer.h
@@ -16,7 +16,7 @@
16#ifndef __CLKSOURCE_ARM_ARCH_TIMER_H 16#ifndef __CLKSOURCE_ARM_ARCH_TIMER_H
17#define __CLKSOURCE_ARM_ARCH_TIMER_H 17#define __CLKSOURCE_ARM_ARCH_TIMER_H
18 18
19#include <linux/clocksource.h> 19#include <linux/timecounter.h>
20#include <linux/types.h> 20#include <linux/types.h>
21 21
22#define ARCH_TIMER_CTRL_ENABLE (1 << 0) 22#define ARCH_TIMER_CTRL_ENABLE (1 << 0)
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index cd62bf4289e9..88ea64e9a91c 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -67,8 +67,7 @@ int af_alg_unregister_type(const struct af_alg_type *type);
67int af_alg_release(struct socket *sock); 67int af_alg_release(struct socket *sock);
68int af_alg_accept(struct sock *sk, struct socket *newsock); 68int af_alg_accept(struct sock *sk, struct socket *newsock);
69 69
70int af_alg_make_sg(struct af_alg_sgl *sgl, void __user *addr, int len, 70int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len);
71 int write);
72void af_alg_free_sg(struct af_alg_sgl *sgl); 71void af_alg_free_sg(struct af_alg_sgl *sgl);
73 72
74int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con); 73int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con);
diff --git a/include/dt-bindings/clock/rk3288-cru.h b/include/dt-bindings/clock/rk3288-cru.h
index f60ce72a2b2c..1c34c24efe08 100644
--- a/include/dt-bindings/clock/rk3288-cru.h
+++ b/include/dt-bindings/clock/rk3288-cru.h
@@ -81,6 +81,9 @@
81#define SCLK_SDIO1_SAMPLE 120 81#define SCLK_SDIO1_SAMPLE 120
82#define SCLK_EMMC_SAMPLE 121 82#define SCLK_EMMC_SAMPLE 121
83 83
84#define SCLK_MAC 151
85#define SCLK_MACREF_OUT 152
86
84#define DCLK_VOP0 190 87#define DCLK_VOP0 190
85#define DCLK_VOP1 191 88#define DCLK_VOP1 191
86 89
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index eb1c6a47b67f..994739da827f 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -318,6 +318,7 @@ struct bcma_bus {
318 const struct bcma_host_ops *ops; 318 const struct bcma_host_ops *ops;
319 319
320 enum bcma_hosttype hosttype; 320 enum bcma_hosttype hosttype;
321 bool host_is_pcie2; /* Used for BCMA_HOSTTYPE_PCI only */
321 union { 322 union {
322 /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */ 323 /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */
323 struct pci_dev *host_pci; 324 struct pci_dev *host_pci;
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index 0333e605ea0d..3f809ae372c4 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -223,6 +223,7 @@ struct bcma_drv_pci_host {
223 223
224struct bcma_drv_pci { 224struct bcma_drv_pci {
225 struct bcma_device *core; 225 struct bcma_device *core;
226 u8 early_setup_done:1;
226 u8 setup_done:1; 227 u8 setup_done:1;
227 u8 hostmode:1; 228 u8 hostmode:1;
228 229
@@ -237,6 +238,7 @@ struct bcma_drv_pci {
237#define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val) 238#define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val)
238#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) 239#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val)
239 240
241extern void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
240extern void bcma_core_pci_init(struct bcma_drv_pci *pc); 242extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
241extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, 243extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
242 struct bcma_device *core, bool enable); 244 struct bcma_device *core, bool enable);
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h
index e64ae7bf80a1..ebd5c1fcdea4 100644
--- a/include/linux/bcma/bcma_regs.h
+++ b/include/linux/bcma/bcma_regs.h
@@ -64,6 +64,8 @@
64#define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ 64#define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */
65#define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ 65#define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */
66 66
67#define BCMA_PCIE2_BAR0_WIN2 0x70
68
67/* SiliconBackplane Address Map. 69/* SiliconBackplane Address Map.
68 * All regions may not exist on all chips. 70 * All regions may not exist on all chips.
69 */ 71 */
diff --git a/include/linux/bcma/bcma_soc.h b/include/linux/bcma/bcma_soc.h
index f24d245f8394..1b5fc0c3b1b5 100644
--- a/include/linux/bcma/bcma_soc.h
+++ b/include/linux/bcma/bcma_soc.h
@@ -5,8 +5,6 @@
5 5
6struct bcma_soc { 6struct bcma_soc {
7 struct bcma_bus bus; 7 struct bcma_bus bus;
8 struct bcma_device core_cc;
9 struct bcma_device core_mips;
10}; 8};
11 9
12int __init bcma_host_soc_register(struct bcma_soc *soc); 10int __init bcma_host_soc_register(struct bcma_soc *soc);
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index abcafaa20b86..9c78d15d33e4 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -18,8 +18,6 @@
18#include <asm/div64.h> 18#include <asm/div64.h>
19#include <asm/io.h> 19#include <asm/io.h>
20 20
21/* clocksource cycle base type */
22typedef u64 cycle_t;
23struct clocksource; 21struct clocksource;
24struct module; 22struct module;
25 23
@@ -28,106 +26,6 @@ struct module;
28#endif 26#endif
29 27
30/** 28/**
31 * struct cyclecounter - hardware abstraction for a free running counter
32 * Provides completely state-free accessors to the underlying hardware.
33 * Depending on which hardware it reads, the cycle counter may wrap
34 * around quickly. Locking rules (if necessary) have to be defined
35 * by the implementor and user of specific instances of this API.
36 *
37 * @read: returns the current cycle value
38 * @mask: bitmask for two's complement
39 * subtraction of non 64 bit counters,
40 * see CLOCKSOURCE_MASK() helper macro
41 * @mult: cycle to nanosecond multiplier
42 * @shift: cycle to nanosecond divisor (power of two)
43 */
44struct cyclecounter {
45 cycle_t (*read)(const struct cyclecounter *cc);
46 cycle_t mask;
47 u32 mult;
48 u32 shift;
49};
50
51/**
52 * struct timecounter - layer above a %struct cyclecounter which counts nanoseconds
53 * Contains the state needed by timecounter_read() to detect
54 * cycle counter wrap around. Initialize with
55 * timecounter_init(). Also used to convert cycle counts into the
56 * corresponding nanosecond counts with timecounter_cyc2time(). Users
57 * of this code are responsible for initializing the underlying
58 * cycle counter hardware, locking issues and reading the time
59 * more often than the cycle counter wraps around. The nanosecond
60 * counter will only wrap around after ~585 years.
61 *
62 * @cc: the cycle counter used by this instance
63 * @cycle_last: most recent cycle counter value seen by
64 * timecounter_read()
65 * @nsec: continuously increasing count
66 */
67struct timecounter {
68 const struct cyclecounter *cc;
69 cycle_t cycle_last;
70 u64 nsec;
71};
72
73/**
74 * cyclecounter_cyc2ns - converts cycle counter cycles to nanoseconds
75 * @cc: Pointer to cycle counter.
76 * @cycles: Cycles
77 *
78 * XXX - This could use some mult_lxl_ll() asm optimization. Same code
79 * as in cyc2ns, but with unsigned result.
80 */
81static inline u64 cyclecounter_cyc2ns(const struct cyclecounter *cc,
82 cycle_t cycles)
83{
84 u64 ret = (u64)cycles;
85 ret = (ret * cc->mult) >> cc->shift;
86 return ret;
87}
88
89/**
90 * timecounter_init - initialize a time counter
91 * @tc: Pointer to time counter which is to be initialized/reset
92 * @cc: A cycle counter, ready to be used.
93 * @start_tstamp: Arbitrary initial time stamp.
94 *
95 * After this call the current cycle register (roughly) corresponds to
96 * the initial time stamp. Every call to timecounter_read() increments
97 * the time stamp counter by the number of elapsed nanoseconds.
98 */
99extern void timecounter_init(struct timecounter *tc,
100 const struct cyclecounter *cc,
101 u64 start_tstamp);
102
103/**
104 * timecounter_read - return nanoseconds elapsed since timecounter_init()
105 * plus the initial time stamp
106 * @tc: Pointer to time counter.
107 *
108 * In other words, keeps track of time since the same epoch as
109 * the function which generated the initial time stamp.
110 */
111extern u64 timecounter_read(struct timecounter *tc);
112
113/**
114 * timecounter_cyc2time - convert a cycle counter to same
115 * time base as values returned by
116 * timecounter_read()
117 * @tc: Pointer to time counter.
118 * @cycle_tstamp: a value returned by tc->cc->read()
119 *
120 * Cycle counts that are converted correctly as long as they
121 * fall into the interval [-1/2 max cycle count, +1/2 max cycle count],
122 * with "max cycle count" == cs->mask+1.
123 *
124 * This allows conversion of cycle counter values which were generated
125 * in the past.
126 */
127extern u64 timecounter_cyc2time(struct timecounter *tc,
128 cycle_t cycle_tstamp);
129
130/**
131 * struct clocksource - hardware abstraction for a free running counter 29 * struct clocksource - hardware abstraction for a free running counter
132 * Provides mostly state-free accessors to the underlying hardware. 30 * Provides mostly state-free accessors to the underlying hardware.
133 * This is the structure used for system time. 31 * This is the structure used for system time.
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 41c891d05f04..1d869d185a0d 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -52,6 +52,10 @@ struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
52#define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) 52#define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1)
53#define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) 53#define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count)
54 54
55struct sk_buff **eth_gro_receive(struct sk_buff **head,
56 struct sk_buff *skb);
57int eth_gro_complete(struct sk_buff *skb, int nhoff);
58
55/* Reserved Ethernet Addresses per IEEE 802.1Q */ 59/* Reserved Ethernet Addresses per IEEE 802.1Q */
56static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = 60static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) =
57{ 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }; 61{ 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
diff --git a/include/linux/fec.h b/include/linux/fec.h
index bcff455d1d53..1454a503622d 100644
--- a/include/linux/fec.h
+++ b/include/linux/fec.h
@@ -19,6 +19,7 @@
19struct fec_platform_data { 19struct fec_platform_data {
20 phy_interface_t phy; 20 phy_interface_t phy;
21 unsigned char mac[ETH_ALEN]; 21 unsigned char mac[ETH_ALEN];
22 void (*sleep_mode_enable)(int enabled);
22}; 23};
23 24
24#endif 25#endif
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 4f4eea8a6288..b9c7897dc566 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1017,6 +1017,15 @@ struct ieee80211_mmie {
1017 u8 mic[8]; 1017 u8 mic[8];
1018} __packed; 1018} __packed;
1019 1019
1020/* Management MIC information element (IEEE 802.11w) for GMAC and CMAC-256 */
1021struct ieee80211_mmie_16 {
1022 u8 element_id;
1023 u8 length;
1024 __le16 key_id;
1025 u8 sequence_number[6];
1026 u8 mic[16];
1027} __packed;
1028
1020struct ieee80211_vendor_ie { 1029struct ieee80211_vendor_ie {
1021 u8 element_id; 1030 u8 element_id;
1022 u8 len; 1031 u8 len;
@@ -1994,9 +2003,15 @@ enum ieee80211_key_len {
1994 WLAN_KEY_LEN_WEP40 = 5, 2003 WLAN_KEY_LEN_WEP40 = 5,
1995 WLAN_KEY_LEN_WEP104 = 13, 2004 WLAN_KEY_LEN_WEP104 = 13,
1996 WLAN_KEY_LEN_CCMP = 16, 2005 WLAN_KEY_LEN_CCMP = 16,
2006 WLAN_KEY_LEN_CCMP_256 = 32,
1997 WLAN_KEY_LEN_TKIP = 32, 2007 WLAN_KEY_LEN_TKIP = 32,
1998 WLAN_KEY_LEN_AES_CMAC = 16, 2008 WLAN_KEY_LEN_AES_CMAC = 16,
1999 WLAN_KEY_LEN_SMS4 = 32, 2009 WLAN_KEY_LEN_SMS4 = 32,
2010 WLAN_KEY_LEN_GCMP = 16,
2011 WLAN_KEY_LEN_GCMP_256 = 32,
2012 WLAN_KEY_LEN_BIP_CMAC_256 = 32,
2013 WLAN_KEY_LEN_BIP_GMAC_128 = 16,
2014 WLAN_KEY_LEN_BIP_GMAC_256 = 32,
2000}; 2015};
2001 2016
2002#define IEEE80211_WEP_IV_LEN 4 2017#define IEEE80211_WEP_IV_LEN 4
@@ -2004,9 +2019,16 @@ enum ieee80211_key_len {
2004#define IEEE80211_CCMP_HDR_LEN 8 2019#define IEEE80211_CCMP_HDR_LEN 8
2005#define IEEE80211_CCMP_MIC_LEN 8 2020#define IEEE80211_CCMP_MIC_LEN 8
2006#define IEEE80211_CCMP_PN_LEN 6 2021#define IEEE80211_CCMP_PN_LEN 6
2022#define IEEE80211_CCMP_256_HDR_LEN 8
2023#define IEEE80211_CCMP_256_MIC_LEN 16
2024#define IEEE80211_CCMP_256_PN_LEN 6
2007#define IEEE80211_TKIP_IV_LEN 8 2025#define IEEE80211_TKIP_IV_LEN 8
2008#define IEEE80211_TKIP_ICV_LEN 4 2026#define IEEE80211_TKIP_ICV_LEN 4
2009#define IEEE80211_CMAC_PN_LEN 6 2027#define IEEE80211_CMAC_PN_LEN 6
2028#define IEEE80211_GMAC_PN_LEN 6
2029#define IEEE80211_GCMP_HDR_LEN 8
2030#define IEEE80211_GCMP_MIC_LEN 16
2031#define IEEE80211_GCMP_PN_LEN 6
2010 2032
2011/* Public action codes */ 2033/* Public action codes */
2012enum ieee80211_pub_actioncode { 2034enum ieee80211_pub_actioncode {
@@ -2230,6 +2252,11 @@ enum ieee80211_sa_query_action {
2230#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 2252#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
2231#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 2253#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
2232#define WLAN_CIPHER_SUITE_GCMP 0x000FAC08 2254#define WLAN_CIPHER_SUITE_GCMP 0x000FAC08
2255#define WLAN_CIPHER_SUITE_GCMP_256 0x000FAC09
2256#define WLAN_CIPHER_SUITE_CCMP_256 0x000FAC0A
2257#define WLAN_CIPHER_SUITE_BIP_GMAC_128 0x000FAC0B
2258#define WLAN_CIPHER_SUITE_BIP_GMAC_256 0x000FAC0C
2259#define WLAN_CIPHER_SUITE_BIP_CMAC_256 0x000FAC0D
2233 2260
2234#define WLAN_CIPHER_SUITE_SMS4 0x00147201 2261#define WLAN_CIPHER_SUITE_SMS4 0x00147201
2235 2262
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 0a8ce762a47f..a57bca2ea97e 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -50,24 +50,6 @@ extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __use
50typedef int br_should_route_hook_t(struct sk_buff *skb); 50typedef int br_should_route_hook_t(struct sk_buff *skb);
51extern br_should_route_hook_t __rcu *br_should_route_hook; 51extern br_should_route_hook_t __rcu *br_should_route_hook;
52 52
53#if IS_ENABLED(CONFIG_BRIDGE)
54int br_fdb_external_learn_add(struct net_device *dev,
55 const unsigned char *addr, u16 vid);
56int br_fdb_external_learn_del(struct net_device *dev,
57 const unsigned char *addr, u16 vid);
58#else
59static inline int br_fdb_external_learn_add(struct net_device *dev,
60 const unsigned char *addr, u16 vid)
61{
62 return 0;
63}
64static inline int br_fdb_external_learn_del(struct net_device *dev,
65 const unsigned char *addr, u16 vid)
66{
67 return 0;
68}
69#endif
70
71#if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING) 53#if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING)
72int br_multicast_list_adjacent(struct net_device *dev, 54int br_multicast_list_adjacent(struct net_device *dev,
73 struct list_head *br_ip_list); 55 struct list_head *br_ip_list);
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 960e666c51e4..b11b28a30b9e 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -78,9 +78,9 @@ static inline bool is_vlan_dev(struct net_device *dev)
78 return dev->priv_flags & IFF_802_1Q_VLAN; 78 return dev->priv_flags & IFF_802_1Q_VLAN;
79} 79}
80 80
81#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) 81#define skb_vlan_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT)
82#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) 82#define skb_vlan_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
83#define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) 83#define skb_vlan_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK)
84 84
85/** 85/**
86 * struct vlan_pcpu_stats - VLAN percpu rx/tx stats 86 * struct vlan_pcpu_stats - VLAN percpu rx/tx stats
@@ -376,7 +376,7 @@ static inline struct sk_buff *vlan_insert_tag_set_proto(struct sk_buff *skb,
376static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb) 376static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb)
377{ 377{
378 skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, 378 skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
379 vlan_tx_tag_get(skb)); 379 skb_vlan_tag_get(skb));
380 if (likely(skb)) 380 if (likely(skb))
381 skb->vlan_tci = 0; 381 skb->vlan_tci = 0;
382 return skb; 382 return skb;
@@ -393,7 +393,7 @@ static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb)
393 */ 393 */
394static inline struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *skb) 394static inline struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *skb)
395{ 395{
396 if (vlan_tx_tag_present(skb)) 396 if (skb_vlan_tag_present(skb))
397 skb = __vlan_hwaccel_push_inside(skb); 397 skb = __vlan_hwaccel_push_inside(skb);
398 return skb; 398 return skb;
399} 399}
@@ -442,8 +442,8 @@ static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
442static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, 442static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
443 u16 *vlan_tci) 443 u16 *vlan_tci)
444{ 444{
445 if (vlan_tx_tag_present(skb)) { 445 if (skb_vlan_tag_present(skb)) {
446 *vlan_tci = vlan_tx_tag_get(skb); 446 *vlan_tci = skb_vlan_tag_get(skb);
447 return 0; 447 return 0;
448 } else { 448 } else {
449 *vlan_tci = 0; 449 *vlan_tci = 0;
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index c694e7baa621..4d5169f5d7d1 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -52,6 +52,7 @@ struct ipv6_devconf {
52 __s32 force_tllao; 52 __s32 force_tllao;
53 __s32 ndisc_notify; 53 __s32 ndisc_notify;
54 __s32 suppress_frag_ndisc; 54 __s32 suppress_frag_ndisc;
55 __s32 accept_ra_mtu;
55 void *sysctl; 56 void *sysctl;
56}; 57};
57 58
@@ -124,6 +125,12 @@ struct ipv6_mc_socklist;
124struct ipv6_ac_socklist; 125struct ipv6_ac_socklist;
125struct ipv6_fl_socklist; 126struct ipv6_fl_socklist;
126 127
128struct inet6_cork {
129 struct ipv6_txoptions *opt;
130 u8 hop_limit;
131 u8 tclass;
132};
133
127/** 134/**
128 * struct ipv6_pinfo - ipv6 private area 135 * struct ipv6_pinfo - ipv6 private area
129 * 136 *
@@ -216,11 +223,7 @@ struct ipv6_pinfo {
216 struct ipv6_txoptions *opt; 223 struct ipv6_txoptions *opt;
217 struct sk_buff *pktoptions; 224 struct sk_buff *pktoptions;
218 struct sk_buff *rxpmtu; 225 struct sk_buff *rxpmtu;
219 struct { 226 struct inet6_cork cork;
220 struct ipv6_txoptions *opt;
221 u8 hop_limit;
222 u8 tclass;
223 } cork;
224}; 227};
225 228
226/* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */ 229/* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */
diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h
index 5d10ae364b5e..f266661d2666 100644
--- a/include/linux/list_nulls.h
+++ b/include/linux/list_nulls.h
@@ -1,6 +1,9 @@
1#ifndef _LINUX_LIST_NULLS_H 1#ifndef _LINUX_LIST_NULLS_H
2#define _LINUX_LIST_NULLS_H 2#define _LINUX_LIST_NULLS_H
3 3
4#include <linux/poison.h>
5#include <linux/const.h>
6
4/* 7/*
5 * Special version of lists, where end of list is not a NULL pointer, 8 * Special version of lists, where end of list is not a NULL pointer,
6 * but a 'nulls' marker, which can have many different values. 9 * but a 'nulls' marker, which can have many different values.
@@ -21,8 +24,9 @@ struct hlist_nulls_head {
21struct hlist_nulls_node { 24struct hlist_nulls_node {
22 struct hlist_nulls_node *next, **pprev; 25 struct hlist_nulls_node *next, **pprev;
23}; 26};
27#define NULLS_MARKER(value) (1UL | (((long)value) << 1))
24#define INIT_HLIST_NULLS_HEAD(ptr, nulls) \ 28#define INIT_HLIST_NULLS_HEAD(ptr, nulls) \
25 ((ptr)->first = (struct hlist_nulls_node *) (1UL | (((long)nulls) << 1))) 29 ((ptr)->first = (struct hlist_nulls_node *) NULLS_MARKER(nulls))
26 30
27#define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member) 31#define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member)
28/** 32/**
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 64d25941b329..7b6d4e9ff603 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -71,6 +71,7 @@ enum {
71 71
72 /*master notify fw on finish for slave's flr*/ 72 /*master notify fw on finish for slave's flr*/
73 MLX4_CMD_INFORM_FLR_DONE = 0x5b, 73 MLX4_CMD_INFORM_FLR_DONE = 0x5b,
74 MLX4_CMD_VIRT_PORT_MAP = 0x5c,
74 MLX4_CMD_GET_OP_REQ = 0x59, 75 MLX4_CMD_GET_OP_REQ = 0x59,
75 76
76 /* TPT commands */ 77 /* TPT commands */
@@ -165,9 +166,15 @@ enum {
165}; 166};
166 167
167enum { 168enum {
168 MLX4_CMD_TIME_CLASS_A = 10000, 169 MLX4_CMD_TIME_CLASS_A = 60000,
169 MLX4_CMD_TIME_CLASS_B = 10000, 170 MLX4_CMD_TIME_CLASS_B = 60000,
170 MLX4_CMD_TIME_CLASS_C = 10000, 171 MLX4_CMD_TIME_CLASS_C = 60000,
172};
173
174enum {
175 /* virtual to physical port mapping opcode modifiers */
176 MLX4_GET_PORT_VIRT2PHY = 0x0,
177 MLX4_SET_PORT_VIRT2PHY = 0x1,
171}; 178};
172 179
173enum { 180enum {
@@ -279,6 +286,8 @@ int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_in
279int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state); 286int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state);
280int mlx4_config_dev_retrieval(struct mlx4_dev *dev, 287int mlx4_config_dev_retrieval(struct mlx4_dev *dev,
281 struct mlx4_config_dev_params *params); 288 struct mlx4_config_dev_params *params);
289void mlx4_cmd_wake_completions(struct mlx4_dev *dev);
290void mlx4_report_internal_err_comm_event(struct mlx4_dev *dev);
282/* 291/*
283 * mlx4_get_slave_default_vlan - 292 * mlx4_get_slave_default_vlan -
284 * return true if VST ( default vlan) 293 * return true if VST ( default vlan)
@@ -288,5 +297,6 @@ bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave,
288 u16 *vlan, u8 *qos); 297 u16 *vlan, u8 *qos);
289 298
290#define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) 299#define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8)
300#define COMM_CHAN_EVENT_INTERNAL_ERR (1 << 17)
291 301
292#endif /* MLX4_CMD_H */ 302#endif /* MLX4_CMD_H */
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 5f3a9aa7225d..e4ebff7e9d02 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -42,7 +42,7 @@
42 42
43#include <linux/atomic.h> 43#include <linux/atomic.h>
44 44
45#include <linux/clocksource.h> 45#include <linux/timecounter.h>
46 46
47#define MAX_MSIX_P_PORT 17 47#define MAX_MSIX_P_PORT 17
48#define MAX_MSIX 64 48#define MAX_MSIX 64
@@ -70,6 +70,7 @@ enum {
70 MLX4_FLAG_SLAVE = 1 << 3, 70 MLX4_FLAG_SLAVE = 1 << 3,
71 MLX4_FLAG_SRIOV = 1 << 4, 71 MLX4_FLAG_SRIOV = 1 << 4,
72 MLX4_FLAG_OLD_REG_MAC = 1 << 6, 72 MLX4_FLAG_OLD_REG_MAC = 1 << 6,
73 MLX4_FLAG_BONDED = 1 << 7
73}; 74};
74 75
75enum { 76enum {
@@ -200,7 +201,9 @@ enum {
200 MLX4_DEV_CAP_FLAG2_CONFIG_DEV = 1LL << 16, 201 MLX4_DEV_CAP_FLAG2_CONFIG_DEV = 1LL << 16,
201 MLX4_DEV_CAP_FLAG2_SYS_EQS = 1LL << 17, 202 MLX4_DEV_CAP_FLAG2_SYS_EQS = 1LL << 17,
202 MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18, 203 MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18,
203 MLX4_DEV_CAP_FLAG2_FS_A0 = 1LL << 19 204 MLX4_DEV_CAP_FLAG2_FS_A0 = 1LL << 19,
205 MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT = 1LL << 20,
206 MLX4_DEV_CAP_FLAG2_PORT_REMAP = 1LL << 21
204}; 207};
205 208
206enum { 209enum {
@@ -208,6 +211,10 @@ enum {
208 MLX4_QUERY_FUNC_FLAGS_A0_RES_QP = 1LL << 1 211 MLX4_QUERY_FUNC_FLAGS_A0_RES_QP = 1LL << 1
209}; 212};
210 213
214enum {
215 MLX4_VF_CAP_FLAG_RESET = 1 << 0
216};
217
211/* bit enums for an 8-bit flags field indicating special use 218/* bit enums for an 8-bit flags field indicating special use
212 * QPs which require special handling in qp_reserve_range. 219 * QPs which require special handling in qp_reserve_range.
213 * Currently, this only includes QPs used by the ETH interface, 220 * Currently, this only includes QPs used by the ETH interface,
@@ -248,9 +255,14 @@ enum {
248 MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, 255 MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9,
249 MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10, 256 MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10,
250 MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11, 257 MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11,
258 MLX4_BMME_FLAG_PORT_REMAP = 1 << 24,
251 MLX4_BMME_FLAG_VSD_INIT2RTR = 1 << 28, 259 MLX4_BMME_FLAG_VSD_INIT2RTR = 1 << 28,
252}; 260};
253 261
262enum {
263 MLX4_FLAG_PORT_REMAP = MLX4_BMME_FLAG_PORT_REMAP
264};
265
254enum mlx4_event { 266enum mlx4_event {
255 MLX4_EVENT_TYPE_COMP = 0x00, 267 MLX4_EVENT_TYPE_COMP = 0x00,
256 MLX4_EVENT_TYPE_PATH_MIG = 0x01, 268 MLX4_EVENT_TYPE_PATH_MIG = 0x01,
@@ -276,6 +288,7 @@ enum mlx4_event {
276 MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, 288 MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b,
277 MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, 289 MLX4_EVENT_TYPE_FLR_EVENT = 0x1c,
278 MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d, 290 MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d,
291 MLX4_EVENT_TYPE_RECOVERABLE_ERROR_EVENT = 0x3e,
279 MLX4_EVENT_TYPE_NONE = 0xff, 292 MLX4_EVENT_TYPE_NONE = 0xff,
280}; 293};
281 294
@@ -285,6 +298,11 @@ enum {
285}; 298};
286 299
287enum { 300enum {
301 MLX4_RECOVERABLE_ERROR_EVENT_SUBTYPE_BAD_CABLE = 1,
302 MLX4_RECOVERABLE_ERROR_EVENT_SUBTYPE_UNSUPPORTED_CABLE = 2,
303};
304
305enum {
288 MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, 306 MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0,
289}; 307};
290 308
@@ -411,6 +429,16 @@ enum {
411 MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4, 429 MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4,
412}; 430};
413 431
432enum {
433 MLX4_DEVICE_STATE_UP = 1 << 0,
434 MLX4_DEVICE_STATE_INTERNAL_ERROR = 1 << 1,
435};
436
437enum {
438 MLX4_INTERFACE_STATE_UP = 1 << 0,
439 MLX4_INTERFACE_STATE_DELETION = 1 << 1,
440};
441
414#define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ 442#define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \
415 MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) 443 MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK)
416 444
@@ -535,6 +563,7 @@ struct mlx4_caps {
535 u8 alloc_res_qp_mask; 563 u8 alloc_res_qp_mask;
536 u32 dmfs_high_rate_qpn_base; 564 u32 dmfs_high_rate_qpn_base;
537 u32 dmfs_high_rate_qpn_range; 565 u32 dmfs_high_rate_qpn_range;
566 u32 vf_caps;
538}; 567};
539 568
540struct mlx4_buf_list { 569struct mlx4_buf_list {
@@ -660,6 +689,8 @@ struct mlx4_cq {
660 void (*comp)(struct mlx4_cq *); 689 void (*comp)(struct mlx4_cq *);
661 void *priv; 690 void *priv;
662 } tasklet_ctx; 691 } tasklet_ctx;
692 int reset_notify_added;
693 struct list_head reset_notify;
663}; 694};
664 695
665struct mlx4_qp { 696struct mlx4_qp {
@@ -744,8 +775,23 @@ struct mlx4_vf_dev {
744 u8 n_ports; 775 u8 n_ports;
745}; 776};
746 777
747struct mlx4_dev { 778struct mlx4_dev_persistent {
748 struct pci_dev *pdev; 779 struct pci_dev *pdev;
780 struct mlx4_dev *dev;
781 int nvfs[MLX4_MAX_PORTS + 1];
782 int num_vfs;
783 enum mlx4_port_type curr_port_type[MLX4_MAX_PORTS + 1];
784 enum mlx4_port_type curr_port_poss_type[MLX4_MAX_PORTS + 1];
785 struct work_struct catas_work;
786 struct workqueue_struct *catas_wq;
787 struct mutex device_state_mutex; /* protect HW state */
788 u8 state;
789 struct mutex interface_state_mutex; /* protect SW state */
790 u8 interface_state;
791};
792
793struct mlx4_dev {
794 struct mlx4_dev_persistent *persist;
749 unsigned long flags; 795 unsigned long flags;
750 unsigned long num_slaves; 796 unsigned long num_slaves;
751 struct mlx4_caps caps; 797 struct mlx4_caps caps;
@@ -754,13 +800,11 @@ struct mlx4_dev {
754 struct radix_tree_root qp_table_tree; 800 struct radix_tree_root qp_table_tree;
755 u8 rev_id; 801 u8 rev_id;
756 char board_id[MLX4_BOARD_ID_LEN]; 802 char board_id[MLX4_BOARD_ID_LEN];
757 int num_vfs;
758 int numa_node; 803 int numa_node;
759 int oper_log_mgm_entry_size; 804 int oper_log_mgm_entry_size;
760 u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; 805 u64 regid_promisc_array[MLX4_MAX_PORTS + 1];
761 u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; 806 u64 regid_allmulti_array[MLX4_MAX_PORTS + 1];
762 struct mlx4_vf_dev *dev_vfs; 807 struct mlx4_vf_dev *dev_vfs;
763 int nvfs[MLX4_MAX_PORTS + 1];
764}; 808};
765 809
766struct mlx4_eqe { 810struct mlx4_eqe {
@@ -832,6 +876,11 @@ struct mlx4_eqe {
832 } __packed tbl_change_info; 876 } __packed tbl_change_info;
833 } params; 877 } params;
834 } __packed port_mgmt_change; 878 } __packed port_mgmt_change;
879 struct {
880 u8 reserved[3];
881 u8 port;
882 u32 reserved1[5];
883 } __packed bad_cable;
835 } event; 884 } event;
836 u8 slave_id; 885 u8 slave_id;
837 u8 reserved3[2]; 886 u8 reserved3[2];
@@ -1338,6 +1387,8 @@ int mlx4_phys_to_slave_port(struct mlx4_dev *dev, int slave, int port);
1338int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port); 1387int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port);
1339 1388
1340int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port); 1389int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port);
1390int mlx4_disable_rx_port_check(struct mlx4_dev *dev, bool dis);
1391int mlx4_virt2phy_port_map(struct mlx4_dev *dev, u32 port1, u32 port2);
1341int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port); 1392int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port);
1342int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port); 1393int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port);
1343int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, 1394int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port,
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h
index 022055c8fb26..9553a73d2049 100644
--- a/include/linux/mlx4/driver.h
+++ b/include/linux/mlx4/driver.h
@@ -49,6 +49,10 @@ enum mlx4_dev_event {
49 MLX4_DEV_EVENT_SLAVE_SHUTDOWN, 49 MLX4_DEV_EVENT_SLAVE_SHUTDOWN,
50}; 50};
51 51
52enum {
53 MLX4_INTFF_BONDING = 1 << 0
54};
55
52struct mlx4_interface { 56struct mlx4_interface {
53 void * (*add) (struct mlx4_dev *dev); 57 void * (*add) (struct mlx4_dev *dev);
54 void (*remove)(struct mlx4_dev *dev, void *context); 58 void (*remove)(struct mlx4_dev *dev, void *context);
@@ -57,11 +61,26 @@ struct mlx4_interface {
57 void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); 61 void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port);
58 struct list_head list; 62 struct list_head list;
59 enum mlx4_protocol protocol; 63 enum mlx4_protocol protocol;
64 int flags;
60}; 65};
61 66
62int mlx4_register_interface(struct mlx4_interface *intf); 67int mlx4_register_interface(struct mlx4_interface *intf);
63void mlx4_unregister_interface(struct mlx4_interface *intf); 68void mlx4_unregister_interface(struct mlx4_interface *intf);
64 69
70int mlx4_bond(struct mlx4_dev *dev);
71int mlx4_unbond(struct mlx4_dev *dev);
72static inline int mlx4_is_bonded(struct mlx4_dev *dev)
73{
74 return !!(dev->flags & MLX4_FLAG_BONDED);
75}
76
77struct mlx4_port_map {
78 u8 port1;
79 u8 port2;
80};
81
82int mlx4_port_map_set(struct mlx4_dev *dev, struct mlx4_port_map *v2p);
83
65void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); 84void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port);
66 85
67static inline u64 mlx4_mac_to_u64(u8 *addr) 86static inline u64 mlx4_mac_to_u64(u8 *addr)
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 467ccdf94c98..2bbc62aa818a 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -96,6 +96,7 @@ enum {
96 MLX4_QP_BIT_RRE = 1 << 15, 96 MLX4_QP_BIT_RRE = 1 << 15,
97 MLX4_QP_BIT_RWE = 1 << 14, 97 MLX4_QP_BIT_RWE = 1 << 14,
98 MLX4_QP_BIT_RAE = 1 << 13, 98 MLX4_QP_BIT_RAE = 1 << 13,
99 MLX4_QP_BIT_FPP = 1 << 3,
99 MLX4_QP_BIT_RIC = 1 << 4, 100 MLX4_QP_BIT_RIC = 1 << 4,
100}; 101};
101 102
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index 0f01fe065424..996807963716 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -24,13 +24,15 @@
24 * Vendors and devices. Sort key: vendor first, device next. 24 * Vendors and devices. Sort key: vendor first, device next.
25 */ 25 */
26#define SDIO_VENDOR_ID_BROADCOM 0x02d0 26#define SDIO_VENDOR_ID_BROADCOM 0x02d0
27#define SDIO_DEVICE_ID_BROADCOM_43143 43143 27#define SDIO_DEVICE_ID_BROADCOM_43143 0xa887
28#define SDIO_DEVICE_ID_BROADCOM_43241 0x4324 28#define SDIO_DEVICE_ID_BROADCOM_43241 0x4324
29#define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 29#define SDIO_DEVICE_ID_BROADCOM_4329 0x4329
30#define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 30#define SDIO_DEVICE_ID_BROADCOM_4330 0x4330
31#define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 31#define SDIO_DEVICE_ID_BROADCOM_4334 0x4334
32#define SDIO_DEVICE_ID_BROADCOM_43340 0xa94c
33#define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d
32#define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 34#define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335
33#define SDIO_DEVICE_ID_BROADCOM_43362 43362 35#define SDIO_DEVICE_ID_BROADCOM_43362 0xa962
34#define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 36#define SDIO_DEVICE_ID_BROADCOM_4354 0x4354
35 37
36#define SDIO_VENDOR_ID_INTEL 0x0089 38#define SDIO_VENDOR_ID_INTEL 0x0089
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 8e30685affeb..7d59dc6ab789 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -66,6 +66,7 @@ enum {
66 NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */ 66 NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */
67 NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ 67 NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */
68 NETIF_F_BUSY_POLL_BIT, /* Busy poll */ 68 NETIF_F_BUSY_POLL_BIT, /* Busy poll */
69 NETIF_F_HW_SWITCH_OFFLOAD_BIT, /* HW switch offload */
69 70
70 /* 71 /*
71 * Add your fresh new feature above and remember to update 72 * Add your fresh new feature above and remember to update
@@ -124,6 +125,7 @@ enum {
124#define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) 125#define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX)
125#define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) 126#define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD)
126#define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) 127#define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL)
128#define NETIF_F_HW_SWITCH_OFFLOAD __NETIF_F(HW_SWITCH_OFFLOAD)
127 129
128/* Features valid for ethtool to change */ 130/* Features valid for ethtool to change */
129/* = all defined minus driver/device-class-related */ 131/* = all defined minus driver/device-class-related */
@@ -159,7 +161,9 @@ enum {
159 */ 161 */
160#define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ 162#define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \
161 NETIF_F_SG | NETIF_F_HIGHDMA | \ 163 NETIF_F_SG | NETIF_F_HIGHDMA | \
162 NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED) 164 NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED | \
165 NETIF_F_HW_SWITCH_OFFLOAD)
166
163/* 167/*
164 * If one device doesn't support one of these features, then disable it 168 * If one device doesn't support one of these features, then disable it
165 * for all in netdev_increment_features. 169 * for all in netdev_increment_features.
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 52fd8e8694cf..d115256ed5a2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -51,6 +51,7 @@
51#include <linux/netdev_features.h> 51#include <linux/netdev_features.h>
52#include <linux/neighbour.h> 52#include <linux/neighbour.h>
53#include <uapi/linux/netdevice.h> 53#include <uapi/linux/netdevice.h>
54#include <uapi/linux/if_bonding.h>
54 55
55struct netpoll_info; 56struct netpoll_info;
56struct device; 57struct device;
@@ -643,39 +644,40 @@ struct rps_dev_flow_table {
643/* 644/*
644 * The rps_sock_flow_table contains mappings of flows to the last CPU 645 * The rps_sock_flow_table contains mappings of flows to the last CPU
645 * on which they were processed by the application (set in recvmsg). 646 * on which they were processed by the application (set in recvmsg).
647 * Each entry is a 32bit value. Upper part is the high order bits
648 * of flow hash, lower part is cpu number.
649 * rps_cpu_mask is used to partition the space, depending on number of
650 * possible cpus : rps_cpu_mask = roundup_pow_of_two(nr_cpu_ids) - 1
651 * For example, if 64 cpus are possible, rps_cpu_mask = 0x3f,
652 * meaning we use 32-6=26 bits for the hash.
646 */ 653 */
647struct rps_sock_flow_table { 654struct rps_sock_flow_table {
648 unsigned int mask; 655 u32 mask;
649 u16 ents[0]; 656
657 u32 ents[0] ____cacheline_aligned_in_smp;
650}; 658};
651#define RPS_SOCK_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_sock_flow_table) + \ 659#define RPS_SOCK_FLOW_TABLE_SIZE(_num) (offsetof(struct rps_sock_flow_table, ents[_num]))
652 ((_num) * sizeof(u16)))
653 660
654#define RPS_NO_CPU 0xffff 661#define RPS_NO_CPU 0xffff
655 662
663extern u32 rps_cpu_mask;
664extern struct rps_sock_flow_table __rcu *rps_sock_flow_table;
665
656static inline void rps_record_sock_flow(struct rps_sock_flow_table *table, 666static inline void rps_record_sock_flow(struct rps_sock_flow_table *table,
657 u32 hash) 667 u32 hash)
658{ 668{
659 if (table && hash) { 669 if (table && hash) {
660 unsigned int cpu, index = hash & table->mask; 670 unsigned int index = hash & table->mask;
671 u32 val = hash & ~rps_cpu_mask;
661 672
662 /* We only give a hint, preemption can change cpu under us */ 673 /* We only give a hint, preemption can change cpu under us */
663 cpu = raw_smp_processor_id(); 674 val |= raw_smp_processor_id();
664 675
665 if (table->ents[index] != cpu) 676 if (table->ents[index] != val)
666 table->ents[index] = cpu; 677 table->ents[index] = val;
667 } 678 }
668} 679}
669 680
670static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table,
671 u32 hash)
672{
673 if (table && hash)
674 table->ents[hash & table->mask] = RPS_NO_CPU;
675}
676
677extern struct rps_sock_flow_table __rcu *rps_sock_flow_table;
678
679#ifdef CONFIG_RFS_ACCEL 681#ifdef CONFIG_RFS_ACCEL
680bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, 682bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id,
681 u16 filter_id); 683 u16 filter_id);
@@ -1154,13 +1156,15 @@ struct net_device_ops {
1154 int idx); 1156 int idx);
1155 1157
1156 int (*ndo_bridge_setlink)(struct net_device *dev, 1158 int (*ndo_bridge_setlink)(struct net_device *dev,
1157 struct nlmsghdr *nlh); 1159 struct nlmsghdr *nlh,
1160 u16 flags);
1158 int (*ndo_bridge_getlink)(struct sk_buff *skb, 1161 int (*ndo_bridge_getlink)(struct sk_buff *skb,
1159 u32 pid, u32 seq, 1162 u32 pid, u32 seq,
1160 struct net_device *dev, 1163 struct net_device *dev,
1161 u32 filter_mask); 1164 u32 filter_mask);
1162 int (*ndo_bridge_dellink)(struct net_device *dev, 1165 int (*ndo_bridge_dellink)(struct net_device *dev,
1163 struct nlmsghdr *nlh); 1166 struct nlmsghdr *nlh,
1167 u16 flags);
1164 int (*ndo_change_carrier)(struct net_device *dev, 1168 int (*ndo_change_carrier)(struct net_device *dev,
1165 bool new_carrier); 1169 bool new_carrier);
1166 int (*ndo_get_phys_port_id)(struct net_device *dev, 1170 int (*ndo_get_phys_port_id)(struct net_device *dev,
@@ -1514,6 +1518,8 @@ struct net_device {
1514 struct list_head napi_list; 1518 struct list_head napi_list;
1515 struct list_head unreg_list; 1519 struct list_head unreg_list;
1516 struct list_head close_list; 1520 struct list_head close_list;
1521 struct list_head ptype_all;
1522 struct list_head ptype_specific;
1517 1523
1518 struct { 1524 struct {
1519 struct list_head upper; 1525 struct list_head upper;
@@ -1969,7 +1975,7 @@ struct offload_callbacks {
1969 struct sk_buff *(*gso_segment)(struct sk_buff *skb, 1975 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
1970 netdev_features_t features); 1976 netdev_features_t features);
1971 struct sk_buff **(*gro_receive)(struct sk_buff **head, 1977 struct sk_buff **(*gro_receive)(struct sk_buff **head,
1972 struct sk_buff *skb); 1978 struct sk_buff *skb);
1973 int (*gro_complete)(struct sk_buff *skb, int nhoff); 1979 int (*gro_complete)(struct sk_buff *skb, int nhoff);
1974}; 1980};
1975 1981
@@ -1979,10 +1985,21 @@ struct packet_offload {
1979 struct list_head list; 1985 struct list_head list;
1980}; 1986};
1981 1987
1988struct udp_offload;
1989
1990struct udp_offload_callbacks {
1991 struct sk_buff **(*gro_receive)(struct sk_buff **head,
1992 struct sk_buff *skb,
1993 struct udp_offload *uoff);
1994 int (*gro_complete)(struct sk_buff *skb,
1995 int nhoff,
1996 struct udp_offload *uoff);
1997};
1998
1982struct udp_offload { 1999struct udp_offload {
1983 __be16 port; 2000 __be16 port;
1984 u8 ipproto; 2001 u8 ipproto;
1985 struct offload_callbacks callbacks; 2002 struct udp_offload_callbacks callbacks;
1986}; 2003};
1987 2004
1988/* often modified stats are per cpu, other are shared (netdev->stats) */ 2005/* often modified stats are per cpu, other are shared (netdev->stats) */
@@ -2041,6 +2058,7 @@ struct pcpu_sw_netstats {
2041#define NETDEV_RESEND_IGMP 0x0016 2058#define NETDEV_RESEND_IGMP 0x0016
2042#define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */ 2059#define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */
2043#define NETDEV_CHANGEINFODATA 0x0018 2060#define NETDEV_CHANGEINFODATA 0x0018
2061#define NETDEV_BONDING_INFO 0x0019
2044 2062
2045int register_netdevice_notifier(struct notifier_block *nb); 2063int register_netdevice_notifier(struct notifier_block *nb);
2046int unregister_netdevice_notifier(struct notifier_block *nb); 2064int unregister_netdevice_notifier(struct notifier_block *nb);
@@ -2303,6 +2321,21 @@ do { \
2303 compute_pseudo(skb, proto)); \ 2321 compute_pseudo(skb, proto)); \
2304} while (0) 2322} while (0)
2305 2323
2324static inline void skb_gro_remcsum_process(struct sk_buff *skb, void *ptr,
2325 int start, int offset)
2326{
2327 __wsum delta;
2328
2329 BUG_ON(!NAPI_GRO_CB(skb)->csum_valid);
2330
2331 delta = remcsum_adjust(ptr, NAPI_GRO_CB(skb)->csum, start, offset);
2332
2333 /* Adjust skb->csum since we changed the packet */
2334 skb->csum = csum_add(skb->csum, delta);
2335 NAPI_GRO_CB(skb)->csum = csum_add(NAPI_GRO_CB(skb)->csum, delta);
2336}
2337
2338
2306static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, 2339static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
2307 unsigned short type, 2340 unsigned short type,
2308 const void *daddr, const void *saddr, 2341 const void *daddr, const void *saddr,
@@ -3464,6 +3497,19 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
3464struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, 3497struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
3465 netdev_features_t features); 3498 netdev_features_t features);
3466 3499
3500struct netdev_bonding_info {
3501 ifslave slave;
3502 ifbond master;
3503};
3504
3505struct netdev_notifier_bonding_info {
3506 struct netdev_notifier_info info; /* must be first */
3507 struct netdev_bonding_info bonding_info;
3508};
3509
3510void netdev_bonding_info_change(struct net_device *dev,
3511 struct netdev_bonding_info *bonding_info);
3512
3467static inline 3513static inline
3468struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) 3514struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features)
3469{ 3515{
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 22af8f8f5802..685809835b5c 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -327,6 +327,8 @@ struct phy_c45_device_ids {
327 * c45_ids: 802.3-c45 Device Identifers if is_c45. 327 * c45_ids: 802.3-c45 Device Identifers if is_c45.
328 * is_c45: Set to true if this phy uses clause 45 addressing. 328 * is_c45: Set to true if this phy uses clause 45 addressing.
329 * is_internal: Set to true if this phy is internal to a MAC. 329 * is_internal: Set to true if this phy is internal to a MAC.
330 * has_fixups: Set to true if this phy has fixups/quirks.
331 * suspended: Set to true if this phy has been suspended successfully.
330 * state: state of the PHY for management purposes 332 * state: state of the PHY for management purposes
331 * dev_flags: Device-specific flags used by the PHY driver. 333 * dev_flags: Device-specific flags used by the PHY driver.
332 * addr: Bus address of PHY 334 * addr: Bus address of PHY
@@ -364,6 +366,7 @@ struct phy_device {
364 bool is_c45; 366 bool is_c45;
365 bool is_internal; 367 bool is_internal;
366 bool has_fixups; 368 bool has_fixups;
369 bool suspended;
367 370
368 enum phy_state state; 371 enum phy_state state;
369 372
@@ -565,6 +568,15 @@ struct phy_driver {
565 void (*write_mmd_indirect)(struct phy_device *dev, int ptrad, 568 void (*write_mmd_indirect)(struct phy_device *dev, int ptrad,
566 int devnum, int regnum, u32 val); 569 int devnum, int regnum, u32 val);
567 570
571 /* Get the size and type of the eeprom contained within a plug-in
572 * module */
573 int (*module_info)(struct phy_device *dev,
574 struct ethtool_modinfo *modinfo);
575
576 /* Get the eeprom information from the plug-in module */
577 int (*module_eeprom)(struct phy_device *dev,
578 struct ethtool_eeprom *ee, u8 *data);
579
568 struct device_driver driver; 580 struct device_driver driver;
569}; 581};
570#define to_phy_driver(d) container_of(d, struct phy_driver, driver) 582#define to_phy_driver(d) container_of(d, struct phy_driver, driver)
diff --git a/include/linux/platform_data/irda-sa11x0.h b/include/linux/platform_data/irda-sa11x0.h
new file mode 100644
index 000000000000..38f77b5e56cf
--- /dev/null
+++ b/include/linux/platform_data/irda-sa11x0.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/include/asm/mach/irda.h
3 *
4 * Copyright (C) 2004 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_ARM_MACH_IRDA_H
11#define __ASM_ARM_MACH_IRDA_H
12
13struct irda_platform_data {
14 int (*startup)(struct device *);
15 void (*shutdown)(struct device *);
16 int (*set_power)(struct device *, unsigned int state);
17 void (*set_speed)(struct device *, unsigned int speed);
18};
19
20#endif
diff --git a/include/linux/platform_data/st21nfca.h b/include/linux/platform_data/st21nfca.h
index 5087fff96d86..cc2bdafb0c69 100644
--- a/include/linux/platform_data/st21nfca.h
+++ b/include/linux/platform_data/st21nfca.h
@@ -26,6 +26,8 @@
26struct st21nfca_nfc_platform_data { 26struct st21nfca_nfc_platform_data {
27 unsigned int gpio_ena; 27 unsigned int gpio_ena;
28 unsigned int irq_polarity; 28 unsigned int irq_polarity;
29 bool is_ese_present;
30 bool is_uicc_present;
29}; 31};
30 32
31#endif /* _ST21NFCA_HCI_H_ */ 33#endif /* _ST21NFCA_HCI_H_ */
diff --git a/include/linux/platform_data/st21nfcb.h b/include/linux/platform_data/st21nfcb.h
index c3b432f5b63e..b023373d9874 100644
--- a/include/linux/platform_data/st21nfcb.h
+++ b/include/linux/platform_data/st21nfcb.h
@@ -19,8 +19,6 @@
19#ifndef _ST21NFCB_NCI_H_ 19#ifndef _ST21NFCB_NCI_H_
20#define _ST21NFCB_NCI_H_ 20#define _ST21NFCB_NCI_H_
21 21
22#include <linux/i2c.h>
23
24#define ST21NFCB_NCI_DRIVER_NAME "st21nfcb_nci" 22#define ST21NFCB_NCI_DRIVER_NAME "st21nfcb_nci"
25 23
26struct st21nfcb_nfc_platform_data { 24struct st21nfcb_nfc_platform_data {
@@ -28,4 +26,4 @@ struct st21nfcb_nfc_platform_data {
28 unsigned int irq_polarity; 26 unsigned int irq_polarity;
29}; 27};
30 28
31#endif /* _ST21NFCA_HCI_H_ */ 29#endif /* _ST21NFCB_NCI_H_ */
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
index b93fd89b2e5e..58851275fed9 100644
--- a/include/linux/rhashtable.h
+++ b/include/linux/rhashtable.h
@@ -18,16 +18,45 @@
18#ifndef _LINUX_RHASHTABLE_H 18#ifndef _LINUX_RHASHTABLE_H
19#define _LINUX_RHASHTABLE_H 19#define _LINUX_RHASHTABLE_H
20 20
21#include <linux/rculist.h> 21#include <linux/compiler.h>
22#include <linux/list_nulls.h>
23#include <linux/workqueue.h>
24#include <linux/mutex.h>
25
26/*
27 * The end of the chain is marked with a special nulls marks which has
28 * the following format:
29 *
30 * +-------+-----------------------------------------------------+-+
31 * | Base | Hash |1|
32 * +-------+-----------------------------------------------------+-+
33 *
34 * Base (4 bits) : Reserved to distinguish between multiple tables.
35 * Specified via &struct rhashtable_params.nulls_base.
36 * Hash (27 bits): Full hash (unmasked) of first element added to bucket
37 * 1 (1 bit) : Nulls marker (always set)
38 *
39 * The remaining bits of the next pointer remain unused for now.
40 */
41#define RHT_BASE_BITS 4
42#define RHT_HASH_BITS 27
43#define RHT_BASE_SHIFT RHT_HASH_BITS
22 44
23struct rhash_head { 45struct rhash_head {
24 struct rhash_head __rcu *next; 46 struct rhash_head __rcu *next;
25}; 47};
26 48
27#define INIT_HASH_HEAD(ptr) ((ptr)->next = NULL) 49/**
28 50 * struct bucket_table - Table of hash buckets
51 * @size: Number of hash buckets
52 * @locks_mask: Mask to apply before accessing locks[]
53 * @locks: Array of spinlocks protecting individual buckets
54 * @buckets: size * hash buckets
55 */
29struct bucket_table { 56struct bucket_table {
30 size_t size; 57 size_t size;
58 unsigned int locks_mask;
59 spinlock_t *locks;
31 struct rhash_head __rcu *buckets[]; 60 struct rhash_head __rcu *buckets[];
32}; 61};
33 62
@@ -45,11 +74,16 @@ struct rhashtable;
45 * @hash_rnd: Seed to use while hashing 74 * @hash_rnd: Seed to use while hashing
46 * @max_shift: Maximum number of shifts while expanding 75 * @max_shift: Maximum number of shifts while expanding
47 * @min_shift: Minimum number of shifts while shrinking 76 * @min_shift: Minimum number of shifts while shrinking
77 * @nulls_base: Base value to generate nulls marker
78 * @locks_mul: Number of bucket locks to allocate per cpu (default: 128)
48 * @hashfn: Function to hash key 79 * @hashfn: Function to hash key
49 * @obj_hashfn: Function to hash object 80 * @obj_hashfn: Function to hash object
50 * @grow_decision: If defined, may return true if table should expand 81 * @grow_decision: If defined, may return true if table should expand
51 * @shrink_decision: If defined, may return true if table should shrink 82 * @shrink_decision: If defined, may return true if table should shrink
52 * @mutex_is_held: Must return true if protecting mutex is held 83 *
84 * Note: when implementing the grow and shrink decision function, min/max
85 * shift must be enforced, otherwise, resizing watermarks they set may be
86 * useless.
53 */ 87 */
54struct rhashtable_params { 88struct rhashtable_params {
55 size_t nelem_hint; 89 size_t nelem_hint;
@@ -59,36 +93,95 @@ struct rhashtable_params {
59 u32 hash_rnd; 93 u32 hash_rnd;
60 size_t max_shift; 94 size_t max_shift;
61 size_t min_shift; 95 size_t min_shift;
96 u32 nulls_base;
97 size_t locks_mul;
62 rht_hashfn_t hashfn; 98 rht_hashfn_t hashfn;
63 rht_obj_hashfn_t obj_hashfn; 99 rht_obj_hashfn_t obj_hashfn;
64 bool (*grow_decision)(const struct rhashtable *ht, 100 bool (*grow_decision)(const struct rhashtable *ht,
65 size_t new_size); 101 size_t new_size);
66 bool (*shrink_decision)(const struct rhashtable *ht, 102 bool (*shrink_decision)(const struct rhashtable *ht,
67 size_t new_size); 103 size_t new_size);
68#ifdef CONFIG_PROVE_LOCKING
69 int (*mutex_is_held)(void *parent);
70 void *parent;
71#endif
72}; 104};
73 105
74/** 106/**
75 * struct rhashtable - Hash table handle 107 * struct rhashtable - Hash table handle
76 * @tbl: Bucket table 108 * @tbl: Bucket table
109 * @future_tbl: Table under construction during expansion/shrinking
77 * @nelems: Number of elements in table 110 * @nelems: Number of elements in table
78 * @shift: Current size (1 << shift) 111 * @shift: Current size (1 << shift)
79 * @p: Configuration parameters 112 * @p: Configuration parameters
113 * @run_work: Deferred worker to expand/shrink asynchronously
114 * @mutex: Mutex to protect current/future table swapping
115 * @walkers: List of active walkers
116 * @being_destroyed: True if table is set up for destruction
80 */ 117 */
81struct rhashtable { 118struct rhashtable {
82 struct bucket_table __rcu *tbl; 119 struct bucket_table __rcu *tbl;
83 size_t nelems; 120 struct bucket_table __rcu *future_tbl;
84 size_t shift; 121 atomic_t nelems;
122 atomic_t shift;
85 struct rhashtable_params p; 123 struct rhashtable_params p;
124 struct work_struct run_work;
125 struct mutex mutex;
126 struct list_head walkers;
127 bool being_destroyed;
128};
129
130/**
131 * struct rhashtable_walker - Hash table walker
132 * @list: List entry on list of walkers
133 * @resize: Resize event occured
134 */
135struct rhashtable_walker {
136 struct list_head list;
137 bool resize;
86}; 138};
87 139
140/**
141 * struct rhashtable_iter - Hash table iterator, fits into netlink cb
142 * @ht: Table to iterate through
143 * @p: Current pointer
144 * @walker: Associated rhashtable walker
145 * @slot: Current slot
146 * @skip: Number of entries to skip in slot
147 */
148struct rhashtable_iter {
149 struct rhashtable *ht;
150 struct rhash_head *p;
151 struct rhashtable_walker *walker;
152 unsigned int slot;
153 unsigned int skip;
154};
155
156static inline unsigned long rht_marker(const struct rhashtable *ht, u32 hash)
157{
158 return NULLS_MARKER(ht->p.nulls_base + hash);
159}
160
161#define INIT_RHT_NULLS_HEAD(ptr, ht, hash) \
162 ((ptr) = (typeof(ptr)) rht_marker(ht, hash))
163
164static inline bool rht_is_a_nulls(const struct rhash_head *ptr)
165{
166 return ((unsigned long) ptr & 1);
167}
168
169static inline unsigned long rht_get_nulls_value(const struct rhash_head *ptr)
170{
171 return ((unsigned long) ptr) >> 1;
172}
173
88#ifdef CONFIG_PROVE_LOCKING 174#ifdef CONFIG_PROVE_LOCKING
89int lockdep_rht_mutex_is_held(const struct rhashtable *ht); 175int lockdep_rht_mutex_is_held(struct rhashtable *ht);
176int lockdep_rht_bucket_is_held(const struct bucket_table *tbl, u32 hash);
90#else 177#else
91static inline int lockdep_rht_mutex_is_held(const struct rhashtable *ht) 178static inline int lockdep_rht_mutex_is_held(struct rhashtable *ht)
179{
180 return 1;
181}
182
183static inline int lockdep_rht_bucket_is_held(const struct bucket_table *tbl,
184 u32 hash)
92{ 185{
93 return 1; 186 return 1;
94} 187}
@@ -96,13 +189,8 @@ static inline int lockdep_rht_mutex_is_held(const struct rhashtable *ht)
96 189
97int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params); 190int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params);
98 191
99u32 rhashtable_hashfn(const struct rhashtable *ht, const void *key, u32 len);
100u32 rhashtable_obj_hashfn(const struct rhashtable *ht, void *ptr);
101
102void rhashtable_insert(struct rhashtable *ht, struct rhash_head *node); 192void rhashtable_insert(struct rhashtable *ht, struct rhash_head *node);
103bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *node); 193bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *node);
104void rhashtable_remove_pprev(struct rhashtable *ht, struct rhash_head *obj,
105 struct rhash_head __rcu **pprev);
106 194
107bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size); 195bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size);
108bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size); 196bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size);
@@ -110,11 +198,23 @@ bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size);
110int rhashtable_expand(struct rhashtable *ht); 198int rhashtable_expand(struct rhashtable *ht);
111int rhashtable_shrink(struct rhashtable *ht); 199int rhashtable_shrink(struct rhashtable *ht);
112 200
113void *rhashtable_lookup(const struct rhashtable *ht, const void *key); 201void *rhashtable_lookup(struct rhashtable *ht, const void *key);
114void *rhashtable_lookup_compare(const struct rhashtable *ht, u32 hash, 202void *rhashtable_lookup_compare(struct rhashtable *ht, const void *key,
115 bool (*compare)(void *, void *), void *arg); 203 bool (*compare)(void *, void *), void *arg);
116 204
117void rhashtable_destroy(const struct rhashtable *ht); 205bool rhashtable_lookup_insert(struct rhashtable *ht, struct rhash_head *obj);
206bool rhashtable_lookup_compare_insert(struct rhashtable *ht,
207 struct rhash_head *obj,
208 bool (*compare)(void *, void *),
209 void *arg);
210
211int rhashtable_walk_init(struct rhashtable *ht, struct rhashtable_iter *iter);
212void rhashtable_walk_exit(struct rhashtable_iter *iter);
213int rhashtable_walk_start(struct rhashtable_iter *iter) __acquires(RCU);
214void *rhashtable_walk_next(struct rhashtable_iter *iter);
215void rhashtable_walk_stop(struct rhashtable_iter *iter) __releases(RCU);
216
217void rhashtable_destroy(struct rhashtable *ht);
118 218
119#define rht_dereference(p, ht) \ 219#define rht_dereference(p, ht) \
120 rcu_dereference_protected(p, lockdep_rht_mutex_is_held(ht)) 220 rcu_dereference_protected(p, lockdep_rht_mutex_is_held(ht))
@@ -122,92 +222,146 @@ void rhashtable_destroy(const struct rhashtable *ht);
122#define rht_dereference_rcu(p, ht) \ 222#define rht_dereference_rcu(p, ht) \
123 rcu_dereference_check(p, lockdep_rht_mutex_is_held(ht)) 223 rcu_dereference_check(p, lockdep_rht_mutex_is_held(ht))
124 224
125#define rht_entry(ptr, type, member) container_of(ptr, type, member) 225#define rht_dereference_bucket(p, tbl, hash) \
126#define rht_entry_safe(ptr, type, member) \ 226 rcu_dereference_protected(p, lockdep_rht_bucket_is_held(tbl, hash))
127({ \ 227
128 typeof(ptr) __ptr = (ptr); \ 228#define rht_dereference_bucket_rcu(p, tbl, hash) \
129 __ptr ? rht_entry(__ptr, type, member) : NULL; \ 229 rcu_dereference_check(p, lockdep_rht_bucket_is_held(tbl, hash))
130})
131 230
132#define rht_next_entry_safe(pos, ht, member) \ 231#define rht_entry(tpos, pos, member) \
133({ \ 232 ({ tpos = container_of(pos, typeof(*tpos), member); 1; })
134 pos ? rht_entry_safe(rht_dereference((pos)->member.next, ht), \ 233
135 typeof(*(pos)), member) : NULL; \ 234/**
136}) 235 * rht_for_each_continue - continue iterating over hash chain
236 * @pos: the &struct rhash_head to use as a loop cursor.
237 * @head: the previous &struct rhash_head to continue from
238 * @tbl: the &struct bucket_table
239 * @hash: the hash value / bucket index
240 */
241#define rht_for_each_continue(pos, head, tbl, hash) \
242 for (pos = rht_dereference_bucket(head, tbl, hash); \
243 !rht_is_a_nulls(pos); \
244 pos = rht_dereference_bucket((pos)->next, tbl, hash))
137 245
138/** 246/**
139 * rht_for_each - iterate over hash chain 247 * rht_for_each - iterate over hash chain
140 * @pos: &struct rhash_head to use as a loop cursor. 248 * @pos: the &struct rhash_head to use as a loop cursor.
141 * @head: head of the hash chain (struct rhash_head *) 249 * @tbl: the &struct bucket_table
142 * @ht: pointer to your struct rhashtable 250 * @hash: the hash value / bucket index
143 */ 251 */
144#define rht_for_each(pos, head, ht) \ 252#define rht_for_each(pos, tbl, hash) \
145 for (pos = rht_dereference(head, ht); \ 253 rht_for_each_continue(pos, (tbl)->buckets[hash], tbl, hash)
146 pos; \ 254
147 pos = rht_dereference((pos)->next, ht)) 255/**
256 * rht_for_each_entry_continue - continue iterating over hash chain
257 * @tpos: the type * to use as a loop cursor.
258 * @pos: the &struct rhash_head to use as a loop cursor.
259 * @head: the previous &struct rhash_head to continue from
260 * @tbl: the &struct bucket_table
261 * @hash: the hash value / bucket index
262 * @member: name of the &struct rhash_head within the hashable struct.
263 */
264#define rht_for_each_entry_continue(tpos, pos, head, tbl, hash, member) \
265 for (pos = rht_dereference_bucket(head, tbl, hash); \
266 (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \
267 pos = rht_dereference_bucket((pos)->next, tbl, hash))
148 268
149/** 269/**
150 * rht_for_each_entry - iterate over hash chain of given type 270 * rht_for_each_entry - iterate over hash chain of given type
151 * @pos: type * to use as a loop cursor. 271 * @tpos: the type * to use as a loop cursor.
152 * @head: head of the hash chain (struct rhash_head *) 272 * @pos: the &struct rhash_head to use as a loop cursor.
153 * @ht: pointer to your struct rhashtable 273 * @tbl: the &struct bucket_table
154 * @member: name of the rhash_head within the hashable struct. 274 * @hash: the hash value / bucket index
275 * @member: name of the &struct rhash_head within the hashable struct.
155 */ 276 */
156#define rht_for_each_entry(pos, head, ht, member) \ 277#define rht_for_each_entry(tpos, pos, tbl, hash, member) \
157 for (pos = rht_entry_safe(rht_dereference(head, ht), \ 278 rht_for_each_entry_continue(tpos, pos, (tbl)->buckets[hash], \
158 typeof(*(pos)), member); \ 279 tbl, hash, member)
159 pos; \
160 pos = rht_next_entry_safe(pos, ht, member))
161 280
162/** 281/**
163 * rht_for_each_entry_safe - safely iterate over hash chain of given type 282 * rht_for_each_entry_safe - safely iterate over hash chain of given type
164 * @pos: type * to use as a loop cursor. 283 * @tpos: the type * to use as a loop cursor.
165 * @n: type * to use for temporary next object storage 284 * @pos: the &struct rhash_head to use as a loop cursor.
166 * @head: head of the hash chain (struct rhash_head *) 285 * @next: the &struct rhash_head to use as next in loop cursor.
167 * @ht: pointer to your struct rhashtable 286 * @tbl: the &struct bucket_table
168 * @member: name of the rhash_head within the hashable struct. 287 * @hash: the hash value / bucket index
288 * @member: name of the &struct rhash_head within the hashable struct.
169 * 289 *
170 * This hash chain list-traversal primitive allows for the looped code to 290 * This hash chain list-traversal primitive allows for the looped code to
171 * remove the loop cursor from the list. 291 * remove the loop cursor from the list.
172 */ 292 */
173#define rht_for_each_entry_safe(pos, n, head, ht, member) \ 293#define rht_for_each_entry_safe(tpos, pos, next, tbl, hash, member) \
174 for (pos = rht_entry_safe(rht_dereference(head, ht), \ 294 for (pos = rht_dereference_bucket((tbl)->buckets[hash], tbl, hash), \
175 typeof(*(pos)), member), \ 295 next = !rht_is_a_nulls(pos) ? \
176 n = rht_next_entry_safe(pos, ht, member); \ 296 rht_dereference_bucket(pos->next, tbl, hash) : NULL; \
177 pos; \ 297 (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \
178 pos = n, \ 298 pos = next, \
179 n = rht_next_entry_safe(pos, ht, member)) 299 next = !rht_is_a_nulls(pos) ? \
300 rht_dereference_bucket(pos->next, tbl, hash) : NULL)
301
302/**
303 * rht_for_each_rcu_continue - continue iterating over rcu hash chain
304 * @pos: the &struct rhash_head to use as a loop cursor.
305 * @head: the previous &struct rhash_head to continue from
306 * @tbl: the &struct bucket_table
307 * @hash: the hash value / bucket index
308 *
309 * This hash chain list-traversal primitive may safely run concurrently with
310 * the _rcu mutation primitives such as rhashtable_insert() as long as the
311 * traversal is guarded by rcu_read_lock().
312 */
313#define rht_for_each_rcu_continue(pos, head, tbl, hash) \
314 for (({barrier(); }), \
315 pos = rht_dereference_bucket_rcu(head, tbl, hash); \
316 !rht_is_a_nulls(pos); \
317 pos = rcu_dereference_raw(pos->next))
180 318
181/** 319/**
182 * rht_for_each_rcu - iterate over rcu hash chain 320 * rht_for_each_rcu - iterate over rcu hash chain
183 * @pos: &struct rhash_head to use as a loop cursor. 321 * @pos: the &struct rhash_head to use as a loop cursor.
184 * @head: head of the hash chain (struct rhash_head *) 322 * @tbl: the &struct bucket_table
185 * @ht: pointer to your struct rhashtable 323 * @hash: the hash value / bucket index
324 *
325 * This hash chain list-traversal primitive may safely run concurrently with
326 * the _rcu mutation primitives such as rhashtable_insert() as long as the
327 * traversal is guarded by rcu_read_lock().
328 */
329#define rht_for_each_rcu(pos, tbl, hash) \
330 rht_for_each_rcu_continue(pos, (tbl)->buckets[hash], tbl, hash)
331
332/**
333 * rht_for_each_entry_rcu_continue - continue iterating over rcu hash chain
334 * @tpos: the type * to use as a loop cursor.
335 * @pos: the &struct rhash_head to use as a loop cursor.
336 * @head: the previous &struct rhash_head to continue from
337 * @tbl: the &struct bucket_table
338 * @hash: the hash value / bucket index
339 * @member: name of the &struct rhash_head within the hashable struct.
186 * 340 *
187 * This hash chain list-traversal primitive may safely run concurrently with 341 * This hash chain list-traversal primitive may safely run concurrently with
188 * the _rcu fkht mutation primitives such as rht_insert() as long as the 342 * the _rcu mutation primitives such as rhashtable_insert() as long as the
189 * traversal is guarded by rcu_read_lock(). 343 * traversal is guarded by rcu_read_lock().
190 */ 344 */
191#define rht_for_each_rcu(pos, head, ht) \ 345#define rht_for_each_entry_rcu_continue(tpos, pos, head, tbl, hash, member) \
192 for (pos = rht_dereference_rcu(head, ht); \ 346 for (({barrier(); }), \
193 pos; \ 347 pos = rht_dereference_bucket_rcu(head, tbl, hash); \
194 pos = rht_dereference_rcu((pos)->next, ht)) 348 (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \
349 pos = rht_dereference_bucket_rcu(pos->next, tbl, hash))
195 350
196/** 351/**
197 * rht_for_each_entry_rcu - iterate over rcu hash chain of given type 352 * rht_for_each_entry_rcu - iterate over rcu hash chain of given type
198 * @pos: type * to use as a loop cursor. 353 * @tpos: the type * to use as a loop cursor.
199 * @head: head of the hash chain (struct rhash_head *) 354 * @pos: the &struct rhash_head to use as a loop cursor.
200 * @member: name of the rhash_head within the hashable struct. 355 * @tbl: the &struct bucket_table
356 * @hash: the hash value / bucket index
357 * @member: name of the &struct rhash_head within the hashable struct.
201 * 358 *
202 * This hash chain list-traversal primitive may safely run concurrently with 359 * This hash chain list-traversal primitive may safely run concurrently with
203 * the _rcu fkht mutation primitives such as rht_insert() as long as the 360 * the _rcu mutation primitives such as rhashtable_insert() as long as the
204 * traversal is guarded by rcu_read_lock(). 361 * traversal is guarded by rcu_read_lock().
205 */ 362 */
206#define rht_for_each_entry_rcu(pos, head, member) \ 363#define rht_for_each_entry_rcu(tpos, pos, tbl, hash, member) \
207 for (pos = rht_entry_safe(rcu_dereference_raw(head), \ 364 rht_for_each_entry_rcu_continue(tpos, pos, (tbl)->buckets[hash],\
208 typeof(*(pos)), member); \ 365 tbl, hash, member)
209 pos; \
210 pos = rht_entry_safe(rcu_dereference_raw((pos)->member.next), \
211 typeof(*(pos)), member))
212 366
213#endif /* _LINUX_RHASHTABLE_H */ 367#endif /* _LINUX_RHASHTABLE_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 85ab7d72b54c..1bb36edb66b9 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -626,8 +626,11 @@ struct sk_buff {
626 __u32 hash; 626 __u32 hash;
627 __be16 vlan_proto; 627 __be16 vlan_proto;
628 __u16 vlan_tci; 628 __u16 vlan_tci;
629#ifdef CONFIG_NET_RX_BUSY_POLL 629#if defined(CONFIG_NET_RX_BUSY_POLL) || defined(CONFIG_XPS)
630 unsigned int napi_id; 630 union {
631 unsigned int napi_id;
632 unsigned int sender_cpu;
633 };
631#endif 634#endif
632#ifdef CONFIG_NETWORK_SECMARK 635#ifdef CONFIG_NETWORK_SECMARK
633 __u32 secmark; 636 __u32 secmark;
@@ -2484,19 +2487,18 @@ static inline int skb_put_padto(struct sk_buff *skb, unsigned int len)
2484} 2487}
2485 2488
2486static inline int skb_add_data(struct sk_buff *skb, 2489static inline int skb_add_data(struct sk_buff *skb,
2487 char __user *from, int copy) 2490 struct iov_iter *from, int copy)
2488{ 2491{
2489 const int off = skb->len; 2492 const int off = skb->len;
2490 2493
2491 if (skb->ip_summed == CHECKSUM_NONE) { 2494 if (skb->ip_summed == CHECKSUM_NONE) {
2492 int err = 0; 2495 __wsum csum = 0;
2493 __wsum csum = csum_and_copy_from_user(from, skb_put(skb, copy), 2496 if (csum_and_copy_from_iter(skb_put(skb, copy), copy,
2494 copy, 0, &err); 2497 &csum, from) == copy) {
2495 if (!err) {
2496 skb->csum = csum_block_add(skb->csum, csum, off); 2498 skb->csum = csum_block_add(skb->csum, csum, off);
2497 return 0; 2499 return 0;
2498 } 2500 }
2499 } else if (!copy_from_user(skb_put(skb, copy), from, copy)) 2501 } else if (copy_from_iter(skb_put(skb, copy), copy, from) == copy)
2500 return 0; 2502 return 0;
2501 2503
2502 __skb_trim(skb, off); 2504 __skb_trim(skb, off);
@@ -2693,8 +2695,7 @@ int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci);
2693 2695
2694static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) 2696static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len)
2695{ 2697{
2696 /* XXX: stripping const */ 2698 return copy_from_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT;
2697 return memcpy_fromiovec(data, (struct iovec *)msg->msg_iter.iov, len);
2698} 2699}
2699 2700
2700static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len) 2701static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len)
@@ -3071,7 +3072,7 @@ static inline __wsum null_compute_pseudo(struct sk_buff *skb, int proto)
3071 3072
3072#define skb_checksum_validate_zero_check(skb, proto, check, \ 3073#define skb_checksum_validate_zero_check(skb, proto, check, \
3073 compute_pseudo) \ 3074 compute_pseudo) \
3074 __skb_checksum_validate_(skb, proto, true, true, check, compute_pseudo) 3075 __skb_checksum_validate(skb, proto, true, true, check, compute_pseudo)
3075 3076
3076#define skb_checksum_simple_validate(skb) \ 3077#define skb_checksum_simple_validate(skb) \
3077 __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo) 3078 __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo)
@@ -3096,6 +3097,27 @@ do { \
3096 compute_pseudo(skb, proto)); \ 3097 compute_pseudo(skb, proto)); \
3097} while (0) 3098} while (0)
3098 3099
3100/* Update skbuf and packet to reflect the remote checksum offload operation.
3101 * When called, ptr indicates the starting point for skb->csum when
3102 * ip_summed is CHECKSUM_COMPLETE. If we need create checksum complete
3103 * here, skb_postpull_rcsum is done so skb->csum start is ptr.
3104 */
3105static inline void skb_remcsum_process(struct sk_buff *skb, void *ptr,
3106 int start, int offset)
3107{
3108 __wsum delta;
3109
3110 if (unlikely(skb->ip_summed != CHECKSUM_COMPLETE)) {
3111 __skb_checksum_complete(skb);
3112 skb_postpull_rcsum(skb, skb->data, ptr - (void *)skb->data);
3113 }
3114
3115 delta = remcsum_adjust(ptr, skb->csum, start, offset);
3116
3117 /* Adjust skb->csum since we changed the packet */
3118 skb->csum = csum_add(skb->csum, delta);
3119}
3120
3099#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 3121#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
3100void nf_conntrack_destroy(struct nf_conntrack *nfct); 3122void nf_conntrack_destroy(struct nf_conntrack *nfct);
3101static inline void nf_conntrack_put(struct nf_conntrack *nfct) 3123static inline void nf_conntrack_put(struct nf_conntrack *nfct)
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 6e49a14365dc..5c19cba34dce 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -318,13 +318,6 @@ struct ucred {
318/* IPX options */ 318/* IPX options */
319#define IPX_TYPE 1 319#define IPX_TYPE 1
320 320
321extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
322 struct iovec *iov,
323 int offset,
324 unsigned int len, __wsum *csump);
325extern unsigned long iov_pages(const struct iovec *iov, int offset,
326 unsigned long nr_segs);
327
328extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr); 321extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr);
329extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); 322extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
330 323
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 262ba4ef9a8e..3e18379dfa6f 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -190,6 +190,8 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock)
190#ifdef CONFIG_DEBUG_LOCK_ALLOC 190#ifdef CONFIG_DEBUG_LOCK_ALLOC
191# define raw_spin_lock_nested(lock, subclass) \ 191# define raw_spin_lock_nested(lock, subclass) \
192 _raw_spin_lock_nested(lock, subclass) 192 _raw_spin_lock_nested(lock, subclass)
193# define raw_spin_lock_bh_nested(lock, subclass) \
194 _raw_spin_lock_bh_nested(lock, subclass)
193 195
194# define raw_spin_lock_nest_lock(lock, nest_lock) \ 196# define raw_spin_lock_nest_lock(lock, nest_lock) \
195 do { \ 197 do { \
@@ -205,6 +207,7 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock)
205# define raw_spin_lock_nested(lock, subclass) \ 207# define raw_spin_lock_nested(lock, subclass) \
206 _raw_spin_lock(((void)(subclass), (lock))) 208 _raw_spin_lock(((void)(subclass), (lock)))
207# define raw_spin_lock_nest_lock(lock, nest_lock) _raw_spin_lock(lock) 209# define raw_spin_lock_nest_lock(lock, nest_lock) _raw_spin_lock(lock)
210# define raw_spin_lock_bh_nested(lock, subclass) _raw_spin_lock_bh(lock)
208#endif 211#endif
209 212
210#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) 213#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
@@ -324,6 +327,11 @@ do { \
324 raw_spin_lock_nested(spinlock_check(lock), subclass); \ 327 raw_spin_lock_nested(spinlock_check(lock), subclass); \
325} while (0) 328} while (0)
326 329
330#define spin_lock_bh_nested(lock, subclass) \
331do { \
332 raw_spin_lock_bh_nested(spinlock_check(lock), subclass);\
333} while (0)
334
327#define spin_lock_nest_lock(lock, nest_lock) \ 335#define spin_lock_nest_lock(lock, nest_lock) \
328do { \ 336do { \
329 raw_spin_lock_nest_lock(spinlock_check(lock), nest_lock); \ 337 raw_spin_lock_nest_lock(spinlock_check(lock), nest_lock); \
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h
index 42dfab89e740..5344268e6e62 100644
--- a/include/linux/spinlock_api_smp.h
+++ b/include/linux/spinlock_api_smp.h
@@ -22,6 +22,8 @@ int in_lock_functions(unsigned long addr);
22void __lockfunc _raw_spin_lock(raw_spinlock_t *lock) __acquires(lock); 22void __lockfunc _raw_spin_lock(raw_spinlock_t *lock) __acquires(lock);
23void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass) 23void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass)
24 __acquires(lock); 24 __acquires(lock);
25void __lockfunc _raw_spin_lock_bh_nested(raw_spinlock_t *lock, int subclass)
26 __acquires(lock);
25void __lockfunc 27void __lockfunc
26_raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map) 28_raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map)
27 __acquires(lock); 29 __acquires(lock);
diff --git a/include/linux/spinlock_api_up.h b/include/linux/spinlock_api_up.h
index d0d188861ad6..d3afef9d8dbe 100644
--- a/include/linux/spinlock_api_up.h
+++ b/include/linux/spinlock_api_up.h
@@ -57,6 +57,7 @@
57 57
58#define _raw_spin_lock(lock) __LOCK(lock) 58#define _raw_spin_lock(lock) __LOCK(lock)
59#define _raw_spin_lock_nested(lock, subclass) __LOCK(lock) 59#define _raw_spin_lock_nested(lock, subclass) __LOCK(lock)
60#define _raw_spin_lock_bh_nested(lock, subclass) __LOCK(lock)
60#define _raw_read_lock(lock) __LOCK(lock) 61#define _raw_read_lock(lock) __LOCK(lock)
61#define _raw_write_lock(lock) __LOCK(lock) 62#define _raw_write_lock(lock) __LOCK(lock)
62#define _raw_spin_lock_bh(lock) __LOCK_BH(lock) 63#define _raw_spin_lock_bh(lock) __LOCK_BH(lock)
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index f7b9100686c3..c0f707ac192b 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -173,6 +173,7 @@
173#define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16)) 173#define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16))
174#define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16)) 174#define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16))
175#define SSB_SPROMSIZE_WORDS_R10 230 175#define SSB_SPROMSIZE_WORDS_R10 230
176#define SSB_SPROMSIZE_WORDS_R11 234
176#define SSB_SPROM_BASE1 0x1000 177#define SSB_SPROM_BASE1 0x1000
177#define SSB_SPROM_BASE31 0x0800 178#define SSB_SPROM_BASE31 0x0800
178#define SSB_SPROM_REVISION 0x007E 179#define SSB_SPROM_REVISION 0x007E
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 67309ece0772..1a7adb411647 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -115,6 +115,7 @@ struct tcp_request_sock {
115 u32 rcv_isn; 115 u32 rcv_isn;
116 u32 snt_isn; 116 u32 snt_isn;
117 u32 snt_synack; /* synack sent time */ 117 u32 snt_synack; /* synack sent time */
118 u32 last_oow_ack_time; /* last SYNACK */
118 u32 rcv_nxt; /* the ack # by SYNACK. For 119 u32 rcv_nxt; /* the ack # by SYNACK. For
119 * FastOpen it's the seq# 120 * FastOpen it's the seq#
120 * after data-in-SYN. 121 * after data-in-SYN.
@@ -152,6 +153,7 @@ struct tcp_sock {
152 u32 snd_sml; /* Last byte of the most recently transmitted small packet */ 153 u32 snd_sml; /* Last byte of the most recently transmitted small packet */
153 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ 154 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */
154 u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ 155 u32 lsndtime; /* timestamp of last sent data packet (for restart window) */
156 u32 last_oow_ack_time; /* timestamp of last out-of-window ACK */
155 157
156 u32 tsoffset; /* timestamp offset */ 158 u32 tsoffset; /* timestamp offset */
157 159
@@ -340,6 +342,10 @@ struct tcp_timewait_sock {
340 u32 tw_rcv_wnd; 342 u32 tw_rcv_wnd;
341 u32 tw_ts_offset; 343 u32 tw_ts_offset;
342 u32 tw_ts_recent; 344 u32 tw_ts_recent;
345
346 /* The time we sent the last out-of-window ACK: */
347 u32 tw_last_oow_ack_time;
348
343 long tw_ts_recent_stamp; 349 long tw_ts_recent_stamp;
344#ifdef CONFIG_TCP_MD5SIG 350#ifdef CONFIG_TCP_MD5SIG
345 struct tcp_md5sig_key *tw_md5_key; 351 struct tcp_md5sig_key *tw_md5_key;
diff --git a/include/linux/timecounter.h b/include/linux/timecounter.h
new file mode 100644
index 000000000000..4382035a75bb
--- /dev/null
+++ b/include/linux/timecounter.h
@@ -0,0 +1,139 @@
1/*
2 * linux/include/linux/timecounter.h
3 *
4 * based on code that migrated away from
5 * linux/include/linux/clocksource.h
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17#ifndef _LINUX_TIMECOUNTER_H
18#define _LINUX_TIMECOUNTER_H
19
20#include <linux/types.h>
21
22/* simplify initialization of mask field */
23#define CYCLECOUNTER_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
24
25/**
26 * struct cyclecounter - hardware abstraction for a free running counter
27 * Provides completely state-free accessors to the underlying hardware.
28 * Depending on which hardware it reads, the cycle counter may wrap
29 * around quickly. Locking rules (if necessary) have to be defined
30 * by the implementor and user of specific instances of this API.
31 *
32 * @read: returns the current cycle value
33 * @mask: bitmask for two's complement
34 * subtraction of non 64 bit counters,
35 * see CYCLECOUNTER_MASK() helper macro
36 * @mult: cycle to nanosecond multiplier
37 * @shift: cycle to nanosecond divisor (power of two)
38 */
39struct cyclecounter {
40 cycle_t (*read)(const struct cyclecounter *cc);
41 cycle_t mask;
42 u32 mult;
43 u32 shift;
44};
45
46/**
47 * struct timecounter - layer above a %struct cyclecounter which counts nanoseconds
48 * Contains the state needed by timecounter_read() to detect
49 * cycle counter wrap around. Initialize with
50 * timecounter_init(). Also used to convert cycle counts into the
51 * corresponding nanosecond counts with timecounter_cyc2time(). Users
52 * of this code are responsible for initializing the underlying
53 * cycle counter hardware, locking issues and reading the time
54 * more often than the cycle counter wraps around. The nanosecond
55 * counter will only wrap around after ~585 years.
56 *
57 * @cc: the cycle counter used by this instance
58 * @cycle_last: most recent cycle counter value seen by
59 * timecounter_read()
60 * @nsec: continuously increasing count
61 * @mask: bit mask for maintaining the 'frac' field
62 * @frac: accumulated fractional nanoseconds
63 */
64struct timecounter {
65 const struct cyclecounter *cc;
66 cycle_t cycle_last;
67 u64 nsec;
68 u64 mask;
69 u64 frac;
70};
71
72/**
73 * cyclecounter_cyc2ns - converts cycle counter cycles to nanoseconds
74 * @cc: Pointer to cycle counter.
75 * @cycles: Cycles
76 * @mask: bit mask for maintaining the 'frac' field
77 * @frac: pointer to storage for the fractional nanoseconds.
78 */
79static inline u64 cyclecounter_cyc2ns(const struct cyclecounter *cc,
80 cycle_t cycles, u64 mask, u64 *frac)
81{
82 u64 ns = (u64) cycles;
83
84 ns = (ns * cc->mult) + *frac;
85 *frac = ns & mask;
86 return ns >> cc->shift;
87}
88
89/**
90 * timecounter_adjtime - Shifts the time of the clock.
91 * @delta: Desired change in nanoseconds.
92 */
93static inline void timecounter_adjtime(struct timecounter *tc, s64 delta)
94{
95 tc->nsec += delta;
96}
97
98/**
99 * timecounter_init - initialize a time counter
100 * @tc: Pointer to time counter which is to be initialized/reset
101 * @cc: A cycle counter, ready to be used.
102 * @start_tstamp: Arbitrary initial time stamp.
103 *
104 * After this call the current cycle register (roughly) corresponds to
105 * the initial time stamp. Every call to timecounter_read() increments
106 * the time stamp counter by the number of elapsed nanoseconds.
107 */
108extern void timecounter_init(struct timecounter *tc,
109 const struct cyclecounter *cc,
110 u64 start_tstamp);
111
112/**
113 * timecounter_read - return nanoseconds elapsed since timecounter_init()
114 * plus the initial time stamp
115 * @tc: Pointer to time counter.
116 *
117 * In other words, keeps track of time since the same epoch as
118 * the function which generated the initial time stamp.
119 */
120extern u64 timecounter_read(struct timecounter *tc);
121
122/**
123 * timecounter_cyc2time - convert a cycle counter to same
124 * time base as values returned by
125 * timecounter_read()
126 * @tc: Pointer to time counter.
127 * @cycle_tstamp: a value returned by tc->cc->read()
128 *
129 * Cycle counts that are converted correctly as long as they
130 * fall into the interval [-1/2 max cycle count, +1/2 max cycle count],
131 * with "max cycle count" == cs->mask+1.
132 *
133 * This allows conversion of cycle counter values which were generated
134 * in the past.
135 */
136extern u64 timecounter_cyc2time(struct timecounter *tc,
137 cycle_t cycle_tstamp);
138
139#endif
diff --git a/include/linux/types.h b/include/linux/types.h
index a0bb7048687f..62323825cff9 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -213,5 +213,8 @@ struct callback_head {
213}; 213};
214#define rcu_head callback_head 214#define rcu_head callback_head
215 215
216/* clocksource cycle base type */
217typedef u64 cycle_t;
218
216#endif /* __ASSEMBLY__ */ 219#endif /* __ASSEMBLY__ */
217#endif /* _LINUX_TYPES_H */ 220#endif /* _LINUX_TYPES_H */
diff --git a/include/linux/udp.h b/include/linux/udp.h
index ee3277593222..247cfdcc4b08 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -49,11 +49,7 @@ struct udp_sock {
49 unsigned int corkflag; /* Cork is required */ 49 unsigned int corkflag; /* Cork is required */
50 __u8 encap_type; /* Is this an Encapsulation socket? */ 50 __u8 encap_type; /* Is this an Encapsulation socket? */
51 unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */ 51 unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */
52 no_check6_rx:1,/* Allow zero UDP6 checksums on RX? */ 52 no_check6_rx:1;/* Allow zero UDP6 checksums on RX? */
53 convert_csum:1;/* On receive, convert checksum
54 * unnecessary to checksum complete
55 * if possible.
56 */
57 /* 53 /*
58 * Following member retains the information to create a UDP header 54 * Following member retains the information to create a UDP header
59 * when the socket is uncorked. 55 * when the socket is uncorked.
@@ -102,16 +98,6 @@ static inline bool udp_get_no_check6_rx(struct sock *sk)
102 return udp_sk(sk)->no_check6_rx; 98 return udp_sk(sk)->no_check6_rx;
103} 99}
104 100
105static inline void udp_set_convert_csum(struct sock *sk, bool val)
106{
107 udp_sk(sk)->convert_csum = val;
108}
109
110static inline bool udp_get_convert_csum(struct sock *sk)
111{
112 return udp_sk(sk)->convert_csum;
113}
114
115#define udp_portaddr_for_each_entry(__sk, node, list) \ 101#define udp_portaddr_for_each_entry(__sk, node, list) \
116 hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) 102 hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node)
117 103
diff --git a/include/linux/uio.h b/include/linux/uio.h
index 1c5e453f7ea9..3e0cb4ea3905 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -135,10 +135,4 @@ static inline void iov_iter_reexpand(struct iov_iter *i, size_t count)
135size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); 135size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
136size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); 136size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
137 137
138int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
139int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
140 int offset, int len);
141int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,
142 int offset, int len);
143
144#endif 138#endif
diff --git a/include/linux/vmw_vmci_api.h b/include/linux/vmw_vmci_api.h
index 5691f752ce8f..63df3a2a8ce5 100644
--- a/include/linux/vmw_vmci_api.h
+++ b/include/linux/vmw_vmci_api.h
@@ -74,7 +74,7 @@ ssize_t vmci_qpair_dequeue(struct vmci_qp *qpair,
74ssize_t vmci_qpair_peek(struct vmci_qp *qpair, void *buf, size_t buf_size, 74ssize_t vmci_qpair_peek(struct vmci_qp *qpair, void *buf, size_t buf_size,
75 int mode); 75 int mode);
76ssize_t vmci_qpair_enquev(struct vmci_qp *qpair, 76ssize_t vmci_qpair_enquev(struct vmci_qp *qpair,
77 void *iov, size_t iov_size, int mode); 77 struct msghdr *msg, size_t iov_size, int mode);
78ssize_t vmci_qpair_dequev(struct vmci_qp *qpair, 78ssize_t vmci_qpair_dequev(struct vmci_qp *qpair,
79 struct msghdr *msg, size_t iov_size, int mode); 79 struct msghdr *msg, size_t iov_size, int mode);
80ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, struct msghdr *msg, size_t iov_size, 80ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, struct msghdr *msg, size_t iov_size,
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index d13573bb879e..80456f72d70a 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -62,6 +62,9 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg);
62 62
63int ipv6_chk_addr(struct net *net, const struct in6_addr *addr, 63int ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
64 const struct net_device *dev, int strict); 64 const struct net_device *dev, int strict);
65int ipv6_chk_addr_and_flags(struct net *net, const struct in6_addr *addr,
66 const struct net_device *dev, int strict,
67 u32 banned_flags);
65 68
66#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) 69#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
67int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr); 70int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr);
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 58695ffeb138..e00455aab18c 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -273,7 +273,7 @@ struct l2cap_ctrl {
273 273
274struct hci_dev; 274struct hci_dev;
275 275
276typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status); 276typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode);
277 277
278struct hci_req_ctrl { 278struct hci_req_ctrl {
279 bool start; 279 bool start;
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 40129b3838b2..8e54f825153c 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -102,6 +102,28 @@ enum {
102 */ 102 */
103 HCI_QUIRK_FIXUP_BUFFER_SIZE, 103 HCI_QUIRK_FIXUP_BUFFER_SIZE,
104 104
105 /* When this quirk is set, then a controller that does not
106 * indicate support for Inquiry Result with RSSI is assumed to
107 * support it anyway. Some early Bluetooth 1.2 controllers had
108 * wrongly configured local features that will require forcing
109 * them to enable this mode. Getting RSSI information with the
110 * inquiry responses is preferred since it allows for a better
111 * user expierence.
112 *
113 * This quirk must be set before hci_register_dev is called.
114 */
115 HCI_QUIRK_FIXUP_INQUIRY_MODE,
116
117 /* When this quirk is set, then the HCI Read Local Supported
118 * Commands command is not supported. In general Bluetooth 1.2
119 * and later controllers should support this command. However
120 * some controllers indicate Bluetooth 1.2 support, but do
121 * not support this command.
122 *
123 * This quirk must be set before hci_register_dev is called.
124 */
125 HCI_QUIRK_BROKEN_LOCAL_COMMANDS,
126
105 /* When this quirk is set, then no stored link key handling 127 /* When this quirk is set, then no stored link key handling
106 * is performed. This is mainly due to the fact that the 128 * is performed. This is mainly due to the fact that the
107 * HCI Delete Stored Link Key command is advertised, but 129 * HCI Delete Stored Link Key command is advertised, but
@@ -162,8 +184,7 @@ enum {
162 */ 184 */
163enum { 185enum {
164 HCI_DUT_MODE, 186 HCI_DUT_MODE,
165 HCI_FORCE_SC, 187 HCI_FORCE_BREDR_SMP,
166 HCI_FORCE_LESC,
167 HCI_FORCE_STATIC_ADDR, 188 HCI_FORCE_STATIC_ADDR,
168}; 189};
169 190
@@ -343,6 +364,7 @@ enum {
343#define HCI_LE_ENCRYPTION 0x01 364#define HCI_LE_ENCRYPTION 0x01
344#define HCI_LE_CONN_PARAM_REQ_PROC 0x02 365#define HCI_LE_CONN_PARAM_REQ_PROC 0x02
345#define HCI_LE_PING 0x10 366#define HCI_LE_PING 0x10
367#define HCI_LE_DATA_LEN_EXT 0x20
346#define HCI_LE_EXT_SCAN_POLICY 0x80 368#define HCI_LE_EXT_SCAN_POLICY 0x80
347 369
348/* Connection modes */ 370/* Connection modes */
@@ -833,11 +855,26 @@ struct hci_cp_set_event_flt {
833#define HCI_CONN_SETUP_AUTO_OFF 0x01 855#define HCI_CONN_SETUP_AUTO_OFF 0x01
834#define HCI_CONN_SETUP_AUTO_ON 0x02 856#define HCI_CONN_SETUP_AUTO_ON 0x02
835 857
858#define HCI_OP_READ_STORED_LINK_KEY 0x0c0d
859struct hci_cp_read_stored_link_key {
860 bdaddr_t bdaddr;
861 __u8 read_all;
862} __packed;
863struct hci_rp_read_stored_link_key {
864 __u8 status;
865 __u8 max_keys;
866 __u8 num_keys;
867} __packed;
868
836#define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 869#define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12
837struct hci_cp_delete_stored_link_key { 870struct hci_cp_delete_stored_link_key {
838 bdaddr_t bdaddr; 871 bdaddr_t bdaddr;
839 __u8 delete_all; 872 __u8 delete_all;
840} __packed; 873} __packed;
874struct hci_rp_delete_stored_link_key {
875 __u8 status;
876 __u8 num_keys;
877} __packed;
841 878
842#define HCI_MAX_NAME_LENGTH 248 879#define HCI_MAX_NAME_LENGTH 248
843 880
@@ -1371,6 +1408,39 @@ struct hci_cp_le_conn_param_req_neg_reply {
1371 __u8 reason; 1408 __u8 reason;
1372} __packed; 1409} __packed;
1373 1410
1411#define HCI_OP_LE_SET_DATA_LEN 0x2022
1412struct hci_cp_le_set_data_len {
1413 __le16 handle;
1414 __le16 tx_len;
1415 __le16 tx_time;
1416} __packed;
1417struct hci_rp_le_set_data_len {
1418 __u8 status;
1419 __le16 handle;
1420} __packed;
1421
1422#define HCI_OP_LE_READ_DEF_DATA_LEN 0x2023
1423struct hci_rp_le_read_def_data_len {
1424 __u8 status;
1425 __le16 tx_len;
1426 __le16 tx_time;
1427} __packed;
1428
1429#define HCI_OP_LE_WRITE_DEF_DATA_LEN 0x2024
1430struct hci_cp_le_write_def_data_len {
1431 __le16 tx_len;
1432 __le16 tx_time;
1433} __packed;
1434
1435#define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f
1436struct hci_rp_le_read_max_data_len {
1437 __u8 status;
1438 __le16 tx_len;
1439 __le16 tx_time;
1440 __le16 rx_len;
1441 __le16 rx_time;
1442} __packed;
1443
1374/* ---- HCI Events ---- */ 1444/* ---- HCI Events ---- */
1375#define HCI_EV_INQUIRY_COMPLETE 0x01 1445#define HCI_EV_INQUIRY_COMPLETE 0x01
1376 1446
@@ -1796,6 +1866,15 @@ struct hci_ev_le_remote_conn_param_req {
1796 __le16 timeout; 1866 __le16 timeout;
1797} __packed; 1867} __packed;
1798 1868
1869#define HCI_EV_LE_DATA_LEN_CHANGE 0x07
1870struct hci_ev_le_data_len_change {
1871 __le16 handle;
1872 __le16 tx_len;
1873 __le16 tx_time;
1874 __le16 rx_len;
1875 __le16 rx_time;
1876} __packed;
1877
1799#define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B 1878#define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B
1800struct hci_ev_le_direct_adv_info { 1879struct hci_ev_le_direct_adv_info {
1801 __u8 evt_type; 1880 __u8 evt_type;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 3c7827005c25..52863c3e0b13 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -79,6 +79,8 @@ struct discovery_state {
79 s8 rssi; 79 s8 rssi;
80 u16 uuid_count; 80 u16 uuid_count;
81 u8 (*uuids)[16]; 81 u8 (*uuids)[16];
82 unsigned long scan_start;
83 unsigned long scan_duration;
82}; 84};
83 85
84struct hci_conn_hash { 86struct hci_conn_hash {
@@ -145,6 +147,7 @@ struct oob_data {
145 struct list_head list; 147 struct list_head list;
146 bdaddr_t bdaddr; 148 bdaddr_t bdaddr;
147 u8 bdaddr_type; 149 u8 bdaddr_type;
150 u8 present;
148 u8 hash192[16]; 151 u8 hash192[16];
149 u8 rand192[16]; 152 u8 rand192[16];
150 u8 hash256[16]; 153 u8 hash256[16];
@@ -205,6 +208,8 @@ struct hci_dev {
205 __u16 lmp_subver; 208 __u16 lmp_subver;
206 __u16 voice_setting; 209 __u16 voice_setting;
207 __u8 num_iac; 210 __u8 num_iac;
211 __u8 stored_max_keys;
212 __u8 stored_num_keys;
208 __u8 io_capability; 213 __u8 io_capability;
209 __s8 inq_tx_power; 214 __s8 inq_tx_power;
210 __u16 page_scan_interval; 215 __u16 page_scan_interval;
@@ -220,10 +225,17 @@ struct hci_dev {
220 __u16 le_conn_max_interval; 225 __u16 le_conn_max_interval;
221 __u16 le_conn_latency; 226 __u16 le_conn_latency;
222 __u16 le_supv_timeout; 227 __u16 le_supv_timeout;
228 __u16 le_def_tx_len;
229 __u16 le_def_tx_time;
230 __u16 le_max_tx_len;
231 __u16 le_max_tx_time;
232 __u16 le_max_rx_len;
233 __u16 le_max_rx_time;
223 __u16 discov_interleaved_timeout; 234 __u16 discov_interleaved_timeout;
224 __u16 conn_info_min_age; 235 __u16 conn_info_min_age;
225 __u16 conn_info_max_age; 236 __u16 conn_info_max_age;
226 __u8 ssp_debug_mode; 237 __u8 ssp_debug_mode;
238 __u8 hw_error_code;
227 __u32 clock; 239 __u32 clock;
228 240
229 __u16 devid_source; 241 __u16 devid_source;
@@ -285,6 +297,7 @@ struct hci_dev {
285 297
286 struct work_struct power_on; 298 struct work_struct power_on;
287 struct delayed_work power_off; 299 struct delayed_work power_off;
300 struct work_struct error_reset;
288 301
289 __u16 discov_timeout; 302 __u16 discov_timeout;
290 struct delayed_work discov_off; 303 struct delayed_work discov_off;
@@ -343,6 +356,7 @@ struct hci_dev {
343 unsigned long dev_flags; 356 unsigned long dev_flags;
344 357
345 struct delayed_work le_scan_disable; 358 struct delayed_work le_scan_disable;
359 struct delayed_work le_scan_restart;
346 360
347 __s8 adv_tx_power; 361 __s8 adv_tx_power;
348 __u8 adv_data[HCI_MAX_AD_LENGTH]; 362 __u8 adv_data[HCI_MAX_AD_LENGTH];
@@ -361,6 +375,7 @@ struct hci_dev {
361 int (*setup)(struct hci_dev *hdev); 375 int (*setup)(struct hci_dev *hdev);
362 int (*send)(struct hci_dev *hdev, struct sk_buff *skb); 376 int (*send)(struct hci_dev *hdev, struct sk_buff *skb);
363 void (*notify)(struct hci_dev *hdev, unsigned int evt); 377 void (*notify)(struct hci_dev *hdev, unsigned int evt);
378 void (*hw_error)(struct hci_dev *hdev, u8 code);
364 int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr); 379 int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr);
365}; 380};
366 381
@@ -434,6 +449,7 @@ struct hci_conn {
434 struct delayed_work le_conn_timeout; 449 struct delayed_work le_conn_timeout;
435 450
436 struct device dev; 451 struct device dev;
452 struct dentry *debugfs;
437 453
438 struct hci_dev *hdev; 454 struct hci_dev *hdev;
439 void *l2cap_data; 455 void *l2cap_data;
@@ -518,6 +534,8 @@ static inline void hci_discovery_filter_clear(struct hci_dev *hdev)
518 hdev->discovery.uuid_count = 0; 534 hdev->discovery.uuid_count = 0;
519 kfree(hdev->discovery.uuids); 535 kfree(hdev->discovery.uuids);
520 hdev->discovery.uuids = NULL; 536 hdev->discovery.uuids = NULL;
537 hdev->discovery.scan_start = 0;
538 hdev->discovery.scan_duration = 0;
521} 539}
522 540
523bool hci_discovery_active(struct hci_dev *hdev); 541bool hci_discovery_active(struct hci_dev *hdev);
@@ -772,7 +790,6 @@ int hci_conn_check_link_mode(struct hci_conn *conn);
772int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); 790int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level);
773int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type, 791int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type,
774 bool initiator); 792 bool initiator);
775int hci_conn_change_link_key(struct hci_conn *conn);
776int hci_conn_switch_role(struct hci_conn *conn, __u8 role); 793int hci_conn_switch_role(struct hci_conn *conn, __u8 role);
777 794
778void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active); 795void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active);
@@ -920,8 +937,6 @@ struct hci_conn_params *hci_conn_params_lookup(struct hci_dev *hdev,
920 bdaddr_t *addr, u8 addr_type); 937 bdaddr_t *addr, u8 addr_type);
921struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev, 938struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev,
922 bdaddr_t *addr, u8 addr_type); 939 bdaddr_t *addr, u8 addr_type);
923int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
924 u8 auto_connect);
925void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type); 940void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type);
926void hci_conn_params_clear_all(struct hci_dev *hdev); 941void hci_conn_params_clear_all(struct hci_dev *hdev);
927void hci_conn_params_clear_disabled(struct hci_dev *hdev); 942void hci_conn_params_clear_disabled(struct hci_dev *hdev);
@@ -930,8 +945,6 @@ struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list,
930 bdaddr_t *addr, 945 bdaddr_t *addr,
931 u8 addr_type); 946 u8 addr_type);
932 947
933void hci_update_background_scan(struct hci_dev *hdev);
934
935void hci_uuids_clear(struct hci_dev *hdev); 948void hci_uuids_clear(struct hci_dev *hdev);
936 949
937void hci_link_keys_clear(struct hci_dev *hdev); 950void hci_link_keys_clear(struct hci_dev *hdev);
@@ -1014,8 +1027,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
1014 1027
1015#define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \ 1028#define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \
1016 !test_bit(HCI_AUTO_OFF, &hdev->dev_flags)) 1029 !test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
1017#define bredr_sc_enabled(dev) ((lmp_sc_capable(dev) || \ 1030#define bredr_sc_enabled(dev) (lmp_sc_capable(dev) && \
1018 test_bit(HCI_FORCE_SC, &(dev)->dbg_flags)) && \
1019 test_bit(HCI_SC_ENABLED, &(dev)->dev_flags)) 1031 test_bit(HCI_SC_ENABLED, &(dev)->dev_flags))
1020 1032
1021/* ----- HCI protocols ----- */ 1033/* ----- HCI protocols ----- */
@@ -1284,30 +1296,8 @@ static inline int hci_check_conn_params(u16 min, u16 max, u16 latency,
1284int hci_register_cb(struct hci_cb *hcb); 1296int hci_register_cb(struct hci_cb *hcb);
1285int hci_unregister_cb(struct hci_cb *hcb); 1297int hci_unregister_cb(struct hci_cb *hcb);
1286 1298
1287struct hci_request {
1288 struct hci_dev *hdev;
1289 struct sk_buff_head cmd_q;
1290
1291 /* If something goes wrong when building the HCI request, the error
1292 * value is stored in this field.
1293 */
1294 int err;
1295};
1296
1297void hci_req_init(struct hci_request *req, struct hci_dev *hdev);
1298int hci_req_run(struct hci_request *req, hci_req_complete_t complete);
1299void hci_req_add(struct hci_request *req, u16 opcode, u32 plen,
1300 const void *param);
1301void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen,
1302 const void *param, u8 event);
1303void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status);
1304bool hci_req_pending(struct hci_dev *hdev); 1299bool hci_req_pending(struct hci_dev *hdev);
1305 1300
1306void hci_req_add_le_scan_disable(struct hci_request *req);
1307void hci_req_add_le_passive_scan(struct hci_request *req);
1308
1309void hci_update_page_scan(struct hci_dev *hdev, struct hci_request *req);
1310
1311struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, 1301struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
1312 const void *param, u32 timeout); 1302 const void *param, u32 timeout);
1313struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen, 1303struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen,
@@ -1344,6 +1334,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event);
1344#define DISCOV_INTERLEAVED_TIMEOUT 5120 /* msec */ 1334#define DISCOV_INTERLEAVED_TIMEOUT 5120 /* msec */
1345#define DISCOV_INTERLEAVED_INQUIRY_LEN 0x04 1335#define DISCOV_INTERLEAVED_INQUIRY_LEN 0x04
1346#define DISCOV_BREDR_INQUIRY_LEN 0x08 1336#define DISCOV_BREDR_INQUIRY_LEN 0x08
1337#define DISCOV_LE_RESTART_DELAY msecs_to_jiffies(200) /* msec */
1347 1338
1348int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); 1339int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len);
1349int mgmt_new_settings(struct hci_dev *hdev); 1340int mgmt_new_settings(struct hci_dev *hdev);
@@ -1388,7 +1379,6 @@ int mgmt_user_passkey_notify(struct hci_dev *hdev, bdaddr_t *bdaddr,
1388void mgmt_auth_failed(struct hci_conn *conn, u8 status); 1379void mgmt_auth_failed(struct hci_conn *conn, u8 status);
1389void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status); 1380void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status);
1390void mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status); 1381void mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status);
1391void mgmt_sc_enable_complete(struct hci_dev *hdev, u8 enable, u8 status);
1392void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class, 1382void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class,
1393 u8 status); 1383 u8 status);
1394void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); 1384void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status);
@@ -1417,8 +1407,6 @@ u8 hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency,
1417void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand, 1407void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand,
1418 __u8 ltk[16]); 1408 __u8 ltk[16]);
1419 1409
1420int hci_update_random_address(struct hci_request *req, bool require_privacy,
1421 u8 *own_addr_type);
1422void hci_copy_identity_address(struct hci_dev *hdev, bdaddr_t *bdaddr, 1410void hci_copy_identity_address(struct hci_dev *hdev, bdaddr_t *bdaddr,
1423 u8 *bdaddr_type); 1411 u8 *bdaddr_type);
1424 1412
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index d1bb342d083f..2239a3753092 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -248,6 +248,7 @@ struct l2cap_conn_rsp {
248#define L2CAP_PSM_SDP 0x0001 248#define L2CAP_PSM_SDP 0x0001
249#define L2CAP_PSM_RFCOMM 0x0003 249#define L2CAP_PSM_RFCOMM 0x0003
250#define L2CAP_PSM_3DSP 0x0021 250#define L2CAP_PSM_3DSP 0x0021
251#define L2CAP_PSM_IPSP 0x0023 /* 6LoWPAN */
251 252
252/* channel identifier */ 253/* channel identifier */
253#define L2CAP_CID_SIGNALING 0x0001 254#define L2CAP_CID_SIGNALING 0x0001
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 95c34d5180fa..e218a30f2061 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -301,10 +301,6 @@ struct mgmt_cp_user_passkey_neg_reply {
301#define MGMT_OP_READ_LOCAL_OOB_DATA 0x0020 301#define MGMT_OP_READ_LOCAL_OOB_DATA 0x0020
302#define MGMT_READ_LOCAL_OOB_DATA_SIZE 0 302#define MGMT_READ_LOCAL_OOB_DATA_SIZE 0
303struct mgmt_rp_read_local_oob_data { 303struct mgmt_rp_read_local_oob_data {
304 __u8 hash[16];
305 __u8 rand[16];
306} __packed;
307struct mgmt_rp_read_local_oob_ext_data {
308 __u8 hash192[16]; 304 __u8 hash192[16];
309 __u8 rand192[16]; 305 __u8 rand192[16];
310 __u8 hash256[16]; 306 __u8 hash256[16];
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index 578b83127af1..4190af53a46a 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -24,8 +24,6 @@
24#ifndef __RFCOMM_H 24#ifndef __RFCOMM_H
25#define __RFCOMM_H 25#define __RFCOMM_H
26 26
27#define RFCOMM_PSM 3
28
29#define RFCOMM_CONN_TIMEOUT (HZ * 30) 27#define RFCOMM_CONN_TIMEOUT (HZ * 30)
30#define RFCOMM_DISC_TIMEOUT (HZ * 20) 28#define RFCOMM_DISC_TIMEOUT (HZ * 20)
31#define RFCOMM_AUTH_TIMEOUT (HZ * 25) 29#define RFCOMM_AUTH_TIMEOUT (HZ * 25)
diff --git a/include/net/bond_3ad.h b/include/net/bond_3ad.h
index e01d903633ef..f04cdbb7848e 100644
--- a/include/net/bond_3ad.h
+++ b/include/net/bond_3ad.h
@@ -274,7 +274,6 @@ void bond_3ad_handle_link_change(struct slave *slave, char link);
274int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); 274int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info);
275int __bond_3ad_get_active_agg_info(struct bonding *bond, 275int __bond_3ad_get_active_agg_info(struct bonding *bond,
276 struct ad_info *ad_info); 276 struct ad_info *ad_info);
277int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev);
278int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond, 277int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
279 struct slave *slave); 278 struct slave *slave);
280int bond_3ad_set_carrier(struct bonding *bond); 279int bond_3ad_set_carrier(struct bonding *bond);
diff --git a/include/net/bonding.h b/include/net/bonding.h
index 983a94b86b95..fda6feeb6c1f 100644
--- a/include/net/bonding.h
+++ b/include/net/bonding.h
@@ -150,6 +150,12 @@ struct bond_parm_tbl {
150 int mode; 150 int mode;
151}; 151};
152 152
153struct netdev_notify_work {
154 struct delayed_work work;
155 struct net_device *dev;
156 struct netdev_bonding_info bonding_info;
157};
158
153struct slave { 159struct slave {
154 struct net_device *dev; /* first - useful for panic debug */ 160 struct net_device *dev; /* first - useful for panic debug */
155 struct bonding *bond; /* our master */ 161 struct bonding *bond; /* our master */
@@ -243,6 +249,8 @@ struct bonding {
243#define bond_slave_get_rtnl(dev) \ 249#define bond_slave_get_rtnl(dev) \
244 ((struct slave *) rtnl_dereference(dev->rx_handler_data)) 250 ((struct slave *) rtnl_dereference(dev->rx_handler_data))
245 251
252void bond_queue_slave_event(struct slave *slave);
253
246struct bond_vlan_tag { 254struct bond_vlan_tag {
247 __be16 vlan_proto; 255 __be16 vlan_proto;
248 unsigned short vlan_id; 256 unsigned short vlan_id;
@@ -315,6 +323,7 @@ static inline void bond_set_active_slave(struct slave *slave)
315{ 323{
316 if (slave->backup) { 324 if (slave->backup) {
317 slave->backup = 0; 325 slave->backup = 0;
326 bond_queue_slave_event(slave);
318 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); 327 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC);
319 } 328 }
320} 329}
@@ -323,6 +332,7 @@ static inline void bond_set_backup_slave(struct slave *slave)
323{ 332{
324 if (!slave->backup) { 333 if (!slave->backup) {
325 slave->backup = 1; 334 slave->backup = 1;
335 bond_queue_slave_event(slave);
326 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); 336 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC);
327 } 337 }
328} 338}
@@ -336,6 +346,7 @@ static inline void bond_set_slave_state(struct slave *slave,
336 slave->backup = slave_state; 346 slave->backup = slave_state;
337 if (notify) { 347 if (notify) {
338 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); 348 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC);
349 bond_queue_slave_event(slave);
339 slave->should_notify = 0; 350 slave->should_notify = 0;
340 } else { 351 } else {
341 if (slave->should_notify) 352 if (slave->should_notify)
@@ -490,6 +501,12 @@ static inline bool bond_is_slave_inactive(struct slave *slave)
490 return slave->inactive; 501 return slave->inactive;
491} 502}
492 503
504static inline void bond_set_slave_link_state(struct slave *slave, int state)
505{
506 slave->link = state;
507 bond_queue_slave_event(slave);
508}
509
493static inline __be32 bond_confirm_addr(struct net_device *dev, __be32 dst, __be32 local) 510static inline __be32 bond_confirm_addr(struct net_device *dev, __be32 dst, __be32 local)
494{ 511{
495 struct in_device *in_dev; 512 struct in_device *in_dev;
@@ -525,6 +542,7 @@ void bond_sysfs_slave_del(struct slave *slave);
525int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev); 542int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev);
526int bond_release(struct net_device *bond_dev, struct net_device *slave_dev); 543int bond_release(struct net_device *bond_dev, struct net_device *slave_dev);
527u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb); 544u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb);
545int bond_set_carrier(struct bonding *bond);
528void bond_select_active_slave(struct bonding *bond); 546void bond_select_active_slave(struct bonding *bond);
529void bond_change_active_slave(struct bonding *bond, struct slave *new_active); 547void bond_change_active_slave(struct bonding *bond, struct slave *new_active);
530void bond_create_debugfs(void); 548void bond_create_debugfs(void);
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 4ebb816241fa..64e09e1e8099 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -520,37 +520,41 @@ ieee80211_chandef_max_power(struct cfg80211_chan_def *chandef)
520 * 520 *
521 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in 521 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in
522 * @SURVEY_INFO_IN_USE: channel is currently being used 522 * @SURVEY_INFO_IN_USE: channel is currently being used
523 * @SURVEY_INFO_CHANNEL_TIME: channel active time (in ms) was filled in 523 * @SURVEY_INFO_TIME: active time (in ms) was filled in
524 * @SURVEY_INFO_CHANNEL_TIME_BUSY: channel busy time was filled in 524 * @SURVEY_INFO_TIME_BUSY: busy time was filled in
525 * @SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: extension channel busy time was filled in 525 * @SURVEY_INFO_TIME_EXT_BUSY: extension channel busy time was filled in
526 * @SURVEY_INFO_CHANNEL_TIME_RX: channel receive time was filled in 526 * @SURVEY_INFO_TIME_RX: receive time was filled in
527 * @SURVEY_INFO_CHANNEL_TIME_TX: channel transmit time was filled in 527 * @SURVEY_INFO_TIME_TX: transmit time was filled in
528 * @SURVEY_INFO_TIME_SCAN: scan time was filled in
528 * 529 *
529 * Used by the driver to indicate which info in &struct survey_info 530 * Used by the driver to indicate which info in &struct survey_info
530 * it has filled in during the get_survey(). 531 * it has filled in during the get_survey().
531 */ 532 */
532enum survey_info_flags { 533enum survey_info_flags {
533 SURVEY_INFO_NOISE_DBM = 1<<0, 534 SURVEY_INFO_NOISE_DBM = BIT(0),
534 SURVEY_INFO_IN_USE = 1<<1, 535 SURVEY_INFO_IN_USE = BIT(1),
535 SURVEY_INFO_CHANNEL_TIME = 1<<2, 536 SURVEY_INFO_TIME = BIT(2),
536 SURVEY_INFO_CHANNEL_TIME_BUSY = 1<<3, 537 SURVEY_INFO_TIME_BUSY = BIT(3),
537 SURVEY_INFO_CHANNEL_TIME_EXT_BUSY = 1<<4, 538 SURVEY_INFO_TIME_EXT_BUSY = BIT(4),
538 SURVEY_INFO_CHANNEL_TIME_RX = 1<<5, 539 SURVEY_INFO_TIME_RX = BIT(5),
539 SURVEY_INFO_CHANNEL_TIME_TX = 1<<6, 540 SURVEY_INFO_TIME_TX = BIT(6),
541 SURVEY_INFO_TIME_SCAN = BIT(7),
540}; 542};
541 543
542/** 544/**
543 * struct survey_info - channel survey response 545 * struct survey_info - channel survey response
544 * 546 *
545 * @channel: the channel this survey record reports, mandatory 547 * @channel: the channel this survey record reports, may be %NULL for a single
548 * record to report global statistics
546 * @filled: bitflag of flags from &enum survey_info_flags 549 * @filled: bitflag of flags from &enum survey_info_flags
547 * @noise: channel noise in dBm. This and all following fields are 550 * @noise: channel noise in dBm. This and all following fields are
548 * optional 551 * optional
549 * @channel_time: amount of time in ms the radio spent on the channel 552 * @time: amount of time in ms the radio was turn on (on the channel)
550 * @channel_time_busy: amount of time the primary channel was sensed busy 553 * @time_busy: amount of time the primary channel was sensed busy
551 * @channel_time_ext_busy: amount of time the extension channel was sensed busy 554 * @time_ext_busy: amount of time the extension channel was sensed busy
552 * @channel_time_rx: amount of time the radio spent receiving data 555 * @time_rx: amount of time the radio spent receiving data
553 * @channel_time_tx: amount of time the radio spent transmitting data 556 * @time_tx: amount of time the radio spent transmitting data
557 * @time_scan: amount of time the radio spent for scanning
554 * 558 *
555 * Used by dump_survey() to report back per-channel survey information. 559 * Used by dump_survey() to report back per-channel survey information.
556 * 560 *
@@ -559,11 +563,12 @@ enum survey_info_flags {
559 */ 563 */
560struct survey_info { 564struct survey_info {
561 struct ieee80211_channel *channel; 565 struct ieee80211_channel *channel;
562 u64 channel_time; 566 u64 time;
563 u64 channel_time_busy; 567 u64 time_busy;
564 u64 channel_time_ext_busy; 568 u64 time_ext_busy;
565 u64 channel_time_rx; 569 u64 time_rx;
566 u64 channel_time_tx; 570 u64 time_tx;
571 u64 time_scan;
567 u32 filled; 572 u32 filled;
568 s8 noise; 573 s8 noise;
569}; 574};
@@ -861,75 +866,6 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
861 enum cfg80211_station_type statype); 866 enum cfg80211_station_type statype);
862 867
863/** 868/**
864 * enum station_info_flags - station information flags
865 *
866 * Used by the driver to indicate which info in &struct station_info
867 * it has filled in during get_station() or dump_station().
868 *
869 * @STATION_INFO_INACTIVE_TIME: @inactive_time filled
870 * @STATION_INFO_RX_BYTES: @rx_bytes filled
871 * @STATION_INFO_TX_BYTES: @tx_bytes filled
872 * @STATION_INFO_RX_BYTES64: @rx_bytes filled with 64-bit value
873 * @STATION_INFO_TX_BYTES64: @tx_bytes filled with 64-bit value
874 * @STATION_INFO_LLID: @llid filled
875 * @STATION_INFO_PLID: @plid filled
876 * @STATION_INFO_PLINK_STATE: @plink_state filled
877 * @STATION_INFO_SIGNAL: @signal filled
878 * @STATION_INFO_TX_BITRATE: @txrate fields are filled
879 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs)
880 * @STATION_INFO_RX_PACKETS: @rx_packets filled with 32-bit value
881 * @STATION_INFO_TX_PACKETS: @tx_packets filled with 32-bit value
882 * @STATION_INFO_TX_RETRIES: @tx_retries filled
883 * @STATION_INFO_TX_FAILED: @tx_failed filled
884 * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled
885 * @STATION_INFO_SIGNAL_AVG: @signal_avg filled
886 * @STATION_INFO_RX_BITRATE: @rxrate fields are filled
887 * @STATION_INFO_BSS_PARAM: @bss_param filled
888 * @STATION_INFO_CONNECTED_TIME: @connected_time filled
889 * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled
890 * @STATION_INFO_STA_FLAGS: @sta_flags filled
891 * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled
892 * @STATION_INFO_T_OFFSET: @t_offset filled
893 * @STATION_INFO_LOCAL_PM: @local_pm filled
894 * @STATION_INFO_PEER_PM: @peer_pm filled
895 * @STATION_INFO_NONPEER_PM: @nonpeer_pm filled
896 * @STATION_INFO_CHAIN_SIGNAL: @chain_signal filled
897 * @STATION_INFO_CHAIN_SIGNAL_AVG: @chain_signal_avg filled
898 * @STATION_INFO_EXPECTED_THROUGHPUT: @expected_throughput filled
899 */
900enum station_info_flags {
901 STATION_INFO_INACTIVE_TIME = BIT(0),
902 STATION_INFO_RX_BYTES = BIT(1),
903 STATION_INFO_TX_BYTES = BIT(2),
904 STATION_INFO_LLID = BIT(3),
905 STATION_INFO_PLID = BIT(4),
906 STATION_INFO_PLINK_STATE = BIT(5),
907 STATION_INFO_SIGNAL = BIT(6),
908 STATION_INFO_TX_BITRATE = BIT(7),
909 STATION_INFO_RX_PACKETS = BIT(8),
910 STATION_INFO_TX_PACKETS = BIT(9),
911 STATION_INFO_TX_RETRIES = BIT(10),
912 STATION_INFO_TX_FAILED = BIT(11),
913 STATION_INFO_RX_DROP_MISC = BIT(12),
914 STATION_INFO_SIGNAL_AVG = BIT(13),
915 STATION_INFO_RX_BITRATE = BIT(14),
916 STATION_INFO_BSS_PARAM = BIT(15),
917 STATION_INFO_CONNECTED_TIME = BIT(16),
918 STATION_INFO_ASSOC_REQ_IES = BIT(17),
919 STATION_INFO_STA_FLAGS = BIT(18),
920 STATION_INFO_BEACON_LOSS_COUNT = BIT(19),
921 STATION_INFO_T_OFFSET = BIT(20),
922 STATION_INFO_LOCAL_PM = BIT(21),
923 STATION_INFO_PEER_PM = BIT(22),
924 STATION_INFO_NONPEER_PM = BIT(23),
925 STATION_INFO_RX_BYTES64 = BIT(24),
926 STATION_INFO_TX_BYTES64 = BIT(25),
927 STATION_INFO_CHAIN_SIGNAL = BIT(26),
928 STATION_INFO_CHAIN_SIGNAL_AVG = BIT(27),
929 STATION_INFO_EXPECTED_THROUGHPUT = BIT(28),
930};
931
932/**
933 * enum station_info_rate_flags - bitrate info flags 869 * enum station_info_rate_flags - bitrate info flags
934 * 870 *
935 * Used by the driver to indicate the specific rate transmission 871 * Used by the driver to indicate the specific rate transmission
@@ -937,22 +873,35 @@ enum station_info_flags {
937 * 873 *
938 * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS 874 * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS
939 * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS 875 * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS
940 * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 MHz width transmission
941 * @RATE_INFO_FLAGS_80_MHZ_WIDTH: 80 MHz width transmission
942 * @RATE_INFO_FLAGS_80P80_MHZ_WIDTH: 80+80 MHz width transmission
943 * @RATE_INFO_FLAGS_160_MHZ_WIDTH: 160 MHz width transmission
944 * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval 876 * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval
945 * @RATE_INFO_FLAGS_60G: 60GHz MCS 877 * @RATE_INFO_FLAGS_60G: 60GHz MCS
946 */ 878 */
947enum rate_info_flags { 879enum rate_info_flags {
948 RATE_INFO_FLAGS_MCS = BIT(0), 880 RATE_INFO_FLAGS_MCS = BIT(0),
949 RATE_INFO_FLAGS_VHT_MCS = BIT(1), 881 RATE_INFO_FLAGS_VHT_MCS = BIT(1),
950 RATE_INFO_FLAGS_40_MHZ_WIDTH = BIT(2), 882 RATE_INFO_FLAGS_SHORT_GI = BIT(2),
951 RATE_INFO_FLAGS_80_MHZ_WIDTH = BIT(3), 883 RATE_INFO_FLAGS_60G = BIT(3),
952 RATE_INFO_FLAGS_80P80_MHZ_WIDTH = BIT(4), 884};
953 RATE_INFO_FLAGS_160_MHZ_WIDTH = BIT(5), 885
954 RATE_INFO_FLAGS_SHORT_GI = BIT(6), 886/**
955 RATE_INFO_FLAGS_60G = BIT(7), 887 * enum rate_info_bw - rate bandwidth information
888 *
889 * Used by the driver to indicate the rate bandwidth.
890 *
891 * @RATE_INFO_BW_5: 5 MHz bandwidth
892 * @RATE_INFO_BW_10: 10 MHz bandwidth
893 * @RATE_INFO_BW_20: 20 MHz bandwidth
894 * @RATE_INFO_BW_40: 40 MHz bandwidth
895 * @RATE_INFO_BW_80: 80 MHz bandwidth
896 * @RATE_INFO_BW_160: 160 MHz bandwidth
897 */
898enum rate_info_bw {
899 RATE_INFO_BW_5,
900 RATE_INFO_BW_10,
901 RATE_INFO_BW_20,
902 RATE_INFO_BW_40,
903 RATE_INFO_BW_80,
904 RATE_INFO_BW_160,
956}; 905};
957 906
958/** 907/**
@@ -964,12 +913,14 @@ enum rate_info_flags {
964 * @mcs: mcs index if struct describes a 802.11n bitrate 913 * @mcs: mcs index if struct describes a 802.11n bitrate
965 * @legacy: bitrate in 100kbit/s for 802.11abg 914 * @legacy: bitrate in 100kbit/s for 802.11abg
966 * @nss: number of streams (VHT only) 915 * @nss: number of streams (VHT only)
916 * @bw: bandwidth (from &enum rate_info_bw)
967 */ 917 */
968struct rate_info { 918struct rate_info {
969 u8 flags; 919 u8 flags;
970 u8 mcs; 920 u8 mcs;
971 u16 legacy; 921 u16 legacy;
972 u8 nss; 922 u8 nss;
923 u8 bw;
973}; 924};
974 925
975/** 926/**
@@ -1003,6 +954,24 @@ struct sta_bss_parameters {
1003 u16 beacon_interval; 954 u16 beacon_interval;
1004}; 955};
1005 956
957/**
958 * struct cfg80211_tid_stats - per-TID statistics
959 * @filled: bitmap of flags using the bits of &enum nl80211_tid_stats to
960 * indicate the relevant values in this struct are filled
961 * @rx_msdu: number of received MSDUs
962 * @tx_msdu: number of (attempted) transmitted MSDUs
963 * @tx_msdu_retries: number of retries (not counting the first) for
964 * transmitted MSDUs
965 * @tx_msdu_failed: number of failed transmitted MSDUs
966 */
967struct cfg80211_tid_stats {
968 u32 filled;
969 u64 rx_msdu;
970 u64 tx_msdu;
971 u64 tx_msdu_retries;
972 u64 tx_msdu_failed;
973};
974
1006#define IEEE80211_MAX_CHAINS 4 975#define IEEE80211_MAX_CHAINS 4
1007 976
1008/** 977/**
@@ -1010,11 +979,12 @@ struct sta_bss_parameters {
1010 * 979 *
1011 * Station information filled by driver for get_station() and dump_station. 980 * Station information filled by driver for get_station() and dump_station.
1012 * 981 *
1013 * @filled: bitflag of flags from &enum station_info_flags 982 * @filled: bitflag of flags using the bits of &enum nl80211_sta_info to
983 * indicate the relevant values in this struct for them
1014 * @connected_time: time(in secs) since a station is last connected 984 * @connected_time: time(in secs) since a station is last connected
1015 * @inactive_time: time since last station activity (tx/rx) in milliseconds 985 * @inactive_time: time since last station activity (tx/rx) in milliseconds
1016 * @rx_bytes: bytes received from this station 986 * @rx_bytes: bytes (size of MPDUs) received from this station
1017 * @tx_bytes: bytes transmitted to this station 987 * @tx_bytes: bytes (size of MPDUs) transmitted to this station
1018 * @llid: mesh local link id 988 * @llid: mesh local link id
1019 * @plid: mesh peer link id 989 * @plid: mesh peer link id
1020 * @plink_state: mesh peer link state 990 * @plink_state: mesh peer link state
@@ -1027,10 +997,10 @@ struct sta_bss_parameters {
1027 * @chain_signal_avg: per-chain signal strength average in dBm 997 * @chain_signal_avg: per-chain signal strength average in dBm
1028 * @txrate: current unicast bitrate from this station 998 * @txrate: current unicast bitrate from this station
1029 * @rxrate: current unicast bitrate to this station 999 * @rxrate: current unicast bitrate to this station
1030 * @rx_packets: packets received from this station 1000 * @rx_packets: packets (MSDUs & MMPDUs) received from this station
1031 * @tx_packets: packets transmitted to this station 1001 * @tx_packets: packets (MSDUs & MMPDUs) transmitted to this station
1032 * @tx_retries: cumulative retry counts 1002 * @tx_retries: cumulative retry counts (MPDUs)
1033 * @tx_failed: number of failed transmissions (retries exceeded, no ACK) 1003 * @tx_failed: number of failed transmissions (MPDUs) (retries exceeded, no ACK)
1034 * @rx_dropped_misc: Dropped for un-specified reason. 1004 * @rx_dropped_misc: Dropped for un-specified reason.
1035 * @bss_param: current BSS parameters 1005 * @bss_param: current BSS parameters
1036 * @generation: generation number for nl80211 dumps. 1006 * @generation: generation number for nl80211 dumps.
@@ -1050,6 +1020,11 @@ struct sta_bss_parameters {
1050 * @nonpeer_pm: non-peer mesh STA power save mode 1020 * @nonpeer_pm: non-peer mesh STA power save mode
1051 * @expected_throughput: expected throughput in kbps (including 802.11 headers) 1021 * @expected_throughput: expected throughput in kbps (including 802.11 headers)
1052 * towards this station. 1022 * towards this station.
1023 * @rx_beacon: number of beacons received from this peer
1024 * @rx_beacon_signal_avg: signal strength average (in dBm) for beacons received
1025 * from this peer
1026 * @pertid: per-TID statistics, see &struct cfg80211_tid_stats, using the last
1027 * (IEEE80211_NUM_TIDS) index for MSDUs not encapsulated in QoS-MPDUs.
1053 */ 1028 */
1054struct station_info { 1029struct station_info {
1055 u32 filled; 1030 u32 filled;
@@ -1090,10 +1065,9 @@ struct station_info {
1090 1065
1091 u32 expected_throughput; 1066 u32 expected_throughput;
1092 1067
1093 /* 1068 u64 rx_beacon;
1094 * Note: Add a new enum station_info_flags value for each new field and 1069 u8 rx_beacon_signal_avg;
1095 * use it to check which fields are initialized. 1070 struct cfg80211_tid_stats pertid[IEEE80211_NUM_TIDS + 1];
1096 */
1097}; 1071};
1098 1072
1099/** 1073/**
@@ -1516,6 +1490,13 @@ struct cfg80211_match_set {
1516 * @mac_addr_mask: MAC address mask used with randomisation, bits that 1490 * @mac_addr_mask: MAC address mask used with randomisation, bits that
1517 * are 0 in the mask should be randomised, bits that are 1 should 1491 * are 0 in the mask should be randomised, bits that are 1 should
1518 * be taken from the @mac_addr 1492 * be taken from the @mac_addr
1493 * @rcu_head: RCU callback used to free the struct
1494 * @owner_nlportid: netlink portid of owner (if this should is a request
1495 * owned by a particular socket)
1496 * @delay: delay in seconds to use before starting the first scan
1497 * cycle. The driver may ignore this parameter and start
1498 * immediately (or at any other time), if this feature is not
1499 * supported.
1519 */ 1500 */
1520struct cfg80211_sched_scan_request { 1501struct cfg80211_sched_scan_request {
1521 struct cfg80211_ssid *ssids; 1502 struct cfg80211_ssid *ssids;
@@ -1529,6 +1510,7 @@ struct cfg80211_sched_scan_request {
1529 struct cfg80211_match_set *match_sets; 1510 struct cfg80211_match_set *match_sets;
1530 int n_match_sets; 1511 int n_match_sets;
1531 s32 min_rssi_thold; 1512 s32 min_rssi_thold;
1513 u32 delay;
1532 1514
1533 u8 mac_addr[ETH_ALEN] __aligned(2); 1515 u8 mac_addr[ETH_ALEN] __aligned(2);
1534 u8 mac_addr_mask[ETH_ALEN] __aligned(2); 1516 u8 mac_addr_mask[ETH_ALEN] __aligned(2);
@@ -1537,6 +1519,8 @@ struct cfg80211_sched_scan_request {
1537 struct wiphy *wiphy; 1519 struct wiphy *wiphy;
1538 struct net_device *dev; 1520 struct net_device *dev;
1539 unsigned long scan_start; 1521 unsigned long scan_start;
1522 struct rcu_head rcu_head;
1523 u32 owner_nlportid;
1540 1524
1541 /* keep last */ 1525 /* keep last */
1542 struct ieee80211_channel *channels[0]; 1526 struct ieee80211_channel *channels[0];
@@ -3011,6 +2995,8 @@ struct wiphy_vendor_command {
3011 * @regulatory_flags: wiphy regulatory flags, see 2995 * @regulatory_flags: wiphy regulatory flags, see
3012 * &enum ieee80211_regulatory_flags 2996 * &enum ieee80211_regulatory_flags
3013 * @features: features advertised to nl80211, see &enum nl80211_feature_flags. 2997 * @features: features advertised to nl80211, see &enum nl80211_feature_flags.
2998 * @ext_features: extended features advertised to nl80211, see
2999 * &enum nl80211_ext_feature_index.
3014 * @bss_priv_size: each BSS struct has private data allocated with it, 3000 * @bss_priv_size: each BSS struct has private data allocated with it,
3015 * this variable determines its size 3001 * this variable determines its size
3016 * @max_scan_ssids: maximum number of SSIDs the device can scan for in 3002 * @max_scan_ssids: maximum number of SSIDs the device can scan for in
@@ -3120,6 +3106,7 @@ struct wiphy {
3120 u16 max_acl_mac_addrs; 3106 u16 max_acl_mac_addrs;
3121 3107
3122 u32 flags, regulatory_flags, features; 3108 u32 flags, regulatory_flags, features;
3109 u8 ext_features[DIV_ROUND_UP(NUM_NL80211_EXT_FEATURES, 8)];
3123 3110
3124 u32 ap_sme_capa; 3111 u32 ap_sme_capa;
3125 3112
@@ -3808,6 +3795,34 @@ const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type,
3808int regulatory_hint(struct wiphy *wiphy, const char *alpha2); 3795int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3809 3796
3810/** 3797/**
3798 * regulatory_set_wiphy_regd - set regdom info for self managed drivers
3799 * @wiphy: the wireless device we want to process the regulatory domain on
3800 * @rd: the regulatory domain informatoin to use for this wiphy
3801 *
3802 * Set the regulatory domain information for self-managed wiphys, only they
3803 * may use this function. See %REGULATORY_WIPHY_SELF_MANAGED for more
3804 * information.
3805 *
3806 * Return: 0 on success. -EINVAL, -EPERM
3807 */
3808int regulatory_set_wiphy_regd(struct wiphy *wiphy,
3809 struct ieee80211_regdomain *rd);
3810
3811/**
3812 * regulatory_set_wiphy_regd_sync_rtnl - set regdom for self-managed drivers
3813 * @wiphy: the wireless device we want to process the regulatory domain on
3814 * @rd: the regulatory domain information to use for this wiphy
3815 *
3816 * This functions requires the RTNL to be held and applies the new regdomain
3817 * synchronously to this wiphy. For more details see
3818 * regulatory_set_wiphy_regd().
3819 *
3820 * Return: 0 on success. -EINVAL, -EPERM
3821 */
3822int regulatory_set_wiphy_regd_sync_rtnl(struct wiphy *wiphy,
3823 struct ieee80211_regdomain *rd);
3824
3825/**
3811 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain 3826 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
3812 * @wiphy: the wireless device we want to process the regulatory domain on 3827 * @wiphy: the wireless device we want to process the regulatory domain on
3813 * @regd: the custom regulatory domain to use for this wiphy 3828 * @regd: the custom regulatory domain to use for this wiphy
@@ -4565,13 +4580,27 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
4565 struct station_info *sinfo, gfp_t gfp); 4580 struct station_info *sinfo, gfp_t gfp);
4566 4581
4567/** 4582/**
4583 * cfg80211_del_sta_sinfo - notify userspace about deletion of a station
4584 * @dev: the netdev
4585 * @mac_addr: the station's address
4586 * @sinfo: the station information/statistics
4587 * @gfp: allocation flags
4588 */
4589void cfg80211_del_sta_sinfo(struct net_device *dev, const u8 *mac_addr,
4590 struct station_info *sinfo, gfp_t gfp);
4591
4592/**
4568 * cfg80211_del_sta - notify userspace about deletion of a station 4593 * cfg80211_del_sta - notify userspace about deletion of a station
4569 * 4594 *
4570 * @dev: the netdev 4595 * @dev: the netdev
4571 * @mac_addr: the station's address 4596 * @mac_addr: the station's address
4572 * @gfp: allocation flags 4597 * @gfp: allocation flags
4573 */ 4598 */
4574void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); 4599static inline void cfg80211_del_sta(struct net_device *dev,
4600 const u8 *mac_addr, gfp_t gfp)
4601{
4602 cfg80211_del_sta_sinfo(dev, mac_addr, NULL, gfp);
4603}
4575 4604
4576/** 4605/**
4577 * cfg80211_conn_failed - connection request failed notification 4606 * cfg80211_conn_failed - connection request failed notification
@@ -5033,6 +5062,42 @@ void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev,
5033 */ 5062 */
5034void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy); 5063void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy);
5035 5064
5065/**
5066 * wiphy_ext_feature_set - set the extended feature flag
5067 *
5068 * @wiphy: the wiphy to modify.
5069 * @ftidx: extended feature bit index.
5070 *
5071 * The extended features are flagged in multiple bytes (see
5072 * &struct wiphy.@ext_features)
5073 */
5074static inline void wiphy_ext_feature_set(struct wiphy *wiphy,
5075 enum nl80211_ext_feature_index ftidx)
5076{
5077 u8 *ft_byte;
5078
5079 ft_byte = &wiphy->ext_features[ftidx / 8];
5080 *ft_byte |= BIT(ftidx % 8);
5081}
5082
5083/**
5084 * wiphy_ext_feature_isset - check the extended feature flag
5085 *
5086 * @wiphy: the wiphy to modify.
5087 * @ftidx: extended feature bit index.
5088 *
5089 * The extended features are flagged in multiple bytes (see
5090 * &struct wiphy.@ext_features)
5091 */
5092static inline bool
5093wiphy_ext_feature_isset(struct wiphy *wiphy,
5094 enum nl80211_ext_feature_index ftidx)
5095{
5096 u8 ft_byte;
5097
5098 ft_byte = wiphy->ext_features[ftidx / 8];
5099 return (ft_byte & BIT(ftidx % 8)) != 0;
5100}
5036 5101
5037/* ethtool helper */ 5102/* ethtool helper */
5038void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info); 5103void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info);
diff --git a/include/net/cfg802154.h b/include/net/cfg802154.h
index 7f713acfa106..eeda67652766 100644
--- a/include/net/cfg802154.h
+++ b/include/net/cfg802154.h
@@ -25,6 +25,7 @@
25#include <net/nl802154.h> 25#include <net/nl802154.h>
26 26
27struct wpan_phy; 27struct wpan_phy;
28struct wpan_phy_cca;
28 29
29struct cfg802154_ops { 30struct cfg802154_ops {
30 struct net_device * (*add_virtual_intf_deprecated)(struct wpan_phy *wpan_phy, 31 struct net_device * (*add_virtual_intf_deprecated)(struct wpan_phy *wpan_phy,
@@ -39,6 +40,8 @@ struct cfg802154_ops {
39 int (*del_virtual_intf)(struct wpan_phy *wpan_phy, 40 int (*del_virtual_intf)(struct wpan_phy *wpan_phy,
40 struct wpan_dev *wpan_dev); 41 struct wpan_dev *wpan_dev);
41 int (*set_channel)(struct wpan_phy *wpan_phy, u8 page, u8 channel); 42 int (*set_channel)(struct wpan_phy *wpan_phy, u8 page, u8 channel);
43 int (*set_cca_mode)(struct wpan_phy *wpan_phy,
44 const struct wpan_phy_cca *cca);
42 int (*set_pan_id)(struct wpan_phy *wpan_phy, 45 int (*set_pan_id)(struct wpan_phy *wpan_phy,
43 struct wpan_dev *wpan_dev, __le16 pan_id); 46 struct wpan_dev *wpan_dev, __le16 pan_id);
44 int (*set_short_addr)(struct wpan_phy *wpan_phy, 47 int (*set_short_addr)(struct wpan_phy *wpan_phy,
@@ -56,6 +59,11 @@ struct cfg802154_ops {
56 struct wpan_dev *wpan_dev, bool mode); 59 struct wpan_dev *wpan_dev, bool mode);
57}; 60};
58 61
62struct wpan_phy_cca {
63 enum nl802154_cca_modes mode;
64 enum nl802154_cca_opts opt;
65};
66
59struct wpan_phy { 67struct wpan_phy {
60 struct mutex pib_lock; 68 struct mutex pib_lock;
61 69
@@ -76,7 +84,7 @@ struct wpan_phy {
76 u8 current_page; 84 u8 current_page;
77 u32 channels_supported[IEEE802154_MAX_PAGE + 1]; 85 u32 channels_supported[IEEE802154_MAX_PAGE + 1];
78 s8 transmit_power; 86 s8 transmit_power;
79 u8 cca_mode; 87 struct wpan_phy_cca cca;
80 88
81 __le64 perm_extended_addr; 89 __le64 perm_extended_addr;
82 90
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 6c92415311ca..0574abd3db86 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -211,6 +211,23 @@ static inline struct nlmsghdr *genlmsg_nlhdr(void *user_hdr,
211} 211}
212 212
213/** 213/**
214 * genlmsg_parse - parse attributes of a genetlink message
215 * @nlh: netlink message header
216 * @family: genetlink message family
217 * @tb: destination array with maxtype+1 elements
218 * @maxtype: maximum attribute type to be expected
219 * @policy: validation policy
220 * */
221static inline int genlmsg_parse(const struct nlmsghdr *nlh,
222 const struct genl_family *family,
223 struct nlattr *tb[], int maxtype,
224 const struct nla_policy *policy)
225{
226 return nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype,
227 policy);
228}
229
230/**
214 * genl_dump_check_consistent - check if sequence is consistent and advertise if not 231 * genl_dump_check_consistent - check if sequence is consistent and advertise if not
215 * @cb: netlink callback structure that stores the sequence number 232 * @cb: netlink callback structure that stores the sequence number
216 * @user_hdr: user header as returned from genlmsg_put() 233 * @user_hdr: user header as returned from genlmsg_put()
@@ -250,9 +267,9 @@ static inline void *genlmsg_put_reply(struct sk_buff *skb,
250 * @skb: socket buffer the message is stored in 267 * @skb: socket buffer the message is stored in
251 * @hdr: user specific header 268 * @hdr: user specific header
252 */ 269 */
253static inline int genlmsg_end(struct sk_buff *skb, void *hdr) 270static inline void genlmsg_end(struct sk_buff *skb, void *hdr)
254{ 271{
255 return nlmsg_end(skb, hdr - GENL_HDRLEN - NLMSG_HDRLEN); 272 nlmsg_end(skb, hdr - GENL_HDRLEN - NLMSG_HDRLEN);
256} 273}
257 274
258/** 275/**
diff --git a/include/net/geneve.h b/include/net/geneve.h
index 112132cf8e2e..14fb8d3390b4 100644
--- a/include/net/geneve.h
+++ b/include/net/geneve.h
@@ -68,13 +68,12 @@ struct geneve_sock;
68typedef void (geneve_rcv_t)(struct geneve_sock *gs, struct sk_buff *skb); 68typedef void (geneve_rcv_t)(struct geneve_sock *gs, struct sk_buff *skb);
69 69
70struct geneve_sock { 70struct geneve_sock {
71 struct hlist_node hlist; 71 struct list_head list;
72 geneve_rcv_t *rcv; 72 geneve_rcv_t *rcv;
73 void *rcv_data; 73 void *rcv_data;
74 struct work_struct del_work;
75 struct socket *sock; 74 struct socket *sock;
76 struct rcu_head rcu; 75 struct rcu_head rcu;
77 atomic_t refcnt; 76 int refcnt;
78 struct udp_offload udp_offloads; 77 struct udp_offload udp_offloads;
79}; 78};
80 79
@@ -91,7 +90,7 @@ int geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt,
91 struct sk_buff *skb, __be32 src, __be32 dst, __u8 tos, 90 struct sk_buff *skb, __be32 src, __be32 dst, __u8 tos,
92 __u8 ttl, __be16 df, __be16 src_port, __be16 dst_port, 91 __u8 ttl, __be16 df, __be16 src_port, __be16 dst_port,
93 __be16 tun_flags, u8 vni[3], u8 opt_len, u8 *opt, 92 __be16 tun_flags, u8 vni[3], u8 opt_len, u8 *opt,
94 bool xnet); 93 bool csum, bool xnet);
95#endif /*ifdef CONFIG_INET */ 94#endif /*ifdef CONFIG_INET */
96 95
97#endif /*ifdef__NET_GENEVE_H */ 96#endif /*ifdef__NET_GENEVE_H */
diff --git a/include/net/gro_cells.h b/include/net/gro_cells.h
index 734d9b5f577a..0f712c0bc0bf 100644
--- a/include/net/gro_cells.h
+++ b/include/net/gro_cells.h
@@ -8,25 +8,23 @@
8struct gro_cell { 8struct gro_cell {
9 struct sk_buff_head napi_skbs; 9 struct sk_buff_head napi_skbs;
10 struct napi_struct napi; 10 struct napi_struct napi;
11} ____cacheline_aligned_in_smp; 11};
12 12
13struct gro_cells { 13struct gro_cells {
14 unsigned int gro_cells_mask; 14 struct gro_cell __percpu *cells;
15 struct gro_cell *cells;
16}; 15};
17 16
18static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) 17static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb)
19{ 18{
20 struct gro_cell *cell = gcells->cells; 19 struct gro_cell *cell;
21 struct net_device *dev = skb->dev; 20 struct net_device *dev = skb->dev;
22 21
23 if (!cell || skb_cloned(skb) || !(dev->features & NETIF_F_GRO)) { 22 if (!gcells->cells || skb_cloned(skb) || !(dev->features & NETIF_F_GRO)) {
24 netif_rx(skb); 23 netif_rx(skb);
25 return; 24 return;
26 } 25 }
27 26
28 if (skb_rx_queue_recorded(skb)) 27 cell = this_cpu_ptr(gcells->cells);
29 cell += skb_get_rx_queue(skb) & gcells->gro_cells_mask;
30 28
31 if (skb_queue_len(&cell->napi_skbs) > netdev_max_backlog) { 29 if (skb_queue_len(&cell->napi_skbs) > netdev_max_backlog) {
32 atomic_long_inc(&dev->rx_dropped); 30 atomic_long_inc(&dev->rx_dropped);
@@ -72,15 +70,12 @@ static inline int gro_cells_init(struct gro_cells *gcells, struct net_device *de
72{ 70{
73 int i; 71 int i;
74 72
75 gcells->gro_cells_mask = roundup_pow_of_two(netif_get_num_default_rss_queues()) - 1; 73 gcells->cells = alloc_percpu(struct gro_cell);
76 gcells->cells = kcalloc(gcells->gro_cells_mask + 1,
77 sizeof(struct gro_cell),
78 GFP_KERNEL);
79 if (!gcells->cells) 74 if (!gcells->cells)
80 return -ENOMEM; 75 return -ENOMEM;
81 76
82 for (i = 0; i <= gcells->gro_cells_mask; i++) { 77 for_each_possible_cpu(i) {
83 struct gro_cell *cell = gcells->cells + i; 78 struct gro_cell *cell = per_cpu_ptr(gcells->cells, i);
84 79
85 skb_queue_head_init(&cell->napi_skbs); 80 skb_queue_head_init(&cell->napi_skbs);
86 netif_napi_add(dev, &cell->napi, gro_cell_poll, 64); 81 netif_napi_add(dev, &cell->napi, gro_cell_poll, 64);
@@ -91,16 +86,16 @@ static inline int gro_cells_init(struct gro_cells *gcells, struct net_device *de
91 86
92static inline void gro_cells_destroy(struct gro_cells *gcells) 87static inline void gro_cells_destroy(struct gro_cells *gcells)
93{ 88{
94 struct gro_cell *cell = gcells->cells;
95 int i; 89 int i;
96 90
97 if (!cell) 91 if (!gcells->cells)
98 return; 92 return;
99 for (i = 0; i <= gcells->gro_cells_mask; i++,cell++) { 93 for_each_possible_cpu(i) {
94 struct gro_cell *cell = per_cpu_ptr(gcells->cells, i);
100 netif_napi_del(&cell->napi); 95 netif_napi_del(&cell->napi);
101 skb_queue_purge(&cell->napi_skbs); 96 skb_queue_purge(&cell->napi_skbs);
102 } 97 }
103 kfree(gcells->cells); 98 free_percpu(gcells->cells);
104 gcells->cells = NULL; 99 gcells->cells = NULL;
105} 100}
106 101
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h
index 83bb8a73d23c..94a297052442 100644
--- a/include/net/ieee802154_netdev.h
+++ b/include/net/ieee802154_netdev.h
@@ -28,6 +28,8 @@
28#include <linux/skbuff.h> 28#include <linux/skbuff.h>
29#include <linux/ieee802154.h> 29#include <linux/ieee802154.h>
30 30
31#include <net/cfg802154.h>
32
31struct ieee802154_sechdr { 33struct ieee802154_sechdr {
32#if defined(__LITTLE_ENDIAN_BITFIELD) 34#if defined(__LITTLE_ENDIAN_BITFIELD)
33 u8 level:3, 35 u8 level:3,
@@ -337,7 +339,7 @@ struct ieee802154_mac_params {
337 s8 frame_retries; 339 s8 frame_retries;
338 340
339 bool lbt; 341 bool lbt;
340 u8 cca_mode; 342 struct wpan_phy_cca cca;
341 s32 cca_ed_level; 343 s32 cca_ed_level;
342}; 344};
343 345
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index 848e85cb5c61..5976bdecf58b 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -98,7 +98,8 @@ struct inet_connection_sock {
98 const struct tcp_congestion_ops *icsk_ca_ops; 98 const struct tcp_congestion_ops *icsk_ca_ops;
99 const struct inet_connection_sock_af_ops *icsk_af_ops; 99 const struct inet_connection_sock_af_ops *icsk_af_ops;
100 unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu); 100 unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu);
101 __u8 icsk_ca_state; 101 __u8 icsk_ca_state:7,
102 icsk_ca_dst_locked:1;
102 __u8 icsk_retransmits; 103 __u8 icsk_retransmits;
103 __u8 icsk_pending; 104 __u8 icsk_pending;
104 __u8 icsk_backoff; 105 __u8 icsk_backoff;
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index a829b77523cf..eb16c7beed1e 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -16,7 +16,7 @@
16#ifndef _INET_SOCK_H 16#ifndef _INET_SOCK_H
17#define _INET_SOCK_H 17#define _INET_SOCK_H
18 18
19 19#include <linux/bitops.h>
20#include <linux/kmemcheck.h> 20#include <linux/kmemcheck.h>
21#include <linux/string.h> 21#include <linux/string.h>
22#include <linux/types.h> 22#include <linux/types.h>
@@ -184,6 +184,7 @@ struct inet_sock {
184 mc_all:1, 184 mc_all:1,
185 nodefrag:1; 185 nodefrag:1;
186 __u8 rcv_tos; 186 __u8 rcv_tos;
187 __u8 convert_csum;
187 int uc_index; 188 int uc_index;
188 int mc_index; 189 int mc_index;
189 __be32 mc_addr; 190 __be32 mc_addr;
@@ -194,6 +195,16 @@ struct inet_sock {
194#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ 195#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */
195#define IPCORK_ALLFRAG 2 /* always fragment (for ipv6 for now) */ 196#define IPCORK_ALLFRAG 2 /* always fragment (for ipv6 for now) */
196 197
198/* cmsg flags for inet */
199#define IP_CMSG_PKTINFO BIT(0)
200#define IP_CMSG_TTL BIT(1)
201#define IP_CMSG_TOS BIT(2)
202#define IP_CMSG_RECVOPTS BIT(3)
203#define IP_CMSG_RETOPTS BIT(4)
204#define IP_CMSG_PASSSEC BIT(5)
205#define IP_CMSG_ORIGDSTADDR BIT(6)
206#define IP_CMSG_CHECKSUM BIT(7)
207
197static inline struct inet_sock *inet_sk(const struct sock *sk) 208static inline struct inet_sock *inet_sk(const struct sock *sk)
198{ 209{
199 return (struct inet_sock *)sk; 210 return (struct inet_sock *)sk;
@@ -250,4 +261,20 @@ static inline __u8 inet_sk_flowi_flags(const struct sock *sk)
250 return flags; 261 return flags;
251} 262}
252 263
264static inline void inet_inc_convert_csum(struct sock *sk)
265{
266 inet_sk(sk)->convert_csum++;
267}
268
269static inline void inet_dec_convert_csum(struct sock *sk)
270{
271 if (inet_sk(sk)->convert_csum > 0)
272 inet_sk(sk)->convert_csum--;
273}
274
275static inline bool inet_get_convert_csum(struct sock *sk)
276{
277 return !!inet_sk(sk)->convert_csum;
278}
279
253#endif /* _INET_SOCK_H */ 280#endif /* _INET_SOCK_H */
diff --git a/include/net/ip.h b/include/net/ip.h
index 09cf5aebb283..025c61c0dffb 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -538,7 +538,7 @@ int ip_options_rcv_srr(struct sk_buff *skb);
538 */ 538 */
539 539
540void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb); 540void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb);
541void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); 541void ip_cmsg_recv_offset(struct msghdr *msg, struct sk_buff *skb, int offset);
542int ip_cmsg_send(struct net *net, struct msghdr *msg, 542int ip_cmsg_send(struct net *net, struct msghdr *msg,
543 struct ipcm_cookie *ipc, bool allow_ipv6); 543 struct ipcm_cookie *ipc, bool allow_ipv6);
544int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, 544int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
@@ -558,6 +558,11 @@ void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port,
558void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, 558void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport,
559 u32 info); 559 u32 info);
560 560
561static inline void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb)
562{
563 ip_cmsg_recv_offset(msg, skb, 0);
564}
565
561bool icmp_global_allow(void); 566bool icmp_global_allow(void);
562extern int sysctl_icmp_msgs_per_sec; 567extern int sysctl_icmp_msgs_per_sec;
563extern int sysctl_icmp_msgs_burst; 568extern int sysctl_icmp_msgs_burst;
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 8eea35d32a75..20e80fa7bbdd 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -74,6 +74,11 @@ struct fib6_node {
74#define FIB6_SUBTREE(fn) ((fn)->subtree) 74#define FIB6_SUBTREE(fn) ((fn)->subtree)
75#endif 75#endif
76 76
77struct mx6_config {
78 const u32 *mx;
79 DECLARE_BITMAP(mx_valid, RTAX_MAX);
80};
81
77/* 82/*
78 * routing information 83 * routing information
79 * 84 *
@@ -291,9 +296,8 @@ struct fib6_node *fib6_locate(struct fib6_node *root,
291void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg), 296void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg),
292 void *arg); 297 void *arg);
293 298
294int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info, 299int fib6_add(struct fib6_node *root, struct rt6_info *rt,
295 struct nlattr *mx, int mx_len); 300 struct nl_info *info, struct mx6_config *mxc);
296
297int fib6_del(struct rt6_info *rt, struct nl_info *info); 301int fib6_del(struct rt6_info *rt, struct nl_info *info);
298 302
299void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info); 303void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info);
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 9326c41c2d7f..76c091b53dae 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -70,6 +70,7 @@ int ip6_tnl_xmit_ctl(struct ip6_tnl *t, const struct in6_addr *laddr,
70__u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw); 70__u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw);
71__u32 ip6_tnl_get_cap(struct ip6_tnl *t, const struct in6_addr *laddr, 71__u32 ip6_tnl_get_cap(struct ip6_tnl *t, const struct in6_addr *laddr,
72 const struct in6_addr *raddr); 72 const struct in6_addr *raddr);
73struct net *ip6_tnl_get_link_net(const struct net_device *dev);
73 74
74static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev) 75static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
75{ 76{
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 09a819ee2151..5bd120e4bc0a 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -222,16 +222,19 @@ static inline struct fib_table *fib_new_table(struct net *net, u32 id)
222static inline int fib_lookup(struct net *net, const struct flowi4 *flp, 222static inline int fib_lookup(struct net *net, const struct flowi4 *flp,
223 struct fib_result *res) 223 struct fib_result *res)
224{ 224{
225 struct fib_table *table; 225 int err = -ENETUNREACH;
226
227 rcu_read_lock();
228
229 if (!fib_table_lookup(fib_get_table(net, RT_TABLE_LOCAL), flp, res,
230 FIB_LOOKUP_NOREF) ||
231 !fib_table_lookup(fib_get_table(net, RT_TABLE_MAIN), flp, res,
232 FIB_LOOKUP_NOREF))
233 err = 0;
226 234
227 table = fib_get_table(net, RT_TABLE_LOCAL); 235 rcu_read_unlock();
228 if (!fib_table_lookup(table, flp, res, FIB_LOOKUP_NOREF))
229 return 0;
230 236
231 table = fib_get_table(net, RT_TABLE_MAIN); 237 return err;
232 if (!fib_table_lookup(table, flp, res, FIB_LOOKUP_NOREF))
233 return 0;
234 return -ENETUNREACH;
235} 238}
236 239
237#else /* CONFIG_IP_MULTIPLE_TABLES */ 240#else /* CONFIG_IP_MULTIPLE_TABLES */
@@ -247,20 +250,25 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp,
247 struct fib_result *res) 250 struct fib_result *res)
248{ 251{
249 if (!net->ipv4.fib_has_custom_rules) { 252 if (!net->ipv4.fib_has_custom_rules) {
253 int err = -ENETUNREACH;
254
255 rcu_read_lock();
256
250 res->tclassid = 0; 257 res->tclassid = 0;
251 if (net->ipv4.fib_local && 258 if ((net->ipv4.fib_local &&
252 !fib_table_lookup(net->ipv4.fib_local, flp, res, 259 !fib_table_lookup(net->ipv4.fib_local, flp, res,
253 FIB_LOOKUP_NOREF)) 260 FIB_LOOKUP_NOREF)) ||
254 return 0; 261 (net->ipv4.fib_main &&
255 if (net->ipv4.fib_main && 262 !fib_table_lookup(net->ipv4.fib_main, flp, res,
256 !fib_table_lookup(net->ipv4.fib_main, flp, res, 263 FIB_LOOKUP_NOREF)) ||
257 FIB_LOOKUP_NOREF)) 264 (net->ipv4.fib_default &&
258 return 0; 265 !fib_table_lookup(net->ipv4.fib_default, flp, res,
259 if (net->ipv4.fib_default && 266 FIB_LOOKUP_NOREF)))
260 !fib_table_lookup(net->ipv4.fib_default, flp, res, 267 err = 0;
261 FIB_LOOKUP_NOREF)) 268
262 return 0; 269 rcu_read_unlock();
263 return -ENETUNREACH; 270
271 return err;
264 } 272 }
265 return __fib_lookup(net, flp, res); 273 return __fib_lookup(net, flp, res);
266} 274}
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index 25a59eb388a6..2c47061a6954 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -97,7 +97,10 @@ struct ip_tunnel {
97#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100) 97#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
98#define TUNNEL_OAM __cpu_to_be16(0x0200) 98#define TUNNEL_OAM __cpu_to_be16(0x0200)
99#define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400) 99#define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400)
100#define TUNNEL_OPTIONS_PRESENT __cpu_to_be16(0x0800) 100#define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800)
101#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)
102
103#define TUNNEL_OPTIONS_PRESENT (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT)
101 104
102struct tnl_ptk_info { 105struct tnl_ptk_info {
103 __be16 flags; 106 __be16 flags;
@@ -138,6 +141,7 @@ int ip_tunnel_encap_del_ops(const struct ip_tunnel_encap_ops *op,
138int ip_tunnel_init(struct net_device *dev); 141int ip_tunnel_init(struct net_device *dev);
139void ip_tunnel_uninit(struct net_device *dev); 142void ip_tunnel_uninit(struct net_device *dev);
140void ip_tunnel_dellink(struct net_device *dev, struct list_head *head); 143void ip_tunnel_dellink(struct net_device *dev, struct list_head *head);
144struct net *ip_tunnel_get_link_net(const struct net_device *dev);
141int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, 145int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
142 struct rtnl_link_ops *ops, char *devname); 146 struct rtnl_link_ops *ops, char *devname);
143 147
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 6e416f6d3e3c..4c9fe224d73b 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -671,8 +671,6 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
671 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); 671 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
672} 672}
673 673
674u32 __ipv6_select_ident(u32 hashrnd, struct in6_addr *dst,
675 struct in6_addr *src);
676void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); 674void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
677void ipv6_proxy_select_ident(struct sk_buff *skb); 675void ipv6_proxy_select_ident(struct sk_buff *skb);
678 676
@@ -791,6 +789,25 @@ int ip6_push_pending_frames(struct sock *sk);
791 789
792void ip6_flush_pending_frames(struct sock *sk); 790void ip6_flush_pending_frames(struct sock *sk);
793 791
792int ip6_send_skb(struct sk_buff *skb);
793
794struct sk_buff *__ip6_make_skb(struct sock *sk, struct sk_buff_head *queue,
795 struct inet_cork_full *cork,
796 struct inet6_cork *v6_cork);
797struct sk_buff *ip6_make_skb(struct sock *sk,
798 int getfrag(void *from, char *to, int offset,
799 int len, int odd, struct sk_buff *skb),
800 void *from, int length, int transhdrlen,
801 int hlimit, int tclass, struct ipv6_txoptions *opt,
802 struct flowi6 *fl6, struct rt6_info *rt,
803 unsigned int flags, int dontfrag);
804
805static inline struct sk_buff *ip6_finish_skb(struct sock *sk)
806{
807 return __ip6_make_skb(sk, &sk->sk_write_queue, &inet_sk(sk)->cork,
808 &inet6_sk(sk)->cork);
809}
810
794int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6); 811int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6);
795struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, 812struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
796 const struct in6_addr *final_dst); 813 const struct in6_addr *final_dst);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 29c7be8808d5..d52914b75331 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -376,6 +376,12 @@ enum ieee80211_rssi_event {
376 * @ssid_len: Length of SSID given in @ssid. 376 * @ssid_len: Length of SSID given in @ssid.
377 * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. 377 * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode.
378 * @txpower: TX power in dBm 378 * @txpower: TX power in dBm
379 * @txpower_type: TX power adjustment used to control per packet Transmit
380 * Power Control (TPC) in lower driver for the current vif. In particular
381 * TPC is enabled if value passed in %txpower_type is
382 * NL80211_TX_POWER_LIMITED (allow using less than specified from
383 * userspace), whereas TPC is disabled if %txpower_type is set to
384 * NL80211_TX_POWER_FIXED (use value configured from userspace)
379 * @p2p_noa_attr: P2P NoA attribute for P2P powersave 385 * @p2p_noa_attr: P2P NoA attribute for P2P powersave
380 */ 386 */
381struct ieee80211_bss_conf { 387struct ieee80211_bss_conf {
@@ -411,6 +417,7 @@ struct ieee80211_bss_conf {
411 size_t ssid_len; 417 size_t ssid_len;
412 bool hidden_ssid; 418 bool hidden_ssid;
413 int txpower; 419 int txpower;
420 enum nl80211_tx_power_setting txpower_type;
414 struct ieee80211_p2p_noa_attr p2p_noa_attr; 421 struct ieee80211_p2p_noa_attr p2p_noa_attr;
415}; 422};
416 423
@@ -505,8 +512,11 @@ struct ieee80211_bss_conf {
505 * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it 512 * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it
506 * would be fragmented by size (this is optional, only used for 513 * would be fragmented by size (this is optional, only used for
507 * monitor injection). 514 * monitor injection).
508 * @IEEE80211_TX_CTL_PS_RESPONSE: This frame is a response to a poll 515 * @IEEE80211_TX_STAT_NOACK_TRANSMITTED: A frame that was marked with
509 * frame (PS-Poll or uAPSD). 516 * IEEE80211_TX_CTL_NO_ACK has been successfully transmitted without
517 * any errors (like issues specific to the driver/HW).
518 * This flag must not be set for frames that don't request no-ack
519 * behaviour with IEEE80211_TX_CTL_NO_ACK.
510 * 520 *
511 * Note: If you have to add new flags to the enumeration, then don't 521 * Note: If you have to add new flags to the enumeration, then don't
512 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. 522 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
@@ -542,7 +552,7 @@ enum mac80211_tx_info_flags {
542 IEEE80211_TX_STATUS_EOSP = BIT(28), 552 IEEE80211_TX_STATUS_EOSP = BIT(28),
543 IEEE80211_TX_CTL_USE_MINRATE = BIT(29), 553 IEEE80211_TX_CTL_USE_MINRATE = BIT(29),
544 IEEE80211_TX_CTL_DONTFRAG = BIT(30), 554 IEEE80211_TX_CTL_DONTFRAG = BIT(30),
545 IEEE80211_TX_CTL_PS_RESPONSE = BIT(31), 555 IEEE80211_TX_STAT_NOACK_TRANSMITTED = BIT(31),
546}; 556};
547 557
548#define IEEE80211_TX_CTL_STBC_SHIFT 23 558#define IEEE80211_TX_CTL_STBC_SHIFT 23
@@ -552,11 +562,14 @@ enum mac80211_tx_info_flags {
552 * 562 *
553 * @IEEE80211_TX_CTRL_PORT_CTRL_PROTO: this frame is a port control 563 * @IEEE80211_TX_CTRL_PORT_CTRL_PROTO: this frame is a port control
554 * protocol frame (e.g. EAP) 564 * protocol frame (e.g. EAP)
565 * @IEEE80211_TX_CTRL_PS_RESPONSE: This frame is a response to a poll
566 * frame (PS-Poll or uAPSD).
555 * 567 *
556 * These flags are used in tx_info->control.flags. 568 * These flags are used in tx_info->control.flags.
557 */ 569 */
558enum mac80211_tx_control_flags { 570enum mac80211_tx_control_flags {
559 IEEE80211_TX_CTRL_PORT_CTRL_PROTO = BIT(0), 571 IEEE80211_TX_CTRL_PORT_CTRL_PROTO = BIT(0),
572 IEEE80211_TX_CTRL_PS_RESPONSE = BIT(1),
560}; 573};
561 574
562/* 575/*
@@ -925,15 +938,13 @@ enum mac80211_rx_flags {
925 * These flags are used with the @vht_flag member of 938 * These flags are used with the @vht_flag member of
926 * &struct ieee80211_rx_status. 939 * &struct ieee80211_rx_status.
927 * @RX_VHT_FLAG_80MHZ: 80 MHz was used 940 * @RX_VHT_FLAG_80MHZ: 80 MHz was used
928 * @RX_VHT_FLAG_80P80MHZ: 80+80 MHz was used
929 * @RX_VHT_FLAG_160MHZ: 160 MHz was used 941 * @RX_VHT_FLAG_160MHZ: 160 MHz was used
930 * @RX_VHT_FLAG_BF: packet was beamformed 942 * @RX_VHT_FLAG_BF: packet was beamformed
931 */ 943 */
932enum mac80211_rx_vht_flags { 944enum mac80211_rx_vht_flags {
933 RX_VHT_FLAG_80MHZ = BIT(0), 945 RX_VHT_FLAG_80MHZ = BIT(0),
934 RX_VHT_FLAG_80P80MHZ = BIT(1), 946 RX_VHT_FLAG_160MHZ = BIT(1),
935 RX_VHT_FLAG_160MHZ = BIT(2), 947 RX_VHT_FLAG_BF = BIT(2),
936 RX_VHT_FLAG_BF = BIT(3),
937}; 948};
938 949
939/** 950/**
@@ -1181,10 +1192,15 @@ struct ieee80211_channel_switch {
1181 * monitoring on this virtual interface -- i.e. it can monitor 1192 * monitoring on this virtual interface -- i.e. it can monitor
1182 * connection quality related parameters, such as the RSSI level and 1193 * connection quality related parameters, such as the RSSI level and
1183 * provide notifications if configured trigger levels are reached. 1194 * provide notifications if configured trigger levels are reached.
1195 * @IEEE80211_VIF_SUPPORTS_UAPSD: The device can do U-APSD for this
1196 * interface. This flag should be set during interface addition,
1197 * but may be set/cleared as late as authentication to an AP. It is
1198 * only valid for managed/station mode interfaces.
1184 */ 1199 */
1185enum ieee80211_vif_flags { 1200enum ieee80211_vif_flags {
1186 IEEE80211_VIF_BEACON_FILTER = BIT(0), 1201 IEEE80211_VIF_BEACON_FILTER = BIT(0),
1187 IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1), 1202 IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1),
1203 IEEE80211_VIF_SUPPORTS_UAPSD = BIT(2),
1188}; 1204};
1189 1205
1190/** 1206/**
@@ -1270,19 +1286,22 @@ struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
1270 * 1286 *
1271 * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the 1287 * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the
1272 * driver to indicate that it requires IV generation for this 1288 * driver to indicate that it requires IV generation for this
1273 * particular key. 1289 * particular key. Setting this flag does not necessarily mean that SKBs
1290 * will have sufficient tailroom for ICV or MIC.
1274 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by 1291 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
1275 * the driver for a TKIP key if it requires Michael MIC 1292 * the driver for a TKIP key if it requires Michael MIC
1276 * generation in software. 1293 * generation in software.
1277 * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates 1294 * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates
1278 * that the key is pairwise rather then a shared key. 1295 * that the key is pairwise rather then a shared key.
1279 * @IEEE80211_KEY_FLAG_SW_MGMT_TX: This flag should be set by the driver for a 1296 * @IEEE80211_KEY_FLAG_SW_MGMT_TX: This flag should be set by the driver for a
1280 * CCMP key if it requires CCMP encryption of management frames (MFP) to 1297 * CCMP/GCMP key if it requires CCMP/GCMP encryption of management frames
1281 * be done in software. 1298 * (MFP) to be done in software.
1282 * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver 1299 * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver
1283 * if space should be prepared for the IV, but the IV 1300 * if space should be prepared for the IV, but the IV
1284 * itself should not be generated. Do not set together with 1301 * itself should not be generated. Do not set together with
1285 * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. 1302 * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. Setting this flag does
1303 * not necessarily mean that SKBs will have sufficient tailroom for ICV or
1304 * MIC.
1286 * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received 1305 * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received
1287 * management frames. The flag can help drivers that have a hardware 1306 * management frames. The flag can help drivers that have a hardware
1288 * crypto implementation that doesn't deal with management frames 1307 * crypto implementation that doesn't deal with management frames
@@ -1291,8 +1310,11 @@ struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
1291 * RX, if your crypto engine can't deal with TX you can also set the 1310 * RX, if your crypto engine can't deal with TX you can also set the
1292 * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW. 1311 * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW.
1293 * @IEEE80211_KEY_FLAG_GENERATE_IV_MGMT: This flag should be set by the 1312 * @IEEE80211_KEY_FLAG_GENERATE_IV_MGMT: This flag should be set by the
1294 * driver for a CCMP key to indicate that is requires IV generation 1313 * driver for a CCMP/GCMP key to indicate that is requires IV generation
1295 * only for managment frames (MFP). 1314 * only for managment frames (MFP).
1315 * @IEEE80211_KEY_FLAG_RESERVE_TAILROOM: This flag should be set by the
1316 * driver for a key to indicate that sufficient tailroom must always
1317 * be reserved for ICV or MIC, even when HW encryption is enabled.
1296 */ 1318 */
1297enum ieee80211_key_flags { 1319enum ieee80211_key_flags {
1298 IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(0), 1320 IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(0),
@@ -1302,6 +1324,7 @@ enum ieee80211_key_flags {
1302 IEEE80211_KEY_FLAG_SW_MGMT_TX = BIT(4), 1324 IEEE80211_KEY_FLAG_SW_MGMT_TX = BIT(4),
1303 IEEE80211_KEY_FLAG_PUT_IV_SPACE = BIT(5), 1325 IEEE80211_KEY_FLAG_PUT_IV_SPACE = BIT(5),
1304 IEEE80211_KEY_FLAG_RX_MGMT = BIT(6), 1326 IEEE80211_KEY_FLAG_RX_MGMT = BIT(6),
1327 IEEE80211_KEY_FLAG_RESERVE_TAILROOM = BIT(7),
1305}; 1328};
1306 1329
1307/** 1330/**
@@ -1580,11 +1603,6 @@ struct ieee80211_tx_control {
1580 * @IEEE80211_HW_MFP_CAPABLE: 1603 * @IEEE80211_HW_MFP_CAPABLE:
1581 * Hardware supports management frame protection (MFP, IEEE 802.11w). 1604 * Hardware supports management frame protection (MFP, IEEE 802.11w).
1582 * 1605 *
1583 * @IEEE80211_HW_SUPPORTS_UAPSD:
1584 * Hardware supports Unscheduled Automatic Power Save Delivery
1585 * (U-APSD) in managed mode. The mode is configured with
1586 * conf_tx() operation.
1587 *
1588 * @IEEE80211_HW_REPORTS_TX_ACK_STATUS: 1606 * @IEEE80211_HW_REPORTS_TX_ACK_STATUS:
1589 * Hardware can provide ack status reports of Tx frames to 1607 * Hardware can provide ack status reports of Tx frames to
1590 * the stack. 1608 * the stack.
@@ -1623,6 +1641,12 @@ struct ieee80211_tx_control {
1623 * be created. It is expected user-space will create vifs as 1641 * be created. It is expected user-space will create vifs as
1624 * desired (and thus have them named as desired). 1642 * desired (and thus have them named as desired).
1625 * 1643 *
1644 * @IEEE80211_HW_SW_CRYPTO_CONTROL: The driver wants to control which of the
1645 * crypto algorithms can be done in software - so don't automatically
1646 * try to fall back to it if hardware crypto fails, but do so only if
1647 * the driver returns 1. This also forces the driver to advertise its
1648 * supported cipher suites.
1649 *
1626 * @IEEE80211_HW_QUEUE_CONTROL: The driver wants to control per-interface 1650 * @IEEE80211_HW_QUEUE_CONTROL: The driver wants to control per-interface
1627 * queue mapping in order to use different queues (not just one per AC) 1651 * queue mapping in order to use different queues (not just one per AC)
1628 * for different virtual interfaces. See the doc section on HW queue 1652 * for different virtual interfaces. See the doc section on HW queue
@@ -1670,8 +1694,8 @@ enum ieee80211_hw_flags {
1670 IEEE80211_HW_MFP_CAPABLE = 1<<13, 1694 IEEE80211_HW_MFP_CAPABLE = 1<<13,
1671 IEEE80211_HW_WANT_MONITOR_VIF = 1<<14, 1695 IEEE80211_HW_WANT_MONITOR_VIF = 1<<14,
1672 IEEE80211_HW_NO_AUTO_VIF = 1<<15, 1696 IEEE80211_HW_NO_AUTO_VIF = 1<<15,
1673 /* free slot */ 1697 IEEE80211_HW_SW_CRYPTO_CONTROL = 1<<16,
1674 IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, 1698 /* free slots */
1675 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, 1699 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18,
1676 IEEE80211_HW_CONNECTION_MONITOR = 1<<19, 1700 IEEE80211_HW_CONNECTION_MONITOR = 1<<19,
1677 IEEE80211_HW_QUEUE_CONTROL = 1<<20, 1701 IEEE80211_HW_QUEUE_CONTROL = 1<<20,
@@ -1945,6 +1969,11 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
1945 * added; if you return 0 then hw_key_idx must be assigned to the 1969 * added; if you return 0 then hw_key_idx must be assigned to the
1946 * hardware key index, you are free to use the full u8 range. 1970 * hardware key index, you are free to use the full u8 range.
1947 * 1971 *
1972 * Note that in the case that the @IEEE80211_HW_SW_CRYPTO_CONTROL flag is
1973 * set, mac80211 will not automatically fall back to software crypto if
1974 * enabling hardware crypto failed. The set_key() call may also return the
1975 * value 1 to permit this specific key/algorithm to be done in software.
1976 *
1948 * When the cmd is %DISABLE_KEY then it must succeed. 1977 * When the cmd is %DISABLE_KEY then it must succeed.
1949 * 1978 *
1950 * Note that it is permissible to not decrypt a frame even if a key 1979 * Note that it is permissible to not decrypt a frame even if a key
@@ -2023,7 +2052,7 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
2023 * enabled whenever user has enabled powersave. 2052 * enabled whenever user has enabled powersave.
2024 * 2053 *
2025 * Driver informs U-APSD client support by enabling 2054 * Driver informs U-APSD client support by enabling
2026 * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the 2055 * %IEEE80211_VIF_SUPPORTS_UAPSD flag. The mode is configured through the
2027 * uapsd parameter in conf_tx() operation. Hardware needs to send the QoS 2056 * uapsd parameter in conf_tx() operation. Hardware needs to send the QoS
2028 * Nullfunc frames and stay awake until the service period has ended. To 2057 * Nullfunc frames and stay awake until the service period has ended. To
2029 * utilize U-APSD, dynamic powersave is disabled for voip AC and all frames 2058 * utilize U-APSD, dynamic powersave is disabled for voip AC and all frames
@@ -2696,6 +2725,14 @@ enum ieee80211_reconfig_type {
2696 * is only used if the configured rate control algorithm actually uses 2725 * is only used if the configured rate control algorithm actually uses
2697 * the new rate table API, and is therefore optional. Must be atomic. 2726 * the new rate table API, and is therefore optional. Must be atomic.
2698 * 2727 *
2728 * @sta_statistics: Get statistics for this station. For example with beacon
2729 * filtering, the statistics kept by mac80211 might not be accurate, so
2730 * let the driver pre-fill the statistics. The driver can fill most of
2731 * the values (indicating which by setting the filled bitmap), but not
2732 * all of them make sense - see the source for which ones are possible.
2733 * Statistics that the driver doesn't fill will be filled by mac80211.
2734 * The callback can sleep.
2735 *
2699 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 2736 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
2700 * bursting) for a hardware TX queue. 2737 * bursting) for a hardware TX queue.
2701 * Returns a negative error code on failure. 2738 * Returns a negative error code on failure.
@@ -2856,9 +2893,6 @@ enum ieee80211_reconfig_type {
2856 * @get_et_strings: Ethtool API to get a set of strings to describe stats 2893 * @get_et_strings: Ethtool API to get a set of strings to describe stats
2857 * and perhaps other supported types of ethtool data-sets. 2894 * and perhaps other supported types of ethtool data-sets.
2858 * 2895 *
2859 * @get_rssi: Get current signal strength in dBm, the function is optional
2860 * and can sleep.
2861 *
2862 * @mgd_prepare_tx: Prepare for transmitting a management frame for association 2896 * @mgd_prepare_tx: Prepare for transmitting a management frame for association
2863 * before associated. In multi-channel scenarios, a virtual interface is 2897 * before associated. In multi-channel scenarios, a virtual interface is
2864 * bound to a channel before it is associated, but as it isn't associated 2898 * bound to a channel before it is associated, but as it isn't associated
@@ -3059,6 +3093,10 @@ struct ieee80211_ops {
3059 void (*sta_rate_tbl_update)(struct ieee80211_hw *hw, 3093 void (*sta_rate_tbl_update)(struct ieee80211_hw *hw,
3060 struct ieee80211_vif *vif, 3094 struct ieee80211_vif *vif,
3061 struct ieee80211_sta *sta); 3095 struct ieee80211_sta *sta);
3096 void (*sta_statistics)(struct ieee80211_hw *hw,
3097 struct ieee80211_vif *vif,
3098 struct ieee80211_sta *sta,
3099 struct station_info *sinfo);
3062 int (*conf_tx)(struct ieee80211_hw *hw, 3100 int (*conf_tx)(struct ieee80211_hw *hw,
3063 struct ieee80211_vif *vif, u16 ac, 3101 struct ieee80211_vif *vif, u16 ac,
3064 const struct ieee80211_tx_queue_params *params); 3102 const struct ieee80211_tx_queue_params *params);
@@ -3126,8 +3164,6 @@ struct ieee80211_ops {
3126 void (*get_et_strings)(struct ieee80211_hw *hw, 3164 void (*get_et_strings)(struct ieee80211_hw *hw,
3127 struct ieee80211_vif *vif, 3165 struct ieee80211_vif *vif,
3128 u32 sset, u8 *data); 3166 u32 sset, u8 *data);
3129 int (*get_rssi)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
3130 struct ieee80211_sta *sta, s8 *rssi_dbm);
3131 3167
3132 void (*mgd_prepare_tx)(struct ieee80211_hw *hw, 3168 void (*mgd_prepare_tx)(struct ieee80211_hw *hw,
3133 struct ieee80211_vif *vif); 3169 struct ieee80211_vif *vif);
@@ -4062,6 +4098,10 @@ void ieee80211_aes_cmac_calculate_k1_k2(struct ieee80211_key_conf *keyconf,
4062 * reverse order than in packet) 4098 * reverse order than in packet)
4063 * @aes_cmac: PN data, most significant byte first (big endian, 4099 * @aes_cmac: PN data, most significant byte first (big endian,
4064 * reverse order than in packet) 4100 * reverse order than in packet)
4101 * @aes_gmac: PN data, most significant byte first (big endian,
4102 * reverse order than in packet)
4103 * @gcmp: PN data, most significant byte first (big endian,
4104 * reverse order than in packet)
4065 */ 4105 */
4066struct ieee80211_key_seq { 4106struct ieee80211_key_seq {
4067 union { 4107 union {
@@ -4075,6 +4115,12 @@ struct ieee80211_key_seq {
4075 struct { 4115 struct {
4076 u8 pn[6]; 4116 u8 pn[6];
4077 } aes_cmac; 4117 } aes_cmac;
4118 struct {
4119 u8 pn[6];
4120 } aes_gmac;
4121 struct {
4122 u8 pn[6];
4123 } gcmp;
4078 }; 4124 };
4079}; 4125};
4080 4126
@@ -4099,7 +4145,7 @@ void ieee80211_get_key_tx_seq(struct ieee80211_key_conf *keyconf,
4099 * ieee80211_get_key_rx_seq - get key RX sequence counter 4145 * ieee80211_get_key_rx_seq - get key RX sequence counter
4100 * 4146 *
4101 * @keyconf: the parameter passed with the set key 4147 * @keyconf: the parameter passed with the set key
4102 * @tid: The TID, or -1 for the management frame value (CCMP only); 4148 * @tid: The TID, or -1 for the management frame value (CCMP/GCMP only);
4103 * the value on TID 0 is also used for non-QoS frames. For 4149 * the value on TID 0 is also used for non-QoS frames. For
4104 * CMAC, only TID 0 is valid. 4150 * CMAC, only TID 0 is valid.
4105 * @seq: buffer to receive the sequence data 4151 * @seq: buffer to receive the sequence data
@@ -4135,7 +4181,7 @@ void ieee80211_set_key_tx_seq(struct ieee80211_key_conf *keyconf,
4135 * ieee80211_set_key_rx_seq - set key RX sequence counter 4181 * ieee80211_set_key_rx_seq - set key RX sequence counter
4136 * 4182 *
4137 * @keyconf: the parameter passed with the set key 4183 * @keyconf: the parameter passed with the set key
4138 * @tid: The TID, or -1 for the management frame value (CCMP only); 4184 * @tid: The TID, or -1 for the management frame value (CCMP/GCMP only);
4139 * the value on TID 0 is also used for non-QoS frames. For 4185 * the value on TID 0 is also used for non-QoS frames. For
4140 * CMAC, only TID 0 is valid. 4186 * CMAC, only TID 0 is valid.
4141 * @seq: new sequence data 4187 * @seq: new sequence data
diff --git a/include/net/mac802154.h b/include/net/mac802154.h
index c823d910b46c..850647811749 100644
--- a/include/net/mac802154.h
+++ b/include/net/mac802154.h
@@ -20,6 +20,8 @@
20#include <linux/ieee802154.h> 20#include <linux/ieee802154.h>
21#include <linux/skbuff.h> 21#include <linux/skbuff.h>
22 22
23#include <net/cfg802154.h>
24
23/* General MAC frame format: 25/* General MAC frame format:
24 * 2 bytes: Frame Control 26 * 2 bytes: Frame Control
25 * 1 byte: Sequence Number 27 * 1 byte: Sequence Number
@@ -212,7 +214,8 @@ struct ieee802154_ops {
212 unsigned long changed); 214 unsigned long changed);
213 int (*set_txpower)(struct ieee802154_hw *hw, int db); 215 int (*set_txpower)(struct ieee802154_hw *hw, int db);
214 int (*set_lbt)(struct ieee802154_hw *hw, bool on); 216 int (*set_lbt)(struct ieee802154_hw *hw, bool on);
215 int (*set_cca_mode)(struct ieee802154_hw *hw, u8 mode); 217 int (*set_cca_mode)(struct ieee802154_hw *hw,
218 const struct wpan_phy_cca *cca);
216 int (*set_cca_ed_level)(struct ieee802154_hw *hw, 219 int (*set_cca_ed_level)(struct ieee802154_hw *hw,
217 s32 level); 220 s32 level);
218 int (*set_csma_params)(struct ieee802154_hw *hw, 221 int (*set_csma_params)(struct ieee802154_hw *hw,
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 2e8756b8c775..36faf4990c4b 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -60,6 +60,7 @@ struct net {
60 struct list_head exit_list; /* Use only net_mutex */ 60 struct list_head exit_list; /* Use only net_mutex */
61 61
62 struct user_namespace *user_ns; /* Owning user namespace */ 62 struct user_namespace *user_ns; /* Owning user namespace */
63 struct idr netns_ids;
63 64
64 struct ns_common ns; 65 struct ns_common ns;
65 66
@@ -290,6 +291,9 @@ static inline struct net *read_pnet(struct net * const *pnet)
290#define __net_initconst __initconst 291#define __net_initconst __initconst
291#endif 292#endif
292 293
294int peernet2id(struct net *net, struct net *peer);
295struct net *get_net_ns_by_id(struct net *net, int id);
296
293struct pernet_operations { 297struct pernet_operations {
294 struct list_head list; 298 struct list_head list;
295 int (*init)(struct net *net); 299 int (*init)(struct net *net);
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index f0daed2b54d1..74f271a172dd 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -191,8 +191,6 @@ __nf_conntrack_find(struct net *net, u16 zone,
191int nf_conntrack_hash_check_insert(struct nf_conn *ct); 191int nf_conntrack_hash_check_insert(struct nf_conn *ct);
192bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report); 192bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report);
193 193
194void nf_conntrack_flush_report(struct net *net, u32 portid, int report);
195
196bool nf_ct_get_tuplepr(const struct sk_buff *skb, unsigned int nhoff, 194bool nf_ct_get_tuplepr(const struct sk_buff *skb, unsigned int nhoff,
197 u_int16_t l3num, struct nf_conntrack_tuple *tuple); 195 u_int16_t l3num, struct nf_conntrack_tuple *tuple);
198bool nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse, 196bool nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse,
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 64158353ecb2..e010ee8da41d 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -490,14 +490,10 @@ static inline struct sk_buff *nlmsg_new(size_t payload, gfp_t flags)
490 * Corrects the netlink message header to include the appeneded 490 * Corrects the netlink message header to include the appeneded
491 * attributes. Only necessary if attributes have been added to 491 * attributes. Only necessary if attributes have been added to
492 * the message. 492 * the message.
493 *
494 * Returns the total data length of the skb.
495 */ 493 */
496static inline int nlmsg_end(struct sk_buff *skb, struct nlmsghdr *nlh) 494static inline void nlmsg_end(struct sk_buff *skb, struct nlmsghdr *nlh)
497{ 495{
498 nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh; 496 nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh;
499
500 return skb->len;
501} 497}
502 498
503/** 499/**
@@ -520,8 +516,10 @@ static inline void *nlmsg_get_pos(struct sk_buff *skb)
520 */ 516 */
521static inline void nlmsg_trim(struct sk_buff *skb, const void *mark) 517static inline void nlmsg_trim(struct sk_buff *skb, const void *mark)
522{ 518{
523 if (mark) 519 if (mark) {
520 WARN_ON((unsigned char *) mark < skb->data);
524 skb_trim(skb, (unsigned char *) mark - skb->data); 521 skb_trim(skb, (unsigned char *) mark - skb->data);
522 }
525} 523}
526 524
527/** 525/**
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 0ffef1a38efc..dbe225478adb 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -48,7 +48,8 @@ struct netns_ipv4 {
48 struct hlist_head *fib_table_hash; 48 struct hlist_head *fib_table_hash;
49 struct sock *fibnl; 49 struct sock *fibnl;
50 50
51 struct sock **icmp_sk; 51 struct sock * __percpu *icmp_sk;
52
52 struct inet_peer_base *peers; 53 struct inet_peer_base *peers;
53 struct tcpm_hash_bucket *tcp_metrics_hash; 54 struct tcpm_hash_bucket *tcp_metrics_hash;
54 unsigned int tcp_metrics_hash_log; 55 unsigned int tcp_metrics_hash_log;
@@ -81,6 +82,8 @@ struct netns_ipv4 {
81 82
82 int sysctl_fwmark_reflect; 83 int sysctl_fwmark_reflect;
83 int sysctl_tcp_fwmark_accept; 84 int sysctl_tcp_fwmark_accept;
85 int sysctl_tcp_mtu_probing;
86 int sysctl_tcp_base_mss;
84 87
85 struct ping_group_range ping_group_range; 88 struct ping_group_range ping_group_range;
86 89
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index 14bd0e1c47fa..ab672b537dd4 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -51,8 +51,10 @@ struct nfc_hci_ops {
51 int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); 51 int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb);
52 int (*check_presence)(struct nfc_hci_dev *hdev, 52 int (*check_presence)(struct nfc_hci_dev *hdev,
53 struct nfc_target *target); 53 struct nfc_target *target);
54 int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, 54 int (*event_received)(struct nfc_hci_dev *hdev, u8 pipe, u8 event,
55 struct sk_buff *skb); 55 struct sk_buff *skb);
56 void (*cmd_received)(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd,
57 struct sk_buff *skb);
56 int (*fw_download)(struct nfc_hci_dev *hdev, const char *firmware_name); 58 int (*fw_download)(struct nfc_hci_dev *hdev, const char *firmware_name);
57 int (*discover_se)(struct nfc_hci_dev *dev); 59 int (*discover_se)(struct nfc_hci_dev *dev);
58 int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx); 60 int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx);
@@ -63,8 +65,10 @@ struct nfc_hci_ops {
63}; 65};
64 66
65/* Pipes */ 67/* Pipes */
66#define NFC_HCI_INVALID_PIPE 0x80
67#define NFC_HCI_DO_NOT_CREATE_PIPE 0x81 68#define NFC_HCI_DO_NOT_CREATE_PIPE 0x81
69#define NFC_HCI_INVALID_PIPE 0x80
70#define NFC_HCI_INVALID_GATE 0xFF
71#define NFC_HCI_INVALID_HOST 0x80
68#define NFC_HCI_LINK_MGMT_PIPE 0x00 72#define NFC_HCI_LINK_MGMT_PIPE 0x00
69#define NFC_HCI_ADMIN_PIPE 0x01 73#define NFC_HCI_ADMIN_PIPE 0x01
70 74
@@ -73,7 +77,13 @@ struct nfc_hci_gate {
73 u8 pipe; 77 u8 pipe;
74}; 78};
75 79
80struct nfc_hci_pipe {
81 u8 gate;
82 u8 dest_host;
83};
84
76#define NFC_HCI_MAX_CUSTOM_GATES 50 85#define NFC_HCI_MAX_CUSTOM_GATES 50
86#define NFC_HCI_MAX_PIPES 127
77struct nfc_hci_init_data { 87struct nfc_hci_init_data {
78 u8 gate_count; 88 u8 gate_count;
79 struct nfc_hci_gate gates[NFC_HCI_MAX_CUSTOM_GATES]; 89 struct nfc_hci_gate gates[NFC_HCI_MAX_CUSTOM_GATES];
@@ -125,6 +135,7 @@ struct nfc_hci_dev {
125 void *clientdata; 135 void *clientdata;
126 136
127 u8 gate2pipe[NFC_HCI_MAX_GATES]; 137 u8 gate2pipe[NFC_HCI_MAX_GATES];
138 struct nfc_hci_pipe pipes[NFC_HCI_MAX_PIPES];
128 139
129 u8 sw_romlib; 140 u8 sw_romlib;
130 u8 sw_patch; 141 u8 sw_patch;
@@ -167,6 +178,8 @@ void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev);
167void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); 178void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err);
168 179
169int nfc_hci_result_to_errno(u8 result); 180int nfc_hci_result_to_errno(u8 result);
181void nfc_hci_reset_pipes(struct nfc_hci_dev *dev);
182void nfc_hci_reset_pipes_per_host(struct nfc_hci_dev *hdev, u8 host);
170 183
171/* Host IDs */ 184/* Host IDs */
172#define NFC_HCI_HOST_CONTROLLER_ID 0x00 185#define NFC_HCI_HOST_CONTROLLER_ID 0x00
@@ -219,6 +232,12 @@ int nfc_hci_result_to_errno(u8 result);
219#define NFC_HCI_EVT_POST_DATA 0x02 232#define NFC_HCI_EVT_POST_DATA 0x02
220#define NFC_HCI_EVT_HOT_PLUG 0x03 233#define NFC_HCI_EVT_HOT_PLUG 0x03
221 234
235/* Generic commands */
236#define NFC_HCI_ANY_SET_PARAMETER 0x01
237#define NFC_HCI_ANY_GET_PARAMETER 0x02
238#define NFC_HCI_ANY_OPEN_PIPE 0x03
239#define NFC_HCI_ANY_CLOSE_PIPE 0x04
240
222/* Reader RF gates events */ 241/* Reader RF gates events */
223#define NFC_HCI_EVT_READER_REQUESTED 0x10 242#define NFC_HCI_EVT_READER_REQUESTED 0x10
224#define NFC_HCI_EVT_END_OPERATION 0x11 243#define NFC_HCI_EVT_END_OPERATION 0x11
@@ -249,8 +268,6 @@ int nfc_hci_send_cmd(struct nfc_hci_dev *hdev, u8 gate, u8 cmd,
249int nfc_hci_send_cmd_async(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, 268int nfc_hci_send_cmd_async(struct nfc_hci_dev *hdev, u8 gate, u8 cmd,
250 const u8 *param, size_t param_len, 269 const u8 *param, size_t param_len,
251 data_exchange_cb_t cb, void *cb_context); 270 data_exchange_cb_t cb, void *cb_context);
252int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response,
253 const u8 *param, size_t param_len);
254int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, 271int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event,
255 const u8 *param, size_t param_len); 272 const u8 *param, size_t param_len);
256int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); 273int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate);
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h
index e7257a4653b4..a2f2f3d3196d 100644
--- a/include/net/nfc/nci.h
+++ b/include/net/nfc/nci.h
@@ -62,6 +62,25 @@
62#define NCI_STATUS_NFCEE_PROTOCOL_ERROR 0xc2 62#define NCI_STATUS_NFCEE_PROTOCOL_ERROR 0xc2
63#define NCI_STATUS_NFCEE_TIMEOUT_ERROR 0xc3 63#define NCI_STATUS_NFCEE_TIMEOUT_ERROR 0xc3
64 64
65/* NFCEE Interface/Protocols */
66#define NCI_NFCEE_INTERFACE_APDU 0x00
67#define NCI_NFCEE_INTERFACE_HCI_ACCESS 0x01
68#define NCI_NFCEE_INTERFACE_TYPE3_CMD_SET 0x02
69#define NCI_NFCEE_INTERFACE_TRANSPARENT 0x03
70
71/* Destination type */
72#define NCI_DESTINATION_NFCC_LOOPBACK 0x01
73#define NCI_DESTINATION_REMOTE_NFC_ENDPOINT 0x02
74#define NCI_DESTINATION_NFCEE 0x03
75
76/* Destination-specific parameters type */
77#define NCI_DESTINATION_SPECIFIC_PARAM_RF_TYPE 0x00
78#define NCI_DESTINATION_SPECIFIC_PARAM_NFCEE_TYPE 0x01
79
80/* NFCEE Discovery Action */
81#define NCI_NFCEE_DISCOVERY_ACTION_DISABLE 0x00
82#define NCI_NFCEE_DISCOVERY_ACTION_ENABLE 0x01
83
65/* NCI RF Technology and Mode */ 84/* NCI RF Technology and Mode */
66#define NCI_NFC_A_PASSIVE_POLL_MODE 0x00 85#define NCI_NFC_A_PASSIVE_POLL_MODE 0x00
67#define NCI_NFC_B_PASSIVE_POLL_MODE 0x01 86#define NCI_NFC_B_PASSIVE_POLL_MODE 0x01
@@ -224,6 +243,28 @@ struct nci_core_set_config_cmd {
224 struct set_config_param param; /* support 1 param per cmd is enough */ 243 struct set_config_param param; /* support 1 param per cmd is enough */
225} __packed; 244} __packed;
226 245
246#define NCI_OP_CORE_CONN_CREATE_CMD nci_opcode_pack(NCI_GID_CORE, 0x04)
247#define DEST_SPEC_PARAMS_ID_INDEX 0
248#define DEST_SPEC_PARAMS_PROTOCOL_INDEX 1
249struct dest_spec_params {
250 __u8 id;
251 __u8 protocol;
252} __packed;
253
254struct core_conn_create_dest_spec_params {
255 __u8 type;
256 __u8 length;
257 __u8 value[0];
258} __packed;
259
260struct nci_core_conn_create_cmd {
261 __u8 destination_type;
262 __u8 number_destination_params;
263 struct core_conn_create_dest_spec_params params[0];
264} __packed;
265
266#define NCI_OP_CORE_CONN_CLOSE_CMD nci_opcode_pack(NCI_GID_CORE, 0x05)
267
227#define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) 268#define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00)
228struct disc_map_config { 269struct disc_map_config {
229 __u8 rf_protocol; 270 __u8 rf_protocol;
@@ -260,6 +301,19 @@ struct nci_rf_deactivate_cmd {
260 __u8 type; 301 __u8 type;
261} __packed; 302} __packed;
262 303
304#define NCI_OP_NFCEE_DISCOVER_CMD nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x00)
305struct nci_nfcee_discover_cmd {
306 __u8 discovery_action;
307} __packed;
308
309#define NCI_OP_NFCEE_MODE_SET_CMD nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x01)
310#define NCI_NFCEE_DISABLE 0x00
311#define NCI_NFCEE_ENABLE 0x01
312struct nci_nfcee_mode_set_cmd {
313 __u8 nfcee_id;
314 __u8 nfcee_mode;
315} __packed;
316
263/* ----------------------- */ 317/* ----------------------- */
264/* ---- NCI Responses ---- */ 318/* ---- NCI Responses ---- */
265/* ----------------------- */ 319/* ----------------------- */
@@ -295,6 +349,16 @@ struct nci_core_set_config_rsp {
295 __u8 params_id[0]; /* variable size array */ 349 __u8 params_id[0]; /* variable size array */
296} __packed; 350} __packed;
297 351
352#define NCI_OP_CORE_CONN_CREATE_RSP nci_opcode_pack(NCI_GID_CORE, 0x04)
353struct nci_core_conn_create_rsp {
354 __u8 status;
355 __u8 max_ctrl_pkt_payload_len;
356 __u8 credits_cnt;
357 __u8 conn_id;
358} __packed;
359
360#define NCI_OP_CORE_CONN_CLOSE_RSP nci_opcode_pack(NCI_GID_CORE, 0x05)
361
298#define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) 362#define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00)
299 363
300#define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) 364#define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
@@ -303,6 +367,13 @@ struct nci_core_set_config_rsp {
303 367
304#define NCI_OP_RF_DEACTIVATE_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x06) 368#define NCI_OP_RF_DEACTIVATE_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
305 369
370#define NCI_OP_NFCEE_DISCOVER_RSP nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x00)
371struct nci_nfcee_discover_rsp {
372 __u8 status;
373 __u8 num_nfcee;
374} __packed;
375
376#define NCI_OP_NFCEE_MODE_SET_RSP nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x01)
306/* --------------------------- */ 377/* --------------------------- */
307/* ---- NCI Notifications ---- */ 378/* ---- NCI Notifications ---- */
308/* --------------------------- */ 379/* --------------------------- */
@@ -430,4 +501,30 @@ struct nci_rf_deactivate_ntf {
430 __u8 reason; 501 __u8 reason;
431} __packed; 502} __packed;
432 503
504#define NCI_OP_RF_NFCEE_ACTION_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x09)
505struct nci_rf_nfcee_action_ntf {
506 __u8 nfcee_id;
507 __u8 trigger;
508 __u8 supported_data_length;
509 __u8 supported_data[0];
510} __packed;
511
512#define NCI_OP_NFCEE_DISCOVER_NTF nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x00)
513struct nci_nfcee_supported_protocol {
514 __u8 num_protocol;
515 __u8 supported_protocol[0];
516} __packed;
517
518struct nci_nfcee_information_tlv {
519 __u8 num_tlv;
520 __u8 information_tlv[0];
521} __packed;
522
523struct nci_nfcee_discover_ntf {
524 __u8 nfcee_id;
525 __u8 nfcee_status;
526 struct nci_nfcee_supported_protocol supported_protocols;
527 struct nci_nfcee_information_tlv information_tlv;
528} __packed;
529
433#endif /* __NCI_H */ 530#endif /* __NCI_H */
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index 9e51bb4d841e..ff87f8611fa3 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -78,15 +78,107 @@ struct nci_ops {
78 int (*se_io)(struct nci_dev *ndev, u32 se_idx, 78 int (*se_io)(struct nci_dev *ndev, u32 se_idx,
79 u8 *apdu, size_t apdu_length, 79 u8 *apdu, size_t apdu_length,
80 se_io_cb_t cb, void *cb_context); 80 se_io_cb_t cb, void *cb_context);
81 int (*hci_load_session)(struct nci_dev *ndev);
82 void (*hci_event_received)(struct nci_dev *ndev, u8 pipe, u8 event,
83 struct sk_buff *skb);
84 void (*hci_cmd_received)(struct nci_dev *ndev, u8 pipe, u8 cmd,
85 struct sk_buff *skb);
81}; 86};
82 87
83#define NCI_MAX_SUPPORTED_RF_INTERFACES 4 88#define NCI_MAX_SUPPORTED_RF_INTERFACES 4
84#define NCI_MAX_DISCOVERED_TARGETS 10 89#define NCI_MAX_DISCOVERED_TARGETS 10
90#define NCI_MAX_NUM_NFCEE 255
91#define NCI_MAX_CONN_ID 7
92
93struct nci_conn_info {
94 struct list_head list;
95 __u8 id; /* can be an RF Discovery ID or an NFCEE ID */
96 __u8 conn_id;
97 __u8 max_pkt_payload_len;
98
99 atomic_t credits_cnt;
100 __u8 initial_num_credits;
101
102 data_exchange_cb_t data_exchange_cb;
103 void *data_exchange_cb_context;
104
105 struct sk_buff *rx_skb;
106};
107
108#define NCI_INVALID_CONN_ID 0x80
109
110#define NCI_HCI_ANY_OPEN_PIPE 0x03
111
112/* Gates */
113#define NCI_HCI_ADMIN_GATE 0x00
114#define NCI_HCI_LINK_MGMT_GATE 0x06
115
116/* Pipes */
117#define NCI_HCI_LINK_MGMT_PIPE 0x00
118#define NCI_HCI_ADMIN_PIPE 0x01
119
120/* Generic responses */
121#define NCI_HCI_ANY_OK 0x00
122#define NCI_HCI_ANY_E_NOT_CONNECTED 0x01
123#define NCI_HCI_ANY_E_CMD_PAR_UNKNOWN 0x02
124#define NCI_HCI_ANY_E_NOK 0x03
125#define NCI_HCI_ANY_E_PIPES_FULL 0x04
126#define NCI_HCI_ANY_E_REG_PAR_UNKNOWN 0x05
127#define NCI_HCI_ANY_E_PIPE_NOT_OPENED 0x06
128#define NCI_HCI_ANY_E_CMD_NOT_SUPPORTED 0x07
129#define NCI_HCI_ANY_E_INHIBITED 0x08
130#define NCI_HCI_ANY_E_TIMEOUT 0x09
131#define NCI_HCI_ANY_E_REG_ACCESS_DENIED 0x0a
132#define NCI_HCI_ANY_E_PIPE_ACCESS_DENIED 0x0b
133
134#define NCI_HCI_DO_NOT_OPEN_PIPE 0x81
135#define NCI_HCI_INVALID_PIPE 0x80
136#define NCI_HCI_INVALID_GATE 0xFF
137#define NCI_HCI_INVALID_HOST 0x80
138
139#define NCI_HCI_MAX_CUSTOM_GATES 50
140#define NCI_HCI_MAX_PIPES 127
141
142struct nci_hci_gate {
143 u8 gate;
144 u8 pipe;
145 u8 dest_host;
146} __packed;
147
148struct nci_hci_pipe {
149 u8 gate;
150 u8 host;
151} __packed;
152
153struct nci_hci_init_data {
154 u8 gate_count;
155 struct nci_hci_gate gates[NCI_HCI_MAX_CUSTOM_GATES];
156 char session_id[9];
157};
158
159#define NCI_HCI_MAX_GATES 256
160
161struct nci_hci_dev {
162 u8 nfcee_id;
163 struct nci_dev *ndev;
164 struct nci_conn_info *conn_info;
165
166 struct nci_hci_init_data init_data;
167 struct nci_hci_pipe pipes[NCI_HCI_MAX_PIPES];
168 u8 gate2pipe[NCI_HCI_MAX_GATES];
169 int expected_pipes;
170 int count_pipes;
171
172 struct sk_buff_head rx_hcp_frags;
173 struct work_struct msg_rx_work;
174 struct sk_buff_head msg_rx_queue;
175};
85 176
86/* NCI Core structures */ 177/* NCI Core structures */
87struct nci_dev { 178struct nci_dev {
88 struct nfc_dev *nfc_dev; 179 struct nfc_dev *nfc_dev;
89 struct nci_ops *ops; 180 struct nci_ops *ops;
181 struct nci_hci_dev *hci_dev;
90 182
91 int tx_headroom; 183 int tx_headroom;
92 int tx_tailroom; 184 int tx_tailroom;
@@ -95,7 +187,10 @@ struct nci_dev {
95 unsigned long flags; 187 unsigned long flags;
96 188
97 atomic_t cmd_cnt; 189 atomic_t cmd_cnt;
98 atomic_t credits_cnt; 190 __u8 cur_conn_id;
191
192 struct list_head conn_info_list;
193 struct nci_conn_info *rf_conn_info;
99 194
100 struct timer_list cmd_timer; 195 struct timer_list cmd_timer;
101 struct timer_list data_timer; 196 struct timer_list data_timer;
@@ -141,13 +236,10 @@ struct nci_dev {
141 __u8 manufact_id; 236 __u8 manufact_id;
142 __u32 manufact_specific_info; 237 __u32 manufact_specific_info;
143 238
144 /* received during NCI_OP_RF_INTF_ACTIVATED_NTF */ 239 /* Save RF Discovery ID or NFCEE ID under conn_create */
145 __u8 max_data_pkt_payload_size; 240 __u8 cur_id;
146 __u8 initial_num_credits;
147 241
148 /* stored during nci_data_exchange */ 242 /* stored during nci_data_exchange */
149 data_exchange_cb_t data_exchange_cb;
150 void *data_exchange_cb_context;
151 struct sk_buff *rx_data_reassembly; 243 struct sk_buff *rx_data_reassembly;
152 244
153 /* stored during intf_activated_ntf */ 245 /* stored during intf_activated_ntf */
@@ -163,9 +255,36 @@ struct nci_dev *nci_allocate_device(struct nci_ops *ops,
163void nci_free_device(struct nci_dev *ndev); 255void nci_free_device(struct nci_dev *ndev);
164int nci_register_device(struct nci_dev *ndev); 256int nci_register_device(struct nci_dev *ndev);
165void nci_unregister_device(struct nci_dev *ndev); 257void nci_unregister_device(struct nci_dev *ndev);
258int nci_request(struct nci_dev *ndev,
259 void (*req)(struct nci_dev *ndev,
260 unsigned long opt),
261 unsigned long opt, __u32 timeout);
166int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb); 262int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb);
167int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val); 263int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val);
168 264
265int nci_nfcee_discover(struct nci_dev *ndev, u8 action);
266int nci_nfcee_mode_set(struct nci_dev *ndev, u8 nfcee_id, u8 nfcee_mode);
267int nci_core_conn_create(struct nci_dev *ndev, u8 destination_type,
268 u8 number_destination_params,
269 size_t params_len,
270 struct core_conn_create_dest_spec_params *params);
271int nci_core_conn_close(struct nci_dev *ndev, u8 conn_id);
272
273struct nci_hci_dev *nci_hci_allocate(struct nci_dev *ndev);
274int nci_hci_send_event(struct nci_dev *ndev, u8 gate, u8 event,
275 const u8 *param, size_t param_len);
276int nci_hci_send_cmd(struct nci_dev *ndev, u8 gate,
277 u8 cmd, const u8 *param, size_t param_len,
278 struct sk_buff **skb);
279int nci_hci_open_pipe(struct nci_dev *ndev, u8 pipe);
280int nci_hci_connect_gate(struct nci_dev *ndev, u8 dest_host,
281 u8 dest_gate, u8 pipe);
282int nci_hci_set_param(struct nci_dev *ndev, u8 gate, u8 idx,
283 const u8 *param, size_t param_len);
284int nci_hci_get_param(struct nci_dev *ndev, u8 gate, u8 idx,
285 struct sk_buff **skb);
286int nci_hci_dev_session_init(struct nci_dev *ndev);
287
169static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, 288static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev,
170 unsigned int len, 289 unsigned int len,
171 gfp_t how) 290 gfp_t how)
@@ -200,7 +319,9 @@ void nci_rx_data_packet(struct nci_dev *ndev, struct sk_buff *skb);
200int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload); 319int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload);
201int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb); 320int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb);
202void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb, 321void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb,
203 int err); 322 __u8 conn_id, int err);
323void nci_hci_data_received_cb(void *context, struct sk_buff *skb, int err);
324
204void nci_clear_target_list(struct nci_dev *ndev); 325void nci_clear_target_list(struct nci_dev *ndev);
205 326
206/* ----- NCI requests ----- */ 327/* ----- NCI requests ----- */
@@ -209,6 +330,8 @@ void nci_clear_target_list(struct nci_dev *ndev);
209#define NCI_REQ_CANCELED 2 330#define NCI_REQ_CANCELED 2
210 331
211void nci_req_complete(struct nci_dev *ndev, int result); 332void nci_req_complete(struct nci_dev *ndev, int result);
333struct nci_conn_info *nci_get_conn_info_by_conn_id(struct nci_dev *ndev,
334 int conn_id);
212 335
213/* ----- NCI status code ----- */ 336/* ----- NCI status code ----- */
214int nci_to_errno(__u8 code); 337int nci_to_errno(__u8 code);
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 12adb817c27a..73190e65d5c1 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -135,6 +135,31 @@ struct nfc_se {
135 u16 state; 135 u16 state;
136}; 136};
137 137
138/**
139 * nfc_evt_transaction - A struct for NFC secure element event transaction.
140 *
141 * @aid: The application identifier triggering the event
142 *
143 * @aid_len: The application identifier length [5:16]
144 *
145 * @params: The application parameters transmitted during the transaction
146 *
147 * @params_len: The applications parameters length [0:255]
148 *
149 */
150#define NFC_MIN_AID_LENGTH 5
151#define NFC_MAX_AID_LENGTH 16
152#define NFC_MAX_PARAMS_LENGTH 255
153
154#define NFC_EVT_TRANSACTION_AID_TAG 0x81
155#define NFC_EVT_TRANSACTION_PARAMS_TAG 0x82
156struct nfc_evt_transaction {
157 u32 aid_len;
158 u8 aid[NFC_MAX_AID_LENGTH];
159 u8 params_len;
160 u8 params[NFC_MAX_PARAMS_LENGTH];
161} __packed;
162
138struct nfc_genl_data { 163struct nfc_genl_data {
139 u32 poll_req_portid; 164 u32 poll_req_portid;
140 struct mutex genl_data_mutex; 165 struct mutex genl_data_mutex;
@@ -262,6 +287,8 @@ int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb);
262 287
263void nfc_driver_failure(struct nfc_dev *dev, int err); 288void nfc_driver_failure(struct nfc_dev *dev, int err);
264 289
290int nfc_se_transaction(struct nfc_dev *dev, u8 se_idx,
291 struct nfc_evt_transaction *evt_transaction);
265int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type); 292int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type);
266int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); 293int nfc_remove_se(struct nfc_dev *dev, u32 se_idx);
267struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx); 294struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx);
diff --git a/include/net/nl802154.h b/include/net/nl802154.h
index 6dbd406ca41b..f8b5bc997959 100644
--- a/include/net/nl802154.h
+++ b/include/net/nl802154.h
@@ -82,7 +82,7 @@ enum nl802154_attrs {
82 NL802154_ATTR_TX_POWER, 82 NL802154_ATTR_TX_POWER,
83 83
84 NL802154_ATTR_CCA_MODE, 84 NL802154_ATTR_CCA_MODE,
85 NL802154_ATTR_CCA_MODE3_AND, 85 NL802154_ATTR_CCA_OPT,
86 NL802154_ATTR_CCA_ED_LEVEL, 86 NL802154_ATTR_CCA_ED_LEVEL,
87 87
88 NL802154_ATTR_MAX_FRAME_RETRIES, 88 NL802154_ATTR_MAX_FRAME_RETRIES,
@@ -119,4 +119,47 @@ enum nl802154_iftype {
119 NL802154_IFTYPE_MAX = NUM_NL802154_IFTYPES - 1 119 NL802154_IFTYPE_MAX = NUM_NL802154_IFTYPES - 1
120}; 120};
121 121
122/**
123 * enum nl802154_cca_modes - cca modes
124 *
125 * @__NL802154_CCA_INVALID: cca mode number 0 is reserved
126 * @NL802154_CCA_ENERGY: Energy above threshold
127 * @NL802154_CCA_CARRIER: Carrier sense only
128 * @NL802154_CCA_ENERGY_CARRIER: Carrier sense with energy above threshold
129 * @NL802154_CCA_ALOHA: CCA shall always report an idle medium
130 * @NL802154_CCA_UWB_SHR: UWB preamble sense based on the SHR of a frame
131 * @NL802154_CCA_UWB_MULTIPEXED: UWB preamble sense based on the packet with
132 * the multiplexed preamble
133 * @__NL802154_CCA_ATTR_AFTER_LAST: Internal
134 * @NL802154_CCA_ATTR_MAX: Maximum CCA attribute number
135 */
136enum nl802154_cca_modes {
137 __NL802154_CCA_INVALID,
138 NL802154_CCA_ENERGY,
139 NL802154_CCA_CARRIER,
140 NL802154_CCA_ENERGY_CARRIER,
141 NL802154_CCA_ALOHA,
142 NL802154_CCA_UWB_SHR,
143 NL802154_CCA_UWB_MULTIPEXED,
144
145 /* keep last */
146 __NL802154_CCA_ATTR_AFTER_LAST,
147 NL802154_CCA_ATTR_MAX = __NL802154_CCA_ATTR_AFTER_LAST - 1
148};
149
150/**
151 * enum nl802154_cca_opts - additional options for cca modes
152 *
153 * @NL802154_CCA_OPT_ENERGY_CARRIER_OR: NL802154_CCA_ENERGY_CARRIER with OR
154 * @NL802154_CCA_OPT_ENERGY_CARRIER_AND: NL802154_CCA_ENERGY_CARRIER with AND
155 */
156enum nl802154_cca_opts {
157 NL802154_CCA_OPT_ENERGY_CARRIER_AND,
158 NL802154_CCA_OPT_ENERGY_CARRIER_OR,
159
160 /* keep last */
161 __NL802154_CCA_OPT_ATTR_AFTER_LAST,
162 NL802154_CCA_OPT_ATTR_MAX = __NL802154_CCA_OPT_ATTR_AFTER_LAST - 1
163};
164
122#endif /* __NL802154_H */ 165#endif /* __NL802154_H */
diff --git a/include/net/ping.h b/include/net/ping.h
index f074060bc5de..cc16d413f681 100644
--- a/include/net/ping.h
+++ b/include/net/ping.h
@@ -59,7 +59,7 @@ extern struct pingv6_ops pingv6_ops;
59 59
60struct pingfakehdr { 60struct pingfakehdr {
61 struct icmphdr icmph; 61 struct icmphdr icmph;
62 struct iovec *iov; 62 struct msghdr *msg;
63 sa_family_t family; 63 sa_family_t family;
64 __wsum wcheck; 64 __wsum wcheck;
65}; 65};
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 27a33833ff4a..2342bf12cb78 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/jiffies.h> 4#include <linux/jiffies.h>
5#include <linux/ktime.h> 5#include <linux/ktime.h>
6#include <linux/if_vlan.h>
6#include <net/sch_generic.h> 7#include <net/sch_generic.h>
7 8
8struct qdisc_walker { 9struct qdisc_walker {
@@ -114,6 +115,17 @@ int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp,
114int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp, 115int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
115 struct tcf_result *res); 116 struct tcf_result *res);
116 117
118static inline __be16 tc_skb_protocol(const struct sk_buff *skb)
119{
120 /* We need to take extra care in case the skb came via
121 * vlan accelerated path. In that case, use skb->vlan_proto
122 * as the original vlan header was already stripped.
123 */
124 if (skb_vlan_tag_present(skb))
125 return skb->vlan_proto;
126 return skb->protocol;
127}
128
117/* Calculate maximal size of packet seen by hard_start_xmit 129/* Calculate maximal size of packet seen by hard_start_xmit
118 routine of this device. 130 routine of this device.
119 */ 131 */
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index b776d72d84be..ebc5a2ed8631 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -147,6 +147,24 @@ struct regulatory_request {
147 * NL80211_IFTYPE_P2P_CLIENT, NL80211_IFTYPE_P2P_GO, 147 * NL80211_IFTYPE_P2P_CLIENT, NL80211_IFTYPE_P2P_GO,
148 * NL80211_IFTYPE_P2P_DEVICE. The flag will be set by default if a device 148 * NL80211_IFTYPE_P2P_DEVICE. The flag will be set by default if a device
149 * includes any modes unsupported for enforcement checking. 149 * includes any modes unsupported for enforcement checking.
150 * @REGULATORY_WIPHY_SELF_MANAGED: for devices that employ wiphy-specific
151 * regdom management. These devices will ignore all regdom changes not
152 * originating from their own wiphy.
153 * A self-managed wiphys only employs regulatory information obtained from
154 * the FW and driver and does not use other cfg80211 sources like
155 * beacon-hints, country-code IEs and hints from other devices on the same
156 * system. Conversely, a self-managed wiphy does not share its regulatory
157 * hints with other devices in the system. If a system contains several
158 * devices, one or more of which are self-managed, there might be
159 * contradictory regulatory settings between them. Usage of flag is
160 * generally discouraged. Only use it if the FW/driver is incompatible
161 * with non-locally originated hints.
162 * This flag is incompatible with the flags: %REGULATORY_CUSTOM_REG,
163 * %REGULATORY_STRICT_REG, %REGULATORY_COUNTRY_IE_FOLLOW_POWER,
164 * %REGULATORY_COUNTRY_IE_IGNORE and %REGULATORY_DISABLE_BEACON_HINTS.
165 * Mixing any of the above flags with this flag will result in a failure
166 * to register the wiphy. This flag implies
167 * %REGULATORY_DISABLE_BEACON_HINTS and %REGULATORY_COUNTRY_IE_IGNORE.
150 */ 168 */
151enum ieee80211_regulatory_flags { 169enum ieee80211_regulatory_flags {
152 REGULATORY_CUSTOM_REG = BIT(0), 170 REGULATORY_CUSTOM_REG = BIT(0),
@@ -156,6 +174,7 @@ enum ieee80211_regulatory_flags {
156 REGULATORY_COUNTRY_IE_IGNORE = BIT(4), 174 REGULATORY_COUNTRY_IE_IGNORE = BIT(4),
157 REGULATORY_ENABLE_RELAX_NO_IR = BIT(5), 175 REGULATORY_ENABLE_RELAX_NO_IR = BIT(5),
158 REGULATORY_IGNORE_STALE_KICKOFF = BIT(6), 176 REGULATORY_IGNORE_STALE_KICKOFF = BIT(6),
177 REGULATORY_WIPHY_SELF_MANAGED = BIT(7),
159}; 178};
160 179
161struct ieee80211_freq_range { 180struct ieee80211_freq_range {
diff --git a/include/net/route.h b/include/net/route.h
index b17cf28f996e..fe22d03afb6a 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -46,6 +46,7 @@
46 46
47struct fib_nh; 47struct fib_nh;
48struct fib_info; 48struct fib_info;
49struct uncached_list;
49struct rtable { 50struct rtable {
50 struct dst_entry dst; 51 struct dst_entry dst;
51 52
@@ -64,6 +65,7 @@ struct rtable {
64 u32 rt_pmtu; 65 u32 rt_pmtu;
65 66
66 struct list_head rt_uncached; 67 struct list_head rt_uncached;
68 struct uncached_list *rt_uncached_list;
67}; 69};
68 70
69static inline bool rt_is_input_route(const struct rtable *rt) 71static inline bool rt_is_input_route(const struct rtable *rt)
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index e21b9f9653c0..6c6d5393fc34 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -46,6 +46,7 @@ static inline int rtnl_msg_family(const struct nlmsghdr *nlh)
46 * to create when creating a new device. 46 * to create when creating a new device.
47 * @get_num_rx_queues: Function to determine number of receive queues 47 * @get_num_rx_queues: Function to determine number of receive queues
48 * to create when creating a new device. 48 * to create when creating a new device.
49 * @get_link_net: Function to get the i/o netns of the device
49 */ 50 */
50struct rtnl_link_ops { 51struct rtnl_link_ops {
51 struct list_head list; 52 struct list_head list;
@@ -93,6 +94,7 @@ struct rtnl_link_ops {
93 int (*fill_slave_info)(struct sk_buff *skb, 94 int (*fill_slave_info)(struct sk_buff *skb,
94 const struct net_device *dev, 95 const struct net_device *dev,
95 const struct net_device *slave_dev); 96 const struct net_device *slave_dev);
97 struct net *(*get_link_net)(const struct net_device *dev);
96}; 98};
97 99
98int __rtnl_link_register(struct rtnl_link_ops *ops); 100int __rtnl_link_register(struct rtnl_link_ops *ops);
diff --git a/include/net/sock.h b/include/net/sock.h
index 2210fec65669..e13824570b0f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -857,18 +857,6 @@ static inline void sock_rps_record_flow_hash(__u32 hash)
857#endif 857#endif
858} 858}
859 859
860static inline void sock_rps_reset_flow_hash(__u32 hash)
861{
862#ifdef CONFIG_RPS
863 struct rps_sock_flow_table *sock_flow_table;
864
865 rcu_read_lock();
866 sock_flow_table = rcu_dereference(rps_sock_flow_table);
867 rps_reset_sock_flow(sock_flow_table, hash);
868 rcu_read_unlock();
869#endif
870}
871
872static inline void sock_rps_record_flow(const struct sock *sk) 860static inline void sock_rps_record_flow(const struct sock *sk)
873{ 861{
874#ifdef CONFIG_RPS 862#ifdef CONFIG_RPS
@@ -876,28 +864,18 @@ static inline void sock_rps_record_flow(const struct sock *sk)
876#endif 864#endif
877} 865}
878 866
879static inline void sock_rps_reset_flow(const struct sock *sk)
880{
881#ifdef CONFIG_RPS
882 sock_rps_reset_flow_hash(sk->sk_rxhash);
883#endif
884}
885
886static inline void sock_rps_save_rxhash(struct sock *sk, 867static inline void sock_rps_save_rxhash(struct sock *sk,
887 const struct sk_buff *skb) 868 const struct sk_buff *skb)
888{ 869{
889#ifdef CONFIG_RPS 870#ifdef CONFIG_RPS
890 if (unlikely(sk->sk_rxhash != skb->hash)) { 871 if (unlikely(sk->sk_rxhash != skb->hash))
891 sock_rps_reset_flow(sk);
892 sk->sk_rxhash = skb->hash; 872 sk->sk_rxhash = skb->hash;
893 }
894#endif 873#endif
895} 874}
896 875
897static inline void sock_rps_reset_rxhash(struct sock *sk) 876static inline void sock_rps_reset_rxhash(struct sock *sk)
898{ 877{
899#ifdef CONFIG_RPS 878#ifdef CONFIG_RPS
900 sock_rps_reset_flow(sk);
901 sk->sk_rxhash = 0; 879 sk->sk_rxhash = 0;
902#endif 880#endif
903} 881}
@@ -1374,29 +1352,6 @@ void sk_prot_clear_portaddr_nulls(struct sock *sk, int size);
1374#define SOCK_BINDADDR_LOCK 4 1352#define SOCK_BINDADDR_LOCK 4
1375#define SOCK_BINDPORT_LOCK 8 1353#define SOCK_BINDPORT_LOCK 8
1376 1354
1377/* sock_iocb: used to kick off async processing of socket ios */
1378struct sock_iocb {
1379 struct list_head list;
1380
1381 int flags;
1382 int size;
1383 struct socket *sock;
1384 struct sock *sk;
1385 struct scm_cookie *scm;
1386 struct msghdr *msg, async_msg;
1387 struct kiocb *kiocb;
1388};
1389
1390static inline struct sock_iocb *kiocb_to_siocb(struct kiocb *iocb)
1391{
1392 return (struct sock_iocb *)iocb->private;
1393}
1394
1395static inline struct kiocb *siocb_to_kiocb(struct sock_iocb *si)
1396{
1397 return si->kiocb;
1398}
1399
1400struct socket_alloc { 1355struct socket_alloc {
1401 struct socket socket; 1356 struct socket socket;
1402 struct inode vfs_inode; 1357 struct inode vfs_inode;
@@ -1826,27 +1781,25 @@ static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags)
1826} 1781}
1827 1782
1828static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb, 1783static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb,
1829 char __user *from, char *to, 1784 struct iov_iter *from, char *to,
1830 int copy, int offset) 1785 int copy, int offset)
1831{ 1786{
1832 if (skb->ip_summed == CHECKSUM_NONE) { 1787 if (skb->ip_summed == CHECKSUM_NONE) {
1833 int err = 0; 1788 __wsum csum = 0;
1834 __wsum csum = csum_and_copy_from_user(from, to, copy, 0, &err); 1789 if (csum_and_copy_from_iter(to, copy, &csum, from) != copy)
1835 if (err) 1790 return -EFAULT;
1836 return err;
1837 skb->csum = csum_block_add(skb->csum, csum, offset); 1791 skb->csum = csum_block_add(skb->csum, csum, offset);
1838 } else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY) { 1792 } else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY) {
1839 if (!access_ok(VERIFY_READ, from, copy) || 1793 if (copy_from_iter_nocache(to, copy, from) != copy)
1840 __copy_from_user_nocache(to, from, copy))
1841 return -EFAULT; 1794 return -EFAULT;
1842 } else if (copy_from_user(to, from, copy)) 1795 } else if (copy_from_iter(to, copy, from) != copy)
1843 return -EFAULT; 1796 return -EFAULT;
1844 1797
1845 return 0; 1798 return 0;
1846} 1799}
1847 1800
1848static inline int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb, 1801static inline int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb,
1849 char __user *from, int copy) 1802 struct iov_iter *from, int copy)
1850{ 1803{
1851 int err, offset = skb->len; 1804 int err, offset = skb->len;
1852 1805
@@ -1858,7 +1811,7 @@ static inline int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb,
1858 return err; 1811 return err;
1859} 1812}
1860 1813
1861static inline int skb_copy_to_page_nocache(struct sock *sk, char __user *from, 1814static inline int skb_copy_to_page_nocache(struct sock *sk, struct iov_iter *from,
1862 struct sk_buff *skb, 1815 struct sk_buff *skb,
1863 struct page *page, 1816 struct page *page,
1864 int off, int copy) 1817 int off, int copy)
@@ -2262,6 +2215,7 @@ bool sk_net_capable(const struct sock *sk, int cap);
2262extern __u32 sysctl_wmem_max; 2215extern __u32 sysctl_wmem_max;
2263extern __u32 sysctl_rmem_max; 2216extern __u32 sysctl_rmem_max;
2264 2217
2218extern int sysctl_tstamp_allow_data;
2265extern int sysctl_optmem_max; 2219extern int sysctl_optmem_max;
2266 2220
2267extern __u32 sysctl_wmem_default; 2221extern __u32 sysctl_wmem_default;
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 8a6d1641fd9b..cfcdac2e5d25 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -11,13 +11,46 @@
11#define _LINUX_SWITCHDEV_H_ 11#define _LINUX_SWITCHDEV_H_
12 12
13#include <linux/netdevice.h> 13#include <linux/netdevice.h>
14#include <linux/notifier.h>
15
16enum netdev_switch_notifier_type {
17 NETDEV_SWITCH_FDB_ADD = 1,
18 NETDEV_SWITCH_FDB_DEL,
19};
20
21struct netdev_switch_notifier_info {
22 struct net_device *dev;
23};
24
25struct netdev_switch_notifier_fdb_info {
26 struct netdev_switch_notifier_info info; /* must be first */
27 const unsigned char *addr;
28 u16 vid;
29};
30
31static inline struct net_device *
32netdev_switch_notifier_info_to_dev(const struct netdev_switch_notifier_info *info)
33{
34 return info->dev;
35}
14 36
15#ifdef CONFIG_NET_SWITCHDEV 37#ifdef CONFIG_NET_SWITCHDEV
16 38
17int netdev_switch_parent_id_get(struct net_device *dev, 39int netdev_switch_parent_id_get(struct net_device *dev,
18 struct netdev_phys_item_id *psid); 40 struct netdev_phys_item_id *psid);
19int netdev_switch_port_stp_update(struct net_device *dev, u8 state); 41int netdev_switch_port_stp_update(struct net_device *dev, u8 state);
20 42int register_netdev_switch_notifier(struct notifier_block *nb);
43int unregister_netdev_switch_notifier(struct notifier_block *nb);
44int call_netdev_switch_notifiers(unsigned long val, struct net_device *dev,
45 struct netdev_switch_notifier_info *info);
46int netdev_switch_port_bridge_setlink(struct net_device *dev,
47 struct nlmsghdr *nlh, u16 flags);
48int netdev_switch_port_bridge_dellink(struct net_device *dev,
49 struct nlmsghdr *nlh, u16 flags);
50int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev,
51 struct nlmsghdr *nlh, u16 flags);
52int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev,
53 struct nlmsghdr *nlh, u16 flags);
21#else 54#else
22 55
23static inline int netdev_switch_parent_id_get(struct net_device *dev, 56static inline int netdev_switch_parent_id_get(struct net_device *dev,
@@ -32,6 +65,50 @@ static inline int netdev_switch_port_stp_update(struct net_device *dev,
32 return -EOPNOTSUPP; 65 return -EOPNOTSUPP;
33} 66}
34 67
68static inline int register_netdev_switch_notifier(struct notifier_block *nb)
69{
70 return 0;
71}
72
73static inline int unregister_netdev_switch_notifier(struct notifier_block *nb)
74{
75 return 0;
76}
77
78static inline int call_netdev_switch_notifiers(unsigned long val, struct net_device *dev,
79 struct netdev_switch_notifier_info *info)
80{
81 return NOTIFY_DONE;
82}
83
84static inline int netdev_switch_port_bridge_setlink(struct net_device *dev,
85 struct nlmsghdr *nlh,
86 u16 flags)
87{
88 return -EOPNOTSUPP;
89}
90
91static inline int netdev_switch_port_bridge_dellink(struct net_device *dev,
92 struct nlmsghdr *nlh,
93 u16 flags)
94{
95 return -EOPNOTSUPP;
96}
97
98static inline int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev,
99 struct nlmsghdr *nlh,
100 u16 flags)
101{
102 return 0;
103}
104
105static inline int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev,
106 struct nlmsghdr *nlh,
107 u16 flags)
108{
109 return 0;
110}
111
35#endif 112#endif
36 113
37#endif /* _LINUX_SWITCHDEV_H_ */ 114#endif /* _LINUX_SWITCHDEV_H_ */
diff --git a/include/net/tc_act/tc_bpf.h b/include/net/tc_act/tc_bpf.h
new file mode 100644
index 000000000000..86a070ffc930
--- /dev/null
+++ b/include/net/tc_act/tc_bpf.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (c) 2015 Jiri Pirko <jiri@resnulli.us>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9
10#ifndef __NET_TC_BPF_H
11#define __NET_TC_BPF_H
12
13#include <linux/filter.h>
14#include <net/act_api.h>
15
16struct tcf_bpf {
17 struct tcf_common common;
18 struct bpf_prog *filter;
19 struct sock_filter *bpf_ops;
20 u16 bpf_num_ops;
21};
22#define to_bpf(a) \
23 container_of(a->priv, struct tcf_bpf, common)
24
25#endif /* __NET_TC_BPF_H */
diff --git a/include/net/tc_act/tc_connmark.h b/include/net/tc_act/tc_connmark.h
new file mode 100644
index 000000000000..5c1104c2e24f
--- /dev/null
+++ b/include/net/tc_act/tc_connmark.h
@@ -0,0 +1,14 @@
1#ifndef __NET_TC_CONNMARK_H
2#define __NET_TC_CONNMARK_H
3
4#include <net/act_api.h>
5
6struct tcf_connmark_info {
7 struct tcf_common common;
8 u16 zone;
9};
10
11#define to_connmark(a) \
12 container_of(a->priv, struct tcf_connmark_info, common)
13
14#endif /* __NET_TC_CONNMARK_H */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 9d9111ef43ae..8d6b983d5099 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -262,8 +262,6 @@ extern int sysctl_tcp_low_latency;
262extern int sysctl_tcp_nometrics_save; 262extern int sysctl_tcp_nometrics_save;
263extern int sysctl_tcp_moderate_rcvbuf; 263extern int sysctl_tcp_moderate_rcvbuf;
264extern int sysctl_tcp_tso_win_divisor; 264extern int sysctl_tcp_tso_win_divisor;
265extern int sysctl_tcp_mtu_probing;
266extern int sysctl_tcp_base_mss;
267extern int sysctl_tcp_workaround_signed_windows; 265extern int sysctl_tcp_workaround_signed_windows;
268extern int sysctl_tcp_slow_start_after_idle; 266extern int sysctl_tcp_slow_start_after_idle;
269extern int sysctl_tcp_thin_linear_timeouts; 267extern int sysctl_tcp_thin_linear_timeouts;
@@ -274,6 +272,7 @@ extern int sysctl_tcp_challenge_ack_limit;
274extern unsigned int sysctl_tcp_notsent_lowat; 272extern unsigned int sysctl_tcp_notsent_lowat;
275extern int sysctl_tcp_min_tso_segs; 273extern int sysctl_tcp_min_tso_segs;
276extern int sysctl_tcp_autocorking; 274extern int sysctl_tcp_autocorking;
275extern int sysctl_tcp_invalid_ratelimit;
277 276
278extern atomic_long_t tcp_memory_allocated; 277extern atomic_long_t tcp_memory_allocated;
279extern struct percpu_counter tcp_sockets_allocated; 278extern struct percpu_counter tcp_sockets_allocated;
@@ -448,6 +447,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb);
448struct sock *tcp_create_openreq_child(struct sock *sk, 447struct sock *tcp_create_openreq_child(struct sock *sk,
449 struct request_sock *req, 448 struct request_sock *req,
450 struct sk_buff *skb); 449 struct sk_buff *skb);
450void tcp_ca_openreq_child(struct sock *sk, const struct dst_entry *dst);
451struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, 451struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
452 struct request_sock *req, 452 struct request_sock *req,
453 struct dst_entry *dst); 453 struct dst_entry *dst);
@@ -636,6 +636,11 @@ static inline u32 tcp_rto_min_us(struct sock *sk)
636 return jiffies_to_usecs(tcp_rto_min(sk)); 636 return jiffies_to_usecs(tcp_rto_min(sk));
637} 637}
638 638
639static inline bool tcp_ca_dst_locked(const struct dst_entry *dst)
640{
641 return dst_metric_locked(dst, RTAX_CC_ALGO);
642}
643
639/* Compute the actual receive window we are currently advertising. 644/* Compute the actual receive window we are currently advertising.
640 * Rcv_nxt can be after the window if our peer push more data 645 * Rcv_nxt can be after the window if our peer push more data
641 * than the offered window. 646 * than the offered window.
@@ -787,6 +792,8 @@ enum tcp_ca_ack_event_flags {
787#define TCP_CA_MAX 128 792#define TCP_CA_MAX 128
788#define TCP_CA_BUF_MAX (TCP_CA_NAME_MAX*TCP_CA_MAX) 793#define TCP_CA_BUF_MAX (TCP_CA_NAME_MAX*TCP_CA_MAX)
789 794
795#define TCP_CA_UNSPEC 0
796
790/* Algorithm can be set on socket without CAP_NET_ADMIN privileges */ 797/* Algorithm can be set on socket without CAP_NET_ADMIN privileges */
791#define TCP_CONG_NON_RESTRICTED 0x1 798#define TCP_CONG_NON_RESTRICTED 0x1
792/* Requires ECN/ECT set on all packets */ 799/* Requires ECN/ECT set on all packets */
@@ -794,7 +801,8 @@ enum tcp_ca_ack_event_flags {
794 801
795struct tcp_congestion_ops { 802struct tcp_congestion_ops {
796 struct list_head list; 803 struct list_head list;
797 unsigned long flags; 804 u32 key;
805 u32 flags;
798 806
799 /* initialize private data (optional) */ 807 /* initialize private data (optional) */
800 void (*init)(struct sock *sk); 808 void (*init)(struct sock *sk);
@@ -841,6 +849,17 @@ u32 tcp_reno_ssthresh(struct sock *sk);
841void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 acked); 849void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 acked);
842extern struct tcp_congestion_ops tcp_reno; 850extern struct tcp_congestion_ops tcp_reno;
843 851
852struct tcp_congestion_ops *tcp_ca_find_key(u32 key);
853u32 tcp_ca_get_key_by_name(const char *name);
854#ifdef CONFIG_INET
855char *tcp_ca_get_name_by_key(u32 key, char *buffer);
856#else
857static inline char *tcp_ca_get_name_by_key(u32 key, char *buffer)
858{
859 return NULL;
860}
861#endif
862
844static inline bool tcp_ca_needs_ecn(const struct sock *sk) 863static inline bool tcp_ca_needs_ecn(const struct sock *sk)
845{ 864{
846 const struct inet_connection_sock *icsk = inet_csk(sk); 865 const struct inet_connection_sock *icsk = inet_csk(sk);
@@ -1124,6 +1143,7 @@ static inline void tcp_openreq_init(struct request_sock *req,
1124 tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; 1143 tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq;
1125 tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1; 1144 tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1;
1126 tcp_rsk(req)->snt_synack = tcp_time_stamp; 1145 tcp_rsk(req)->snt_synack = tcp_time_stamp;
1146 tcp_rsk(req)->last_oow_ack_time = 0;
1127 req->mss = rx_opt->mss_clamp; 1147 req->mss = rx_opt->mss_clamp;
1128 req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; 1148 req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0;
1129 ireq->tstamp_ok = rx_opt->tstamp_ok; 1149 ireq->tstamp_ok = rx_opt->tstamp_ok;
@@ -1216,6 +1236,37 @@ static inline bool tcp_paws_reject(const struct tcp_options_received *rx_opt,
1216 return true; 1236 return true;
1217} 1237}
1218 1238
1239/* Return true if we're currently rate-limiting out-of-window ACKs and
1240 * thus shouldn't send a dupack right now. We rate-limit dupacks in
1241 * response to out-of-window SYNs or ACKs to mitigate ACK loops or DoS
1242 * attacks that send repeated SYNs or ACKs for the same connection. To
1243 * do this, we do not send a duplicate SYNACK or ACK if the remote
1244 * endpoint is sending out-of-window SYNs or pure ACKs at a high rate.
1245 */
1246static inline bool tcp_oow_rate_limited(struct net *net,
1247 const struct sk_buff *skb,
1248 int mib_idx, u32 *last_oow_ack_time)
1249{
1250 /* Data packets without SYNs are not likely part of an ACK loop. */
1251 if ((TCP_SKB_CB(skb)->seq != TCP_SKB_CB(skb)->end_seq) &&
1252 !tcp_hdr(skb)->syn)
1253 goto not_rate_limited;
1254
1255 if (*last_oow_ack_time) {
1256 s32 elapsed = (s32)(tcp_time_stamp - *last_oow_ack_time);
1257
1258 if (0 <= elapsed && elapsed < sysctl_tcp_invalid_ratelimit) {
1259 NET_INC_STATS_BH(net, mib_idx);
1260 return true; /* rate-limited: don't send yet! */
1261 }
1262 }
1263
1264 *last_oow_ack_time = tcp_time_stamp;
1265
1266not_rate_limited:
1267 return false; /* not rate-limited: go ahead, send dupack now! */
1268}
1269
1219static inline void tcp_mib_init(struct net *net) 1270static inline void tcp_mib_init(struct net *net)
1220{ 1271{
1221 /* See RFC 2012 */ 1272 /* See RFC 2012 */
@@ -1693,4 +1744,19 @@ static inline struct ip_options_rcu *tcp_v4_save_options(struct sk_buff *skb)
1693 return dopt; 1744 return dopt;
1694} 1745}
1695 1746
1747/* locally generated TCP pure ACKs have skb->truesize == 2
1748 * (check tcp_send_ack() in net/ipv4/tcp_output.c )
1749 * This is much faster than dissecting the packet to find out.
1750 * (Think of GRE encapsulations, IPv4, IPv6, ...)
1751 */
1752static inline bool skb_is_tcp_pure_ack(const struct sk_buff *skb)
1753{
1754 return skb->truesize == 2;
1755}
1756
1757static inline void skb_set_tcp_pure_ack(struct sk_buff *skb)
1758{
1759 skb->truesize = 2;
1760}
1761
1696#endif /* _TCP_H */ 1762#endif /* _TCP_H */
diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h
index 2a50a70ef587..1a20d33d56bc 100644
--- a/include/net/udp_tunnel.h
+++ b/include/net/udp_tunnel.h
@@ -77,17 +77,17 @@ void setup_udp_tunnel_sock(struct net *net, struct socket *sock,
77 struct udp_tunnel_sock_cfg *sock_cfg); 77 struct udp_tunnel_sock_cfg *sock_cfg);
78 78
79/* Transmit the skb using UDP encapsulation. */ 79/* Transmit the skb using UDP encapsulation. */
80int udp_tunnel_xmit_skb(struct socket *sock, struct rtable *rt, 80int udp_tunnel_xmit_skb(struct rtable *rt, struct sk_buff *skb,
81 struct sk_buff *skb, __be32 src, __be32 dst, 81 __be32 src, __be32 dst, __u8 tos, __u8 ttl,
82 __u8 tos, __u8 ttl, __be16 df, __be16 src_port, 82 __be16 df, __be16 src_port, __be16 dst_port,
83 __be16 dst_port, bool xnet); 83 bool xnet, bool nocheck);
84 84
85#if IS_ENABLED(CONFIG_IPV6) 85#if IS_ENABLED(CONFIG_IPV6)
86int udp_tunnel6_xmit_skb(struct socket *sock, struct dst_entry *dst, 86int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sk_buff *skb,
87 struct sk_buff *skb, struct net_device *dev, 87 struct net_device *dev, struct in6_addr *saddr,
88 struct in6_addr *saddr, struct in6_addr *daddr, 88 struct in6_addr *daddr,
89 __u8 prio, __u8 ttl, __be16 src_port, 89 __u8 prio, __u8 ttl, __be16 src_port,
90 __be16 dst_port); 90 __be16 dst_port, bool nocheck);
91#endif 91#endif
92 92
93void udp_tunnel_sock_release(struct socket *sock); 93void udp_tunnel_sock_release(struct socket *sock);
diff --git a/include/net/udplite.h b/include/net/udplite.h
index ae7c8d1fbcad..80761938b9a7 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -20,8 +20,7 @@ static __inline__ int udplite_getfrag(void *from, char *to, int offset,
20 int len, int odd, struct sk_buff *skb) 20 int len, int odd, struct sk_buff *skb)
21{ 21{
22 struct msghdr *msg = from; 22 struct msghdr *msg = from;
23 /* XXX: stripping const */ 23 return copy_from_iter(to, len, &msg->msg_iter) != len ? -EFAULT : 0;
24 return memcpy_fromiovecend(to, (struct iovec *)msg->msg_iter.iov, offset, len);
25} 24}
26 25
27/* Designate sk as UDP-Lite socket */ 26/* Designate sk as UDP-Lite socket */
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 903461aa5644..2927d6244481 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -11,14 +11,96 @@
11#define VNI_HASH_BITS 10 11#define VNI_HASH_BITS 10
12#define VNI_HASH_SIZE (1<<VNI_HASH_BITS) 12#define VNI_HASH_SIZE (1<<VNI_HASH_BITS)
13 13
14/* VXLAN protocol header */ 14/*
15 * VXLAN Group Based Policy Extension:
16 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
17 * |1|-|-|-|1|-|-|-|R|D|R|R|A|R|R|R| Group Policy ID |
18 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
19 * | VXLAN Network Identifier (VNI) | Reserved |
20 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
21 *
22 * D = Don't Learn bit. When set, this bit indicates that the egress
23 * VTEP MUST NOT learn the source address of the encapsulated frame.
24 *
25 * A = Indicates that the group policy has already been applied to
26 * this packet. Policies MUST NOT be applied by devices when the
27 * A bit is set.
28 *
29 * [0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
30 */
31struct vxlanhdr_gbp {
32 __u8 vx_flags;
33#ifdef __LITTLE_ENDIAN_BITFIELD
34 __u8 reserved_flags1:3,
35 policy_applied:1,
36 reserved_flags2:2,
37 dont_learn:1,
38 reserved_flags3:1;
39#elif defined(__BIG_ENDIAN_BITFIELD)
40 __u8 reserved_flags1:1,
41 dont_learn:1,
42 reserved_flags2:2,
43 policy_applied:1,
44 reserved_flags3:3;
45#else
46#error "Please fix <asm/byteorder.h>"
47#endif
48 __be16 policy_id;
49 __be32 vx_vni;
50};
51
52#define VXLAN_GBP_USED_BITS (VXLAN_HF_GBP | 0xFFFFFF)
53
54/* skb->mark mapping
55 *
56 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
57 * |R|R|R|R|R|R|R|R|R|D|R|R|A|R|R|R| Group Policy ID |
58 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
59 */
60#define VXLAN_GBP_DONT_LEARN (BIT(6) << 16)
61#define VXLAN_GBP_POLICY_APPLIED (BIT(3) << 16)
62#define VXLAN_GBP_ID_MASK (0xFFFF)
63
64/* VXLAN protocol header:
65 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
66 * |G|R|R|R|I|R|R|C| Reserved |
67 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
68 * | VXLAN Network Identifier (VNI) | Reserved |
69 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
70 *
71 * G = 1 Group Policy (VXLAN-GBP)
72 * I = 1 VXLAN Network Identifier (VNI) present
73 * C = 1 Remote checksum offload (RCO)
74 */
15struct vxlanhdr { 75struct vxlanhdr {
16 __be32 vx_flags; 76 __be32 vx_flags;
17 __be32 vx_vni; 77 __be32 vx_vni;
18}; 78};
19 79
80/* VXLAN header flags. */
81#define VXLAN_HF_RCO BIT(24)
82#define VXLAN_HF_VNI BIT(27)
83#define VXLAN_HF_GBP BIT(31)
84
85/* Remote checksum offload header option */
86#define VXLAN_RCO_MASK 0x7f /* Last byte of vni field */
87#define VXLAN_RCO_UDP 0x80 /* Indicate UDP RCO (TCP when not set *) */
88#define VXLAN_RCO_SHIFT 1 /* Left shift of start */
89#define VXLAN_RCO_SHIFT_MASK ((1 << VXLAN_RCO_SHIFT) - 1)
90#define VXLAN_MAX_REMCSUM_START (VXLAN_RCO_MASK << VXLAN_RCO_SHIFT)
91
92#define VXLAN_N_VID (1u << 24)
93#define VXLAN_VID_MASK (VXLAN_N_VID - 1)
94#define VXLAN_HLEN (sizeof(struct udphdr) + sizeof(struct vxlanhdr))
95
96struct vxlan_metadata {
97 __be32 vni;
98 u32 gbp;
99};
100
20struct vxlan_sock; 101struct vxlan_sock;
21typedef void (vxlan_rcv_t)(struct vxlan_sock *vh, struct sk_buff *skb, __be32 key); 102typedef void (vxlan_rcv_t)(struct vxlan_sock *vh, struct sk_buff *skb,
103 struct vxlan_metadata *md);
22 104
23/* per UDP socket information */ 105/* per UDP socket information */
24struct vxlan_sock { 106struct vxlan_sock {
@@ -31,6 +113,7 @@ struct vxlan_sock {
31 struct hlist_head vni_list[VNI_HASH_SIZE]; 113 struct hlist_head vni_list[VNI_HASH_SIZE];
32 atomic_t refcnt; 114 atomic_t refcnt;
33 struct udp_offload udp_offloads; 115 struct udp_offload udp_offloads;
116 u32 flags;
34}; 117};
35 118
36#define VXLAN_F_LEARN 0x01 119#define VXLAN_F_LEARN 0x01
@@ -42,6 +125,16 @@ struct vxlan_sock {
42#define VXLAN_F_UDP_CSUM 0x40 125#define VXLAN_F_UDP_CSUM 0x40
43#define VXLAN_F_UDP_ZERO_CSUM6_TX 0x80 126#define VXLAN_F_UDP_ZERO_CSUM6_TX 0x80
44#define VXLAN_F_UDP_ZERO_CSUM6_RX 0x100 127#define VXLAN_F_UDP_ZERO_CSUM6_RX 0x100
128#define VXLAN_F_REMCSUM_TX 0x200
129#define VXLAN_F_REMCSUM_RX 0x400
130#define VXLAN_F_GBP 0x800
131
132/* Flags that are used in the receive patch. These flags must match in
133 * order for a socket to be shareable
134 */
135#define VXLAN_F_RCV_FLAGS (VXLAN_F_GBP | \
136 VXLAN_F_UDP_ZERO_CSUM6_RX | \
137 VXLAN_F_REMCSUM_RX)
45 138
46struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, 139struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
47 vxlan_rcv_t *rcv, void *data, 140 vxlan_rcv_t *rcv, void *data,
@@ -49,10 +142,10 @@ struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
49 142
50void vxlan_sock_release(struct vxlan_sock *vs); 143void vxlan_sock_release(struct vxlan_sock *vs);
51 144
52int vxlan_xmit_skb(struct vxlan_sock *vs, 145int vxlan_xmit_skb(struct rtable *rt, struct sk_buff *skb,
53 struct rtable *rt, struct sk_buff *skb,
54 __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, 146 __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df,
55 __be16 src_port, __be16 dst_port, __be32 vni, bool xnet); 147 __be16 src_port, __be16 dst_port, struct vxlan_metadata *md,
148 bool xnet, u32 vxflags);
56 149
57static inline netdev_features_t vxlan_features_check(struct sk_buff *skb, 150static inline netdev_features_t vxlan_features_check(struct sk_buff *skb,
58 netdev_features_t features) 151 netdev_features_t features)
diff --git a/include/trace/events/net.h b/include/trace/events/net.h
index 1de256b35807..49cc7c3de252 100644
--- a/include/trace/events/net.h
+++ b/include/trace/events/net.h
@@ -40,9 +40,9 @@ TRACE_EVENT(net_dev_start_xmit,
40 __assign_str(name, dev->name); 40 __assign_str(name, dev->name);
41 __entry->queue_mapping = skb->queue_mapping; 41 __entry->queue_mapping = skb->queue_mapping;
42 __entry->skbaddr = skb; 42 __entry->skbaddr = skb;
43 __entry->vlan_tagged = vlan_tx_tag_present(skb); 43 __entry->vlan_tagged = skb_vlan_tag_present(skb);
44 __entry->vlan_proto = ntohs(skb->vlan_proto); 44 __entry->vlan_proto = ntohs(skb->vlan_proto);
45 __entry->vlan_tci = vlan_tx_tag_get(skb); 45 __entry->vlan_tci = skb_vlan_tag_get(skb);
46 __entry->protocol = ntohs(skb->protocol); 46 __entry->protocol = ntohs(skb->protocol);
47 __entry->ip_summed = skb->ip_summed; 47 __entry->ip_summed = skb->ip_summed;
48 __entry->len = skb->len; 48 __entry->len = skb->len;
@@ -174,9 +174,9 @@ DECLARE_EVENT_CLASS(net_dev_rx_verbose_template,
174#endif 174#endif
175 __entry->queue_mapping = skb->queue_mapping; 175 __entry->queue_mapping = skb->queue_mapping;
176 __entry->skbaddr = skb; 176 __entry->skbaddr = skb;
177 __entry->vlan_tagged = vlan_tx_tag_present(skb); 177 __entry->vlan_tagged = skb_vlan_tag_present(skb);
178 __entry->vlan_proto = ntohs(skb->vlan_proto); 178 __entry->vlan_proto = ntohs(skb->vlan_proto);
179 __entry->vlan_tci = vlan_tx_tag_get(skb); 179 __entry->vlan_tci = skb_vlan_tag_get(skb);
180 __entry->protocol = ntohs(skb->protocol); 180 __entry->protocol = ntohs(skb->protocol);
181 __entry->ip_summed = skb->ip_summed; 181 __entry->ip_summed = skb->ip_summed;
182 __entry->hash = skb->hash; 182 __entry->hash = skb->hash;
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 00b100023c47..14b7b6e44c77 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -283,6 +283,7 @@ header-y += net.h
283header-y += netlink_diag.h 283header-y += netlink_diag.h
284header-y += netlink.h 284header-y += netlink.h
285header-y += netrom.h 285header-y += netrom.h
286header-y += net_namespace.h
286header-y += net_tstamp.h 287header-y += net_tstamp.h
287header-y += nfc.h 288header-y += nfc.h
288header-y += nfs2.h 289header-y += nfs2.h
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 5f66d9c2889d..2e49fc880d29 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -139,6 +139,7 @@ static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
139 139
140#define ETHTOOL_FWVERS_LEN 32 140#define ETHTOOL_FWVERS_LEN 32
141#define ETHTOOL_BUSINFO_LEN 32 141#define ETHTOOL_BUSINFO_LEN 32
142#define ETHTOOL_EROMVERS_LEN 32
142 143
143/** 144/**
144 * struct ethtool_drvinfo - general driver and device information 145 * struct ethtool_drvinfo - general driver and device information
@@ -148,6 +149,7 @@ static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
148 * not be an empty string. 149 * not be an empty string.
149 * @version: Driver version string; may be an empty string 150 * @version: Driver version string; may be an empty string
150 * @fw_version: Firmware version string; may be an empty string 151 * @fw_version: Firmware version string; may be an empty string
152 * @erom_version: Expansion ROM version string; may be an empty string
151 * @bus_info: Device bus address. This should match the dev_name() 153 * @bus_info: Device bus address. This should match the dev_name()
152 * string for the underlying bus device, if there is one. May be 154 * string for the underlying bus device, if there is one. May be
153 * an empty string. 155 * an empty string.
@@ -176,7 +178,7 @@ struct ethtool_drvinfo {
176 char version[32]; 178 char version[32];
177 char fw_version[ETHTOOL_FWVERS_LEN]; 179 char fw_version[ETHTOOL_FWVERS_LEN];
178 char bus_info[ETHTOOL_BUSINFO_LEN]; 180 char bus_info[ETHTOOL_BUSINFO_LEN];
179 char reserved1[32]; 181 char erom_version[ETHTOOL_EROMVERS_LEN];
180 char reserved2[12]; 182 char reserved2[12];
181 __u32 n_priv_flags; 183 __u32 n_priv_flags;
182 __u32 n_stats; 184 __u32 n_stats;
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index b03ee8f62d3c..eaaea6208b42 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -125,6 +125,8 @@ enum {
125#define BRIDGE_VLAN_INFO_MASTER (1<<0) /* Operate on Bridge device as well */ 125#define BRIDGE_VLAN_INFO_MASTER (1<<0) /* Operate on Bridge device as well */
126#define BRIDGE_VLAN_INFO_PVID (1<<1) /* VLAN is PVID, ingress untagged */ 126#define BRIDGE_VLAN_INFO_PVID (1<<1) /* VLAN is PVID, ingress untagged */
127#define BRIDGE_VLAN_INFO_UNTAGGED (1<<2) /* VLAN egresses untagged */ 127#define BRIDGE_VLAN_INFO_UNTAGGED (1<<2) /* VLAN egresses untagged */
128#define BRIDGE_VLAN_INFO_RANGE_BEGIN (1<<3) /* VLAN is start of vlan range */
129#define BRIDGE_VLAN_INFO_RANGE_END (1<<4) /* VLAN is end of vlan range */
128 130
129struct bridge_vlan_info { 131struct bridge_vlan_info {
130 __u16 flags; 132 __u16 flags;
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index f7d0d2d7173a..0deee3eeddbf 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -146,6 +146,7 @@ enum {
146 IFLA_PHYS_PORT_ID, 146 IFLA_PHYS_PORT_ID,
147 IFLA_CARRIER_CHANGES, 147 IFLA_CARRIER_CHANGES,
148 IFLA_PHYS_SWITCH_ID, 148 IFLA_PHYS_SWITCH_ID,
149 IFLA_LINK_NETNSID,
149 __IFLA_MAX 150 __IFLA_MAX
150}; 151};
151 152
@@ -370,6 +371,9 @@ enum {
370 IFLA_VXLAN_UDP_CSUM, 371 IFLA_VXLAN_UDP_CSUM,
371 IFLA_VXLAN_UDP_ZERO_CSUM6_TX, 372 IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
372 IFLA_VXLAN_UDP_ZERO_CSUM6_RX, 373 IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
374 IFLA_VXLAN_REMCSUM_TX,
375 IFLA_VXLAN_REMCSUM_RX,
376 IFLA_VXLAN_GBP,
373 __IFLA_VXLAN_MAX 377 __IFLA_VXLAN_MAX
374}; 378};
375#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) 379#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h
index c33a65e3d62c..589ced069e8a 100644
--- a/include/uapi/linux/in.h
+++ b/include/uapi/linux/in.h
@@ -109,6 +109,7 @@ struct in_addr {
109 109
110#define IP_MINTTL 21 110#define IP_MINTTL 21
111#define IP_NODEFRAG 22 111#define IP_NODEFRAG 22
112#define IP_CHECKSUM 23
112 113
113/* IP_MTU_DISCOVER values */ 114/* IP_MTU_DISCOVER values */
114#define IP_PMTUDISC_DONT 0 /* Never send DF frames */ 115#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index e863d088b9a5..437a6a4b125a 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -1,6 +1,7 @@
1#ifndef _UAPI_IPV6_H 1#ifndef _UAPI_IPV6_H
2#define _UAPI_IPV6_H 2#define _UAPI_IPV6_H
3 3
4#include <linux/libc-compat.h>
4#include <linux/types.h> 5#include <linux/types.h>
5#include <linux/in6.h> 6#include <linux/in6.h>
6#include <asm/byteorder.h> 7#include <asm/byteorder.h>
@@ -15,16 +16,19 @@
15 * *under construction* 16 * *under construction*
16 */ 17 */
17 18
18 19#if __UAPI_DEF_IN6_PKTINFO
19struct in6_pktinfo { 20struct in6_pktinfo {
20 struct in6_addr ipi6_addr; 21 struct in6_addr ipi6_addr;
21 int ipi6_ifindex; 22 int ipi6_ifindex;
22}; 23};
24#endif
23 25
26#if __UAPI_DEF_IP6_MTUINFO
24struct ip6_mtuinfo { 27struct ip6_mtuinfo {
25 struct sockaddr_in6 ip6m_addr; 28 struct sockaddr_in6 ip6m_addr;
26 __u32 ip6m_mtu; 29 __u32 ip6m_mtu;
27}; 30};
31#endif
28 32
29struct in6_ifreq { 33struct in6_ifreq {
30 struct in6_addr ifr6_addr; 34 struct in6_addr ifr6_addr;
@@ -165,6 +169,7 @@ enum {
165 DEVCONF_SUPPRESS_FRAG_NDISC, 169 DEVCONF_SUPPRESS_FRAG_NDISC,
166 DEVCONF_ACCEPT_RA_FROM_LOCAL, 170 DEVCONF_ACCEPT_RA_FROM_LOCAL,
167 DEVCONF_USE_OPTIMISTIC, 171 DEVCONF_USE_OPTIMISTIC,
172 DEVCONF_ACCEPT_RA_MTU,
168 DEVCONF_MAX 173 DEVCONF_MAX
169}; 174};
170 175
diff --git a/include/uapi/linux/l2tp.h b/include/uapi/linux/l2tp.h
index 21caa2631c20..347ef22a964e 100644
--- a/include/uapi/linux/l2tp.h
+++ b/include/uapi/linux/l2tp.h
@@ -178,5 +178,6 @@ enum l2tp_seqmode {
178 */ 178 */
179#define L2TP_GENL_NAME "l2tp" 179#define L2TP_GENL_NAME "l2tp"
180#define L2TP_GENL_VERSION 0x1 180#define L2TP_GENL_VERSION 0x1
181#define L2TP_GENL_MCGROUP "l2tp"
181 182
182#endif /* _UAPI_LINUX_L2TP_H_ */ 183#endif /* _UAPI_LINUX_L2TP_H_ */
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index e28807ad17fa..fa673e9cc040 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -70,6 +70,8 @@
70#define __UAPI_DEF_IPV6_MREQ 0 70#define __UAPI_DEF_IPV6_MREQ 0
71#define __UAPI_DEF_IPPROTO_V6 0 71#define __UAPI_DEF_IPPROTO_V6 0
72#define __UAPI_DEF_IPV6_OPTIONS 0 72#define __UAPI_DEF_IPV6_OPTIONS 0
73#define __UAPI_DEF_IN6_PKTINFO 0
74#define __UAPI_DEF_IP6_MTUINFO 0
73 75
74#else 76#else
75 77
@@ -84,6 +86,8 @@
84#define __UAPI_DEF_IPV6_MREQ 1 86#define __UAPI_DEF_IPV6_MREQ 1
85#define __UAPI_DEF_IPPROTO_V6 1 87#define __UAPI_DEF_IPPROTO_V6 1
86#define __UAPI_DEF_IPV6_OPTIONS 1 88#define __UAPI_DEF_IPV6_OPTIONS 1
89#define __UAPI_DEF_IN6_PKTINFO 1
90#define __UAPI_DEF_IP6_MTUINFO 1
87 91
88#endif /* _NETINET_IN_H */ 92#endif /* _NETINET_IN_H */
89 93
@@ -106,6 +110,8 @@
106#define __UAPI_DEF_IPV6_MREQ 1 110#define __UAPI_DEF_IPV6_MREQ 1
107#define __UAPI_DEF_IPPROTO_V6 1 111#define __UAPI_DEF_IPPROTO_V6 1
108#define __UAPI_DEF_IPV6_OPTIONS 1 112#define __UAPI_DEF_IPV6_OPTIONS 1
113#define __UAPI_DEF_IN6_PKTINFO 1
114#define __UAPI_DEF_IP6_MTUINFO 1
109 115
110/* Definitions for xattr.h */ 116/* Definitions for xattr.h */
111#define __UAPI_DEF_XATTR 1 117#define __UAPI_DEF_XATTR 1
diff --git a/include/uapi/linux/neighbour.h b/include/uapi/linux/neighbour.h
index f3d77f9f1e0b..3873a35509aa 100644
--- a/include/uapi/linux/neighbour.h
+++ b/include/uapi/linux/neighbour.h
@@ -25,6 +25,7 @@ enum {
25 NDA_VNI, 25 NDA_VNI,
26 NDA_IFINDEX, 26 NDA_IFINDEX,
27 NDA_MASTER, 27 NDA_MASTER,
28 NDA_LINK_NETNSID,
28 __NDA_MAX 29 __NDA_MAX
29}; 30};
30 31
diff --git a/include/uapi/linux/net_namespace.h b/include/uapi/linux/net_namespace.h
new file mode 100644
index 000000000000..778cd2c3ebf4
--- /dev/null
+++ b/include/uapi/linux/net_namespace.h
@@ -0,0 +1,23 @@
1/* Copyright (c) 2015 6WIND S.A.
2 * Author: Nicolas Dichtel <nicolas.dichtel@6wind.com>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 */
8#ifndef _UAPI_LINUX_NET_NAMESPACE_H_
9#define _UAPI_LINUX_NET_NAMESPACE_H_
10
11/* Attributes of RTM_NEWNSID/RTM_GETNSID messages */
12enum {
13 NETNSA_NONE,
14#define NETNSA_NSID_NOT_ASSIGNED -1
15 NETNSA_NSID,
16 NETNSA_PID,
17 NETNSA_FD,
18 __NETNSA_MAX,
19};
20
21#define NETNSA_MAX (__NETNSA_MAX - 1)
22
23#endif /* _UAPI_LINUX_NET_NAMESPACE_H_ */
diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h
index edbc888ceb51..6d1abea9746e 100644
--- a/include/uapi/linux/net_tstamp.h
+++ b/include/uapi/linux/net_tstamp.h
@@ -24,8 +24,9 @@ enum {
24 SOF_TIMESTAMPING_TX_SCHED = (1<<8), 24 SOF_TIMESTAMPING_TX_SCHED = (1<<8),
25 SOF_TIMESTAMPING_TX_ACK = (1<<9), 25 SOF_TIMESTAMPING_TX_ACK = (1<<9),
26 SOF_TIMESTAMPING_OPT_CMSG = (1<<10), 26 SOF_TIMESTAMPING_OPT_CMSG = (1<<10),
27 SOF_TIMESTAMPING_OPT_TSONLY = (1<<11),
27 28
28 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_CMSG, 29 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_TSONLY,
29 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) | 30 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |
30 SOF_TIMESTAMPING_LAST 31 SOF_TIMESTAMPING_LAST
31}; 32};
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index 8119255feae4..c1e2e63cf9b5 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -183,6 +183,7 @@ enum nfc_attrs {
183 NFC_ATTR_SE_APDU, 183 NFC_ATTR_SE_APDU,
184 NFC_ATTR_TARGET_ISO15693_DSFID, 184 NFC_ATTR_TARGET_ISO15693_DSFID,
185 NFC_ATTR_TARGET_ISO15693_UID, 185 NFC_ATTR_TARGET_ISO15693_UID,
186 NFC_ATTR_SE_PARAMS,
186/* private: internal use only */ 187/* private: internal use only */
187 __NFC_ATTR_AFTER_LAST 188 __NFC_ATTR_AFTER_LAST
188}; 189};
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index b37bd5a1cb82..68b294e83944 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -29,6 +29,13 @@
29 29
30#define NL80211_GENL_NAME "nl80211" 30#define NL80211_GENL_NAME "nl80211"
31 31
32#define NL80211_MULTICAST_GROUP_CONFIG "config"
33#define NL80211_MULTICAST_GROUP_SCAN "scan"
34#define NL80211_MULTICAST_GROUP_REG "regulatory"
35#define NL80211_MULTICAST_GROUP_MLME "mlme"
36#define NL80211_MULTICAST_GROUP_VENDOR "vendor"
37#define NL80211_MULTICAST_GROUP_TESTMODE "testmode"
38
32/** 39/**
33 * DOC: Station handling 40 * DOC: Station handling
34 * 41 *
@@ -173,8 +180,8 @@
173 * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME. 180 * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
174 * 181 *
175 * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration; 182 * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
176 * either a dump request on a %NL80211_ATTR_WIPHY or a specific get 183 * either a dump request for all interfaces or a specific get with a
177 * on an %NL80211_ATTR_IFINDEX is supported. 184 * single %NL80211_ATTR_IFINDEX is supported.
178 * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires 185 * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
179 * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE. 186 * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
180 * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response 187 * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
@@ -252,7 +259,18 @@
252 * %NL80211_ATTR_IFINDEX. 259 * %NL80211_ATTR_IFINDEX.
253 * 260 *
254 * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set 261 * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set
255 * regulatory domain. 262 * regulatory domain. If %NL80211_ATTR_WIPHY is specified and the device
263 * has a private regulatory domain, it will be returned. Otherwise, the
264 * global regdomain will be returned.
265 * A device will have a private regulatory domain if it uses the
266 * regulatory_hint() API. Even when a private regdomain is used the channel
267 * information will still be mended according to further hints from
268 * the regulatory core to help with compliance. A dump version of this API
269 * is now available which will returns the global regdomain as well as
270 * all private regdomains of present wiphys (for those that have it).
271 * If a wiphy is self-managed (%NL80211_ATTR_WIPHY_SELF_MANAGED_REG), then
272 * its private regdomain is the only valid one for it. The regulatory
273 * core is not used to help with compliance in this case.
256 * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command 274 * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command
257 * after being queried by the kernel. CRDA replies by sending a regulatory 275 * after being queried by the kernel. CRDA replies by sending a regulatory
258 * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our 276 * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our
@@ -306,7 +324,9 @@
306 * if passed, define which channels should be scanned; if not 324 * if passed, define which channels should be scanned; if not
307 * passed, all channels allowed for the current regulatory domain 325 * passed, all channels allowed for the current regulatory domain
308 * are used. Extra IEs can also be passed from the userspace by 326 * are used. Extra IEs can also be passed from the userspace by
309 * using the %NL80211_ATTR_IE attribute. 327 * using the %NL80211_ATTR_IE attribute. The first cycle of the
328 * scheduled scan can be delayed by %NL80211_ATTR_SCHED_SCAN_DELAY
329 * is supplied.
310 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if 330 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if
311 * scheduled scan is not running. The caller may assume that as soon 331 * scheduled scan is not running. The caller may assume that as soon
312 * as the call returns, it is safe to start a new scheduled scan again. 332 * as the call returns, it is safe to start a new scheduled scan again.
@@ -774,6 +794,10 @@
774 * peer given by %NL80211_ATTR_MAC. Both peers must be on the base channel 794 * peer given by %NL80211_ATTR_MAC. Both peers must be on the base channel
775 * when this command completes. 795 * when this command completes.
776 * 796 *
797 * @NL80211_CMD_WIPHY_REG_CHANGE: Similar to %NL80211_CMD_REG_CHANGE, but used
798 * as an event to indicate changes for devices with wiphy-specific regdom
799 * management.
800 *
777 * @NL80211_CMD_MAX: highest used command number 801 * @NL80211_CMD_MAX: highest used command number
778 * @__NL80211_CMD_AFTER_LAST: internal use 802 * @__NL80211_CMD_AFTER_LAST: internal use
779 */ 803 */
@@ -958,6 +982,8 @@ enum nl80211_commands {
958 NL80211_CMD_TDLS_CHANNEL_SWITCH, 982 NL80211_CMD_TDLS_CHANNEL_SWITCH,
959 NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH, 983 NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH,
960 984
985 NL80211_CMD_WIPHY_REG_CHANGE,
986
961 /* add new commands above here */ 987 /* add new commands above here */
962 988
963 /* used to define NL80211_CMD_MAX below */ 989 /* used to define NL80211_CMD_MAX below */
@@ -1655,6 +1681,9 @@ enum nl80211_commands {
1655 * @NL80211_ATTR_SOCKET_OWNER: Flag attribute, if set during interface 1681 * @NL80211_ATTR_SOCKET_OWNER: Flag attribute, if set during interface
1656 * creation then the new interface will be owned by the netlink socket 1682 * creation then the new interface will be owned by the netlink socket
1657 * that created it and will be destroyed when the socket is closed. 1683 * that created it and will be destroyed when the socket is closed.
1684 * If set during scheduled scan start then the new scan req will be
1685 * owned by the netlink socket that created it and the scheduled scan will
1686 * be stopped when the socket is closed.
1658 * 1687 *
1659 * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is 1688 * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
1660 * the TDLS link initiator. 1689 * the TDLS link initiator.
@@ -1688,6 +1717,29 @@ enum nl80211_commands {
1688 * 1717 *
1689 * @NL80211_ATTR_MAC_MASK: MAC address mask 1718 * @NL80211_ATTR_MAC_MASK: MAC address mask
1690 * 1719 *
1720 * @NL80211_ATTR_WIPHY_SELF_MANAGED_REG: flag attribute indicating this device
1721 * is self-managing its regulatory information and any regulatory domain
1722 * obtained from it is coming from the device's wiphy and not the global
1723 * cfg80211 regdomain.
1724 *
1725 * @NL80211_ATTR_EXT_FEATURES: extended feature flags contained in a byte
1726 * array. The feature flags are identified by their bit index (see &enum
1727 * nl80211_ext_feature_index). The bit index is ordered starting at the
1728 * least-significant bit of the first byte in the array, ie. bit index 0
1729 * is located at bit 0 of byte 0. bit index 25 would be located at bit 1
1730 * of byte 3 (u8 array).
1731 *
1732 * @NL80211_ATTR_SURVEY_RADIO_STATS: Request overall radio statistics to be
1733 * returned along with other survey data. If set, @NL80211_CMD_GET_SURVEY
1734 * may return a survey entry without a channel indicating global radio
1735 * statistics (only some values are valid and make sense.)
1736 * For devices that don't return such an entry even then, the information
1737 * should be contained in the result as the sum of the respective counters
1738 * over all channels.
1739 *
1740 * @NL80211_ATTR_SCHED_SCAN_DELAY: delay before a scheduled scan (or a
1741 * WoWLAN net-detect scan) is started, u32 in seconds.
1742 *
1691 * @NUM_NL80211_ATTR: total number of nl80211_attrs available 1743 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
1692 * @NL80211_ATTR_MAX: highest attribute number currently defined 1744 * @NL80211_ATTR_MAX: highest attribute number currently defined
1693 * @__NL80211_ATTR_AFTER_LAST: internal use 1745 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2045,6 +2097,16 @@ enum nl80211_attrs {
2045 2097
2046 NL80211_ATTR_MAC_MASK, 2098 NL80211_ATTR_MAC_MASK,
2047 2099
2100 NL80211_ATTR_WIPHY_SELF_MANAGED_REG,
2101
2102 NL80211_ATTR_EXT_FEATURES,
2103
2104 NL80211_ATTR_SURVEY_RADIO_STATS,
2105
2106 NL80211_ATTR_NETNS_FD,
2107
2108 NL80211_ATTR_SCHED_SCAN_DELAY,
2109
2048 /* add attributes here, update the policy in nl80211.c */ 2110 /* add attributes here, update the policy in nl80211.c */
2049 2111
2050 __NL80211_ATTR_AFTER_LAST, 2112 __NL80211_ATTR_AFTER_LAST,
@@ -2085,7 +2147,7 @@ enum nl80211_attrs {
2085 2147
2086#define NL80211_MAX_SUPP_RATES 32 2148#define NL80211_MAX_SUPP_RATES 32
2087#define NL80211_MAX_SUPP_HT_RATES 77 2149#define NL80211_MAX_SUPP_HT_RATES 77
2088#define NL80211_MAX_SUPP_REG_RULES 32 2150#define NL80211_MAX_SUPP_REG_RULES 64
2089#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 2151#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
2090#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 2152#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
2091#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 2153#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
@@ -2225,8 +2287,15 @@ struct nl80211_sta_flag_update {
2225 * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8) 2287 * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8)
2226 * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8) 2288 * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8)
2227 * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate 2289 * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate
2228 * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate 2290 * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: unused - 80+80 is treated the
2291 * same as 160 for purposes of the bitrates
2229 * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate 2292 * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate
2293 * @NL80211_RATE_INFO_10_MHZ_WIDTH: 10 MHz width - note that this is
2294 * a legacy rate and will be reported as the actual bitrate, i.e.
2295 * half the base (20 MHz) rate
2296 * @NL80211_RATE_INFO_5_MHZ_WIDTH: 5 MHz width - note that this is
2297 * a legacy rate and will be reported as the actual bitrate, i.e.
2298 * a quarter of the base (20 MHz) rate
2230 * @__NL80211_RATE_INFO_AFTER_LAST: internal use 2299 * @__NL80211_RATE_INFO_AFTER_LAST: internal use
2231 */ 2300 */
2232enum nl80211_rate_info { 2301enum nl80211_rate_info {
@@ -2241,6 +2310,8 @@ enum nl80211_rate_info {
2241 NL80211_RATE_INFO_80_MHZ_WIDTH, 2310 NL80211_RATE_INFO_80_MHZ_WIDTH,
2242 NL80211_RATE_INFO_80P80_MHZ_WIDTH, 2311 NL80211_RATE_INFO_80P80_MHZ_WIDTH,
2243 NL80211_RATE_INFO_160_MHZ_WIDTH, 2312 NL80211_RATE_INFO_160_MHZ_WIDTH,
2313 NL80211_RATE_INFO_10_MHZ_WIDTH,
2314 NL80211_RATE_INFO_5_MHZ_WIDTH,
2244 2315
2245 /* keep last */ 2316 /* keep last */
2246 __NL80211_RATE_INFO_AFTER_LAST, 2317 __NL80211_RATE_INFO_AFTER_LAST,
@@ -2285,18 +2356,24 @@ enum nl80211_sta_bss_param {
2285 * 2356 *
2286 * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved 2357 * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved
2287 * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) 2358 * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
2288 * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) 2359 * @NL80211_STA_INFO_RX_BYTES: total received bytes (MPDU length)
2289 * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) 2360 * (u32, from this station)
2290 * @NL80211_STA_INFO_RX_BYTES64: total received bytes (u64, from this station) 2361 * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (MPDU length)
2291 * @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (u64, to this station) 2362 * (u32, to this station)
2363 * @NL80211_STA_INFO_RX_BYTES64: total received bytes (MPDU length)
2364 * (u64, from this station)
2365 * @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (MPDU length)
2366 * (u64, to this station)
2292 * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) 2367 * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
2293 * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute 2368 * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
2294 * containing info as possible, see &enum nl80211_rate_info 2369 * containing info as possible, see &enum nl80211_rate_info
2295 * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) 2370 * @NL80211_STA_INFO_RX_PACKETS: total received packet (MSDUs and MMPDUs)
2296 * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this 2371 * (u32, from this station)
2297 * station) 2372 * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (MSDUs and MMPDUs)
2298 * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) 2373 * (u32, to this station)
2299 * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) 2374 * @NL80211_STA_INFO_TX_RETRIES: total retries (MPDUs) (u32, to this station)
2375 * @NL80211_STA_INFO_TX_FAILED: total failed packets (MPDUs)
2376 * (u32, to this station)
2300 * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm) 2377 * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm)
2301 * @NL80211_STA_INFO_LLID: the station's mesh LLID 2378 * @NL80211_STA_INFO_LLID: the station's mesh LLID
2302 * @NL80211_STA_INFO_PLID: the station's mesh PLID 2379 * @NL80211_STA_INFO_PLID: the station's mesh PLID
@@ -2320,6 +2397,16 @@ enum nl80211_sta_bss_param {
2320 * Same format as NL80211_STA_INFO_CHAIN_SIGNAL. 2397 * Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
2321 * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the 2398 * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the
2322 * 802.11 header (u32, kbps) 2399 * 802.11 header (u32, kbps)
2400 * @NL80211_STA_INFO_RX_DROP_MISC: RX packets dropped for unspecified reasons
2401 * (u64)
2402 * @NL80211_STA_INFO_BEACON_RX: number of beacons received from this peer (u64)
2403 * @NL80211_STA_INFO_BEACON_SIGNAL_AVG: signal strength average
2404 * for beacons only (u8, dBm)
2405 * @NL80211_STA_INFO_TID_STATS: per-TID statistics (see &enum nl80211_tid_stats)
2406 * This is a nested attribute where each the inner attribute number is the
2407 * TID+1 and the special TID 16 (i.e. value 17) is used for non-QoS frames;
2408 * each one of those is again nested with &enum nl80211_tid_stats
2409 * attributes carrying the actual values.
2323 * @__NL80211_STA_INFO_AFTER_LAST: internal 2410 * @__NL80211_STA_INFO_AFTER_LAST: internal
2324 * @NL80211_STA_INFO_MAX: highest possible station info attribute 2411 * @NL80211_STA_INFO_MAX: highest possible station info attribute
2325 */ 2412 */
@@ -2352,6 +2439,10 @@ enum nl80211_sta_info {
2352 NL80211_STA_INFO_CHAIN_SIGNAL, 2439 NL80211_STA_INFO_CHAIN_SIGNAL,
2353 NL80211_STA_INFO_CHAIN_SIGNAL_AVG, 2440 NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
2354 NL80211_STA_INFO_EXPECTED_THROUGHPUT, 2441 NL80211_STA_INFO_EXPECTED_THROUGHPUT,
2442 NL80211_STA_INFO_RX_DROP_MISC,
2443 NL80211_STA_INFO_BEACON_RX,
2444 NL80211_STA_INFO_BEACON_SIGNAL_AVG,
2445 NL80211_STA_INFO_TID_STATS,
2355 2446
2356 /* keep last */ 2447 /* keep last */
2357 __NL80211_STA_INFO_AFTER_LAST, 2448 __NL80211_STA_INFO_AFTER_LAST,
@@ -2359,6 +2450,31 @@ enum nl80211_sta_info {
2359}; 2450};
2360 2451
2361/** 2452/**
2453 * enum nl80211_tid_stats - per TID statistics attributes
2454 * @__NL80211_TID_STATS_INVALID: attribute number 0 is reserved
2455 * @NL80211_TID_STATS_RX_MSDU: number of MSDUs received (u64)
2456 * @NL80211_TID_STATS_TX_MSDU: number of MSDUs transmitted (or
2457 * attempted to transmit; u64)
2458 * @NL80211_TID_STATS_TX_MSDU_RETRIES: number of retries for
2459 * transmitted MSDUs (not counting the first attempt; u64)
2460 * @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted
2461 * MSDUs (u64)
2462 * @NUM_NL80211_TID_STATS: number of attributes here
2463 * @NL80211_TID_STATS_MAX: highest numbered attribute here
2464 */
2465enum nl80211_tid_stats {
2466 __NL80211_TID_STATS_INVALID,
2467 NL80211_TID_STATS_RX_MSDU,
2468 NL80211_TID_STATS_TX_MSDU,
2469 NL80211_TID_STATS_TX_MSDU_RETRIES,
2470 NL80211_TID_STATS_TX_MSDU_FAILED,
2471
2472 /* keep last */
2473 NUM_NL80211_TID_STATS,
2474 NL80211_TID_STATS_MAX = NUM_NL80211_TID_STATS - 1
2475};
2476
2477/**
2362 * enum nl80211_mpath_flags - nl80211 mesh path flags 2478 * enum nl80211_mpath_flags - nl80211 mesh path flags
2363 * 2479 *
2364 * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active 2480 * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
@@ -2772,16 +2888,18 @@ enum nl80211_user_reg_hint_type {
2772 * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel 2888 * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
2773 * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) 2889 * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
2774 * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used 2890 * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used
2775 * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio 2891 * @NL80211_SURVEY_INFO_TIME: amount of time (in ms) that the radio
2776 * spent on this channel 2892 * was turned on (on channel or globally)
2777 * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary 2893 * @NL80211_SURVEY_INFO_TIME_BUSY: amount of the time the primary
2778 * channel was sensed busy (either due to activity or energy detect) 2894 * channel was sensed busy (either due to activity or energy detect)
2779 * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension 2895 * @NL80211_SURVEY_INFO_TIME_EXT_BUSY: amount of time the extension
2780 * channel was sensed busy 2896 * channel was sensed busy
2781 * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent 2897 * @NL80211_SURVEY_INFO_TIME_RX: amount of time the radio spent
2782 * receiving data 2898 * receiving data (on channel or globally)
2783 * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent 2899 * @NL80211_SURVEY_INFO_TIME_TX: amount of time the radio spent
2784 * transmitting data 2900 * transmitting data (on channel or globally)
2901 * @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan
2902 * (on this channel or globally)
2785 * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number 2903 * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
2786 * currently defined 2904 * currently defined
2787 * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use 2905 * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
@@ -2791,17 +2909,25 @@ enum nl80211_survey_info {
2791 NL80211_SURVEY_INFO_FREQUENCY, 2909 NL80211_SURVEY_INFO_FREQUENCY,
2792 NL80211_SURVEY_INFO_NOISE, 2910 NL80211_SURVEY_INFO_NOISE,
2793 NL80211_SURVEY_INFO_IN_USE, 2911 NL80211_SURVEY_INFO_IN_USE,
2794 NL80211_SURVEY_INFO_CHANNEL_TIME, 2912 NL80211_SURVEY_INFO_TIME,
2795 NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY, 2913 NL80211_SURVEY_INFO_TIME_BUSY,
2796 NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY, 2914 NL80211_SURVEY_INFO_TIME_EXT_BUSY,
2797 NL80211_SURVEY_INFO_CHANNEL_TIME_RX, 2915 NL80211_SURVEY_INFO_TIME_RX,
2798 NL80211_SURVEY_INFO_CHANNEL_TIME_TX, 2916 NL80211_SURVEY_INFO_TIME_TX,
2917 NL80211_SURVEY_INFO_TIME_SCAN,
2799 2918
2800 /* keep last */ 2919 /* keep last */
2801 __NL80211_SURVEY_INFO_AFTER_LAST, 2920 __NL80211_SURVEY_INFO_AFTER_LAST,
2802 NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1 2921 NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1
2803}; 2922};
2804 2923
2924/* keep old names for compatibility */
2925#define NL80211_SURVEY_INFO_CHANNEL_TIME NL80211_SURVEY_INFO_TIME
2926#define NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY NL80211_SURVEY_INFO_TIME_BUSY
2927#define NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY NL80211_SURVEY_INFO_TIME_EXT_BUSY
2928#define NL80211_SURVEY_INFO_CHANNEL_TIME_RX NL80211_SURVEY_INFO_TIME_RX
2929#define NL80211_SURVEY_INFO_CHANNEL_TIME_TX NL80211_SURVEY_INFO_TIME_TX
2930
2805/** 2931/**
2806 * enum nl80211_mntr_flags - monitor configuration flags 2932 * enum nl80211_mntr_flags - monitor configuration flags
2807 * 2933 *
@@ -3238,6 +3364,9 @@ enum nl80211_bss {
3238/** 3364/**
3239 * enum nl80211_bss_status - BSS "status" 3365 * enum nl80211_bss_status - BSS "status"
3240 * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS. 3366 * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS.
3367 * Note that this is no longer used since cfg80211 no longer
3368 * keeps track of whether or not authentication was done with
3369 * a given BSS.
3241 * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS. 3370 * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS.
3242 * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS. 3371 * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS.
3243 * 3372 *
@@ -3621,9 +3750,12 @@ struct nl80211_pattern_support {
3621 * @NL80211_WOWLAN_TRIG_NET_DETECT: wake up when a configured network 3750 * @NL80211_WOWLAN_TRIG_NET_DETECT: wake up when a configured network
3622 * is detected. This is a nested attribute that contains the 3751 * is detected. This is a nested attribute that contains the
3623 * same attributes used with @NL80211_CMD_START_SCHED_SCAN. It 3752 * same attributes used with @NL80211_CMD_START_SCHED_SCAN. It
3624 * specifies how the scan is performed (e.g. the interval and the 3753 * specifies how the scan is performed (e.g. the interval, the
3625 * channels to scan) as well as the scan results that will 3754 * channels to scan and the initial delay) as well as the scan
3626 * trigger a wake (i.e. the matchsets). 3755 * results that will trigger a wake (i.e. the matchsets). This
3756 * attribute is also sent in a response to
3757 * @NL80211_CMD_GET_WIPHY, indicating the number of match sets
3758 * supported by the driver (u32).
3627 * @NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS: nested attribute 3759 * @NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS: nested attribute
3628 * containing an array with information about what triggered the 3760 * containing an array with information about what triggered the
3629 * wake up. If no elements are present in the array, it means 3761 * wake up. If no elements are present in the array, it means
@@ -4194,6 +4326,19 @@ enum nl80211_feature_flags {
4194}; 4326};
4195 4327
4196/** 4328/**
4329 * enum nl80211_ext_feature_index - bit index of extended features.
4330 *
4331 * @NUM_NL80211_EXT_FEATURES: number of extended features.
4332 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
4333 */
4334enum nl80211_ext_feature_index {
4335
4336 /* add new features before the definition below */
4337 NUM_NL80211_EXT_FEATURES,
4338 MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1
4339};
4340
4341/**
4197 * enum nl80211_probe_resp_offload_support_attr - optional supported 4342 * enum nl80211_probe_resp_offload_support_attr - optional supported
4198 * protocols for probe-response offloading by the driver/FW. 4343 * protocols for probe-response offloading by the driver/FW.
4199 * To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute. 4344 * To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute.
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index f714e8633352..bbd49a0c46c7 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -252,11 +252,21 @@ enum ovs_vport_attr {
252 252
253#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1) 253#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
254 254
255enum {
256 OVS_VXLAN_EXT_UNSPEC,
257 OVS_VXLAN_EXT_GBP, /* Flag or __u32 */
258 __OVS_VXLAN_EXT_MAX,
259};
260
261#define OVS_VXLAN_EXT_MAX (__OVS_VXLAN_EXT_MAX - 1)
262
263
255/* OVS_VPORT_ATTR_OPTIONS attributes for tunnels. 264/* OVS_VPORT_ATTR_OPTIONS attributes for tunnels.
256 */ 265 */
257enum { 266enum {
258 OVS_TUNNEL_ATTR_UNSPEC, 267 OVS_TUNNEL_ATTR_UNSPEC,
259 OVS_TUNNEL_ATTR_DST_PORT, /* 16-bit UDP port, used by L4 tunnels. */ 268 OVS_TUNNEL_ATTR_DST_PORT, /* 16-bit UDP port, used by L4 tunnels. */
269 OVS_TUNNEL_ATTR_EXTENSION,
260 __OVS_TUNNEL_ATTR_MAX 270 __OVS_TUNNEL_ATTR_MAX
261}; 271};
262 272
@@ -328,6 +338,7 @@ enum ovs_tunnel_key_attr {
328 OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS, /* Array of Geneve options. */ 338 OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS, /* Array of Geneve options. */
329 OVS_TUNNEL_KEY_ATTR_TP_SRC, /* be16 src Transport Port. */ 339 OVS_TUNNEL_KEY_ATTR_TP_SRC, /* be16 src Transport Port. */
330 OVS_TUNNEL_KEY_ATTR_TP_DST, /* be16 dst Transport Port. */ 340 OVS_TUNNEL_KEY_ATTR_TP_DST, /* be16 dst Transport Port. */
341 OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS, /* Nested OVS_VXLAN_EXT_* */
331 __OVS_TUNNEL_KEY_ATTR_MAX 342 __OVS_TUNNEL_KEY_ATTR_MAX
332}; 343};
333 344
@@ -448,6 +459,14 @@ struct ovs_key_nd {
448 * a wildcarded match. Omitting attribute is treated as wildcarding all 459 * a wildcarded match. Omitting attribute is treated as wildcarding all
449 * corresponding fields. Optional for all requests. If not present, 460 * corresponding fields. Optional for all requests. If not present,
450 * all flow key bits are exact match bits. 461 * all flow key bits are exact match bits.
462 * @OVS_FLOW_ATTR_UFID: A value between 1-16 octets specifying a unique
463 * identifier for the flow. Causes the flow to be indexed by this value rather
464 * than the value of the %OVS_FLOW_ATTR_KEY attribute. Optional for all
465 * requests. Present in notifications if the flow was created with this
466 * attribute.
467 * @OVS_FLOW_ATTR_UFID_FLAGS: A 32-bit value of OR'd %OVS_UFID_F_*
468 * flags that provide alternative semantics for flow installation and
469 * retrieval. Optional for all requests.
451 * 470 *
452 * These attributes follow the &struct ovs_header within the Generic Netlink 471 * These attributes follow the &struct ovs_header within the Generic Netlink
453 * payload for %OVS_FLOW_* commands. 472 * payload for %OVS_FLOW_* commands.
@@ -463,12 +482,24 @@ enum ovs_flow_attr {
463 OVS_FLOW_ATTR_MASK, /* Sequence of OVS_KEY_ATTR_* attributes. */ 482 OVS_FLOW_ATTR_MASK, /* Sequence of OVS_KEY_ATTR_* attributes. */
464 OVS_FLOW_ATTR_PROBE, /* Flow operation is a feature probe, error 483 OVS_FLOW_ATTR_PROBE, /* Flow operation is a feature probe, error
465 * logging should be suppressed. */ 484 * logging should be suppressed. */
485 OVS_FLOW_ATTR_UFID, /* Variable length unique flow identifier. */
486 OVS_FLOW_ATTR_UFID_FLAGS,/* u32 of OVS_UFID_F_*. */
466 __OVS_FLOW_ATTR_MAX 487 __OVS_FLOW_ATTR_MAX
467}; 488};
468 489
469#define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1) 490#define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1)
470 491
471/** 492/**
493 * Omit attributes for notifications.
494 *
495 * If a datapath request contains an %OVS_UFID_F_OMIT_* flag, then the datapath
496 * may omit the corresponding %OVS_FLOW_ATTR_* from the response.
497 */
498#define OVS_UFID_F_OMIT_KEY (1 << 0)
499#define OVS_UFID_F_OMIT_MASK (1 << 1)
500#define OVS_UFID_F_OMIT_ACTIONS (1 << 2)
501
502/**
472 * enum ovs_sample_attr - Attributes for %OVS_ACTION_ATTR_SAMPLE action. 503 * enum ovs_sample_attr - Attributes for %OVS_ACTION_ATTR_SAMPLE action.
473 * @OVS_SAMPLE_ATTR_PROBABILITY: 32-bit fraction of packets to sample with 504 * @OVS_SAMPLE_ATTR_PROBABILITY: 32-bit fraction of packets to sample with
474 * @OVS_ACTION_ATTR_SAMPLE. A value of 0 samples no packets, a value of 505 * @OVS_ACTION_ATTR_SAMPLE. A value of 0 samples no packets, a value of
@@ -568,6 +599,12 @@ struct ovs_action_hash {
568 * @OVS_ACTION_ATTR_SET: Replaces the contents of an existing header. The 599 * @OVS_ACTION_ATTR_SET: Replaces the contents of an existing header. The
569 * single nested %OVS_KEY_ATTR_* attribute specifies a header to modify and its 600 * single nested %OVS_KEY_ATTR_* attribute specifies a header to modify and its
570 * value. 601 * value.
602 * @OVS_ACTION_ATTR_SET_MASKED: Replaces the contents of an existing header. A
603 * nested %OVS_KEY_ATTR_* attribute specifies a header to modify, its value,
604 * and a mask. For every bit set in the mask, the corresponding bit value
605 * is copied from the value to the packet header field, rest of the bits are
606 * left unchanged. The non-masked value bits must be passed in as zeroes.
607 * Masking is not supported for the %OVS_KEY_ATTR_TUNNEL attribute.
571 * @OVS_ACTION_ATTR_PUSH_VLAN: Push a new outermost 802.1Q header onto the 608 * @OVS_ACTION_ATTR_PUSH_VLAN: Push a new outermost 802.1Q header onto the
572 * packet. 609 * packet.
573 * @OVS_ACTION_ATTR_POP_VLAN: Pop the outermost 802.1Q header off the packet. 610 * @OVS_ACTION_ATTR_POP_VLAN: Pop the outermost 802.1Q header off the packet.
@@ -586,6 +623,9 @@ struct ovs_action_hash {
586 * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all 623 * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all
587 * fields within a header are modifiable, e.g. the IPv4 protocol and fragment 624 * fields within a header are modifiable, e.g. the IPv4 protocol and fragment
588 * type may not be changed. 625 * type may not be changed.
626 *
627 * @OVS_ACTION_ATTR_SET_TO_MASKED: Kernel internal masked set action translated
628 * from the @OVS_ACTION_ATTR_SET.
589 */ 629 */
590 630
591enum ovs_action_attr { 631enum ovs_action_attr {
@@ -600,8 +640,19 @@ enum ovs_action_attr {
600 OVS_ACTION_ATTR_HASH, /* struct ovs_action_hash. */ 640 OVS_ACTION_ATTR_HASH, /* struct ovs_action_hash. */
601 OVS_ACTION_ATTR_PUSH_MPLS, /* struct ovs_action_push_mpls. */ 641 OVS_ACTION_ATTR_PUSH_MPLS, /* struct ovs_action_push_mpls. */
602 OVS_ACTION_ATTR_POP_MPLS, /* __be16 ethertype. */ 642 OVS_ACTION_ATTR_POP_MPLS, /* __be16 ethertype. */
643 OVS_ACTION_ATTR_SET_MASKED, /* One nested OVS_KEY_ATTR_* including
644 * data immediately followed by a mask.
645 * The data must be zero for the unmasked
646 * bits. */
603 647
604 __OVS_ACTION_ATTR_MAX 648 __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted
649 * from userspace. */
650
651#ifdef __KERNEL__
652 OVS_ACTION_ATTR_SET_TO_MASKED, /* Kernel module internal masked
653 * set action converted from
654 * OVS_ACTION_ATTR_SET. */
655#endif
605}; 656};
606 657
607#define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1) 658#define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1)
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index d62316baae94..534b84710745 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -774,6 +774,8 @@ enum {
774 774
775 TCA_FQ_FLOW_REFILL_DELAY, /* flow credit refill delay in usec */ 775 TCA_FQ_FLOW_REFILL_DELAY, /* flow credit refill delay in usec */
776 776
777 TCA_FQ_ORPHAN_MASK, /* mask applied to orphaned skb hashes */
778
777 __TCA_FQ_MAX 779 __TCA_FQ_MAX
778}; 780};
779 781
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index 9c9b8b4480cd..5cc5d66bf519 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -132,6 +132,11 @@ enum {
132 RTM_GETMDB = 86, 132 RTM_GETMDB = 86,
133#define RTM_GETMDB RTM_GETMDB 133#define RTM_GETMDB RTM_GETMDB
134 134
135 RTM_NEWNSID = 88,
136#define RTM_NEWNSID RTM_NEWNSID
137 RTM_GETNSID = 90,
138#define RTM_GETNSID RTM_GETNSID
139
135 __RTM_MAX, 140 __RTM_MAX,
136#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) 141#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
137}; 142};
@@ -389,6 +394,8 @@ enum {
389#define RTAX_INITRWND RTAX_INITRWND 394#define RTAX_INITRWND RTAX_INITRWND
390 RTAX_QUICKACK, 395 RTAX_QUICKACK,
391#define RTAX_QUICKACK RTAX_QUICKACK 396#define RTAX_QUICKACK RTAX_QUICKACK
397 RTAX_CC_ALGO,
398#define RTAX_CC_ALGO RTAX_CC_ALGO
392 __RTAX_MAX 399 __RTAX_MAX
393}; 400};
394 401
@@ -634,6 +641,7 @@ struct tcamsg {
634/* New extended info filters for IFLA_EXT_MASK */ 641/* New extended info filters for IFLA_EXT_MASK */
635#define RTEXT_FILTER_VF (1 << 0) 642#define RTEXT_FILTER_VF (1 << 0)
636#define RTEXT_FILTER_BRVLAN (1 << 1) 643#define RTEXT_FILTER_BRVLAN (1 << 1)
644#define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2)
637 645
638/* End of information exported to user level */ 646/* End of information exported to user level */
639 647
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h
index b22224100011..6a6fb747c78d 100644
--- a/include/uapi/linux/snmp.h
+++ b/include/uapi/linux/snmp.h
@@ -270,6 +270,12 @@ enum
270 LINUX_MIB_TCPHYSTARTTRAINCWND, /* TCPHystartTrainCwnd */ 270 LINUX_MIB_TCPHYSTARTTRAINCWND, /* TCPHystartTrainCwnd */
271 LINUX_MIB_TCPHYSTARTDELAYDETECT, /* TCPHystartDelayDetect */ 271 LINUX_MIB_TCPHYSTARTDELAYDETECT, /* TCPHystartDelayDetect */
272 LINUX_MIB_TCPHYSTARTDELAYCWND, /* TCPHystartDelayCwnd */ 272 LINUX_MIB_TCPHYSTARTDELAYCWND, /* TCPHystartDelayCwnd */
273 LINUX_MIB_TCPACKSKIPPEDSYNRECV, /* TCPACKSkippedSynRecv */
274 LINUX_MIB_TCPACKSKIPPEDPAWS, /* TCPACKSkippedPAWS */
275 LINUX_MIB_TCPACKSKIPPEDSEQ, /* TCPACKSkippedSeq */
276 LINUX_MIB_TCPACKSKIPPEDFINWAIT2, /* TCPACKSkippedFinWait2 */
277 LINUX_MIB_TCPACKSKIPPEDTIMEWAIT, /* TCPACKSkippedTimeWait */
278 LINUX_MIB_TCPACKSKIPPEDCHALLENGE, /* TCPACKSkippedChallenge */
273 __LINUX_MIB_MAX 279 __LINUX_MIB_MAX
274}; 280};
275 281
diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild
index b057da2b87a4..19d5219b0b99 100644
--- a/include/uapi/linux/tc_act/Kbuild
+++ b/include/uapi/linux/tc_act/Kbuild
@@ -8,3 +8,4 @@ header-y += tc_nat.h
8header-y += tc_pedit.h 8header-y += tc_pedit.h
9header-y += tc_skbedit.h 9header-y += tc_skbedit.h
10header-y += tc_vlan.h 10header-y += tc_vlan.h
11header-y += tc_bpf.h
diff --git a/include/uapi/linux/tc_act/tc_bpf.h b/include/uapi/linux/tc_act/tc_bpf.h
new file mode 100644
index 000000000000..5288bd77e63b
--- /dev/null
+++ b/include/uapi/linux/tc_act/tc_bpf.h
@@ -0,0 +1,31 @@
1/*
2 * Copyright (c) 2015 Jiri Pirko <jiri@resnulli.us>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9
10#ifndef __LINUX_TC_BPF_H
11#define __LINUX_TC_BPF_H
12
13#include <linux/pkt_cls.h>
14
15#define TCA_ACT_BPF 13
16
17struct tc_act_bpf {
18 tc_gen;
19};
20
21enum {
22 TCA_ACT_BPF_UNSPEC,
23 TCA_ACT_BPF_TM,
24 TCA_ACT_BPF_PARMS,
25 TCA_ACT_BPF_OPS_LEN,
26 TCA_ACT_BPF_OPS,
27 __TCA_ACT_BPF_MAX,
28};
29#define TCA_ACT_BPF_MAX (__TCA_ACT_BPF_MAX - 1)
30
31#endif
diff --git a/include/uapi/linux/tc_act/tc_connmark.h b/include/uapi/linux/tc_act/tc_connmark.h
new file mode 100644
index 000000000000..994b0971bce2
--- /dev/null
+++ b/include/uapi/linux/tc_act/tc_connmark.h
@@ -0,0 +1,22 @@
1#ifndef __UAPI_TC_CONNMARK_H
2#define __UAPI_TC_CONNMARK_H
3
4#include <linux/types.h>
5#include <linux/pkt_cls.h>
6
7#define TCA_ACT_CONNMARK 14
8
9struct tc_connmark {
10 tc_gen;
11 __u16 zone;
12};
13
14enum {
15 TCA_CONNMARK_UNSPEC,
16 TCA_CONNMARK_PARMS,
17 TCA_CONNMARK_TM,
18 __TCA_CONNMARK_MAX
19};
20#define TCA_CONNMARK_MAX (__TCA_CONNMARK_MAX - 1)
21
22#endif
diff --git a/include/uapi/linux/tipc_config.h b/include/uapi/linux/tipc_config.h
index 876d0a14863c..087b0ef82c07 100644
--- a/include/uapi/linux/tipc_config.h
+++ b/include/uapi/linux/tipc_config.h
@@ -272,6 +272,26 @@ static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type)
272 (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type); 272 (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type);
273} 273}
274 274
275static inline int TLV_GET_LEN(struct tlv_desc *tlv)
276{
277 return ntohs(tlv->tlv_len);
278}
279
280static inline void TLV_SET_LEN(struct tlv_desc *tlv, __u16 len)
281{
282 tlv->tlv_len = htons(len);
283}
284
285static inline int TLV_CHECK_TYPE(struct tlv_desc *tlv, __u16 type)
286{
287 return (ntohs(tlv->tlv_type) == type);
288}
289
290static inline void TLV_SET_TYPE(struct tlv_desc *tlv, __u16 type)
291{
292 tlv->tlv_type = htons(type);
293}
294
275static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len) 295static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
276{ 296{
277 struct tlv_desc *tlv_ptr; 297 struct tlv_desc *tlv_ptr;
diff --git a/include/xen/page.h b/include/xen/page.h
index 12765b6f9517..c5ed20bb3fe9 100644
--- a/include/xen/page.h
+++ b/include/xen/page.h
@@ -3,6 +3,11 @@
3 3
4#include <asm/xen/page.h> 4#include <asm/xen/page.h>
5 5
6static inline unsigned long page_to_mfn(struct page *page)
7{
8 return pfn_to_mfn(page_to_pfn(page));
9}
10
6struct xen_memory_region { 11struct xen_memory_region {
7 phys_addr_t start; 12 phys_addr_t start;
8 phys_addr_t size; 13 phys_addr_t size;