aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-12 17:27:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-12 17:27:40 -0400
commitf9da455b93f6ba076935b4ef4589f61e529ae046 (patch)
tree3c4e69ce1ba1d6bf65915b97a76ca2172105b278 /include
parent0e04c641b199435f3779454055f6a7de258ecdfc (diff)
parente5eca6d41f53db48edd8cf88a3f59d2c30227f8e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: 1) Seccomp BPF filters can now be JIT'd, from Alexei Starovoitov. 2) Multiqueue support in xen-netback and xen-netfront, from Andrew J Benniston. 3) Allow tweaking of aggregation settings in cdc_ncm driver, from Bjørn Mork. 4) BPF now has a "random" opcode, from Chema Gonzalez. 5) Add more BPF documentation and improve test framework, from Daniel Borkmann. 6) Support TCP fastopen over ipv6, from Daniel Lee. 7) Add software TSO helper functions and use them to support software TSO in mvneta and mv643xx_eth drivers. From Ezequiel Garcia. 8) Support software TSO in fec driver too, from Nimrod Andy. 9) Add Broadcom SYSTEMPORT driver, from Florian Fainelli. 10) Handle broadcasts more gracefully over macvlan when there are large numbers of interfaces configured, from Herbert Xu. 11) Allow more control over fwmark used for non-socket based responses, from Lorenzo Colitti. 12) Do TCP congestion window limiting based upon measurements, from Neal Cardwell. 13) Support busy polling in SCTP, from Neal Horman. 14) Allow RSS key to be configured via ethtool, from Venkata Duvvuru. 15) Bridge promisc mode handling improvements from Vlad Yasevich. 16) Don't use inetpeer entries to implement ID generation any more, it performs poorly, from Eric Dumazet. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1522 commits) rtnetlink: fix userspace API breakage for iproute2 < v3.9.0 tcp: fixing TLP's FIN recovery net: fec: Add software TSO support net: fec: Add Scatter/gather support net: fec: Increase buffer descriptor entry number net: fec: Factorize feature setting net: fec: Enable IP header hardware checksum net: fec: Factorize the .xmit transmit function bridge: fix compile error when compiling without IPv6 support bridge: fix smatch warning / potential null pointer dereference via-rhine: fix full-duplex with autoneg disable bnx2x: Enlarge the dorq threshold for VFs bnx2x: Check for UNDI in uncommon branch bnx2x: Fix 1G-baseT link bnx2x: Fix link for KR with swapped polarity lane sctp: Fix sk_ack_backlog wrap-around problem net/core: Add VF link state control policy net/fsl: xgmac_mdio is dependent on OF_MDIO net/fsl: Make xgmac_mdio read error message useful net_sched: drr: warn when qdisc is not work conserving ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/ath9k_platform.h2
-rw-r--r--include/linux/can/core.h6
-rw-r--r--include/linux/can/dev.h6
-rw-r--r--include/linux/can/led.h6
-rw-r--r--include/linux/can/platform/cc770.h6
-rw-r--r--include/linux/can/platform/mcp251x.h6
-rw-r--r--include/linux/can/platform/rcar_can.h17
-rw-r--r--include/linux/can/platform/sja1000.h6
-rw-r--r--include/linux/can/platform/ti_hecc.h6
-rw-r--r--include/linux/can/skb.h6
-rw-r--r--include/linux/cpumask.h8
-rw-r--r--include/linux/crc7.h8
-rw-r--r--include/linux/ethtool.h21
-rw-r--r--include/linux/filter.h384
-rw-r--r--include/linux/ieee80211.h1
-rw-r--r--include/linux/if_bridge.h19
-rw-r--r--include/linux/if_link.h3
-rw-r--r--include/linux/if_macvlan.h3
-rw-r--r--include/linux/if_vlan.h4
-rw-r--r--include/linux/isdn/capiutil.h5
-rw-r--r--include/linux/ktime.h24
-rw-r--r--include/linux/mlx4/device.h4
-rw-r--r--include/linux/netdev_features.h3
-rw-r--r--include/linux/netdevice.h99
-rw-r--r--include/linux/netfilter/nfnetlink_acct.h8
-rw-r--r--include/linux/netlink.h3
-rw-r--r--include/linux/nl802154.h31
-rw-r--r--include/linux/of_mdio.h29
-rw-r--r--include/linux/phy.h8
-rw-r--r--include/linux/phy_fixed.h16
-rw-r--r--include/linux/platform_data/st21nfca.h32
-rw-r--r--include/linux/rfkill-gpio.h10
-rw-r--r--include/linux/skbuff.h151
-rw-r--r--include/linux/spi/at86rf230.h14
-rw-r--r--include/linux/ssb/ssb.h1
-rw-r--r--include/linux/tcp.h10
-rw-r--r--include/linux/udp.h24
-rw-r--r--include/linux/usb/cdc_ncm.h35
-rw-r--r--include/net/6lowpan.h1
-rw-r--r--include/net/addrconf.h5
-rw-r--r--include/net/af_ieee802154.h10
-rw-r--r--include/net/bluetooth/hci.h22
-rw-r--r--include/net/bluetooth/hci_core.h24
-rw-r--r--include/net/bluetooth/mgmt.h15
-rw-r--r--include/net/bluetooth/rfcomm.h6
-rw-r--r--include/net/cfg80211.h275
-rw-r--r--include/net/checksum.h2
-rw-r--r--include/net/dsa.h5
-rw-r--r--include/net/gre.h5
-rw-r--r--include/net/ieee802154.h9
-rw-r--r--include/net/ieee802154_netdev.h187
-rw-r--r--include/net/inet_ecn.h2
-rw-r--r--include/net/inet_hashtables.h8
-rw-r--r--include/net/inet_sock.h10
-rw-r--r--include/net/inetpeer.h17
-rw-r--r--include/net/ip.h83
-rw-r--r--include/net/ip6_checksum.h19
-rw-r--r--include/net/ip6_route.h2
-rw-r--r--include/net/ipv6.h24
-rw-r--r--include/net/mac80211.h155
-rw-r--r--include/net/net_namespace.h8
-rw-r--r--include/net/netfilter/nf_nat.h2
-rw-r--r--include/net/netfilter/nf_tables.h130
-rw-r--r--include/net/netfilter/nft_meta.h36
-rw-r--r--include/net/netns/ipv4.h7
-rw-r--r--include/net/netns/ipv6.h1
-rw-r--r--include/net/nfc/digital.h4
-rw-r--r--include/net/nfc/hci.h1
-rw-r--r--include/net/nfc/nfc.h3
-rw-r--r--include/net/pkt_cls.h2
-rw-r--r--include/net/pkt_sched.h2
-rw-r--r--include/net/protocol.h1
-rw-r--r--include/net/regulatory.h6
-rw-r--r--include/net/sch_generic.h2
-rw-r--r--include/net/sctp/structs.h6
-rw-r--r--include/net/secure_seq.h2
-rw-r--r--include/net/snmp.h32
-rw-r--r--include/net/sock.h6
-rw-r--r--include/net/tcp.h47
-rw-r--r--include/net/tso.h20
-rw-r--r--include/net/udp.h18
-rw-r--r--include/net/vxlan.h14
-rw-r--r--include/net/xfrm.h57
-rw-r--r--include/uapi/linux/audit.h8
-rw-r--r--include/uapi/linux/can.h6
-rw-r--r--include/uapi/linux/can/bcm.h6
-rw-r--r--include/uapi/linux/can/error.h6
-rw-r--r--include/uapi/linux/can/gw.h6
-rw-r--r--include/uapi/linux/can/netlink.h6
-rw-r--r--include/uapi/linux/can/raw.h6
-rw-r--r--include/uapi/linux/capability.h7
-rw-r--r--include/uapi/linux/ethtool.h35
-rw-r--r--include/uapi/linux/filter.h3
-rw-r--r--include/uapi/linux/if_fddi.h90
-rw-r--r--include/uapi/linux/if_link.h12
-rw-r--r--include/uapi/linux/if_tunnel.h2
-rw-r--r--include/uapi/linux/l2tp.h2
-rw-r--r--include/uapi/linux/neighbour.h1
-rw-r--r--include/uapi/linux/netfilter/nf_tables.h37
-rw-r--r--include/uapi/linux/netfilter/nfnetlink.h2
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_acct.h9
-rw-r--r--include/uapi/linux/nfc.h16
-rw-r--r--include/uapi/linux/nl80211.h67
-rw-r--r--include/uapi/linux/openvswitch.h4
-rw-r--r--include/uapi/linux/tipc.h23
-rw-r--r--include/uapi/linux/tipc_config.h10
-rw-r--r--include/uapi/linux/udp.h2
-rw-r--r--include/xen/interface/io/netif.h53
108 files changed, 2197 insertions, 540 deletions
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
index 8598f8eacb20..a495a959e8a7 100644
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -36,6 +36,8 @@ struct ath9k_platform_data {
36 36
37 int (*get_mac_revision)(void); 37 int (*get_mac_revision)(void);
38 int (*external_reset)(void); 38 int (*external_reset)(void);
39
40 bool use_eeprom;
39}; 41};
40 42
41#endif /* _LINUX_ATH9K_PLATFORM_H */ 43#endif /* _LINUX_ATH9K_PLATFORM_H */
diff --git a/include/linux/can/core.h b/include/linux/can/core.h
index 78c6c52073ad..a0875001b13c 100644
--- a/include/linux/can/core.h
+++ b/include/linux/can/core.h
@@ -10,8 +10,8 @@
10 * 10 *
11 */ 11 */
12 12
13#ifndef CAN_CORE_H 13#ifndef _CAN_CORE_H
14#define CAN_CORE_H 14#define _CAN_CORE_H
15 15
16#include <linux/can.h> 16#include <linux/can.h>
17#include <linux/skbuff.h> 17#include <linux/skbuff.h>
@@ -58,4 +58,4 @@ extern void can_rx_unregister(struct net_device *dev, canid_t can_id,
58extern int can_send(struct sk_buff *skb, int loop); 58extern int can_send(struct sk_buff *skb, int loop);
59extern int can_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); 59extern int can_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
60 60
61#endif /* CAN_CORE_H */ 61#endif /* !_CAN_CORE_H */
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 3ce5e526525f..6992afc6ba7f 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -10,8 +10,8 @@
10 * 10 *
11 */ 11 */
12 12
13#ifndef CAN_DEV_H 13#ifndef _CAN_DEV_H
14#define CAN_DEV_H 14#define _CAN_DEV_H
15 15
16#include <linux/can.h> 16#include <linux/can.h>
17#include <linux/can/netlink.h> 17#include <linux/can/netlink.h>
@@ -132,4 +132,4 @@ struct sk_buff *alloc_canfd_skb(struct net_device *dev,
132struct sk_buff *alloc_can_err_skb(struct net_device *dev, 132struct sk_buff *alloc_can_err_skb(struct net_device *dev,
133 struct can_frame **cf); 133 struct can_frame **cf);
134 134
135#endif /* CAN_DEV_H */ 135#endif /* !_CAN_DEV_H */
diff --git a/include/linux/can/led.h b/include/linux/can/led.h
index 9c1167baf273..e0475c5cbb92 100644
--- a/include/linux/can/led.h
+++ b/include/linux/can/led.h
@@ -6,8 +6,8 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#ifndef CAN_LED_H 9#ifndef _CAN_LED_H
10#define CAN_LED_H 10#define _CAN_LED_H
11 11
12#include <linux/if.h> 12#include <linux/if.h>
13#include <linux/leds.h> 13#include <linux/leds.h>
@@ -48,4 +48,4 @@ static inline void can_led_notifier_exit(void)
48 48
49#endif 49#endif
50 50
51#endif 51#endif /* !_CAN_LED_H */
diff --git a/include/linux/can/platform/cc770.h b/include/linux/can/platform/cc770.h
index 7702641f87ee..78b2d44f04cf 100644
--- a/include/linux/can/platform/cc770.h
+++ b/include/linux/can/platform/cc770.h
@@ -1,5 +1,5 @@
1#ifndef _CAN_PLATFORM_CC770_H_ 1#ifndef _CAN_PLATFORM_CC770_H
2#define _CAN_PLATFORM_CC770_H_ 2#define _CAN_PLATFORM_CC770_H
3 3
4/* CPU Interface Register (0x02) */ 4/* CPU Interface Register (0x02) */
5#define CPUIF_CEN 0x01 /* Clock Out Enable */ 5#define CPUIF_CEN 0x01 /* Clock Out Enable */
@@ -30,4 +30,4 @@ struct cc770_platform_data {
30 u8 bcr; /* Bus Configuration Register */ 30 u8 bcr; /* Bus Configuration Register */
31}; 31};
32 32
33#endif /* !_CAN_PLATFORM_CC770_H_ */ 33#endif /* !_CAN_PLATFORM_CC770_H */
diff --git a/include/linux/can/platform/mcp251x.h b/include/linux/can/platform/mcp251x.h
index dc029dba7a03..d44fcae274ff 100644
--- a/include/linux/can/platform/mcp251x.h
+++ b/include/linux/can/platform/mcp251x.h
@@ -1,5 +1,5 @@
1#ifndef __CAN_PLATFORM_MCP251X_H__ 1#ifndef _CAN_PLATFORM_MCP251X_H
2#define __CAN_PLATFORM_MCP251X_H__ 2#define _CAN_PLATFORM_MCP251X_H
3 3
4/* 4/*
5 * 5 *
@@ -18,4 +18,4 @@ struct mcp251x_platform_data {
18 unsigned long oscillator_frequency; 18 unsigned long oscillator_frequency;
19}; 19};
20 20
21#endif /* __CAN_PLATFORM_MCP251X_H__ */ 21#endif /* !_CAN_PLATFORM_MCP251X_H */
diff --git a/include/linux/can/platform/rcar_can.h b/include/linux/can/platform/rcar_can.h
new file mode 100644
index 000000000000..0f4a2f3df504
--- /dev/null
+++ b/include/linux/can/platform/rcar_can.h
@@ -0,0 +1,17 @@
1#ifndef _CAN_PLATFORM_RCAR_CAN_H_
2#define _CAN_PLATFORM_RCAR_CAN_H_
3
4#include <linux/types.h>
5
6/* Clock Select Register settings */
7enum CLKR {
8 CLKR_CLKP1 = 0, /* Peripheral clock (clkp1) */
9 CLKR_CLKP2 = 1, /* Peripheral clock (clkp2) */
10 CLKR_CLKEXT = 3 /* Externally input clock */
11};
12
13struct rcar_can_platform_data {
14 enum CLKR clock_select; /* Clock source select */
15};
16
17#endif /* !_CAN_PLATFORM_RCAR_CAN_H_ */
diff --git a/include/linux/can/platform/sja1000.h b/include/linux/can/platform/sja1000.h
index 96f8fcc78d78..93570b61ec6c 100644
--- a/include/linux/can/platform/sja1000.h
+++ b/include/linux/can/platform/sja1000.h
@@ -1,5 +1,5 @@
1#ifndef _CAN_PLATFORM_SJA1000_H_ 1#ifndef _CAN_PLATFORM_SJA1000_H
2#define _CAN_PLATFORM_SJA1000_H_ 2#define _CAN_PLATFORM_SJA1000_H
3 3
4/* clock divider register */ 4/* clock divider register */
5#define CDR_CLKOUT_MASK 0x07 5#define CDR_CLKOUT_MASK 0x07
@@ -32,4 +32,4 @@ struct sja1000_platform_data {
32 u8 cdr; /* clock divider register */ 32 u8 cdr; /* clock divider register */
33}; 33};
34 34
35#endif /* !_CAN_PLATFORM_SJA1000_H_ */ 35#endif /* !_CAN_PLATFORM_SJA1000_H */
diff --git a/include/linux/can/platform/ti_hecc.h b/include/linux/can/platform/ti_hecc.h
index af17cb3f7a84..a52f47ca6c8a 100644
--- a/include/linux/can/platform/ti_hecc.h
+++ b/include/linux/can/platform/ti_hecc.h
@@ -1,5 +1,5 @@
1#ifndef __CAN_PLATFORM_TI_HECC_H__ 1#ifndef _CAN_PLATFORM_TI_HECC_H
2#define __CAN_PLATFORM_TI_HECC_H__ 2#define _CAN_PLATFORM_TI_HECC_H
3 3
4/* 4/*
5 * TI HECC (High End CAN Controller) driver platform header 5 * TI HECC (High End CAN Controller) driver platform header
@@ -41,4 +41,4 @@ struct ti_hecc_platform_data {
41 u32 version; 41 u32 version;
42 void (*transceiver_switch) (int); 42 void (*transceiver_switch) (int);
43}; 43};
44#endif 44#endif /* !_CAN_PLATFORM_TI_HECC_H */
diff --git a/include/linux/can/skb.h b/include/linux/can/skb.h
index f9bbbb472663..cc00d15c6107 100644
--- a/include/linux/can/skb.h
+++ b/include/linux/can/skb.h
@@ -7,8 +7,8 @@
7 * 7 *
8 */ 8 */
9 9
10#ifndef CAN_SKB_H 10#ifndef _CAN_SKB_H
11#define CAN_SKB_H 11#define _CAN_SKB_H
12 12
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/skbuff.h> 14#include <linux/skbuff.h>
@@ -80,4 +80,4 @@ static inline struct sk_buff *can_create_echo_skb(struct sk_buff *skb)
80 return skb; 80 return skb;
81} 81}
82 82
83#endif /* CAN_SKB_H */ 83#endif /* !_CAN_SKB_H */
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 3557ea7b2049..2997af6d2ccd 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -142,6 +142,13 @@ static inline unsigned int cpumask_any_but(const struct cpumask *mask,
142 return 1; 142 return 1;
143} 143}
144 144
145static inline int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp)
146{
147 set_bit(0, cpumask_bits(dstp));
148
149 return 0;
150}
151
145#define for_each_cpu(cpu, mask) \ 152#define for_each_cpu(cpu, mask) \
146 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) 153 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
147#define for_each_cpu_not(cpu, mask) \ 154#define for_each_cpu_not(cpu, mask) \
@@ -192,6 +199,7 @@ static inline unsigned int cpumask_next_zero(int n, const struct cpumask *srcp)
192 199
193int cpumask_next_and(int n, const struct cpumask *, const struct cpumask *); 200int cpumask_next_and(int n, const struct cpumask *, const struct cpumask *);
194int cpumask_any_but(const struct cpumask *mask, unsigned int cpu); 201int cpumask_any_but(const struct cpumask *mask, unsigned int cpu);
202int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp);
195 203
196/** 204/**
197 * for_each_cpu - iterate over every cpu in a mask 205 * for_each_cpu - iterate over every cpu in a mask
diff --git a/include/linux/crc7.h b/include/linux/crc7.h
index 1786e772d5c6..d590765106f3 100644
--- a/include/linux/crc7.h
+++ b/include/linux/crc7.h
@@ -2,13 +2,13 @@
2#define _LINUX_CRC7_H 2#define _LINUX_CRC7_H
3#include <linux/types.h> 3#include <linux/types.h>
4 4
5extern const u8 crc7_syndrome_table[256]; 5extern const u8 crc7_be_syndrome_table[256];
6 6
7static inline u8 crc7_byte(u8 crc, u8 data) 7static inline u8 crc7_be_byte(u8 crc, u8 data)
8{ 8{
9 return crc7_syndrome_table[(crc << 1) ^ data]; 9 return crc7_be_syndrome_table[crc ^ data];
10} 10}
11 11
12extern u8 crc7(u8 crc, const u8 *buffer, size_t len); 12extern u8 crc7_be(u8 crc, const u8 *buffer, size_t len);
13 13
14#endif 14#endif
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 0a114d05f68d..e658229fee39 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -154,13 +154,20 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
154 * @reset: Reset (part of) the device, as specified by a bitmask of 154 * @reset: Reset (part of) the device, as specified by a bitmask of
155 * flags from &enum ethtool_reset_flags. Returns a negative 155 * flags from &enum ethtool_reset_flags. Returns a negative
156 * error code or zero. 156 * error code or zero.
157 * @get_rxfh_key_size: Get the size of the RX flow hash key.
158 * Returns zero if not supported for this specific device.
157 * @get_rxfh_indir_size: Get the size of the RX flow hash indirection table. 159 * @get_rxfh_indir_size: Get the size of the RX flow hash indirection table.
158 * Returns zero if not supported for this specific device. 160 * Returns zero if not supported for this specific device.
159 * @get_rxfh_indir: Get the contents of the RX flow hash indirection table. 161 * @get_rxfh: Get the contents of the RX flow hash indirection table and hash
160 * Will not be called if @get_rxfh_indir_size returns zero. 162 * key.
163 * Will only be called if one or both of @get_rxfh_indir_size and
164 * @get_rxfh_key_size are implemented and return non-zero.
161 * Returns a negative error code or zero. 165 * Returns a negative error code or zero.
162 * @set_rxfh_indir: Set the contents of the RX flow hash indirection table. 166 * @set_rxfh: Set the contents of the RX flow hash indirection table and/or
163 * Will not be called if @get_rxfh_indir_size returns zero. 167 * hash key. In case only the indirection table or hash key is to be
168 * changed, the other argument will be %NULL.
169 * Will only be called if one or both of @get_rxfh_indir_size and
170 * @get_rxfh_key_size are implemented and return non-zero.
164 * Returns a negative error code or zero. 171 * Returns a negative error code or zero.
165 * @get_channels: Get number of channels. 172 * @get_channels: Get number of channels.
166 * @set_channels: Set number of channels. Returns a negative error code or 173 * @set_channels: Set number of channels. Returns a negative error code or
@@ -232,9 +239,11 @@ struct ethtool_ops {
232 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); 239 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
233 int (*flash_device)(struct net_device *, struct ethtool_flash *); 240 int (*flash_device)(struct net_device *, struct ethtool_flash *);
234 int (*reset)(struct net_device *, u32 *); 241 int (*reset)(struct net_device *, u32 *);
242 u32 (*get_rxfh_key_size)(struct net_device *);
235 u32 (*get_rxfh_indir_size)(struct net_device *); 243 u32 (*get_rxfh_indir_size)(struct net_device *);
236 int (*get_rxfh_indir)(struct net_device *, u32 *); 244 int (*get_rxfh)(struct net_device *, u32 *indir, u8 *key);
237 int (*set_rxfh_indir)(struct net_device *, const u32 *); 245 int (*set_rxfh)(struct net_device *, const u32 *indir,
246 const u8 *key);
238 void (*get_channels)(struct net_device *, struct ethtool_channels *); 247 void (*get_channels)(struct net_device *, struct ethtool_channels *);
239 int (*set_channels)(struct net_device *, struct ethtool_channels *); 248 int (*set_channels)(struct net_device *, struct ethtool_channels *);
240 int (*get_dump_flag)(struct net_device *, struct ethtool_dump *); 249 int (*get_dump_flag)(struct net_device *, struct ethtool_dump *);
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 024fd03e5d18..a7e3c48d73a7 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -37,21 +37,270 @@
37#define BPF_CALL 0x80 /* function call */ 37#define BPF_CALL 0x80 /* function call */
38#define BPF_EXIT 0x90 /* function return */ 38#define BPF_EXIT 0x90 /* function return */
39 39
40/* Register numbers */
41enum {
42 BPF_REG_0 = 0,
43 BPF_REG_1,
44 BPF_REG_2,
45 BPF_REG_3,
46 BPF_REG_4,
47 BPF_REG_5,
48 BPF_REG_6,
49 BPF_REG_7,
50 BPF_REG_8,
51 BPF_REG_9,
52 BPF_REG_10,
53 __MAX_BPF_REG,
54};
55
40/* BPF has 10 general purpose 64-bit registers and stack frame. */ 56/* BPF has 10 general purpose 64-bit registers and stack frame. */
41#define MAX_BPF_REG 11 57#define MAX_BPF_REG __MAX_BPF_REG
58
59/* ArgX, context and stack frame pointer register positions. Note,
60 * Arg1, Arg2, Arg3, etc are used as argument mappings of function
61 * calls in BPF_CALL instruction.
62 */
63#define BPF_REG_ARG1 BPF_REG_1
64#define BPF_REG_ARG2 BPF_REG_2
65#define BPF_REG_ARG3 BPF_REG_3
66#define BPF_REG_ARG4 BPF_REG_4
67#define BPF_REG_ARG5 BPF_REG_5
68#define BPF_REG_CTX BPF_REG_6
69#define BPF_REG_FP BPF_REG_10
70
71/* Additional register mappings for converted user programs. */
72#define BPF_REG_A BPF_REG_0
73#define BPF_REG_X BPF_REG_7
74#define BPF_REG_TMP BPF_REG_8
42 75
43/* BPF program can access up to 512 bytes of stack space. */ 76/* BPF program can access up to 512 bytes of stack space. */
44#define MAX_BPF_STACK 512 77#define MAX_BPF_STACK 512
45 78
46/* Arg1, context and stack frame pointer register positions. */ 79/* Helper macros for filter block array initializers. */
47#define ARG1_REG 1 80
48#define CTX_REG 6 81/* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */
49#define FP_REG 10 82
83#define BPF_ALU64_REG(OP, DST, SRC) \
84 ((struct sock_filter_int) { \
85 .code = BPF_ALU64 | BPF_OP(OP) | BPF_X, \
86 .dst_reg = DST, \
87 .src_reg = SRC, \
88 .off = 0, \
89 .imm = 0 })
90
91#define BPF_ALU32_REG(OP, DST, SRC) \
92 ((struct sock_filter_int) { \
93 .code = BPF_ALU | BPF_OP(OP) | BPF_X, \
94 .dst_reg = DST, \
95 .src_reg = SRC, \
96 .off = 0, \
97 .imm = 0 })
98
99/* ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 */
100
101#define BPF_ALU64_IMM(OP, DST, IMM) \
102 ((struct sock_filter_int) { \
103 .code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \
104 .dst_reg = DST, \
105 .src_reg = 0, \
106 .off = 0, \
107 .imm = IMM })
108
109#define BPF_ALU32_IMM(OP, DST, IMM) \
110 ((struct sock_filter_int) { \
111 .code = BPF_ALU | BPF_OP(OP) | BPF_K, \
112 .dst_reg = DST, \
113 .src_reg = 0, \
114 .off = 0, \
115 .imm = IMM })
116
117/* Endianess conversion, cpu_to_{l,b}e(), {l,b}e_to_cpu() */
118
119#define BPF_ENDIAN(TYPE, DST, LEN) \
120 ((struct sock_filter_int) { \
121 .code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \
122 .dst_reg = DST, \
123 .src_reg = 0, \
124 .off = 0, \
125 .imm = LEN })
126
127/* Short form of mov, dst_reg = src_reg */
128
129#define BPF_MOV64_REG(DST, SRC) \
130 ((struct sock_filter_int) { \
131 .code = BPF_ALU64 | BPF_MOV | BPF_X, \
132 .dst_reg = DST, \
133 .src_reg = SRC, \
134 .off = 0, \
135 .imm = 0 })
136
137#define BPF_MOV32_REG(DST, SRC) \
138 ((struct sock_filter_int) { \
139 .code = BPF_ALU | BPF_MOV | BPF_X, \
140 .dst_reg = DST, \
141 .src_reg = SRC, \
142 .off = 0, \
143 .imm = 0 })
144
145/* Short form of mov, dst_reg = imm32 */
146
147#define BPF_MOV64_IMM(DST, IMM) \
148 ((struct sock_filter_int) { \
149 .code = BPF_ALU64 | BPF_MOV | BPF_K, \
150 .dst_reg = DST, \
151 .src_reg = 0, \
152 .off = 0, \
153 .imm = IMM })
154
155#define BPF_MOV32_IMM(DST, IMM) \
156 ((struct sock_filter_int) { \
157 .code = BPF_ALU | BPF_MOV | BPF_K, \
158 .dst_reg = DST, \
159 .src_reg = 0, \
160 .off = 0, \
161 .imm = IMM })
162
163/* Short form of mov based on type, BPF_X: dst_reg = src_reg, BPF_K: dst_reg = imm32 */
164
165#define BPF_MOV64_RAW(TYPE, DST, SRC, IMM) \
166 ((struct sock_filter_int) { \
167 .code = BPF_ALU64 | BPF_MOV | BPF_SRC(TYPE), \
168 .dst_reg = DST, \
169 .src_reg = SRC, \
170 .off = 0, \
171 .imm = IMM })
172
173#define BPF_MOV32_RAW(TYPE, DST, SRC, IMM) \
174 ((struct sock_filter_int) { \
175 .code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \
176 .dst_reg = DST, \
177 .src_reg = SRC, \
178 .off = 0, \
179 .imm = IMM })
180
181/* Direct packet access, R0 = *(uint *) (skb->data + imm32) */
182
183#define BPF_LD_ABS(SIZE, IMM) \
184 ((struct sock_filter_int) { \
185 .code = BPF_LD | BPF_SIZE(SIZE) | BPF_ABS, \
186 .dst_reg = 0, \
187 .src_reg = 0, \
188 .off = 0, \
189 .imm = IMM })
190
191/* Indirect packet access, R0 = *(uint *) (skb->data + src_reg + imm32) */
192
193#define BPF_LD_IND(SIZE, SRC, IMM) \
194 ((struct sock_filter_int) { \
195 .code = BPF_LD | BPF_SIZE(SIZE) | BPF_IND, \
196 .dst_reg = 0, \
197 .src_reg = SRC, \
198 .off = 0, \
199 .imm = IMM })
200
201/* Memory load, dst_reg = *(uint *) (src_reg + off16) */
202
203#define BPF_LDX_MEM(SIZE, DST, SRC, OFF) \
204 ((struct sock_filter_int) { \
205 .code = BPF_LDX | BPF_SIZE(SIZE) | BPF_MEM, \
206 .dst_reg = DST, \
207 .src_reg = SRC, \
208 .off = OFF, \
209 .imm = 0 })
210
211/* Memory store, *(uint *) (dst_reg + off16) = src_reg */
212
213#define BPF_STX_MEM(SIZE, DST, SRC, OFF) \
214 ((struct sock_filter_int) { \
215 .code = BPF_STX | BPF_SIZE(SIZE) | BPF_MEM, \
216 .dst_reg = DST, \
217 .src_reg = SRC, \
218 .off = OFF, \
219 .imm = 0 })
220
221/* Memory store, *(uint *) (dst_reg + off16) = imm32 */
222
223#define BPF_ST_MEM(SIZE, DST, OFF, IMM) \
224 ((struct sock_filter_int) { \
225 .code = BPF_ST | BPF_SIZE(SIZE) | BPF_MEM, \
226 .dst_reg = DST, \
227 .src_reg = 0, \
228 .off = OFF, \
229 .imm = IMM })
230
231/* Conditional jumps against registers, if (dst_reg 'op' src_reg) goto pc + off16 */
232
233#define BPF_JMP_REG(OP, DST, SRC, OFF) \
234 ((struct sock_filter_int) { \
235 .code = BPF_JMP | BPF_OP(OP) | BPF_X, \
236 .dst_reg = DST, \
237 .src_reg = SRC, \
238 .off = OFF, \
239 .imm = 0 })
240
241/* Conditional jumps against immediates, if (dst_reg 'op' imm32) goto pc + off16 */
242
243#define BPF_JMP_IMM(OP, DST, IMM, OFF) \
244 ((struct sock_filter_int) { \
245 .code = BPF_JMP | BPF_OP(OP) | BPF_K, \
246 .dst_reg = DST, \
247 .src_reg = 0, \
248 .off = OFF, \
249 .imm = IMM })
250
251/* Function call */
252
253#define BPF_EMIT_CALL(FUNC) \
254 ((struct sock_filter_int) { \
255 .code = BPF_JMP | BPF_CALL, \
256 .dst_reg = 0, \
257 .src_reg = 0, \
258 .off = 0, \
259 .imm = ((FUNC) - __bpf_call_base) })
260
261/* Raw code statement block */
262
263#define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \
264 ((struct sock_filter_int) { \
265 .code = CODE, \
266 .dst_reg = DST, \
267 .src_reg = SRC, \
268 .off = OFF, \
269 .imm = IMM })
270
271/* Program exit */
272
273#define BPF_EXIT_INSN() \
274 ((struct sock_filter_int) { \
275 .code = BPF_JMP | BPF_EXIT, \
276 .dst_reg = 0, \
277 .src_reg = 0, \
278 .off = 0, \
279 .imm = 0 })
280
281#define bytes_to_bpf_size(bytes) \
282({ \
283 int bpf_size = -EINVAL; \
284 \
285 if (bytes == sizeof(u8)) \
286 bpf_size = BPF_B; \
287 else if (bytes == sizeof(u16)) \
288 bpf_size = BPF_H; \
289 else if (bytes == sizeof(u32)) \
290 bpf_size = BPF_W; \
291 else if (bytes == sizeof(u64)) \
292 bpf_size = BPF_DW; \
293 \
294 bpf_size; \
295})
296
297/* Macro to invoke filter function. */
298#define SK_RUN_FILTER(filter, ctx) (*filter->bpf_func)(ctx, filter->insnsi)
50 299
51struct sock_filter_int { 300struct sock_filter_int {
52 __u8 code; /* opcode */ 301 __u8 code; /* opcode */
53 __u8 a_reg:4; /* dest register */ 302 __u8 dst_reg:4; /* dest register */
54 __u8 x_reg:4; /* source register */ 303 __u8 src_reg:4; /* source register */
55 __s16 off; /* signed offset */ 304 __s16 off; /* signed offset */
56 __s32 imm; /* signed immediate constant */ 305 __s32 imm; /* signed immediate constant */
57}; 306};
@@ -97,21 +346,16 @@ static inline unsigned int sk_filter_size(unsigned int proglen)
97#define sk_filter_proglen(fprog) \ 346#define sk_filter_proglen(fprog) \
98 (fprog->len * sizeof(fprog->filter[0])) 347 (fprog->len * sizeof(fprog->filter[0]))
99 348
100#define SK_RUN_FILTER(filter, ctx) \
101 (*filter->bpf_func)(ctx, filter->insnsi)
102
103int sk_filter(struct sock *sk, struct sk_buff *skb); 349int sk_filter(struct sock *sk, struct sk_buff *skb);
104 350
105u32 sk_run_filter_int_seccomp(const struct seccomp_data *ctx, 351void sk_filter_select_runtime(struct sk_filter *fp);
106 const struct sock_filter_int *insni); 352void sk_filter_free(struct sk_filter *fp);
107u32 sk_run_filter_int_skb(const struct sk_buff *ctx,
108 const struct sock_filter_int *insni);
109 353
110int sk_convert_filter(struct sock_filter *prog, int len, 354int sk_convert_filter(struct sock_filter *prog, int len,
111 struct sock_filter_int *new_prog, int *new_len); 355 struct sock_filter_int *new_prog, int *new_len);
112 356
113int sk_unattached_filter_create(struct sk_filter **pfp, 357int sk_unattached_filter_create(struct sk_filter **pfp,
114 struct sock_fprog *fprog); 358 struct sock_fprog_kern *fprog);
115void sk_unattached_filter_destroy(struct sk_filter *fp); 359void sk_unattached_filter_destroy(struct sk_filter *fp);
116 360
117int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 361int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
@@ -120,11 +364,48 @@ int sk_detach_filter(struct sock *sk);
120int sk_chk_filter(struct sock_filter *filter, unsigned int flen); 364int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
121int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, 365int sk_get_filter(struct sock *sk, struct sock_filter __user *filter,
122 unsigned int len); 366 unsigned int len);
123void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to);
124 367
125void sk_filter_charge(struct sock *sk, struct sk_filter *fp); 368void sk_filter_charge(struct sock *sk, struct sk_filter *fp);
126void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp); 369void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp);
127 370
371u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);
372void bpf_int_jit_compile(struct sk_filter *fp);
373
374#define BPF_ANC BIT(15)
375
376static inline u16 bpf_anc_helper(const struct sock_filter *ftest)
377{
378 BUG_ON(ftest->code & BPF_ANC);
379
380 switch (ftest->code) {
381 case BPF_LD | BPF_W | BPF_ABS:
382 case BPF_LD | BPF_H | BPF_ABS:
383 case BPF_LD | BPF_B | BPF_ABS:
384#define BPF_ANCILLARY(CODE) case SKF_AD_OFF + SKF_AD_##CODE: \
385 return BPF_ANC | SKF_AD_##CODE
386 switch (ftest->k) {
387 BPF_ANCILLARY(PROTOCOL);
388 BPF_ANCILLARY(PKTTYPE);
389 BPF_ANCILLARY(IFINDEX);
390 BPF_ANCILLARY(NLATTR);
391 BPF_ANCILLARY(NLATTR_NEST);
392 BPF_ANCILLARY(MARK);
393 BPF_ANCILLARY(QUEUE);
394 BPF_ANCILLARY(HATYPE);
395 BPF_ANCILLARY(RXHASH);
396 BPF_ANCILLARY(CPU);
397 BPF_ANCILLARY(ALU_XOR_X);
398 BPF_ANCILLARY(VLAN_TAG);
399 BPF_ANCILLARY(VLAN_TAG_PRESENT);
400 BPF_ANCILLARY(PAY_OFFSET);
401 BPF_ANCILLARY(RANDOM);
402 }
403 /* Fallthrough. */
404 default:
405 return ftest->code;
406 }
407}
408
128#ifdef CONFIG_BPF_JIT 409#ifdef CONFIG_BPF_JIT
129#include <stdarg.h> 410#include <stdarg.h>
130#include <linux/linkage.h> 411#include <linux/linkage.h>
@@ -144,85 +425,20 @@ static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
144} 425}
145#else 426#else
146#include <linux/slab.h> 427#include <linux/slab.h>
428
147static inline void bpf_jit_compile(struct sk_filter *fp) 429static inline void bpf_jit_compile(struct sk_filter *fp)
148{ 430{
149} 431}
432
150static inline void bpf_jit_free(struct sk_filter *fp) 433static inline void bpf_jit_free(struct sk_filter *fp)
151{ 434{
152 kfree(fp); 435 kfree(fp);
153} 436}
154#endif 437#endif /* CONFIG_BPF_JIT */
155 438
156static inline int bpf_tell_extensions(void) 439static inline int bpf_tell_extensions(void)
157{ 440{
158 return SKF_AD_MAX; 441 return SKF_AD_MAX;
159} 442}
160 443
161enum {
162 BPF_S_RET_K = 1,
163 BPF_S_RET_A,
164 BPF_S_ALU_ADD_K,
165 BPF_S_ALU_ADD_X,
166 BPF_S_ALU_SUB_K,
167 BPF_S_ALU_SUB_X,
168 BPF_S_ALU_MUL_K,
169 BPF_S_ALU_MUL_X,
170 BPF_S_ALU_DIV_X,
171 BPF_S_ALU_MOD_K,
172 BPF_S_ALU_MOD_X,
173 BPF_S_ALU_AND_K,
174 BPF_S_ALU_AND_X,
175 BPF_S_ALU_OR_K,
176 BPF_S_ALU_OR_X,
177 BPF_S_ALU_XOR_K,
178 BPF_S_ALU_XOR_X,
179 BPF_S_ALU_LSH_K,
180 BPF_S_ALU_LSH_X,
181 BPF_S_ALU_RSH_K,
182 BPF_S_ALU_RSH_X,
183 BPF_S_ALU_NEG,
184 BPF_S_LD_W_ABS,
185 BPF_S_LD_H_ABS,
186 BPF_S_LD_B_ABS,
187 BPF_S_LD_W_LEN,
188 BPF_S_LD_W_IND,
189 BPF_S_LD_H_IND,
190 BPF_S_LD_B_IND,
191 BPF_S_LD_IMM,
192 BPF_S_LDX_W_LEN,
193 BPF_S_LDX_B_MSH,
194 BPF_S_LDX_IMM,
195 BPF_S_MISC_TAX,
196 BPF_S_MISC_TXA,
197 BPF_S_ALU_DIV_K,
198 BPF_S_LD_MEM,
199 BPF_S_LDX_MEM,
200 BPF_S_ST,
201 BPF_S_STX,
202 BPF_S_JMP_JA,
203 BPF_S_JMP_JEQ_K,
204 BPF_S_JMP_JEQ_X,
205 BPF_S_JMP_JGE_K,
206 BPF_S_JMP_JGE_X,
207 BPF_S_JMP_JGT_K,
208 BPF_S_JMP_JGT_X,
209 BPF_S_JMP_JSET_K,
210 BPF_S_JMP_JSET_X,
211 /* Ancillary data */
212 BPF_S_ANC_PROTOCOL,
213 BPF_S_ANC_PKTTYPE,
214 BPF_S_ANC_IFINDEX,
215 BPF_S_ANC_NLATTR,
216 BPF_S_ANC_NLATTR_NEST,
217 BPF_S_ANC_MARK,
218 BPF_S_ANC_QUEUE,
219 BPF_S_ANC_HATYPE,
220 BPF_S_ANC_RXHASH,
221 BPF_S_ANC_CPU,
222 BPF_S_ANC_ALU_XOR_X,
223 BPF_S_ANC_VLAN_TAG,
224 BPF_S_ANC_VLAN_TAG_PRESENT,
225 BPF_S_ANC_PAY_OFFSET,
226};
227
228#endif /* __LINUX_FILTER_H__ */ 444#endif /* __LINUX_FILTER_H__ */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index f194ccb8539c..6bff13f74050 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1711,6 +1711,7 @@ enum ieee80211_eid {
1711 WLAN_EID_RRM_ENABLED_CAPABILITIES = 70, 1711 WLAN_EID_RRM_ENABLED_CAPABILITIES = 70,
1712 WLAN_EID_MULTIPLE_BSSID = 71, 1712 WLAN_EID_MULTIPLE_BSSID = 71,
1713 WLAN_EID_BSS_COEX_2040 = 72, 1713 WLAN_EID_BSS_COEX_2040 = 72,
1714 WLAN_EID_BSS_INTOLERANT_CHL_REPORT = 73,
1714 WLAN_EID_OVERLAP_BSS_SCAN_PARAM = 74, 1715 WLAN_EID_OVERLAP_BSS_SCAN_PARAM = 74,
1715 WLAN_EID_RIC_DESCRIPTOR = 75, 1716 WLAN_EID_RIC_DESCRIPTOR = 75,
1716 WLAN_EID_MMIE = 76, 1717 WLAN_EID_MMIE = 76,
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 1085ffeef956..fd22789d7b2e 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -16,9 +16,28 @@
16#include <linux/netdevice.h> 16#include <linux/netdevice.h>
17#include <uapi/linux/if_bridge.h> 17#include <uapi/linux/if_bridge.h>
18 18
19struct br_ip {
20 union {
21 __be32 ip4;
22#if IS_ENABLED(CONFIG_IPV6)
23 struct in6_addr ip6;
24#endif
25 } u;
26 __be16 proto;
27 __u16 vid;
28};
29
30struct br_ip_list {
31 struct list_head list;
32 struct br_ip addr;
33};
34
19extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); 35extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
20 36
21typedef int br_should_route_hook_t(struct sk_buff *skb); 37typedef int br_should_route_hook_t(struct sk_buff *skb);
22extern br_should_route_hook_t __rcu *br_should_route_hook; 38extern br_should_route_hook_t __rcu *br_should_route_hook;
39int br_multicast_list_adjacent(struct net_device *dev,
40 struct list_head *br_ip_list);
41bool br_multicast_has_querier_adjacent(struct net_device *dev, int proto);
23 42
24#endif 43#endif
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index a86784dec3d3..119130e9298b 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -10,8 +10,9 @@ struct ifla_vf_info {
10 __u8 mac[32]; 10 __u8 mac[32];
11 __u32 vlan; 11 __u32 vlan;
12 __u32 qos; 12 __u32 qos;
13 __u32 tx_rate;
14 __u32 spoofchk; 13 __u32 spoofchk;
15 __u32 linkstate; 14 __u32 linkstate;
15 __u32 min_tx_rate;
16 __u32 max_tx_rate;
16}; 17};
17#endif /* _LINUX_IF_LINK_H */ 18#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index a9a53b12397b..6b2c7cf352a5 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -57,6 +57,9 @@ struct macvlan_dev {
57 netdev_features_t tap_features; 57 netdev_features_t tap_features;
58 int minor; 58 int minor;
59 int nest_level; 59 int nest_level;
60#ifdef CONFIG_NET_POLL_CONTROLLER
61 struct netpoll *netpoll;
62#endif
60}; 63};
61 64
62static inline void macvlan_count_rx(const struct macvlan_dev *vlan, 65static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index b2acc4a1b13c..4967916fe4ac 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -106,7 +106,7 @@ struct vlan_pcpu_stats {
106 106
107#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 107#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
108 108
109extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev, 109extern struct net_device *__vlan_find_dev_deep_rcu(struct net_device *real_dev,
110 __be16 vlan_proto, u16 vlan_id); 110 __be16 vlan_proto, u16 vlan_id);
111extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); 111extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
112extern u16 vlan_dev_vlan_id(const struct net_device *dev); 112extern u16 vlan_dev_vlan_id(const struct net_device *dev);
@@ -206,7 +206,7 @@ static inline int vlan_get_encap_level(struct net_device *dev)
206} 206}
207#else 207#else
208static inline struct net_device * 208static inline struct net_device *
209__vlan_find_dev_deep(struct net_device *real_dev, 209__vlan_find_dev_deep_rcu(struct net_device *real_dev,
210 __be16 vlan_proto, u16 vlan_id) 210 __be16 vlan_proto, u16 vlan_id)
211{ 211{
212 return NULL; 212 return NULL;
diff --git a/include/linux/isdn/capiutil.h b/include/linux/isdn/capiutil.h
index 5a52f2c94f3f..44bd6046e6e2 100644
--- a/include/linux/isdn/capiutil.h
+++ b/include/linux/isdn/capiutil.h
@@ -164,11 +164,6 @@ unsigned capi_cmsg_header(_cmsg * cmsg, __u16 _ApplId,
164 __u8 _Command, __u8 _Subcommand, 164 __u8 _Command, __u8 _Subcommand,
165 __u16 _Messagenumber, __u32 _Controller); 165 __u16 _Messagenumber, __u32 _Controller);
166 166
167/*
168 * capi_info2str generated a readable string for Capi2.0 reasons.
169 */
170char *capi_info2str(__u16 reason);
171
172/*-----------------------------------------------------------------------*/ 167/*-----------------------------------------------------------------------*/
173 168
174/* 169/*
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 31c0cd1c941a..de9e46e6bcc9 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -304,6 +304,30 @@ static inline int ktime_compare(const ktime_t cmp1, const ktime_t cmp2)
304 return 0; 304 return 0;
305} 305}
306 306
307/**
308 * ktime_after - Compare if a ktime_t value is bigger than another one.
309 * @cmp1: comparable1
310 * @cmp2: comparable2
311 *
312 * Return: true if cmp1 happened after cmp2.
313 */
314static inline bool ktime_after(const ktime_t cmp1, const ktime_t cmp2)
315{
316 return ktime_compare(cmp1, cmp2) > 0;
317}
318
319/**
320 * ktime_before - Compare if a ktime_t value is smaller than another one.
321 * @cmp1: comparable1
322 * @cmp2: comparable2
323 *
324 * Return: true if cmp1 happened before cmp2.
325 */
326static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2)
327{
328 return ktime_compare(cmp1, cmp2) < 0;
329}
330
307static inline s64 ktime_to_us(const ktime_t kt) 331static inline s64 ktime_to_us(const ktime_t kt)
308{ 332{
309 struct timeval tv = ktime_to_timeval(kt); 333 struct timeval tv = ktime_to_timeval(kt);
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 3447bead9620..b12f4bbd064c 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -450,7 +450,6 @@ struct mlx4_caps {
450 int reserved_qps_base[MLX4_NUM_QP_REGION]; 450 int reserved_qps_base[MLX4_NUM_QP_REGION];
451 int log_num_macs; 451 int log_num_macs;
452 int log_num_vlans; 452 int log_num_vlans;
453 int log_num_prios;
454 enum mlx4_port_type port_type[MLX4_MAX_PORTS + 1]; 453 enum mlx4_port_type port_type[MLX4_MAX_PORTS + 1];
455 u8 supported_type[MLX4_MAX_PORTS + 1]; 454 u8 supported_type[MLX4_MAX_PORTS + 1];
456 u8 suggested_type[MLX4_MAX_PORTS + 1]; 455 u8 suggested_type[MLX4_MAX_PORTS + 1];
@@ -578,6 +577,9 @@ struct mlx4_cq {
578 577
579 u32 cons_index; 578 u32 cons_index;
580 579
580 u16 irq;
581 bool irq_affinity_change;
582
581 __be32 *set_ci_db; 583 __be32 *set_ci_db;
582 __be32 *arm_db; 584 __be32 *arm_db;
583 int arm_sn; 585 int arm_sn;
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index c26d0ec2ef3a..e5a589435e2b 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -42,9 +42,11 @@ enum {
42 NETIF_F_TSO6_BIT, /* ... TCPv6 segmentation */ 42 NETIF_F_TSO6_BIT, /* ... TCPv6 segmentation */
43 NETIF_F_FSO_BIT, /* ... FCoE segmentation */ 43 NETIF_F_FSO_BIT, /* ... FCoE segmentation */
44 NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */ 44 NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */
45 NETIF_F_GSO_GRE_CSUM_BIT, /* ... GRE with csum with TSO */
45 NETIF_F_GSO_IPIP_BIT, /* ... IPIP tunnel with TSO */ 46 NETIF_F_GSO_IPIP_BIT, /* ... IPIP tunnel with TSO */
46 NETIF_F_GSO_SIT_BIT, /* ... SIT tunnel with TSO */ 47 NETIF_F_GSO_SIT_BIT, /* ... SIT tunnel with TSO */
47 NETIF_F_GSO_UDP_TUNNEL_BIT, /* ... UDP TUNNEL with TSO */ 48 NETIF_F_GSO_UDP_TUNNEL_BIT, /* ... UDP TUNNEL with TSO */
49 NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT,/* ... UDP TUNNEL with TSO & CSUM */
48 NETIF_F_GSO_MPLS_BIT, /* ... MPLS segmentation */ 50 NETIF_F_GSO_MPLS_BIT, /* ... MPLS segmentation */
49 /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */ 51 /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */
50 NETIF_F_GSO_MPLS_BIT, 52 NETIF_F_GSO_MPLS_BIT,
@@ -111,6 +113,7 @@ enum {
111#define NETIF_F_RXFCS __NETIF_F(RXFCS) 113#define NETIF_F_RXFCS __NETIF_F(RXFCS)
112#define NETIF_F_RXALL __NETIF_F(RXALL) 114#define NETIF_F_RXALL __NETIF_F(RXALL)
113#define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE) 115#define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE)
116#define NETIF_F_GSO_GRE_CSUM __NETIF_F(GSO_GRE_CSUM)
114#define NETIF_F_GSO_IPIP __NETIF_F(GSO_IPIP) 117#define NETIF_F_GSO_IPIP __NETIF_F(GSO_IPIP)
115#define NETIF_F_GSO_SIT __NETIF_F(GSO_SIT) 118#define NETIF_F_GSO_SIT __NETIF_F(GSO_SIT)
116#define NETIF_F_GSO_UDP_TUNNEL __NETIF_F(GSO_UDP_TUNNEL) 119#define NETIF_F_GSO_UDP_TUNNEL __NETIF_F(GSO_UDP_TUNNEL)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 6c1ae9fd9505..abe3de1db932 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -56,9 +56,6 @@ struct device;
56struct phy_device; 56struct phy_device;
57/* 802.11 specific */ 57/* 802.11 specific */
58struct wireless_dev; 58struct wireless_dev;
59 /* source back-compat hooks */
60#define SET_ETHTOOL_OPS(netdev,ops) \
61 ( (netdev)->ethtool_ops = (ops) )
62 59
63void netdev_set_default_ethtool_ops(struct net_device *dev, 60void netdev_set_default_ethtool_ops(struct net_device *dev,
64 const struct ethtool_ops *ops); 61 const struct ethtool_ops *ops);
@@ -853,7 +850,8 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
853 * SR-IOV management functions. 850 * SR-IOV management functions.
854 * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac); 851 * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac);
855 * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos); 852 * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos);
856 * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); 853 * int (*ndo_set_vf_rate)(struct net_device *dev, int vf, int min_tx_rate,
854 * int max_tx_rate);
857 * int (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool setting); 855 * int (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool setting);
858 * int (*ndo_get_vf_config)(struct net_device *dev, 856 * int (*ndo_get_vf_config)(struct net_device *dev,
859 * int vf, struct ifla_vf_info *ivf); 857 * int vf, struct ifla_vf_info *ivf);
@@ -1047,8 +1045,9 @@ struct net_device_ops {
1047 int queue, u8 *mac); 1045 int queue, u8 *mac);
1048 int (*ndo_set_vf_vlan)(struct net_device *dev, 1046 int (*ndo_set_vf_vlan)(struct net_device *dev,
1049 int queue, u16 vlan, u8 qos); 1047 int queue, u16 vlan, u8 qos);
1050 int (*ndo_set_vf_tx_rate)(struct net_device *dev, 1048 int (*ndo_set_vf_rate)(struct net_device *dev,
1051 int vf, int rate); 1049 int vf, int min_tx_rate,
1050 int max_tx_rate);
1052 int (*ndo_set_vf_spoofchk)(struct net_device *dev, 1051 int (*ndo_set_vf_spoofchk)(struct net_device *dev,
1053 int vf, bool setting); 1052 int vf, bool setting);
1054 int (*ndo_get_vf_config)(struct net_device *dev, 1053 int (*ndo_get_vf_config)(struct net_device *dev,
@@ -2634,6 +2633,7 @@ int dev_get_phys_port_id(struct net_device *dev,
2634 struct netdev_phys_port_id *ppid); 2633 struct netdev_phys_port_id *ppid);
2635int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, 2634int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
2636 struct netdev_queue *txq); 2635 struct netdev_queue *txq);
2636int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
2637int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); 2637int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
2638bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb); 2638bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb);
2639 2639
@@ -3003,6 +3003,15 @@ int __hw_addr_sync(struct netdev_hw_addr_list *to_list,
3003 struct netdev_hw_addr_list *from_list, int addr_len); 3003 struct netdev_hw_addr_list *from_list, int addr_len);
3004void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, 3004void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,
3005 struct netdev_hw_addr_list *from_list, int addr_len); 3005 struct netdev_hw_addr_list *from_list, int addr_len);
3006int __hw_addr_sync_dev(struct netdev_hw_addr_list *list,
3007 struct net_device *dev,
3008 int (*sync)(struct net_device *, const unsigned char *),
3009 int (*unsync)(struct net_device *,
3010 const unsigned char *));
3011void __hw_addr_unsync_dev(struct netdev_hw_addr_list *list,
3012 struct net_device *dev,
3013 int (*unsync)(struct net_device *,
3014 const unsigned char *));
3006void __hw_addr_init(struct netdev_hw_addr_list *list); 3015void __hw_addr_init(struct netdev_hw_addr_list *list);
3007 3016
3008/* Functions used for device addresses handling */ 3017/* Functions used for device addresses handling */
@@ -3023,6 +3032,38 @@ void dev_uc_unsync(struct net_device *to, struct net_device *from);
3023void dev_uc_flush(struct net_device *dev); 3032void dev_uc_flush(struct net_device *dev);
3024void dev_uc_init(struct net_device *dev); 3033void dev_uc_init(struct net_device *dev);
3025 3034
3035/**
3036 * __dev_uc_sync - Synchonize device's unicast list
3037 * @dev: device to sync
3038 * @sync: function to call if address should be added
3039 * @unsync: function to call if address should be removed
3040 *
3041 * Add newly added addresses to the interface, and release
3042 * addresses that have been deleted.
3043 **/
3044static inline int __dev_uc_sync(struct net_device *dev,
3045 int (*sync)(struct net_device *,
3046 const unsigned char *),
3047 int (*unsync)(struct net_device *,
3048 const unsigned char *))
3049{
3050 return __hw_addr_sync_dev(&dev->uc, dev, sync, unsync);
3051}
3052
3053/**
3054 * __dev_uc_unsync - Remove synchonized addresses from device
3055 * @dev: device to sync
3056 * @unsync: function to call if address should be removed
3057 *
3058 * Remove all addresses that were added to the device by dev_uc_sync().
3059 **/
3060static inline void __dev_uc_unsync(struct net_device *dev,
3061 int (*unsync)(struct net_device *,
3062 const unsigned char *))
3063{
3064 __hw_addr_unsync_dev(&dev->uc, dev, unsync);
3065}
3066
3026/* Functions used for multicast addresses handling */ 3067/* Functions used for multicast addresses handling */
3027int dev_mc_add(struct net_device *dev, const unsigned char *addr); 3068int dev_mc_add(struct net_device *dev, const unsigned char *addr);
3028int dev_mc_add_global(struct net_device *dev, const unsigned char *addr); 3069int dev_mc_add_global(struct net_device *dev, const unsigned char *addr);
@@ -3035,6 +3076,38 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from);
3035void dev_mc_flush(struct net_device *dev); 3076void dev_mc_flush(struct net_device *dev);
3036void dev_mc_init(struct net_device *dev); 3077void dev_mc_init(struct net_device *dev);
3037 3078
3079/**
3080 * __dev_mc_sync - Synchonize device's multicast list
3081 * @dev: device to sync
3082 * @sync: function to call if address should be added
3083 * @unsync: function to call if address should be removed
3084 *
3085 * Add newly added addresses to the interface, and release
3086 * addresses that have been deleted.
3087 **/
3088static inline int __dev_mc_sync(struct net_device *dev,
3089 int (*sync)(struct net_device *,
3090 const unsigned char *),
3091 int (*unsync)(struct net_device *,
3092 const unsigned char *))
3093{
3094 return __hw_addr_sync_dev(&dev->mc, dev, sync, unsync);
3095}
3096
3097/**
3098 * __dev_mc_unsync - Remove synchonized addresses from device
3099 * @dev: device to sync
3100 * @unsync: function to call if address should be removed
3101 *
3102 * Remove all addresses that were added to the device by dev_mc_sync().
3103 **/
3104static inline void __dev_mc_unsync(struct net_device *dev,
3105 int (*unsync)(struct net_device *,
3106 const unsigned char *))
3107{
3108 __hw_addr_unsync_dev(&dev->mc, dev, unsync);
3109}
3110
3038/* Functions used for secondary unicast and multicast support */ 3111/* Functions used for secondary unicast and multicast support */
3039void dev_set_rx_mode(struct net_device *dev); 3112void dev_set_rx_mode(struct net_device *dev);
3040void __dev_set_rx_mode(struct net_device *dev); 3113void __dev_set_rx_mode(struct net_device *dev);
@@ -3180,6 +3253,20 @@ const char *netdev_drivername(const struct net_device *dev);
3180 3253
3181void linkwatch_run_queue(void); 3254void linkwatch_run_queue(void);
3182 3255
3256static inline netdev_features_t netdev_intersect_features(netdev_features_t f1,
3257 netdev_features_t f2)
3258{
3259 if (f1 & NETIF_F_GEN_CSUM)
3260 f1 |= (NETIF_F_ALL_CSUM & ~NETIF_F_GEN_CSUM);
3261 if (f2 & NETIF_F_GEN_CSUM)
3262 f2 |= (NETIF_F_ALL_CSUM & ~NETIF_F_GEN_CSUM);
3263 f1 &= f2;
3264 if (f1 & NETIF_F_GEN_CSUM)
3265 f1 &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_GEN_CSUM);
3266
3267 return f1;
3268}
3269
3183static inline netdev_features_t netdev_get_wanted_features( 3270static inline netdev_features_t netdev_get_wanted_features(
3184 struct net_device *dev) 3271 struct net_device *dev)
3185{ 3272{
diff --git a/include/linux/netfilter/nfnetlink_acct.h b/include/linux/netfilter/nfnetlink_acct.h
index b2e85e59f760..6ec975748742 100644
--- a/include/linux/netfilter/nfnetlink_acct.h
+++ b/include/linux/netfilter/nfnetlink_acct.h
@@ -3,11 +3,17 @@
3 3
4#include <uapi/linux/netfilter/nfnetlink_acct.h> 4#include <uapi/linux/netfilter/nfnetlink_acct.h>
5 5
6enum {
7 NFACCT_NO_QUOTA = -1,
8 NFACCT_UNDERQUOTA,
9 NFACCT_OVERQUOTA,
10};
6 11
7struct nf_acct; 12struct nf_acct;
8 13
9struct nf_acct *nfnl_acct_find_get(const char *filter_name); 14struct nf_acct *nfnl_acct_find_get(const char *filter_name);
10void nfnl_acct_put(struct nf_acct *acct); 15void nfnl_acct_put(struct nf_acct *acct);
11void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct); 16void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct);
12 17extern int nfnl_acct_overquota(const struct sk_buff *skb,
18 struct nf_acct *nfacct);
13#endif /* _NFNL_ACCT_H */ 19#endif /* _NFNL_ACCT_H */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 034cda789a15..9e572daa15d5 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -46,7 +46,8 @@ struct netlink_kernel_cfg {
46 unsigned int flags; 46 unsigned int flags;
47 void (*input)(struct sk_buff *skb); 47 void (*input)(struct sk_buff *skb);
48 struct mutex *cb_mutex; 48 struct mutex *cb_mutex;
49 void (*bind)(int group); 49 int (*bind)(int group);
50 void (*unbind)(int group);
50 bool (*compare)(struct net *net, struct sock *sk); 51 bool (*compare)(struct net *net, struct sock *sk);
51}; 52};
52 53
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h
index c8d7f3965fff..20163b9a0eae 100644
--- a/include/linux/nl802154.h
+++ b/include/linux/nl802154.h
@@ -80,6 +80,22 @@ enum {
80 80
81 IEEE802154_ATTR_FRAME_RETRIES, 81 IEEE802154_ATTR_FRAME_RETRIES,
82 82
83 IEEE802154_ATTR_LLSEC_ENABLED,
84 IEEE802154_ATTR_LLSEC_SECLEVEL,
85 IEEE802154_ATTR_LLSEC_KEY_MODE,
86 IEEE802154_ATTR_LLSEC_KEY_SOURCE_SHORT,
87 IEEE802154_ATTR_LLSEC_KEY_SOURCE_EXTENDED,
88 IEEE802154_ATTR_LLSEC_KEY_ID,
89 IEEE802154_ATTR_LLSEC_FRAME_COUNTER,
90 IEEE802154_ATTR_LLSEC_KEY_BYTES,
91 IEEE802154_ATTR_LLSEC_KEY_USAGE_FRAME_TYPES,
92 IEEE802154_ATTR_LLSEC_KEY_USAGE_COMMANDS,
93 IEEE802154_ATTR_LLSEC_FRAME_TYPE,
94 IEEE802154_ATTR_LLSEC_CMD_FRAME_ID,
95 IEEE802154_ATTR_LLSEC_SECLEVELS,
96 IEEE802154_ATTR_LLSEC_DEV_OVERRIDE,
97 IEEE802154_ATTR_LLSEC_DEV_KEY_MODE,
98
83 __IEEE802154_ATTR_MAX, 99 __IEEE802154_ATTR_MAX,
84}; 100};
85 101
@@ -134,6 +150,21 @@ enum {
134 150
135 IEEE802154_SET_MACPARAMS, 151 IEEE802154_SET_MACPARAMS,
136 152
153 IEEE802154_LLSEC_GETPARAMS,
154 IEEE802154_LLSEC_SETPARAMS,
155 IEEE802154_LLSEC_LIST_KEY,
156 IEEE802154_LLSEC_ADD_KEY,
157 IEEE802154_LLSEC_DEL_KEY,
158 IEEE802154_LLSEC_LIST_DEV,
159 IEEE802154_LLSEC_ADD_DEV,
160 IEEE802154_LLSEC_DEL_DEV,
161 IEEE802154_LLSEC_LIST_DEVKEY,
162 IEEE802154_LLSEC_ADD_DEVKEY,
163 IEEE802154_LLSEC_DEL_DEVKEY,
164 IEEE802154_LLSEC_LIST_SECLEVEL,
165 IEEE802154_LLSEC_ADD_SECLEVEL,
166 IEEE802154_LLSEC_DEL_SECLEVEL,
167
137 __IEEE802154_CMD_MAX, 168 __IEEE802154_CMD_MAX,
138}; 169};
139 170
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index 881a7c3571f4..a70c9493d55a 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -22,12 +22,12 @@ extern struct phy_device *of_phy_connect(struct net_device *dev,
22struct phy_device *of_phy_attach(struct net_device *dev, 22struct phy_device *of_phy_attach(struct net_device *dev,
23 struct device_node *phy_np, u32 flags, 23 struct device_node *phy_np, u32 flags,
24 phy_interface_t iface); 24 phy_interface_t iface);
25extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
26 void (*hndlr)(struct net_device *),
27 phy_interface_t iface);
28 25
29extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); 26extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
30 27
28extern void of_mdiobus_link_phydev(struct mii_bus *mdio,
29 struct phy_device *phydev);
30
31#else /* CONFIG_OF */ 31#else /* CONFIG_OF */
32static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) 32static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
33{ 33{
@@ -59,17 +59,30 @@ static inline struct phy_device *of_phy_attach(struct net_device *dev,
59 return NULL; 59 return NULL;
60} 60}
61 61
62static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, 62static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
63 void (*hndlr)(struct net_device *),
64 phy_interface_t iface)
65{ 63{
66 return NULL; 64 return NULL;
67} 65}
68 66
69static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np) 67static inline void of_mdiobus_link_phydev(struct mii_bus *mdio,
68 struct phy_device *phydev)
70{ 69{
71 return NULL;
72} 70}
73#endif /* CONFIG_OF */ 71#endif /* CONFIG_OF */
74 72
73#if defined(CONFIG_OF) && defined(CONFIG_FIXED_PHY)
74extern int of_phy_register_fixed_link(struct device_node *np);
75extern bool of_phy_is_fixed_link(struct device_node *np);
76#else
77static inline int of_phy_register_fixed_link(struct device_node *np)
78{
79 return -ENOSYS;
80}
81static inline bool of_phy_is_fixed_link(struct device_node *np)
82{
83 return false;
84}
85#endif
86
87
75#endif /* __LINUX_OF_MDIO_H */ 88#endif /* __LINUX_OF_MDIO_H */
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 4d0221fd0688..864ddafad8cc 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -198,6 +198,13 @@ static inline struct mii_bus *mdiobus_alloc(void)
198int mdiobus_register(struct mii_bus *bus); 198int mdiobus_register(struct mii_bus *bus);
199void mdiobus_unregister(struct mii_bus *bus); 199void mdiobus_unregister(struct mii_bus *bus);
200void mdiobus_free(struct mii_bus *bus); 200void mdiobus_free(struct mii_bus *bus);
201struct mii_bus *devm_mdiobus_alloc_size(struct device *dev, int sizeof_priv);
202static inline struct mii_bus *devm_mdiobus_alloc(struct device *dev)
203{
204 return devm_mdiobus_alloc_size(dev, 0);
205}
206
207void devm_mdiobus_free(struct device *dev, struct mii_bus *bus);
201struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr); 208struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr);
202int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum); 209int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum);
203int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val); 210int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
@@ -666,6 +673,7 @@ static inline int phy_read_status(struct phy_device *phydev)
666 return phydev->drv->read_status(phydev); 673 return phydev->drv->read_status(phydev);
667} 674}
668 675
676int genphy_config_init(struct phy_device *phydev);
669int genphy_setup_forced(struct phy_device *phydev); 677int genphy_setup_forced(struct phy_device *phydev);
670int genphy_restart_aneg(struct phy_device *phydev); 678int genphy_restart_aneg(struct phy_device *phydev);
671int genphy_config_aneg(struct phy_device *phydev); 679int genphy_config_aneg(struct phy_device *phydev);
diff --git a/include/linux/phy_fixed.h b/include/linux/phy_fixed.h
index 509d8f5f984e..ae612acebb53 100644
--- a/include/linux/phy_fixed.h
+++ b/include/linux/phy_fixed.h
@@ -9,15 +9,31 @@ struct fixed_phy_status {
9 int asym_pause; 9 int asym_pause;
10}; 10};
11 11
12struct device_node;
13
12#ifdef CONFIG_FIXED_PHY 14#ifdef CONFIG_FIXED_PHY
13extern int fixed_phy_add(unsigned int irq, int phy_id, 15extern int fixed_phy_add(unsigned int irq, int phy_id,
14 struct fixed_phy_status *status); 16 struct fixed_phy_status *status);
17extern int fixed_phy_register(unsigned int irq,
18 struct fixed_phy_status *status,
19 struct device_node *np);
20extern void fixed_phy_del(int phy_addr);
15#else 21#else
16static inline int fixed_phy_add(unsigned int irq, int phy_id, 22static inline int fixed_phy_add(unsigned int irq, int phy_id,
17 struct fixed_phy_status *status) 23 struct fixed_phy_status *status)
18{ 24{
19 return -ENODEV; 25 return -ENODEV;
20} 26}
27static inline int fixed_phy_register(unsigned int irq,
28 struct fixed_phy_status *status,
29 struct device_node *np)
30{
31 return -ENODEV;
32}
33static inline int fixed_phy_del(int phy_addr)
34{
35 return -ENODEV;
36}
21#endif /* CONFIG_FIXED_PHY */ 37#endif /* CONFIG_FIXED_PHY */
22 38
23/* 39/*
diff --git a/include/linux/platform_data/st21nfca.h b/include/linux/platform_data/st21nfca.h
new file mode 100644
index 000000000000..1730312398ff
--- /dev/null
+++ b/include/linux/platform_data/st21nfca.h
@@ -0,0 +1,32 @@
1/*
2 * Driver include for the ST21NFCA NFC chip.
3 *
4 * Copyright (C) 2014 STMicroelectronics SAS. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef _ST21NFCA_HCI_H_
20#define _ST21NFCA_HCI_H_
21
22#include <linux/i2c.h>
23
24#define ST21NFCA_HCI_DRIVER_NAME "st21nfca_hci"
25
26struct st21nfca_nfc_platform_data {
27 unsigned int gpio_irq;
28 unsigned int gpio_ena;
29 unsigned int irq_polarity;
30};
31
32#endif /* _ST21NFCA_HCI_H_ */
diff --git a/include/linux/rfkill-gpio.h b/include/linux/rfkill-gpio.h
index 4d09f6eab359..20bcb55498cd 100644
--- a/include/linux/rfkill-gpio.h
+++ b/include/linux/rfkill-gpio.h
@@ -27,21 +27,11 @@
27 * struct rfkill_gpio_platform_data - platform data for rfkill gpio device. 27 * struct rfkill_gpio_platform_data - platform data for rfkill gpio device.
28 * for unused gpio's, the expected value is -1. 28 * for unused gpio's, the expected value is -1.
29 * @name: name for the gpio rf kill instance 29 * @name: name for the gpio rf kill instance
30 * @reset_gpio: GPIO which is used for reseting rfkill switch
31 * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch
32 * @power_clk_name: [optional] name of clk to turn off while blocked
33 * @gpio_runtime_close: clean up platform specific gpio configuration
34 * @gpio_runtime_setup: set up platform specific gpio configuration
35 */ 30 */
36 31
37struct rfkill_gpio_platform_data { 32struct rfkill_gpio_platform_data {
38 char *name; 33 char *name;
39 int reset_gpio;
40 int shutdown_gpio;
41 const char *power_clk_name;
42 enum rfkill_type type; 34 enum rfkill_type type;
43 void (*gpio_runtime_close)(struct platform_device *);
44 int (*gpio_runtime_setup)(struct platform_device *);
45}; 35};
46 36
47#endif /* __RFKILL_GPIO_H */ 37#endif /* __RFKILL_GPIO_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 08074a810164..5b5cd3189c98 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -345,6 +345,10 @@ enum {
345 SKB_GSO_UDP_TUNNEL = 1 << 9, 345 SKB_GSO_UDP_TUNNEL = 1 << 9,
346 346
347 SKB_GSO_MPLS = 1 << 10, 347 SKB_GSO_MPLS = 1 << 10,
348
349 SKB_GSO_UDP_TUNNEL_CSUM = 1 << 11,
350
351 SKB_GSO_GRE_CSUM = 1 << 12,
348}; 352};
349 353
350#if BITS_PER_LONG > 32 354#if BITS_PER_LONG > 32
@@ -426,7 +430,7 @@ static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1,
426 * @csum_start: Offset from skb->head where checksumming should start 430 * @csum_start: Offset from skb->head where checksumming should start
427 * @csum_offset: Offset from csum_start where checksum should be stored 431 * @csum_offset: Offset from csum_start where checksum should be stored
428 * @priority: Packet queueing priority 432 * @priority: Packet queueing priority
429 * @local_df: allow local fragmentation 433 * @ignore_df: allow local fragmentation
430 * @cloned: Head may be cloned (check refcnt to be sure) 434 * @cloned: Head may be cloned (check refcnt to be sure)
431 * @ip_summed: Driver fed us an IP checksum 435 * @ip_summed: Driver fed us an IP checksum
432 * @nohdr: Payload reference only, must not modify header 436 * @nohdr: Payload reference only, must not modify header
@@ -514,7 +518,7 @@ struct sk_buff {
514 }; 518 };
515 __u32 priority; 519 __u32 priority;
516 kmemcheck_bitfield_begin(flags1); 520 kmemcheck_bitfield_begin(flags1);
517 __u8 local_df:1, 521 __u8 ignore_df:1,
518 cloned:1, 522 cloned:1,
519 ip_summed:2, 523 ip_summed:2,
520 nohdr:1, 524 nohdr:1,
@@ -567,7 +571,10 @@ struct sk_buff {
567 * headers if needed 571 * headers if needed
568 */ 572 */
569 __u8 encapsulation:1; 573 __u8 encapsulation:1;
570 /* 6/8 bit hole (depending on ndisc_nodetype presence) */ 574 __u8 encap_hdr_csum:1;
575 __u8 csum_valid:1;
576 __u8 csum_complete_sw:1;
577 /* 3/5 bit hole (depending on ndisc_nodetype presence) */
571 kmemcheck_bitfield_end(flags2); 578 kmemcheck_bitfield_end(flags2);
572 579
573#if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL 580#if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL
@@ -739,7 +746,13 @@ struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
739int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask); 746int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask);
740struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t priority); 747struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t priority);
741struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t priority); 748struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t priority);
742struct sk_buff *__pskb_copy(struct sk_buff *skb, int headroom, gfp_t gfp_mask); 749struct sk_buff *__pskb_copy_fclone(struct sk_buff *skb, int headroom,
750 gfp_t gfp_mask, bool fclone);
751static inline struct sk_buff *__pskb_copy(struct sk_buff *skb, int headroom,
752 gfp_t gfp_mask)
753{
754 return __pskb_copy_fclone(skb, headroom, gfp_mask, false);
755}
743 756
744int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask); 757int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask);
745struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, 758struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
@@ -2233,6 +2246,14 @@ static inline struct sk_buff *pskb_copy(struct sk_buff *skb,
2233 return __pskb_copy(skb, skb_headroom(skb), gfp_mask); 2246 return __pskb_copy(skb, skb_headroom(skb), gfp_mask);
2234} 2247}
2235 2248
2249
2250static inline struct sk_buff *pskb_copy_for_clone(struct sk_buff *skb,
2251 gfp_t gfp_mask)
2252{
2253 return __pskb_copy_fclone(skb, skb_headroom(skb), gfp_mask, true);
2254}
2255
2256
2236/** 2257/**
2237 * skb_clone_writable - is the header of a clone writable 2258 * skb_clone_writable - is the header of a clone writable
2238 * @skb: buffer to check 2259 * @skb: buffer to check
@@ -2716,7 +2737,7 @@ __sum16 __skb_checksum_complete(struct sk_buff *skb);
2716 2737
2717static inline int skb_csum_unnecessary(const struct sk_buff *skb) 2738static inline int skb_csum_unnecessary(const struct sk_buff *skb)
2718{ 2739{
2719 return skb->ip_summed & CHECKSUM_UNNECESSARY; 2740 return ((skb->ip_summed & CHECKSUM_UNNECESSARY) || skb->csum_valid);
2720} 2741}
2721 2742
2722/** 2743/**
@@ -2741,6 +2762,103 @@ static inline __sum16 skb_checksum_complete(struct sk_buff *skb)
2741 0 : __skb_checksum_complete(skb); 2762 0 : __skb_checksum_complete(skb);
2742} 2763}
2743 2764
2765/* Check if we need to perform checksum complete validation.
2766 *
2767 * Returns true if checksum complete is needed, false otherwise
2768 * (either checksum is unnecessary or zero checksum is allowed).
2769 */
2770static inline bool __skb_checksum_validate_needed(struct sk_buff *skb,
2771 bool zero_okay,
2772 __sum16 check)
2773{
2774 if (skb_csum_unnecessary(skb) || (zero_okay && !check)) {
2775 skb->csum_valid = 1;
2776 return false;
2777 }
2778
2779 return true;
2780}
2781
2782/* For small packets <= CHECKSUM_BREAK peform checksum complete directly
2783 * in checksum_init.
2784 */
2785#define CHECKSUM_BREAK 76
2786
2787/* Validate (init) checksum based on checksum complete.
2788 *
2789 * Return values:
2790 * 0: checksum is validated or try to in skb_checksum_complete. In the latter
2791 * case the ip_summed will not be CHECKSUM_UNNECESSARY and the pseudo
2792 * checksum is stored in skb->csum for use in __skb_checksum_complete
2793 * non-zero: value of invalid checksum
2794 *
2795 */
2796static inline __sum16 __skb_checksum_validate_complete(struct sk_buff *skb,
2797 bool complete,
2798 __wsum psum)
2799{
2800 if (skb->ip_summed == CHECKSUM_COMPLETE) {
2801 if (!csum_fold(csum_add(psum, skb->csum))) {
2802 skb->csum_valid = 1;
2803 return 0;
2804 }
2805 }
2806
2807 skb->csum = psum;
2808
2809 if (complete || skb->len <= CHECKSUM_BREAK) {
2810 __sum16 csum;
2811
2812 csum = __skb_checksum_complete(skb);
2813 skb->csum_valid = !csum;
2814 return csum;
2815 }
2816
2817 return 0;
2818}
2819
2820static inline __wsum null_compute_pseudo(struct sk_buff *skb, int proto)
2821{
2822 return 0;
2823}
2824
2825/* Perform checksum validate (init). Note that this is a macro since we only
2826 * want to calculate the pseudo header which is an input function if necessary.
2827 * First we try to validate without any computation (checksum unnecessary) and
2828 * then calculate based on checksum complete calling the function to compute
2829 * pseudo header.
2830 *
2831 * Return values:
2832 * 0: checksum is validated or try to in skb_checksum_complete
2833 * non-zero: value of invalid checksum
2834 */
2835#define __skb_checksum_validate(skb, proto, complete, \
2836 zero_okay, check, compute_pseudo) \
2837({ \
2838 __sum16 __ret = 0; \
2839 skb->csum_valid = 0; \
2840 if (__skb_checksum_validate_needed(skb, zero_okay, check)) \
2841 __ret = __skb_checksum_validate_complete(skb, \
2842 complete, compute_pseudo(skb, proto)); \
2843 __ret; \
2844})
2845
2846#define skb_checksum_init(skb, proto, compute_pseudo) \
2847 __skb_checksum_validate(skb, proto, false, false, 0, compute_pseudo)
2848
2849#define skb_checksum_init_zero_check(skb, proto, check, compute_pseudo) \
2850 __skb_checksum_validate(skb, proto, false, true, check, compute_pseudo)
2851
2852#define skb_checksum_validate(skb, proto, compute_pseudo) \
2853 __skb_checksum_validate(skb, proto, true, false, 0, compute_pseudo)
2854
2855#define skb_checksum_validate_zero_check(skb, proto, check, \
2856 compute_pseudo) \
2857 __skb_checksum_validate_(skb, proto, true, true, check, compute_pseudo)
2858
2859#define skb_checksum_simple_validate(skb) \
2860 __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo)
2861
2744#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 2862#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
2745void nf_conntrack_destroy(struct nf_conntrack *nfct); 2863void nf_conntrack_destroy(struct nf_conntrack *nfct);
2746static inline void nf_conntrack_put(struct nf_conntrack *nfct) 2864static inline void nf_conntrack_put(struct nf_conntrack *nfct)
@@ -2895,6 +3013,7 @@ static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
2895struct skb_gso_cb { 3013struct skb_gso_cb {
2896 int mac_offset; 3014 int mac_offset;
2897 int encap_level; 3015 int encap_level;
3016 __u16 csum_start;
2898}; 3017};
2899#define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb) 3018#define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb)
2900 3019
@@ -2919,6 +3038,28 @@ static inline int gso_pskb_expand_head(struct sk_buff *skb, int extra)
2919 return 0; 3038 return 0;
2920} 3039}
2921 3040
3041/* Compute the checksum for a gso segment. First compute the checksum value
3042 * from the start of transport header to SKB_GSO_CB(skb)->csum_start, and
3043 * then add in skb->csum (checksum from csum_start to end of packet).
3044 * skb->csum and csum_start are then updated to reflect the checksum of the
3045 * resultant packet starting from the transport header-- the resultant checksum
3046 * is in the res argument (i.e. normally zero or ~ of checksum of a pseudo
3047 * header.
3048 */
3049static inline __sum16 gso_make_checksum(struct sk_buff *skb, __wsum res)
3050{
3051 int plen = SKB_GSO_CB(skb)->csum_start - skb_headroom(skb) -
3052 skb_transport_offset(skb);
3053 __u16 csum;
3054
3055 csum = csum_fold(csum_partial(skb_transport_header(skb),
3056 plen, skb->csum));
3057 skb->csum = res;
3058 SKB_GSO_CB(skb)->csum_start -= plen;
3059
3060 return csum;
3061}
3062
2922static inline bool skb_is_gso(const struct sk_buff *skb) 3063static inline bool skb_is_gso(const struct sk_buff *skb)
2923{ 3064{
2924 return skb_shinfo(skb)->gso_size; 3065 return skb_shinfo(skb)->gso_size;
diff --git a/include/linux/spi/at86rf230.h b/include/linux/spi/at86rf230.h
index aa327a8105ad..b2b1afbb3202 100644
--- a/include/linux/spi/at86rf230.h
+++ b/include/linux/spi/at86rf230.h
@@ -26,20 +26,6 @@ struct at86rf230_platform_data {
26 int rstn; 26 int rstn;
27 int slp_tr; 27 int slp_tr;
28 int dig2; 28 int dig2;
29
30 /* Setting the irq_type will configure the driver to request
31 * the platform irq trigger type according to the given value
32 * and configure the interrupt polarity of the device to the
33 * corresponding polarity.
34 *
35 * Allowed values are: IRQF_TRIGGER_RISING, IRQF_TRIGGER_FALLING,
36 * IRQF_TRIGGER_HIGH and IRQF_TRIGGER_LOW
37 *
38 * Setting it to 0, the driver does not touch the trigger type
39 * configuration of the interrupt and sets the interrupt polarity
40 * of the device to high active (the default value).
41 */
42 int irq_type;
43}; 29};
44 30
45#endif 31#endif
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 07ef9b82b66d..4568a5cc9ab8 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -33,6 +33,7 @@ struct ssb_sprom {
33 u8 et1phyaddr; /* MII address for enet1 */ 33 u8 et1phyaddr; /* MII address for enet1 */
34 u8 et0mdcport; /* MDIO for enet0 */ 34 u8 et0mdcport; /* MDIO for enet0 */
35 u8 et1mdcport; /* MDIO for enet1 */ 35 u8 et1mdcport; /* MDIO for enet1 */
36 u16 dev_id; /* Device ID overriding e.g. PCI ID */
36 u16 board_rev; /* Board revision number from SPROM. */ 37 u16 board_rev; /* Board revision number from SPROM. */
37 u16 board_num; /* Board number from SPROM. */ 38 u16 board_num; /* Board number from SPROM. */
38 u16 board_type; /* Board type from SPROM. */ 39 u16 board_type; /* Board type from SPROM. */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 239946868142..a0513210798f 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -197,7 +197,8 @@ struct tcp_sock {
197 u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ 197 u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */
198 syn_data:1, /* SYN includes data */ 198 syn_data:1, /* SYN includes data */
199 syn_fastopen:1, /* SYN includes Fast Open option */ 199 syn_fastopen:1, /* SYN includes Fast Open option */
200 syn_data_acked:1;/* data in SYN is acked by SYN-ACK */ 200 syn_data_acked:1,/* data in SYN is acked by SYN-ACK */
201 is_cwnd_limited:1;/* forward progress limited by snd_cwnd? */
201 u32 tlp_high_seq; /* snd_nxt at the time of TLP retransmit. */ 202 u32 tlp_high_seq; /* snd_nxt at the time of TLP retransmit. */
202 203
203/* RTT measurement */ 204/* RTT measurement */
@@ -209,6 +210,8 @@ struct tcp_sock {
209 210
210 u32 packets_out; /* Packets which are "in flight" */ 211 u32 packets_out; /* Packets which are "in flight" */
211 u32 retrans_out; /* Retransmitted packets out */ 212 u32 retrans_out; /* Retransmitted packets out */
213 u32 max_packets_out; /* max packets_out in last window */
214 u32 max_packets_seq; /* right edge of max_packets_out flight */
212 215
213 u16 urg_data; /* Saved octet of OOB data and control flags */ 216 u16 urg_data; /* Saved octet of OOB data and control flags */
214 u8 ecn_flags; /* ECN status bits. */ 217 u8 ecn_flags; /* ECN status bits. */
@@ -365,11 +368,6 @@ static inline bool tcp_passive_fastopen(const struct sock *sk)
365 tcp_sk(sk)->fastopen_rsk != NULL); 368 tcp_sk(sk)->fastopen_rsk != NULL);
366} 369}
367 370
368static inline bool fastopen_cookie_present(struct tcp_fastopen_cookie *foc)
369{
370 return foc->len != -1;
371}
372
373extern void tcp_sock_destruct(struct sock *sk); 371extern void tcp_sock_destruct(struct sock *sk);
374 372
375static inline int fastopen_init_queue(struct sock *sk, int backlog) 373static inline int fastopen_init_queue(struct sock *sk, int backlog)
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 42278bbf7a88..247cfdcc4b08 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -47,7 +47,9 @@ struct udp_sock {
47#define udp_portaddr_node inet.sk.__sk_common.skc_portaddr_node 47#define udp_portaddr_node inet.sk.__sk_common.skc_portaddr_node
48 int pending; /* Any pending frames ? */ 48 int pending; /* Any pending frames ? */
49 unsigned int corkflag; /* Cork is required */ 49 unsigned int corkflag; /* Cork is required */
50 __u16 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? */
52 no_check6_rx:1;/* Allow zero UDP6 checksums on RX? */
51 /* 53 /*
52 * Following member retains the information to create a UDP header 54 * Following member retains the information to create a UDP header
53 * when the socket is uncorked. 55 * when the socket is uncorked.
@@ -76,6 +78,26 @@ static inline struct udp_sock *udp_sk(const struct sock *sk)
76 return (struct udp_sock *)sk; 78 return (struct udp_sock *)sk;
77} 79}
78 80
81static inline void udp_set_no_check6_tx(struct sock *sk, bool val)
82{
83 udp_sk(sk)->no_check6_tx = val;
84}
85
86static inline void udp_set_no_check6_rx(struct sock *sk, bool val)
87{
88 udp_sk(sk)->no_check6_rx = val;
89}
90
91static inline bool udp_get_no_check6_tx(struct sock *sk)
92{
93 return udp_sk(sk)->no_check6_tx;
94}
95
96static inline bool udp_get_no_check6_rx(struct sock *sk)
97{
98 return udp_sk(sk)->no_check6_rx;
99}
100
79#define udp_portaddr_for_each_entry(__sk, node, list) \ 101#define udp_portaddr_for_each_entry(__sk, node, list) \
80 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)
81 103
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
index 44b38b92236a..7c9b484735c5 100644
--- a/include/linux/usb/cdc_ncm.h
+++ b/include/linux/usb/cdc_ncm.h
@@ -52,6 +52,10 @@
52#define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */ 52#define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */
53#define CDC_NCM_NTB_MAX_SIZE_RX 32768 /* bytes */ 53#define CDC_NCM_NTB_MAX_SIZE_RX 32768 /* bytes */
54 54
55/* Initial NTB length */
56#define CDC_NCM_NTB_DEF_SIZE_TX 16384 /* bytes */
57#define CDC_NCM_NTB_DEF_SIZE_RX 16384 /* bytes */
58
55/* Minimum value for MaxDatagramSize, ch. 6.2.9 */ 59/* Minimum value for MaxDatagramSize, ch. 6.2.9 */
56#define CDC_NCM_MIN_DATAGRAM_SIZE 1514 /* bytes */ 60#define CDC_NCM_MIN_DATAGRAM_SIZE 1514 /* bytes */
57 61
@@ -72,16 +76,9 @@
72/* Restart the timer, if amount of datagrams is less than given value */ 76/* Restart the timer, if amount of datagrams is less than given value */
73#define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3 77#define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3
74#define CDC_NCM_TIMER_PENDING_CNT 2 78#define CDC_NCM_TIMER_PENDING_CNT 2
75#define CDC_NCM_TIMER_INTERVAL (400UL * NSEC_PER_USEC) 79#define CDC_NCM_TIMER_INTERVAL_USEC 400UL
76 80#define CDC_NCM_TIMER_INTERVAL_MIN 5UL
77/* The following macro defines the minimum header space */ 81#define CDC_NCM_TIMER_INTERVAL_MAX (U32_MAX / NSEC_PER_USEC)
78#define CDC_NCM_MIN_HDR_SIZE \
79 (sizeof(struct usb_cdc_ncm_nth16) + sizeof(struct usb_cdc_ncm_ndp16) + \
80 (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16))
81
82#define CDC_NCM_NDP_SIZE \
83 (sizeof(struct usb_cdc_ncm_ndp16) + \
84 (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16))
85 82
86#define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \ 83#define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \
87 (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE) 84 (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE)
@@ -107,6 +104,9 @@ struct cdc_ncm_ctx {
107 spinlock_t mtx; 104 spinlock_t mtx;
108 atomic_t stop; 105 atomic_t stop;
109 106
107 u32 timer_interval;
108 u32 max_ndp_size;
109
110 u32 tx_timer_pending; 110 u32 tx_timer_pending;
111 u32 tx_curr_frame_num; 111 u32 tx_curr_frame_num;
112 u32 rx_max; 112 u32 rx_max;
@@ -118,10 +118,21 @@ struct cdc_ncm_ctx {
118 u16 tx_ndp_modulus; 118 u16 tx_ndp_modulus;
119 u16 tx_seq; 119 u16 tx_seq;
120 u16 rx_seq; 120 u16 rx_seq;
121 u16 connected; 121 u16 min_tx_pkt;
122
123 /* statistics */
124 u32 tx_curr_frame_payload;
125 u32 tx_reason_ntb_full;
126 u32 tx_reason_ndp_full;
127 u32 tx_reason_timeout;
128 u32 tx_reason_max_datagram;
129 u64 tx_overhead;
130 u64 tx_ntbs;
131 u64 rx_overhead;
132 u64 rx_ntbs;
122}; 133};
123 134
124u8 cdc_ncm_select_altsetting(struct usbnet *dev, struct usb_interface *intf); 135u8 cdc_ncm_select_altsetting(struct usb_interface *intf);
125int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); 136int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting);
126void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); 137void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf);
127struct sk_buff *cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign); 138struct sk_buff *cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign);
diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
index f7d372b7d4ff..79b530fb2c4d 100644
--- a/include/net/6lowpan.h
+++ b/include/net/6lowpan.h
@@ -54,6 +54,7 @@
54#define __6LOWPAN_H__ 54#define __6LOWPAN_H__
55 55
56#include <net/ipv6.h> 56#include <net/ipv6.h>
57#include <net/net_namespace.h>
57 58
58#define UIP_802154_SHORTADDR_LEN 2 /* compressed ipv6 address length */ 59#define UIP_802154_SHORTADDR_LEN 2 /* compressed ipv6 address length */
59#define UIP_IPH_LEN 40 /* ipv6 fixed header size */ 60#define UIP_IPH_LEN 40 /* ipv6 fixed header size */
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 933a9f22a05f..f679877bb601 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -306,11 +306,6 @@ static inline void addrconf_addr_solict_mult(const struct in6_addr *addr,
306 htonl(0xFF000000) | addr->s6_addr32[3]); 306 htonl(0xFF000000) | addr->s6_addr32[3]);
307} 307}
308 308
309static inline bool ipv6_addr_is_multicast(const struct in6_addr *addr)
310{
311 return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000);
312}
313
314static inline bool ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) 309static inline bool ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr)
315{ 310{
316#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 311#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
diff --git a/include/net/af_ieee802154.h b/include/net/af_ieee802154.h
index f79ae2aa76d6..085940f7eeec 100644
--- a/include/net/af_ieee802154.h
+++ b/include/net/af_ieee802154.h
@@ -57,6 +57,14 @@ struct sockaddr_ieee802154 {
57/* get/setsockopt */ 57/* get/setsockopt */
58#define SOL_IEEE802154 0 58#define SOL_IEEE802154 0
59 59
60#define WPAN_WANTACK 0 60#define WPAN_WANTACK 0
61#define WPAN_SECURITY 1
62#define WPAN_SECURITY_LEVEL 2
63
64#define WPAN_SECURITY_DEFAULT 0
65#define WPAN_SECURITY_OFF 1
66#define WPAN_SECURITY_ON 2
67
68#define WPAN_SECURITY_LEVEL_DEFAULT (-1)
61 69
62#endif 70#endif
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index be150cf8cd43..16587dcd6a91 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -367,6 +367,7 @@ enum {
367#define HCI_ERROR_REMOTE_POWER_OFF 0x15 367#define HCI_ERROR_REMOTE_POWER_OFF 0x15
368#define HCI_ERROR_LOCAL_HOST_TERM 0x16 368#define HCI_ERROR_LOCAL_HOST_TERM 0x16
369#define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 369#define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18
370#define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c
370 371
371/* Flow control modes */ 372/* Flow control modes */
372#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 373#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00
@@ -1053,6 +1054,17 @@ struct hci_cp_write_page_scan_activity {
1053 __le16 window; 1054 __le16 window;
1054} __packed; 1055} __packed;
1055 1056
1057#define HCI_OP_READ_TX_POWER 0x0c2d
1058struct hci_cp_read_tx_power {
1059 __le16 handle;
1060 __u8 type;
1061} __packed;
1062struct hci_rp_read_tx_power {
1063 __u8 status;
1064 __le16 handle;
1065 __s8 tx_power;
1066} __packed;
1067
1056#define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46 1068#define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46
1057struct hci_rp_read_page_scan_type { 1069struct hci_rp_read_page_scan_type {
1058 __u8 status; 1070 __u8 status;
@@ -1063,6 +1075,16 @@ struct hci_rp_read_page_scan_type {
1063 #define PAGE_SCAN_TYPE_STANDARD 0x00 1075 #define PAGE_SCAN_TYPE_STANDARD 0x00
1064 #define PAGE_SCAN_TYPE_INTERLACED 0x01 1076 #define PAGE_SCAN_TYPE_INTERLACED 0x01
1065 1077
1078#define HCI_OP_READ_RSSI 0x1405
1079struct hci_cp_read_rssi {
1080 __le16 handle;
1081} __packed;
1082struct hci_rp_read_rssi {
1083 __u8 status;
1084 __le16 handle;
1085 __s8 rssi;
1086} __packed;
1087
1066#define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 1088#define HCI_OP_READ_LOCAL_AMP_INFO 0x1409
1067struct hci_rp_read_local_amp_info { 1089struct hci_rp_read_local_amp_info {
1068 __u8 status; 1090 __u8 status;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 5f8bc05694ac..b386bf17e6c2 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -68,6 +68,11 @@ struct discovery_state {
68 struct list_head unknown; /* Name state not known */ 68 struct list_head unknown; /* Name state not known */
69 struct list_head resolve; /* Name needs to be resolved */ 69 struct list_head resolve; /* Name needs to be resolved */
70 __u32 timestamp; 70 __u32 timestamp;
71 bdaddr_t last_adv_addr;
72 u8 last_adv_addr_type;
73 s8 last_adv_rssi;
74 u8 last_adv_data[HCI_MAX_AD_LENGTH];
75 u8 last_adv_data_len;
71}; 76};
72 77
73struct hci_conn_hash { 78struct hci_conn_hash {
@@ -140,6 +145,10 @@ struct oob_data {
140/* Default LE RPA expiry time, 15 minutes */ 145/* Default LE RPA expiry time, 15 minutes */
141#define HCI_DEFAULT_RPA_TIMEOUT (15 * 60) 146#define HCI_DEFAULT_RPA_TIMEOUT (15 * 60)
142 147
148/* Default min/max age of connection information (1s/3s) */
149#define DEFAULT_CONN_INFO_MIN_AGE 1000
150#define DEFAULT_CONN_INFO_MAX_AGE 3000
151
143struct amp_assoc { 152struct amp_assoc {
144 __u16 len; 153 __u16 len;
145 __u16 offset; 154 __u16 offset;
@@ -194,6 +203,9 @@ struct hci_dev {
194 __u16 le_scan_window; 203 __u16 le_scan_window;
195 __u16 le_conn_min_interval; 204 __u16 le_conn_min_interval;
196 __u16 le_conn_max_interval; 205 __u16 le_conn_max_interval;
206 __u16 discov_interleaved_timeout;
207 __u16 conn_info_min_age;
208 __u16 conn_info_max_age;
197 __u8 ssp_debug_mode; 209 __u8 ssp_debug_mode;
198 210
199 __u16 devid_source; 211 __u16 devid_source;
@@ -368,8 +380,13 @@ struct hci_conn {
368 __u16 setting; 380 __u16 setting;
369 __u16 le_conn_min_interval; 381 __u16 le_conn_min_interval;
370 __u16 le_conn_max_interval; 382 __u16 le_conn_max_interval;
383 __s8 rssi;
384 __s8 tx_power;
385 __s8 max_tx_power;
371 unsigned long flags; 386 unsigned long flags;
372 387
388 unsigned long conn_info_timestamp;
389
373 __u8 remote_cap; 390 __u8 remote_cap;
374 __u8 remote_auth; 391 __u8 remote_auth;
375 __u8 remote_id; 392 __u8 remote_id;
@@ -1204,8 +1221,8 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event);
1204 */ 1221 */
1205#define DISCOV_LE_SCAN_WIN 0x12 1222#define DISCOV_LE_SCAN_WIN 0x12
1206#define DISCOV_LE_SCAN_INT 0x12 1223#define DISCOV_LE_SCAN_INT 0x12
1207#define DISCOV_LE_TIMEOUT msecs_to_jiffies(10240) 1224#define DISCOV_LE_TIMEOUT 10240 /* msec */
1208#define DISCOV_INTERLEAVED_TIMEOUT msecs_to_jiffies(5120) 1225#define DISCOV_INTERLEAVED_TIMEOUT 5120 /* msec */
1209#define DISCOV_INTERLEAVED_INQUIRY_LEN 0x04 1226#define DISCOV_INTERLEAVED_INQUIRY_LEN 0x04
1210#define DISCOV_BREDR_INQUIRY_LEN 0x08 1227#define DISCOV_BREDR_INQUIRY_LEN 0x08
1211 1228
@@ -1265,7 +1282,8 @@ void mgmt_read_local_oob_data_complete(struct hci_dev *hdev, u8 *hash192,
1265 u8 *randomizer256, u8 status); 1282 u8 *randomizer256, u8 status);
1266void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 1283void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
1267 u8 addr_type, u8 *dev_class, s8 rssi, u8 cfm_name, 1284 u8 addr_type, u8 *dev_class, s8 rssi, u8 cfm_name,
1268 u8 ssp, u8 *eir, u16 eir_len); 1285 u8 ssp, u8 *eir, u16 eir_len, u8 *scan_rsp,
1286 u8 scan_rsp_len);
1269void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 1287void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
1270 u8 addr_type, s8 rssi, u8 *name, u8 name_len); 1288 u8 addr_type, s8 rssi, u8 *name, u8 name_len);
1271void mgmt_discovering(struct hci_dev *hdev, u8 discovering); 1289void mgmt_discovering(struct hci_dev *hdev, u8 discovering);
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index d4b571c2f9fd..bcffc9ae0c89 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -181,6 +181,9 @@ struct mgmt_cp_load_link_keys {
181} __packed; 181} __packed;
182#define MGMT_LOAD_LINK_KEYS_SIZE 3 182#define MGMT_LOAD_LINK_KEYS_SIZE 3
183 183
184#define MGMT_LTK_UNAUTHENTICATED 0x00
185#define MGMT_LTK_AUTHENTICATED 0x01
186
184struct mgmt_ltk_info { 187struct mgmt_ltk_info {
185 struct mgmt_addr_info addr; 188 struct mgmt_addr_info addr;
186 __u8 type; 189 __u8 type;
@@ -409,6 +412,18 @@ struct mgmt_cp_load_irks {
409} __packed; 412} __packed;
410#define MGMT_LOAD_IRKS_SIZE 2 413#define MGMT_LOAD_IRKS_SIZE 2
411 414
415#define MGMT_OP_GET_CONN_INFO 0x0031
416struct mgmt_cp_get_conn_info {
417 struct mgmt_addr_info addr;
418} __packed;
419#define MGMT_GET_CONN_INFO_SIZE MGMT_ADDR_INFO_SIZE
420struct mgmt_rp_get_conn_info {
421 struct mgmt_addr_info addr;
422 __s8 rssi;
423 __s8 tx_power;
424 __s8 max_tx_power;
425} __packed;
426
412#define MGMT_EV_CMD_COMPLETE 0x0001 427#define MGMT_EV_CMD_COMPLETE 0x0001
413struct mgmt_ev_cmd_complete { 428struct mgmt_ev_cmd_complete {
414 __le16 opcode; 429 __le16 opcode;
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index 2611cc389d7d..578b83127af1 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -173,7 +173,7 @@ struct rfcomm_dlc {
173 struct sk_buff_head tx_queue; 173 struct sk_buff_head tx_queue;
174 struct timer_list timer; 174 struct timer_list timer;
175 175
176 spinlock_t lock; 176 struct mutex lock;
177 unsigned long state; 177 unsigned long state;
178 unsigned long flags; 178 unsigned long flags;
179 atomic_t refcnt; 179 atomic_t refcnt;
@@ -244,8 +244,8 @@ int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig);
244void rfcomm_dlc_accept(struct rfcomm_dlc *d); 244void rfcomm_dlc_accept(struct rfcomm_dlc *d);
245struct rfcomm_dlc *rfcomm_dlc_exists(bdaddr_t *src, bdaddr_t *dst, u8 channel); 245struct rfcomm_dlc *rfcomm_dlc_exists(bdaddr_t *src, bdaddr_t *dst, u8 channel);
246 246
247#define rfcomm_dlc_lock(d) spin_lock(&d->lock) 247#define rfcomm_dlc_lock(d) mutex_lock(&d->lock)
248#define rfcomm_dlc_unlock(d) spin_unlock(&d->lock) 248#define rfcomm_dlc_unlock(d) mutex_unlock(&d->lock)
249 249
250static inline void rfcomm_dlc_hold(struct rfcomm_dlc *d) 250static inline void rfcomm_dlc_hold(struct rfcomm_dlc *d)
251{ 251{
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index f856e5a746fa..e46c437944f7 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -109,6 +109,13 @@ enum ieee80211_band {
109 * channel as the control or any of the secondary channels. 109 * channel as the control or any of the secondary channels.
110 * This may be due to the driver or due to regulatory bandwidth 110 * This may be due to the driver or due to regulatory bandwidth
111 * restrictions. 111 * restrictions.
112 * @IEEE80211_CHAN_INDOOR_ONLY: see %NL80211_FREQUENCY_ATTR_INDOOR_ONLY
113 * @IEEE80211_CHAN_GO_CONCURRENT: see %NL80211_FREQUENCY_ATTR_GO_CONCURRENT
114 * @IEEE80211_CHAN_NO_20MHZ: 20 MHz bandwidth is not permitted
115 * on this channel.
116 * @IEEE80211_CHAN_NO_10MHZ: 10 MHz bandwidth is not permitted
117 * on this channel.
118 *
112 */ 119 */
113enum ieee80211_channel_flags { 120enum ieee80211_channel_flags {
114 IEEE80211_CHAN_DISABLED = 1<<0, 121 IEEE80211_CHAN_DISABLED = 1<<0,
@@ -120,6 +127,10 @@ enum ieee80211_channel_flags {
120 IEEE80211_CHAN_NO_OFDM = 1<<6, 127 IEEE80211_CHAN_NO_OFDM = 1<<6,
121 IEEE80211_CHAN_NO_80MHZ = 1<<7, 128 IEEE80211_CHAN_NO_80MHZ = 1<<7,
122 IEEE80211_CHAN_NO_160MHZ = 1<<8, 129 IEEE80211_CHAN_NO_160MHZ = 1<<8,
130 IEEE80211_CHAN_INDOOR_ONLY = 1<<9,
131 IEEE80211_CHAN_GO_CONCURRENT = 1<<10,
132 IEEE80211_CHAN_NO_20MHZ = 1<<11,
133 IEEE80211_CHAN_NO_10MHZ = 1<<12,
123}; 134};
124 135
125#define IEEE80211_CHAN_NO_HT40 \ 136#define IEEE80211_CHAN_NO_HT40 \
@@ -330,8 +341,8 @@ struct vif_params {
330 * @seq_len: length of @seq. 341 * @seq_len: length of @seq.
331 */ 342 */
332struct key_params { 343struct key_params {
333 u8 *key; 344 const u8 *key;
334 u8 *seq; 345 const u8 *seq;
335 int key_len; 346 int key_len;
336 int seq_len; 347 int seq_len;
337 u32 cipher; 348 u32 cipher;
@@ -441,10 +452,13 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
441 * cfg80211_chandef_dfs_required - checks if radar detection is required 452 * cfg80211_chandef_dfs_required - checks if radar detection is required
442 * @wiphy: the wiphy to validate against 453 * @wiphy: the wiphy to validate against
443 * @chandef: the channel definition to check 454 * @chandef: the channel definition to check
444 * Return: 1 if radar detection is required, 0 if it is not, < 0 on error 455 * @iftype: the interface type as specified in &enum nl80211_iftype
456 * Returns:
457 * 1 if radar detection is required, 0 if it is not, < 0 on error
445 */ 458 */
446int cfg80211_chandef_dfs_required(struct wiphy *wiphy, 459int cfg80211_chandef_dfs_required(struct wiphy *wiphy,
447 const struct cfg80211_chan_def *chandef); 460 const struct cfg80211_chan_def *chandef,
461 enum nl80211_iftype iftype);
448 462
449/** 463/**
450 * ieee80211_chandef_rate_flags - returns rate flags for a channel 464 * ieee80211_chandef_rate_flags - returns rate flags for a channel
@@ -654,7 +668,6 @@ struct cfg80211_acl_data {
654 * @p2p_opp_ps: P2P opportunistic PS 668 * @p2p_opp_ps: P2P opportunistic PS
655 * @acl: ACL configuration used by the drivers which has support for 669 * @acl: ACL configuration used by the drivers which has support for
656 * MAC address based access control 670 * MAC address based access control
657 * @radar_required: set if radar detection is required
658 */ 671 */
659struct cfg80211_ap_settings { 672struct cfg80211_ap_settings {
660 struct cfg80211_chan_def chandef; 673 struct cfg80211_chan_def chandef;
@@ -672,7 +685,6 @@ struct cfg80211_ap_settings {
672 u8 p2p_ctwindow; 685 u8 p2p_ctwindow;
673 bool p2p_opp_ps; 686 bool p2p_opp_ps;
674 const struct cfg80211_acl_data *acl; 687 const struct cfg80211_acl_data *acl;
675 bool radar_required;
676}; 688};
677 689
678/** 690/**
@@ -682,8 +694,10 @@ struct cfg80211_ap_settings {
682 * 694 *
683 * @chandef: defines the channel to use after the switch 695 * @chandef: defines the channel to use after the switch
684 * @beacon_csa: beacon data while performing the switch 696 * @beacon_csa: beacon data while performing the switch
685 * @counter_offset_beacon: offset for the counter within the beacon (tail) 697 * @counter_offsets_beacon: offsets of the counters within the beacon (tail)
686 * @counter_offset_presp: offset for the counter within the probe response 698 * @counter_offsets_presp: offsets of the counters within the probe response
699 * @n_counter_offsets_beacon: number of csa counters the beacon (tail)
700 * @n_counter_offsets_presp: number of csa counters in the probe response
687 * @beacon_after: beacon data to be used on the new channel 701 * @beacon_after: beacon data to be used on the new channel
688 * @radar_required: whether radar detection is required on the new channel 702 * @radar_required: whether radar detection is required on the new channel
689 * @block_tx: whether transmissions should be blocked while changing 703 * @block_tx: whether transmissions should be blocked while changing
@@ -692,7 +706,10 @@ struct cfg80211_ap_settings {
692struct cfg80211_csa_settings { 706struct cfg80211_csa_settings {
693 struct cfg80211_chan_def chandef; 707 struct cfg80211_chan_def chandef;
694 struct cfg80211_beacon_data beacon_csa; 708 struct cfg80211_beacon_data beacon_csa;
695 u16 counter_offset_beacon, counter_offset_presp; 709 const u16 *counter_offsets_beacon;
710 const u16 *counter_offsets_presp;
711 unsigned int n_counter_offsets_beacon;
712 unsigned int n_counter_offsets_presp;
696 struct cfg80211_beacon_data beacon_after; 713 struct cfg80211_beacon_data beacon_after;
697 bool radar_required; 714 bool radar_required;
698 bool block_tx; 715 bool block_tx;
@@ -856,36 +873,38 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
856 * @STATION_INFO_NONPEER_PM: @nonpeer_pm filled 873 * @STATION_INFO_NONPEER_PM: @nonpeer_pm filled
857 * @STATION_INFO_CHAIN_SIGNAL: @chain_signal filled 874 * @STATION_INFO_CHAIN_SIGNAL: @chain_signal filled
858 * @STATION_INFO_CHAIN_SIGNAL_AVG: @chain_signal_avg filled 875 * @STATION_INFO_CHAIN_SIGNAL_AVG: @chain_signal_avg filled
876 * @STATION_INFO_EXPECTED_THROUGHPUT: @expected_throughput filled
859 */ 877 */
860enum station_info_flags { 878enum station_info_flags {
861 STATION_INFO_INACTIVE_TIME = 1<<0, 879 STATION_INFO_INACTIVE_TIME = BIT(0),
862 STATION_INFO_RX_BYTES = 1<<1, 880 STATION_INFO_RX_BYTES = BIT(1),
863 STATION_INFO_TX_BYTES = 1<<2, 881 STATION_INFO_TX_BYTES = BIT(2),
864 STATION_INFO_LLID = 1<<3, 882 STATION_INFO_LLID = BIT(3),
865 STATION_INFO_PLID = 1<<4, 883 STATION_INFO_PLID = BIT(4),
866 STATION_INFO_PLINK_STATE = 1<<5, 884 STATION_INFO_PLINK_STATE = BIT(5),
867 STATION_INFO_SIGNAL = 1<<6, 885 STATION_INFO_SIGNAL = BIT(6),
868 STATION_INFO_TX_BITRATE = 1<<7, 886 STATION_INFO_TX_BITRATE = BIT(7),
869 STATION_INFO_RX_PACKETS = 1<<8, 887 STATION_INFO_RX_PACKETS = BIT(8),
870 STATION_INFO_TX_PACKETS = 1<<9, 888 STATION_INFO_TX_PACKETS = BIT(9),
871 STATION_INFO_TX_RETRIES = 1<<10, 889 STATION_INFO_TX_RETRIES = BIT(10),
872 STATION_INFO_TX_FAILED = 1<<11, 890 STATION_INFO_TX_FAILED = BIT(11),
873 STATION_INFO_RX_DROP_MISC = 1<<12, 891 STATION_INFO_RX_DROP_MISC = BIT(12),
874 STATION_INFO_SIGNAL_AVG = 1<<13, 892 STATION_INFO_SIGNAL_AVG = BIT(13),
875 STATION_INFO_RX_BITRATE = 1<<14, 893 STATION_INFO_RX_BITRATE = BIT(14),
876 STATION_INFO_BSS_PARAM = 1<<15, 894 STATION_INFO_BSS_PARAM = BIT(15),
877 STATION_INFO_CONNECTED_TIME = 1<<16, 895 STATION_INFO_CONNECTED_TIME = BIT(16),
878 STATION_INFO_ASSOC_REQ_IES = 1<<17, 896 STATION_INFO_ASSOC_REQ_IES = BIT(17),
879 STATION_INFO_STA_FLAGS = 1<<18, 897 STATION_INFO_STA_FLAGS = BIT(18),
880 STATION_INFO_BEACON_LOSS_COUNT = 1<<19, 898 STATION_INFO_BEACON_LOSS_COUNT = BIT(19),
881 STATION_INFO_T_OFFSET = 1<<20, 899 STATION_INFO_T_OFFSET = BIT(20),
882 STATION_INFO_LOCAL_PM = 1<<21, 900 STATION_INFO_LOCAL_PM = BIT(21),
883 STATION_INFO_PEER_PM = 1<<22, 901 STATION_INFO_PEER_PM = BIT(22),
884 STATION_INFO_NONPEER_PM = 1<<23, 902 STATION_INFO_NONPEER_PM = BIT(23),
885 STATION_INFO_RX_BYTES64 = 1<<24, 903 STATION_INFO_RX_BYTES64 = BIT(24),
886 STATION_INFO_TX_BYTES64 = 1<<25, 904 STATION_INFO_TX_BYTES64 = BIT(25),
887 STATION_INFO_CHAIN_SIGNAL = 1<<26, 905 STATION_INFO_CHAIN_SIGNAL = BIT(26),
888 STATION_INFO_CHAIN_SIGNAL_AVG = 1<<27, 906 STATION_INFO_CHAIN_SIGNAL_AVG = BIT(27),
907 STATION_INFO_EXPECTED_THROUGHPUT = BIT(28),
889}; 908};
890 909
891/** 910/**
@@ -1007,6 +1026,8 @@ struct sta_bss_parameters {
1007 * @local_pm: local mesh STA power save mode 1026 * @local_pm: local mesh STA power save mode
1008 * @peer_pm: peer mesh STA power save mode 1027 * @peer_pm: peer mesh STA power save mode
1009 * @nonpeer_pm: non-peer mesh STA power save mode 1028 * @nonpeer_pm: non-peer mesh STA power save mode
1029 * @expected_throughput: expected throughput in kbps (including 802.11 headers)
1030 * towards this station.
1010 */ 1031 */
1011struct station_info { 1032struct station_info {
1012 u32 filled; 1033 u32 filled;
@@ -1045,6 +1066,8 @@ struct station_info {
1045 enum nl80211_mesh_power_mode peer_pm; 1066 enum nl80211_mesh_power_mode peer_pm;
1046 enum nl80211_mesh_power_mode nonpeer_pm; 1067 enum nl80211_mesh_power_mode nonpeer_pm;
1047 1068
1069 u32 expected_throughput;
1070
1048 /* 1071 /*
1049 * Note: Add a new enum station_info_flags value for each new field and 1072 * Note: Add a new enum station_info_flags value for each new field and
1050 * use it to check which fields are initialized. 1073 * use it to check which fields are initialized.
@@ -1052,6 +1075,19 @@ struct station_info {
1052}; 1075};
1053 1076
1054/** 1077/**
1078 * cfg80211_get_station - retrieve information about a given station
1079 * @dev: the device where the station is supposed to be connected to
1080 * @mac_addr: the mac address of the station of interest
1081 * @sinfo: pointer to the structure to fill with the information
1082 *
1083 * Returns 0 on success and sinfo is filled with the available information
1084 * otherwise returns a negative error code and the content of sinfo has to be
1085 * considered undefined.
1086 */
1087int cfg80211_get_station(struct net_device *dev, const u8 *mac_addr,
1088 struct station_info *sinfo);
1089
1090/**
1055 * enum monitor_flags - monitor flags 1091 * enum monitor_flags - monitor flags
1056 * 1092 *
1057 * Monitor interface configuration flags. Note that these must be the bits 1093 * Monitor interface configuration flags. Note that these must be the bits
@@ -1152,7 +1188,7 @@ struct bss_parameters {
1152 int use_cts_prot; 1188 int use_cts_prot;
1153 int use_short_preamble; 1189 int use_short_preamble;
1154 int use_short_slot_time; 1190 int use_short_slot_time;
1155 u8 *basic_rates; 1191 const u8 *basic_rates;
1156 u8 basic_rates_len; 1192 u8 basic_rates_len;
1157 int ap_isolate; 1193 int ap_isolate;
1158 int ht_opmode; 1194 int ht_opmode;
@@ -1682,10 +1718,10 @@ struct cfg80211_disassoc_request {
1682 * @ht_capa_mask: The bits of ht_capa which are to be used. 1718 * @ht_capa_mask: The bits of ht_capa which are to be used.
1683 */ 1719 */
1684struct cfg80211_ibss_params { 1720struct cfg80211_ibss_params {
1685 u8 *ssid; 1721 const u8 *ssid;
1686 u8 *bssid; 1722 const u8 *bssid;
1687 struct cfg80211_chan_def chandef; 1723 struct cfg80211_chan_def chandef;
1688 u8 *ie; 1724 const u8 *ie;
1689 u8 ssid_len, ie_len; 1725 u8 ssid_len, ie_len;
1690 u16 beacon_interval; 1726 u16 beacon_interval;
1691 u32 basic_rates; 1727 u32 basic_rates;
@@ -1794,8 +1830,8 @@ struct cfg80211_bitrate_mask {
1794 * @pmkid: The PMK material itself. 1830 * @pmkid: The PMK material itself.
1795 */ 1831 */
1796struct cfg80211_pmksa { 1832struct cfg80211_pmksa {
1797 u8 *bssid; 1833 const u8 *bssid;
1798 u8 *pmkid; 1834 const u8 *pmkid;
1799}; 1835};
1800 1836
1801/** 1837/**
@@ -1810,7 +1846,7 @@ struct cfg80211_pmksa {
1810 * memory, free @mask only! 1846 * memory, free @mask only!
1811 */ 1847 */
1812struct cfg80211_pkt_pattern { 1848struct cfg80211_pkt_pattern {
1813 u8 *mask, *pattern; 1849 const u8 *mask, *pattern;
1814 int pattern_len; 1850 int pattern_len;
1815 int pkt_offset; 1851 int pkt_offset;
1816}; 1852};
@@ -1974,6 +2010,8 @@ struct cfg80211_update_ft_ies_params {
1974 * @len: buffer length 2010 * @len: buffer length
1975 * @no_cck: don't use cck rates for this frame 2011 * @no_cck: don't use cck rates for this frame
1976 * @dont_wait_for_ack: tells the low level not to wait for an ack 2012 * @dont_wait_for_ack: tells the low level not to wait for an ack
2013 * @n_csa_offsets: length of csa_offsets array
2014 * @csa_offsets: array of all the csa offsets in the frame
1977 */ 2015 */
1978struct cfg80211_mgmt_tx_params { 2016struct cfg80211_mgmt_tx_params {
1979 struct ieee80211_channel *chan; 2017 struct ieee80211_channel *chan;
@@ -1983,6 +2021,8 @@ struct cfg80211_mgmt_tx_params {
1983 size_t len; 2021 size_t len;
1984 bool no_cck; 2022 bool no_cck;
1985 bool dont_wait_for_ack; 2023 bool dont_wait_for_ack;
2024 int n_csa_offsets;
2025 const u16 *csa_offsets;
1986}; 2026};
1987 2027
1988/** 2028/**
@@ -2278,6 +2318,10 @@ struct cfg80211_qos_map {
2278 * @channel_switch: initiate channel-switch procedure (with CSA) 2318 * @channel_switch: initiate channel-switch procedure (with CSA)
2279 * 2319 *
2280 * @set_qos_map: Set QoS mapping information to the driver 2320 * @set_qos_map: Set QoS mapping information to the driver
2321 *
2322 * @set_ap_chanwidth: Set the AP (including P2P GO) mode channel width for the
2323 * given interface This is used e.g. for dynamic HT 20/40 MHz channel width
2324 * changes during the lifetime of the BSS.
2281 */ 2325 */
2282struct cfg80211_ops { 2326struct cfg80211_ops {
2283 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 2327 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2320,28 +2364,29 @@ struct cfg80211_ops {
2320 2364
2321 2365
2322 int (*add_station)(struct wiphy *wiphy, struct net_device *dev, 2366 int (*add_station)(struct wiphy *wiphy, struct net_device *dev,
2323 u8 *mac, struct station_parameters *params); 2367 const u8 *mac,
2368 struct station_parameters *params);
2324 int (*del_station)(struct wiphy *wiphy, struct net_device *dev, 2369 int (*del_station)(struct wiphy *wiphy, struct net_device *dev,
2325 u8 *mac); 2370 const u8 *mac);
2326 int (*change_station)(struct wiphy *wiphy, struct net_device *dev, 2371 int (*change_station)(struct wiphy *wiphy, struct net_device *dev,
2327 u8 *mac, struct station_parameters *params); 2372 const u8 *mac,
2373 struct station_parameters *params);
2328 int (*get_station)(struct wiphy *wiphy, struct net_device *dev, 2374 int (*get_station)(struct wiphy *wiphy, struct net_device *dev,
2329 u8 *mac, struct station_info *sinfo); 2375 const u8 *mac, struct station_info *sinfo);
2330 int (*dump_station)(struct wiphy *wiphy, struct net_device *dev, 2376 int (*dump_station)(struct wiphy *wiphy, struct net_device *dev,
2331 int idx, u8 *mac, struct station_info *sinfo); 2377 int idx, u8 *mac, struct station_info *sinfo);
2332 2378
2333 int (*add_mpath)(struct wiphy *wiphy, struct net_device *dev, 2379 int (*add_mpath)(struct wiphy *wiphy, struct net_device *dev,
2334 u8 *dst, u8 *next_hop); 2380 const u8 *dst, const u8 *next_hop);
2335 int (*del_mpath)(struct wiphy *wiphy, struct net_device *dev, 2381 int (*del_mpath)(struct wiphy *wiphy, struct net_device *dev,
2336 u8 *dst); 2382 const u8 *dst);
2337 int (*change_mpath)(struct wiphy *wiphy, struct net_device *dev, 2383 int (*change_mpath)(struct wiphy *wiphy, struct net_device *dev,
2338 u8 *dst, u8 *next_hop); 2384 const u8 *dst, const u8 *next_hop);
2339 int (*get_mpath)(struct wiphy *wiphy, struct net_device *dev, 2385 int (*get_mpath)(struct wiphy *wiphy, struct net_device *dev,
2340 u8 *dst, u8 *next_hop, 2386 u8 *dst, u8 *next_hop, struct mpath_info *pinfo);
2341 struct mpath_info *pinfo);
2342 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, 2387 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev,
2343 int idx, u8 *dst, u8 *next_hop, 2388 int idx, u8 *dst, u8 *next_hop,
2344 struct mpath_info *pinfo); 2389 struct mpath_info *pinfo);
2345 int (*get_mesh_config)(struct wiphy *wiphy, 2390 int (*get_mesh_config)(struct wiphy *wiphy,
2346 struct net_device *dev, 2391 struct net_device *dev,
2347 struct mesh_config *conf); 2392 struct mesh_config *conf);
@@ -2471,11 +2516,11 @@ struct cfg80211_ops {
2471 struct cfg80211_gtk_rekey_data *data); 2516 struct cfg80211_gtk_rekey_data *data);
2472 2517
2473 int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev, 2518 int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev,
2474 u8 *peer, u8 action_code, u8 dialog_token, 2519 const u8 *peer, u8 action_code, u8 dialog_token,
2475 u16 status_code, u32 peer_capability, 2520 u16 status_code, u32 peer_capability,
2476 const u8 *buf, size_t len); 2521 const u8 *buf, size_t len);
2477 int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev, 2522 int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev,
2478 u8 *peer, enum nl80211_tdls_operation oper); 2523 const u8 *peer, enum nl80211_tdls_operation oper);
2479 2524
2480 int (*probe_client)(struct wiphy *wiphy, struct net_device *dev, 2525 int (*probe_client)(struct wiphy *wiphy, struct net_device *dev,
2481 const u8 *peer, u64 *cookie); 2526 const u8 *peer, u64 *cookie);
@@ -2521,9 +2566,13 @@ struct cfg80211_ops {
2521 int (*channel_switch)(struct wiphy *wiphy, 2566 int (*channel_switch)(struct wiphy *wiphy,
2522 struct net_device *dev, 2567 struct net_device *dev,
2523 struct cfg80211_csa_settings *params); 2568 struct cfg80211_csa_settings *params);
2569
2524 int (*set_qos_map)(struct wiphy *wiphy, 2570 int (*set_qos_map)(struct wiphy *wiphy,
2525 struct net_device *dev, 2571 struct net_device *dev,
2526 struct cfg80211_qos_map *qos_map); 2572 struct cfg80211_qos_map *qos_map);
2573
2574 int (*set_ap_chanwidth)(struct wiphy *wiphy, struct net_device *dev,
2575 struct cfg80211_chan_def *chandef);
2527}; 2576};
2528 2577
2529/* 2578/*
@@ -2618,6 +2667,7 @@ struct ieee80211_iface_limit {
2618 * between infrastructure and AP types must match. This is required 2667 * between infrastructure and AP types must match. This is required
2619 * only in special cases. 2668 * only in special cases.
2620 * @radar_detect_widths: bitmap of channel widths supported for radar detection 2669 * @radar_detect_widths: bitmap of channel widths supported for radar detection
2670 * @radar_detect_regions: bitmap of regions supported for radar detection
2621 * 2671 *
2622 * With this structure the driver can describe which interface 2672 * With this structure the driver can describe which interface
2623 * combinations it supports concurrently. 2673 * combinations it supports concurrently.
@@ -2675,6 +2725,7 @@ struct ieee80211_iface_combination {
2675 u8 n_limits; 2725 u8 n_limits;
2676 bool beacon_int_infra_match; 2726 bool beacon_int_infra_match;
2677 u8 radar_detect_widths; 2727 u8 radar_detect_widths;
2728 u8 radar_detect_regions;
2678}; 2729};
2679 2730
2680struct ieee80211_txrx_stypes { 2731struct ieee80211_txrx_stypes {
@@ -2905,6 +2956,17 @@ struct wiphy_vendor_command {
2905 * (including P2P GO) or 0 to indicate no such limit is advertised. The 2956 * (including P2P GO) or 0 to indicate no such limit is advertised. The
2906 * driver is allowed to advertise a theoretical limit that it can reach in 2957 * driver is allowed to advertise a theoretical limit that it can reach in
2907 * some cases, but may not always reach. 2958 * some cases, but may not always reach.
2959 *
2960 * @max_num_csa_counters: Number of supported csa_counters in beacons
2961 * and probe responses. This value should be set if the driver
2962 * wishes to limit the number of csa counters. Default (0) means
2963 * infinite.
2964 * @max_adj_channel_rssi_comp: max offset of between the channel on which the
2965 * frame was sent and the channel on which the frame was heard for which
2966 * the reported rssi is still valid. If a driver is able to compensate the
2967 * low rssi when a frame is heard on different channel, then it should set
2968 * this variable to the maximal offset for which it can compensate.
2969 * This value should be set in MHz.
2908 */ 2970 */
2909struct wiphy { 2971struct wiphy {
2910 /* assign these fields before you register the wiphy */ 2972 /* assign these fields before you register the wiphy */
@@ -3022,6 +3084,9 @@ struct wiphy {
3022 3084
3023 u16 max_ap_assoc_sta; 3085 u16 max_ap_assoc_sta;
3024 3086
3087 u8 max_num_csa_counters;
3088 u8 max_adj_channel_rssi_comp;
3089
3025 char priv[0] __aligned(NETDEV_ALIGN); 3090 char priv[0] __aligned(NETDEV_ALIGN);
3026}; 3091};
3027 3092
@@ -3194,6 +3259,7 @@ struct cfg80211_cached_keys;
3194 * @ibss_dfs_possible: (private) IBSS may change to a DFS channel 3259 * @ibss_dfs_possible: (private) IBSS may change to a DFS channel
3195 * @event_list: (private) list for internal event processing 3260 * @event_list: (private) list for internal event processing
3196 * @event_lock: (private) lock for event list 3261 * @event_lock: (private) lock for event list
3262 * @owner_nlportid: (private) owner socket port ID
3197 */ 3263 */
3198struct wireless_dev { 3264struct wireless_dev {
3199 struct wiphy *wiphy; 3265 struct wiphy *wiphy;
@@ -3241,13 +3307,15 @@ struct wireless_dev {
3241 unsigned long cac_start_time; 3307 unsigned long cac_start_time;
3242 unsigned int cac_time_ms; 3308 unsigned int cac_time_ms;
3243 3309
3310 u32 owner_nlportid;
3311
3244#ifdef CONFIG_CFG80211_WEXT 3312#ifdef CONFIG_CFG80211_WEXT
3245 /* wext data */ 3313 /* wext data */
3246 struct { 3314 struct {
3247 struct cfg80211_ibss_params ibss; 3315 struct cfg80211_ibss_params ibss;
3248 struct cfg80211_connect_params connect; 3316 struct cfg80211_connect_params connect;
3249 struct cfg80211_cached_keys *keys; 3317 struct cfg80211_cached_keys *keys;
3250 u8 *ie; 3318 const u8 *ie;
3251 size_t ie_len; 3319 size_t ie_len;
3252 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; 3320 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
3253 u8 ssid[IEEE80211_MAX_SSID_LEN]; 3321 u8 ssid[IEEE80211_MAX_SSID_LEN];
@@ -3488,7 +3556,8 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
3488 * Return: 0 on success, or a negative error code. 3556 * Return: 0 on success, or a negative error code.
3489 */ 3557 */
3490int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, 3558int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
3491 enum nl80211_iftype iftype, u8 *bssid, bool qos); 3559 enum nl80211_iftype iftype, const u8 *bssid,
3560 bool qos);
3492 3561
3493/** 3562/**
3494 * ieee80211_amsdu_to_8023s - decode an IEEE 802.11n A-MSDU frame 3563 * ieee80211_amsdu_to_8023s - decode an IEEE 802.11n A-MSDU frame
@@ -3600,7 +3669,7 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3600 * default channel settings will be disregarded. If no rule is found for a 3669 * default channel settings will be disregarded. If no rule is found for a
3601 * channel on the regulatory domain the channel will be disabled. 3670 * channel on the regulatory domain the channel will be disabled.
3602 * Drivers using this for a wiphy should also set the wiphy flag 3671 * Drivers using this for a wiphy should also set the wiphy flag
3603 * WIPHY_FLAG_CUSTOM_REGULATORY or cfg80211 will set it for the wiphy 3672 * REGULATORY_CUSTOM_REG or cfg80211 will set it for the wiphy
3604 * that called this helper. 3673 * that called this helper.
3605 */ 3674 */
3606void wiphy_apply_custom_regulatory(struct wiphy *wiphy, 3675void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
@@ -4289,7 +4358,7 @@ void cfg80211_roamed_bss(struct net_device *dev, struct cfg80211_bss *bss,
4289 * and not try to connect to any AP any more. 4358 * and not try to connect to any AP any more.
4290 */ 4359 */
4291void cfg80211_disconnected(struct net_device *dev, u16 reason, 4360void cfg80211_disconnected(struct net_device *dev, u16 reason,
4292 u8 *ie, size_t ie_len, gfp_t gfp); 4361 const u8 *ie, size_t ie_len, gfp_t gfp);
4293 4362
4294/** 4363/**
4295 * cfg80211_ready_on_channel - notification of remain_on_channel start 4364 * cfg80211_ready_on_channel - notification of remain_on_channel start
@@ -4543,12 +4612,14 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy,
4543 * cfg80211_reg_can_beacon - check if beaconing is allowed 4612 * cfg80211_reg_can_beacon - check if beaconing is allowed
4544 * @wiphy: the wiphy 4613 * @wiphy: the wiphy
4545 * @chandef: the channel definition 4614 * @chandef: the channel definition
4615 * @iftype: interface type
4546 * 4616 *
4547 * Return: %true if there is no secondary channel or the secondary channel(s) 4617 * Return: %true if there is no secondary channel or the secondary channel(s)
4548 * can be used for beaconing (i.e. is not a radar channel etc.) 4618 * can be used for beaconing (i.e. is not a radar channel etc.)
4549 */ 4619 */
4550bool cfg80211_reg_can_beacon(struct wiphy *wiphy, 4620bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
4551 struct cfg80211_chan_def *chandef); 4621 struct cfg80211_chan_def *chandef,
4622 enum nl80211_iftype iftype);
4552 4623
4553/* 4624/*
4554 * cfg80211_ch_switch_notify - update wdev channel and notify userspace 4625 * cfg80211_ch_switch_notify - update wdev channel and notify userspace
@@ -4694,6 +4765,84 @@ void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp);
4694 */ 4765 */
4695unsigned int ieee80211_get_num_supported_channels(struct wiphy *wiphy); 4766unsigned int ieee80211_get_num_supported_channels(struct wiphy *wiphy);
4696 4767
4768/**
4769 * cfg80211_check_combinations - check interface combinations
4770 *
4771 * @wiphy: the wiphy
4772 * @num_different_channels: the number of different channels we want
4773 * to use for verification
4774 * @radar_detect: a bitmap where each bit corresponds to a channel
4775 * width where radar detection is needed, as in the definition of
4776 * &struct ieee80211_iface_combination.@radar_detect_widths
4777 * @iftype_num: array with the numbers of interfaces of each interface
4778 * type. The index is the interface type as specified in &enum
4779 * nl80211_iftype.
4780 *
4781 * This function can be called by the driver to check whether a
4782 * combination of interfaces and their types are allowed according to
4783 * the interface combinations.
4784 */
4785int cfg80211_check_combinations(struct wiphy *wiphy,
4786 const int num_different_channels,
4787 const u8 radar_detect,
4788 const int iftype_num[NUM_NL80211_IFTYPES]);
4789
4790/**
4791 * cfg80211_iter_combinations - iterate over matching combinations
4792 *
4793 * @wiphy: the wiphy
4794 * @num_different_channels: the number of different channels we want
4795 * to use for verification
4796 * @radar_detect: a bitmap where each bit corresponds to a channel
4797 * width where radar detection is needed, as in the definition of
4798 * &struct ieee80211_iface_combination.@radar_detect_widths
4799 * @iftype_num: array with the numbers of interfaces of each interface
4800 * type. The index is the interface type as specified in &enum
4801 * nl80211_iftype.
4802 * @iter: function to call for each matching combination
4803 * @data: pointer to pass to iter function
4804 *
4805 * This function can be called by the driver to check what possible
4806 * combinations it fits in at a given moment, e.g. for channel switching
4807 * purposes.
4808 */
4809int cfg80211_iter_combinations(struct wiphy *wiphy,
4810 const int num_different_channels,
4811 const u8 radar_detect,
4812 const int iftype_num[NUM_NL80211_IFTYPES],
4813 void (*iter)(const struct ieee80211_iface_combination *c,
4814 void *data),
4815 void *data);
4816
4817/*
4818 * cfg80211_stop_iface - trigger interface disconnection
4819 *
4820 * @wiphy: the wiphy
4821 * @wdev: wireless device
4822 * @gfp: context flags
4823 *
4824 * Trigger interface to be stopped as if AP was stopped, IBSS/mesh left, STA
4825 * disconnected.
4826 *
4827 * Note: This doesn't need any locks and is asynchronous.
4828 */
4829void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev,
4830 gfp_t gfp);
4831
4832/**
4833 * cfg80211_shutdown_all_interfaces - shut down all interfaces for a wiphy
4834 * @wiphy: the wiphy to shut down
4835 *
4836 * This function shuts down all interfaces belonging to this wiphy by
4837 * calling dev_close() (and treating non-netdev interfaces as needed).
4838 * It shouldn't really be used unless there are some fatal device errors
4839 * that really can't be recovered in any other way.
4840 *
4841 * Callers must hold the RTNL and be able to deal with callbacks into
4842 * the driver while the function is running.
4843 */
4844void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy);
4845
4697/* Logging, debugging and troubleshooting/diagnostic helpers. */ 4846/* Logging, debugging and troubleshooting/diagnostic helpers. */
4698 4847
4699/* wiphy_printk helpers, similar to dev_printk */ 4848/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/net/checksum.h b/include/net/checksum.h
index a28f4e0f6251..87cb1903640d 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -57,12 +57,14 @@ static __inline__ __wsum csum_and_copy_to_user
57} 57}
58#endif 58#endif
59 59
60#ifndef HAVE_ARCH_CSUM_ADD
60static inline __wsum csum_add(__wsum csum, __wsum addend) 61static inline __wsum csum_add(__wsum csum, __wsum addend)
61{ 62{
62 u32 res = (__force u32)csum; 63 u32 res = (__force u32)csum;
63 res += (__force u32)addend; 64 res += (__force u32)addend;
64 return (__force __wsum)(res + (res < (__force u32)addend)); 65 return (__force __wsum)(res + (res < (__force u32)addend));
65} 66}
67#endif
66 68
67static inline __wsum csum_sub(__wsum csum, __wsum addend) 69static inline __wsum csum_sub(__wsum csum, __wsum addend)
68{ 70{
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 7828ebf99ee1..6efce384451e 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -181,6 +181,11 @@ struct dsa_switch_driver {
181void register_switch_driver(struct dsa_switch_driver *type); 181void register_switch_driver(struct dsa_switch_driver *type);
182void unregister_switch_driver(struct dsa_switch_driver *type); 182void unregister_switch_driver(struct dsa_switch_driver *type);
183 183
184static inline void *ds_to_priv(struct dsa_switch *ds)
185{
186 return (void *)(ds + 1);
187}
188
184/* 189/*
185 * The original DSA tag format and some other tag formats have no 190 * The original DSA tag format and some other tag formats have no
186 * ethertype, which means that we need to add a little hack to the 191 * ethertype, which means that we need to add a little hack to the
diff --git a/include/net/gre.h b/include/net/gre.h
index 70046a0b0b89..b53182018743 100644
--- a/include/net/gre.h
+++ b/include/net/gre.h
@@ -37,9 +37,10 @@ void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi,
37 int hdr_len); 37 int hdr_len);
38 38
39static inline struct sk_buff *gre_handle_offloads(struct sk_buff *skb, 39static inline struct sk_buff *gre_handle_offloads(struct sk_buff *skb,
40 bool gre_csum) 40 bool csum)
41{ 41{
42 return iptunnel_handle_offloads(skb, gre_csum, SKB_GSO_GRE); 42 return iptunnel_handle_offloads(skb, csum,
43 csum ? SKB_GSO_GRE_CSUM : SKB_GSO_GRE);
43} 44}
44 45
45 46
diff --git a/include/net/ieee802154.h b/include/net/ieee802154.h
index c7ae0ac528dc..0aa7122e8f15 100644
--- a/include/net/ieee802154.h
+++ b/include/net/ieee802154.h
@@ -79,6 +79,15 @@
79#define IEEE802154_SCF_KEY_SHORT_INDEX 2 79#define IEEE802154_SCF_KEY_SHORT_INDEX 2
80#define IEEE802154_SCF_KEY_HW_INDEX 3 80#define IEEE802154_SCF_KEY_HW_INDEX 3
81 81
82#define IEEE802154_SCF_SECLEVEL_NONE 0
83#define IEEE802154_SCF_SECLEVEL_MIC32 1
84#define IEEE802154_SCF_SECLEVEL_MIC64 2
85#define IEEE802154_SCF_SECLEVEL_MIC128 3
86#define IEEE802154_SCF_SECLEVEL_ENC 4
87#define IEEE802154_SCF_SECLEVEL_ENC_MIC32 5
88#define IEEE802154_SCF_SECLEVEL_ENC_MIC64 6
89#define IEEE802154_SCF_SECLEVEL_ENC_MIC128 7
90
82/* MAC footer size */ 91/* MAC footer size */
83#define IEEE802154_MFR_SIZE 2 /* 2 octets */ 92#define IEEE802154_MFR_SIZE 2 /* 2 octets */
84 93
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h
index 5a719ca892f4..3b53c8e405e4 100644
--- a/include/net/ieee802154_netdev.h
+++ b/include/net/ieee802154_netdev.h
@@ -27,6 +27,7 @@
27#ifndef IEEE802154_NETDEVICE_H 27#ifndef IEEE802154_NETDEVICE_H
28#define IEEE802154_NETDEVICE_H 28#define IEEE802154_NETDEVICE_H
29 29
30#include <net/ieee802154.h>
30#include <net/af_ieee802154.h> 31#include <net/af_ieee802154.h>
31#include <linux/netdevice.h> 32#include <linux/netdevice.h>
32#include <linux/skbuff.h> 33#include <linux/skbuff.h>
@@ -114,6 +115,34 @@ int ieee802154_hdr_pull(struct sk_buff *skb, struct ieee802154_hdr *hdr);
114int ieee802154_hdr_peek_addrs(const struct sk_buff *skb, 115int ieee802154_hdr_peek_addrs(const struct sk_buff *skb,
115 struct ieee802154_hdr *hdr); 116 struct ieee802154_hdr *hdr);
116 117
118/* parses the full 802.15.4 header a given skb and stores them into hdr,
119 * performing pan id decompression and length checks to be suitable for use in
120 * header_ops.parse
121 */
122int ieee802154_hdr_peek(const struct sk_buff *skb, struct ieee802154_hdr *hdr);
123
124int ieee802154_max_payload(const struct ieee802154_hdr *hdr);
125
126static inline int
127ieee802154_sechdr_authtag_len(const struct ieee802154_sechdr *sec)
128{
129 switch (sec->level) {
130 case IEEE802154_SCF_SECLEVEL_MIC32:
131 case IEEE802154_SCF_SECLEVEL_ENC_MIC32:
132 return 4;
133 case IEEE802154_SCF_SECLEVEL_MIC64:
134 case IEEE802154_SCF_SECLEVEL_ENC_MIC64:
135 return 8;
136 case IEEE802154_SCF_SECLEVEL_MIC128:
137 case IEEE802154_SCF_SECLEVEL_ENC_MIC128:
138 return 16;
139 case IEEE802154_SCF_SECLEVEL_NONE:
140 case IEEE802154_SCF_SECLEVEL_ENC:
141 default:
142 return 0;
143 }
144}
145
117static inline int ieee802154_hdr_length(struct sk_buff *skb) 146static inline int ieee802154_hdr_length(struct sk_buff *skb)
118{ 147{
119 struct ieee802154_hdr hdr; 148 struct ieee802154_hdr hdr;
@@ -193,8 +222,12 @@ static inline void ieee802154_addr_to_sa(struct ieee802154_addr_sa *sa,
193 */ 222 */
194struct ieee802154_mac_cb { 223struct ieee802154_mac_cb {
195 u8 lqi; 224 u8 lqi;
196 u8 flags; 225 u8 type;
197 u8 seq; 226 bool ackreq;
227 bool secen;
228 bool secen_override;
229 u8 seclevel;
230 bool seclevel_override;
198 struct ieee802154_addr source; 231 struct ieee802154_addr source;
199 struct ieee802154_addr dest; 232 struct ieee802154_addr dest;
200}; 233};
@@ -204,25 +237,96 @@ static inline struct ieee802154_mac_cb *mac_cb(struct sk_buff *skb)
204 return (struct ieee802154_mac_cb *)skb->cb; 237 return (struct ieee802154_mac_cb *)skb->cb;
205} 238}
206 239
207#define MAC_CB_FLAG_TYPEMASK ((1 << 3) - 1) 240static inline struct ieee802154_mac_cb *mac_cb_init(struct sk_buff *skb)
208
209#define MAC_CB_FLAG_ACKREQ (1 << 3)
210#define MAC_CB_FLAG_SECEN (1 << 4)
211
212static inline bool mac_cb_is_ackreq(struct sk_buff *skb)
213{ 241{
214 return mac_cb(skb)->flags & MAC_CB_FLAG_ACKREQ; 242 BUILD_BUG_ON(sizeof(struct ieee802154_mac_cb) > sizeof(skb->cb));
215}
216 243
217static inline bool mac_cb_is_secen(struct sk_buff *skb) 244 memset(skb->cb, 0, sizeof(struct ieee802154_mac_cb));
218{ 245 return mac_cb(skb);
219 return mac_cb(skb)->flags & MAC_CB_FLAG_SECEN;
220} 246}
221 247
222static inline int mac_cb_type(struct sk_buff *skb) 248#define IEEE802154_LLSEC_KEY_SIZE 16
223{ 249
224 return mac_cb(skb)->flags & MAC_CB_FLAG_TYPEMASK; 250struct ieee802154_llsec_key_id {
225} 251 u8 mode;
252 u8 id;
253 union {
254 struct ieee802154_addr device_addr;
255 __le32 short_source;
256 __le64 extended_source;
257 };
258};
259
260struct ieee802154_llsec_key {
261 u8 frame_types;
262 u32 cmd_frame_ids;
263 u8 key[IEEE802154_LLSEC_KEY_SIZE];
264};
265
266struct ieee802154_llsec_key_entry {
267 struct list_head list;
268
269 struct ieee802154_llsec_key_id id;
270 struct ieee802154_llsec_key *key;
271};
272
273struct ieee802154_llsec_device_key {
274 struct list_head list;
275
276 struct ieee802154_llsec_key_id key_id;
277 u32 frame_counter;
278};
279
280enum {
281 IEEE802154_LLSEC_DEVKEY_IGNORE,
282 IEEE802154_LLSEC_DEVKEY_RESTRICT,
283 IEEE802154_LLSEC_DEVKEY_RECORD,
284
285 __IEEE802154_LLSEC_DEVKEY_MAX,
286};
287
288struct ieee802154_llsec_device {
289 struct list_head list;
290
291 __le16 pan_id;
292 __le16 short_addr;
293 __le64 hwaddr;
294 u32 frame_counter;
295 bool seclevel_exempt;
296
297 u8 key_mode;
298 struct list_head keys;
299};
300
301struct ieee802154_llsec_seclevel {
302 struct list_head list;
303
304 u8 frame_type;
305 u8 cmd_frame_id;
306 bool device_override;
307 u32 sec_levels;
308};
309
310struct ieee802154_llsec_params {
311 bool enabled;
312
313 __be32 frame_counter;
314 u8 out_level;
315 struct ieee802154_llsec_key_id out_key;
316
317 __le64 default_key_source;
318
319 __le16 pan_id;
320 __le64 hwaddr;
321 __le64 coord_hwaddr;
322 __le16 coord_shortaddr;
323};
324
325struct ieee802154_llsec_table {
326 struct list_head keys;
327 struct list_head devices;
328 struct list_head security_levels;
329};
226 330
227#define IEEE802154_MAC_SCAN_ED 0 331#define IEEE802154_MAC_SCAN_ED 0
228#define IEEE802154_MAC_SCAN_ACTIVE 1 332#define IEEE802154_MAC_SCAN_ACTIVE 1
@@ -242,6 +346,53 @@ struct ieee802154_mac_params {
242}; 346};
243 347
244struct wpan_phy; 348struct wpan_phy;
349
350enum {
351 IEEE802154_LLSEC_PARAM_ENABLED = 1 << 0,
352 IEEE802154_LLSEC_PARAM_FRAME_COUNTER = 1 << 1,
353 IEEE802154_LLSEC_PARAM_OUT_LEVEL = 1 << 2,
354 IEEE802154_LLSEC_PARAM_OUT_KEY = 1 << 3,
355 IEEE802154_LLSEC_PARAM_KEY_SOURCE = 1 << 4,
356 IEEE802154_LLSEC_PARAM_PAN_ID = 1 << 5,
357 IEEE802154_LLSEC_PARAM_HWADDR = 1 << 6,
358 IEEE802154_LLSEC_PARAM_COORD_HWADDR = 1 << 7,
359 IEEE802154_LLSEC_PARAM_COORD_SHORTADDR = 1 << 8,
360};
361
362struct ieee802154_llsec_ops {
363 int (*get_params)(struct net_device *dev,
364 struct ieee802154_llsec_params *params);
365 int (*set_params)(struct net_device *dev,
366 const struct ieee802154_llsec_params *params,
367 int changed);
368
369 int (*add_key)(struct net_device *dev,
370 const struct ieee802154_llsec_key_id *id,
371 const struct ieee802154_llsec_key *key);
372 int (*del_key)(struct net_device *dev,
373 const struct ieee802154_llsec_key_id *id);
374
375 int (*add_dev)(struct net_device *dev,
376 const struct ieee802154_llsec_device *llsec_dev);
377 int (*del_dev)(struct net_device *dev, __le64 dev_addr);
378
379 int (*add_devkey)(struct net_device *dev,
380 __le64 device_addr,
381 const struct ieee802154_llsec_device_key *key);
382 int (*del_devkey)(struct net_device *dev,
383 __le64 device_addr,
384 const struct ieee802154_llsec_device_key *key);
385
386 int (*add_seclevel)(struct net_device *dev,
387 const struct ieee802154_llsec_seclevel *sl);
388 int (*del_seclevel)(struct net_device *dev,
389 const struct ieee802154_llsec_seclevel *sl);
390
391 void (*lock_table)(struct net_device *dev);
392 void (*get_table)(struct net_device *dev,
393 struct ieee802154_llsec_table **t);
394 void (*unlock_table)(struct net_device *dev);
395};
245/* 396/*
246 * This should be located at net_device->ml_priv 397 * This should be located at net_device->ml_priv
247 * 398 *
@@ -272,6 +423,8 @@ struct ieee802154_mlme_ops {
272 void (*get_mac_params)(struct net_device *dev, 423 void (*get_mac_params)(struct net_device *dev,
273 struct ieee802154_mac_params *params); 424 struct ieee802154_mac_params *params);
274 425
426 struct ieee802154_llsec_ops *llsec;
427
275 /* The fields below are required. */ 428 /* The fields below are required. */
276 429
277 struct wpan_phy *(*get_phy)(const struct net_device *dev); 430 struct wpan_phy *(*get_phy)(const struct net_device *dev);
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 3bd22795c3e2..84b20835b736 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -150,7 +150,7 @@ static inline int INET_ECN_set_ce(struct sk_buff *skb)
150} 150}
151 151
152/* 152/*
153 * RFC 6080 4.2 153 * RFC 6040 4.2
154 * To decapsulate the inner header at the tunnel egress, a compliant 154 * To decapsulate the inner header at the tunnel egress, a compliant
155 * tunnel egress MUST set the outgoing ECN field to the codepoint at the 155 * tunnel egress MUST set the outgoing ECN field to the codepoint at the
156 * intersection of the appropriate arriving inner header (row) and outer 156 * intersection of the appropriate arriving inner header (row) and outer
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 1bdb47715def..dd1950a7e273 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -292,12 +292,12 @@ static inline struct sock *inet_lookup_listener(struct net *net,
292#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ 292#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
293 const __addrpair __name = (__force __addrpair) ( \ 293 const __addrpair __name = (__force __addrpair) ( \
294 (((__force __u64)(__be32)(__saddr)) << 32) | \ 294 (((__force __u64)(__be32)(__saddr)) << 32) | \
295 ((__force __u64)(__be32)(__daddr))); 295 ((__force __u64)(__be32)(__daddr)))
296#else /* __LITTLE_ENDIAN */ 296#else /* __LITTLE_ENDIAN */
297#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ 297#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
298 const __addrpair __name = (__force __addrpair) ( \ 298 const __addrpair __name = (__force __addrpair) ( \
299 (((__force __u64)(__be32)(__daddr)) << 32) | \ 299 (((__force __u64)(__be32)(__daddr)) << 32) | \
300 ((__force __u64)(__be32)(__saddr))); 300 ((__force __u64)(__be32)(__saddr)))
301#endif /* __BIG_ENDIAN */ 301#endif /* __BIG_ENDIAN */
302#define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ 302#define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \
303 (((__sk)->sk_portpair == (__ports)) && \ 303 (((__sk)->sk_portpair == (__ports)) && \
@@ -306,7 +306,9 @@ static inline struct sock *inet_lookup_listener(struct net *net,
306 ((__sk)->sk_bound_dev_if == (__dif))) && \ 306 ((__sk)->sk_bound_dev_if == (__dif))) && \
307 net_eq(sock_net(__sk), (__net))) 307 net_eq(sock_net(__sk), (__net)))
308#else /* 32-bit arch */ 308#else /* 32-bit arch */
309#define INET_ADDR_COOKIE(__name, __saddr, __daddr) 309#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
310 const int __name __deprecated __attribute__((unused))
311
310#define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ 312#define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \
311 (((__sk)->sk_portpair == (__ports)) && \ 313 (((__sk)->sk_portpair == (__ports)) && \
312 ((__sk)->sk_daddr == (__saddr)) && \ 314 ((__sk)->sk_daddr == (__saddr)) && \
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 1833c3f389ee..b1edf17bec01 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -90,6 +90,7 @@ struct inet_request_sock {
90 kmemcheck_bitfield_end(flags); 90 kmemcheck_bitfield_end(flags);
91 struct ip_options_rcu *opt; 91 struct ip_options_rcu *opt;
92 struct sk_buff *pktopts; 92 struct sk_buff *pktopts;
93 u32 ir_mark;
93}; 94};
94 95
95static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) 96static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk)
@@ -97,6 +98,15 @@ static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk)
97 return (struct inet_request_sock *)sk; 98 return (struct inet_request_sock *)sk;
98} 99}
99 100
101static inline u32 inet_request_mark(struct sock *sk, struct sk_buff *skb)
102{
103 if (!sk->sk_mark && sock_net(sk)->ipv4.sysctl_tcp_fwmark_accept) {
104 return skb->mark;
105 } else {
106 return sk->sk_mark;
107 }
108}
109
100struct inet_cork { 110struct inet_cork {
101 unsigned int flags; 111 unsigned int flags;
102 __be32 addr; 112 __be32 addr;
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 058271bde27a..01d590ee5e7e 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -41,14 +41,13 @@ struct inet_peer {
41 struct rcu_head gc_rcu; 41 struct rcu_head gc_rcu;
42 }; 42 };
43 /* 43 /*
44 * Once inet_peer is queued for deletion (refcnt == -1), following fields 44 * Once inet_peer is queued for deletion (refcnt == -1), following field
45 * are not available: rid, ip_id_count 45 * is not available: rid
46 * We can share memory with rcu_head to help keep inet_peer small. 46 * We can share memory with rcu_head to help keep inet_peer small.
47 */ 47 */
48 union { 48 union {
49 struct { 49 struct {
50 atomic_t rid; /* Frag reception counter */ 50 atomic_t rid; /* Frag reception counter */
51 atomic_t ip_id_count; /* IP ID for the next packet */
52 }; 51 };
53 struct rcu_head rcu; 52 struct rcu_head rcu;
54 struct inet_peer *gc_next; 53 struct inet_peer *gc_next;
@@ -165,21 +164,11 @@ bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout);
165void inetpeer_invalidate_tree(struct inet_peer_base *); 164void inetpeer_invalidate_tree(struct inet_peer_base *);
166 165
167/* 166/*
168 * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, 167 * temporary check to make sure we dont access rid, tcp_ts,
169 * tcp_ts_stamp if no refcount is taken on inet_peer 168 * tcp_ts_stamp if no refcount is taken on inet_peer
170 */ 169 */
171static inline void inet_peer_refcheck(const struct inet_peer *p) 170static inline void inet_peer_refcheck(const struct inet_peer *p)
172{ 171{
173 WARN_ON_ONCE(atomic_read(&p->refcnt) <= 0); 172 WARN_ON_ONCE(atomic_read(&p->refcnt) <= 0);
174} 173}
175
176
177/* can be called with or without local BH being disabled */
178static inline int inet_getid(struct inet_peer *p, int more)
179{
180 more++;
181 inet_peer_refcheck(p);
182 return atomic_add_return(more, &p->ip_id_count) - more;
183}
184
185#endif /* _NET_INETPEER_H */ 174#endif /* _NET_INETPEER_H */
diff --git a/include/net/ip.h b/include/net/ip.h
index 3ec2b0fb9d83..0e795df05ec9 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -196,35 +196,31 @@ void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
196#define NET_ADD_STATS_BH(net, field, adnd) SNMP_ADD_STATS_BH((net)->mib.net_statistics, field, adnd) 196#define NET_ADD_STATS_BH(net, field, adnd) SNMP_ADD_STATS_BH((net)->mib.net_statistics, field, adnd)
197#define NET_ADD_STATS_USER(net, field, adnd) SNMP_ADD_STATS_USER((net)->mib.net_statistics, field, adnd) 197#define NET_ADD_STATS_USER(net, field, adnd) SNMP_ADD_STATS_USER((net)->mib.net_statistics, field, adnd)
198 198
199unsigned long snmp_fold_field(void __percpu *mib[], int offt); 199unsigned long snmp_fold_field(void __percpu *mib, int offt);
200#if BITS_PER_LONG==32 200#if BITS_PER_LONG==32
201u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t sync_off); 201u64 snmp_fold_field64(void __percpu *mib, int offt, size_t sync_off);
202#else 202#else
203static inline u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t syncp_off) 203static inline u64 snmp_fold_field64(void __percpu *mib, int offt, size_t syncp_off)
204{ 204{
205 return snmp_fold_field(mib, offt); 205 return snmp_fold_field(mib, offt);
206} 206}
207#endif 207#endif
208int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align);
209
210static inline void snmp_mib_free(void __percpu *ptr[SNMP_ARRAY_SZ])
211{
212 int i;
213
214 BUG_ON(ptr == NULL);
215 for (i = 0; i < SNMP_ARRAY_SZ; i++) {
216 free_percpu(ptr[i]);
217 ptr[i] = NULL;
218 }
219}
220 208
221void inet_get_local_port_range(struct net *net, int *low, int *high); 209void inet_get_local_port_range(struct net *net, int *low, int *high);
222 210
223extern unsigned long *sysctl_local_reserved_ports; 211#ifdef CONFIG_SYSCTL
224static inline int inet_is_reserved_local_port(int port) 212static inline int inet_is_local_reserved_port(struct net *net, int port)
225{ 213{
226 return test_bit(port, sysctl_local_reserved_ports); 214 if (!net->ipv4.sysctl_local_reserved_ports)
215 return 0;
216 return test_bit(port, net->ipv4.sysctl_local_reserved_ports);
227} 217}
218#else
219static inline int inet_is_local_reserved_port(struct net *net, int port)
220{
221 return 0;
222}
223#endif
228 224
229extern int sysctl_ip_nonlocal_bind; 225extern int sysctl_ip_nonlocal_bind;
230 226
@@ -243,6 +239,9 @@ void ipfrag_init(void);
243 239
244void ip_static_sysctl_init(void); 240void ip_static_sysctl_init(void);
245 241
242#define IP4_REPLY_MARK(net, mark) \
243 ((net)->ipv4.sysctl_fwmark_reflect ? (mark) : 0)
244
246static inline bool ip_is_fragment(const struct iphdr *iph) 245static inline bool ip_is_fragment(const struct iphdr *iph)
247{ 246{
248 return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0; 247 return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0;
@@ -281,7 +280,7 @@ static inline bool ip_sk_use_pmtu(const struct sock *sk)
281 return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE; 280 return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE;
282} 281}
283 282
284static inline bool ip_sk_local_df(const struct sock *sk) 283static inline bool ip_sk_ignore_df(const struct sock *sk)
285{ 284{
286 return inet_sk(sk)->pmtudisc < IP_PMTUDISC_DO || 285 return inet_sk(sk)->pmtudisc < IP_PMTUDISC_DO ||
287 inet_sk(sk)->pmtudisc == IP_PMTUDISC_OMIT; 286 inet_sk(sk)->pmtudisc == IP_PMTUDISC_OMIT;
@@ -310,36 +309,48 @@ static inline unsigned int ip_skb_dst_mtu(const struct sk_buff *skb)
310 } 309 }
311} 310}
312 311
313void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); 312#define IP_IDENTS_SZ 2048u
313extern atomic_t *ip_idents;
314
315static inline u32 ip_idents_reserve(u32 hash, int segs)
316{
317 atomic_t *id_ptr = ip_idents + hash % IP_IDENTS_SZ;
318
319 return atomic_add_return(segs, id_ptr) - segs;
320}
321
322void __ip_select_ident(struct iphdr *iph, int segs);
314 323
315static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk) 324static inline void ip_select_ident_segs(struct sk_buff *skb, struct sock *sk, int segs)
316{ 325{
317 struct iphdr *iph = ip_hdr(skb); 326 struct iphdr *iph = ip_hdr(skb);
318 327
319 if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) { 328 if ((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) {
320 /* This is only to work around buggy Windows95/2000 329 /* This is only to work around buggy Windows95/2000
321 * VJ compression implementations. If the ID field 330 * VJ compression implementations. If the ID field
322 * does not change, they drop every other packet in 331 * does not change, they drop every other packet in
323 * a TCP stream using header compression. 332 * a TCP stream using header compression.
324 */ 333 */
325 iph->id = (sk && inet_sk(sk)->inet_daddr) ? 334 if (sk && inet_sk(sk)->inet_daddr) {
326 htons(inet_sk(sk)->inet_id++) : 0; 335 iph->id = htons(inet_sk(sk)->inet_id);
327 } else 336 inet_sk(sk)->inet_id += segs;
328 __ip_select_ident(iph, dst, 0); 337 } else {
338 iph->id = 0;
339 }
340 } else {
341 __ip_select_ident(iph, segs);
342 }
329} 343}
330 344
331static inline void ip_select_ident_more(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk, int more) 345static inline void ip_select_ident(struct sk_buff *skb, struct sock *sk)
332{ 346{
333 struct iphdr *iph = ip_hdr(skb); 347 ip_select_ident_segs(skb, sk, 1);
348}
334 349
335 if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) { 350static inline __wsum inet_compute_pseudo(struct sk_buff *skb, int proto)
336 if (sk && inet_sk(sk)->inet_daddr) { 351{
337 iph->id = htons(inet_sk(sk)->inet_id); 352 return csum_tcpudp_nofold(ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
338 inet_sk(sk)->inet_id += 1 + more; 353 skb->len, proto, 0);
339 } else
340 iph->id = 0;
341 } else
342 __ip_select_ident(iph, dst, more);
343} 354}
344 355
345/* 356/*
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h
index 9e3c540c1b11..55236cb71174 100644
--- a/include/net/ip6_checksum.h
+++ b/include/net/ip6_checksum.h
@@ -41,6 +41,13 @@ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
41 __wsum csum); 41 __wsum csum);
42#endif 42#endif
43 43
44static inline __wsum ip6_compute_pseudo(struct sk_buff *skb, int proto)
45{
46 return ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
47 &ipv6_hdr(skb)->daddr,
48 skb->len, proto, 0));
49}
50
44static __inline__ __sum16 tcp_v6_check(int len, 51static __inline__ __sum16 tcp_v6_check(int len,
45 const struct in6_addr *saddr, 52 const struct in6_addr *saddr,
46 const struct in6_addr *daddr, 53 const struct in6_addr *daddr,
@@ -75,5 +82,17 @@ static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)
75} 82}
76#endif 83#endif
77 84
85static inline __sum16 udp_v6_check(int len,
86 const struct in6_addr *saddr,
87 const struct in6_addr *daddr,
88 __wsum base)
89{
90 return csum_ipv6_magic(saddr, daddr, len, IPPROTO_UDP, base);
91}
92
93void udp6_set_csum(bool nocheck, struct sk_buff *skb,
94 const struct in6_addr *saddr,
95 const struct in6_addr *daddr, int len);
96
78int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto); 97int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto);
79#endif 98#endif
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 216cecce65e9..1d09b46c1e48 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -186,7 +186,7 @@ static inline bool ip6_sk_accept_pmtu(const struct sock *sk)
186 inet6_sk(sk)->pmtudisc != IPV6_PMTUDISC_OMIT; 186 inet6_sk(sk)->pmtudisc != IPV6_PMTUDISC_OMIT;
187} 187}
188 188
189static inline bool ip6_sk_local_df(const struct sock *sk) 189static inline bool ip6_sk_ignore_df(const struct sock *sk)
190{ 190{
191 return inet6_sk(sk)->pmtudisc < IPV6_PMTUDISC_DO || 191 return inet6_sk(sk)->pmtudisc < IPV6_PMTUDISC_DO ||
192 inet6_sk(sk)->pmtudisc == IPV6_PMTUDISC_OMIT; 192 inet6_sk(sk)->pmtudisc == IPV6_PMTUDISC_OMIT;
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index d640925bc454..574337fe72dd 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -113,6 +113,9 @@ struct frag_hdr {
113#define IP6_MF 0x0001 113#define IP6_MF 0x0001
114#define IP6_OFFSET 0xFFF8 114#define IP6_OFFSET 0xFFF8
115 115
116#define IP6_REPLY_MARK(net, mark) \
117 ((net)->ipv6.sysctl.fwmark_reflect ? (mark) : 0)
118
116#include <net/sock.h> 119#include <net/sock.h>
117 120
118/* sysctls */ 121/* sysctls */
@@ -583,6 +586,11 @@ static inline bool ipv6_addr_orchid(const struct in6_addr *a)
583 return (a->s6_addr32[0] & htonl(0xfffffff0)) == htonl(0x20010010); 586 return (a->s6_addr32[0] & htonl(0xfffffff0)) == htonl(0x20010010);
584} 587}
585 588
589static inline bool ipv6_addr_is_multicast(const struct in6_addr *addr)
590{
591 return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000);
592}
593
586static inline void ipv6_addr_set_v4mapped(const __be32 addr, 594static inline void ipv6_addr_set_v4mapped(const __be32 addr,
587 struct in6_addr *v4mapped) 595 struct in6_addr *v4mapped)
588{ 596{
@@ -660,10 +668,22 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
660 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); 668 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
661} 669}
662 670
663void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
664
665int ip6_dst_hoplimit(struct dst_entry *dst); 671int ip6_dst_hoplimit(struct dst_entry *dst);
666 672
673static inline int ip6_sk_dst_hoplimit(struct ipv6_pinfo *np, struct flowi6 *fl6,
674 struct dst_entry *dst)
675{
676 int hlimit;
677
678 if (ipv6_addr_is_multicast(&fl6->daddr))
679 hlimit = np->mcast_hops;
680 else
681 hlimit = np->hop_limit;
682 if (hlimit < 0)
683 hlimit = ip6_dst_hoplimit(dst);
684 return hlimit;
685}
686
667/* 687/*
668 * Header manipulation 688 * Header manipulation
669 */ 689 */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 8248e3909fdf..421b6ecb4b2c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -189,6 +189,43 @@ struct ieee80211_chanctx_conf {
189}; 189};
190 190
191/** 191/**
192 * enum ieee80211_chanctx_switch_mode - channel context switch mode
193 * @CHANCTX_SWMODE_REASSIGN_VIF: Both old and new contexts already
194 * exist (and will continue to exist), but the virtual interface
195 * needs to be switched from one to the other.
196 * @CHANCTX_SWMODE_SWAP_CONTEXTS: The old context exists but will stop
197 * to exist with this call, the new context doesn't exist but
198 * will be active after this call, the virtual interface switches
199 * from the old to the new (note that the driver may of course
200 * implement this as an on-the-fly chandef switch of the existing
201 * hardware context, but the mac80211 pointer for the old context
202 * will cease to exist and only the new one will later be used
203 * for changes/removal.)
204 */
205enum ieee80211_chanctx_switch_mode {
206 CHANCTX_SWMODE_REASSIGN_VIF,
207 CHANCTX_SWMODE_SWAP_CONTEXTS,
208};
209
210/**
211 * struct ieee80211_vif_chanctx_switch - vif chanctx switch information
212 *
213 * This is structure is used to pass information about a vif that
214 * needs to switch from one chanctx to another. The
215 * &ieee80211_chanctx_switch_mode defines how the switch should be
216 * done.
217 *
218 * @vif: the vif that should be switched from old_ctx to new_ctx
219 * @old_ctx: the old context to which the vif was assigned
220 * @new_ctx: the new context to which the vif must be assigned
221 */
222struct ieee80211_vif_chanctx_switch {
223 struct ieee80211_vif *vif;
224 struct ieee80211_chanctx_conf *old_ctx;
225 struct ieee80211_chanctx_conf *new_ctx;
226};
227
228/**
192 * enum ieee80211_bss_change - BSS change notification flags 229 * enum ieee80211_bss_change - BSS change notification flags
193 * 230 *
194 * These flags are used with the bss_info_changed() callback 231 * These flags are used with the bss_info_changed() callback
@@ -1113,7 +1150,9 @@ enum ieee80211_vif_flags {
1113 * @addr: address of this interface 1150 * @addr: address of this interface
1114 * @p2p: indicates whether this AP or STA interface is a p2p 1151 * @p2p: indicates whether this AP or STA interface is a p2p
1115 * interface, i.e. a GO or p2p-sta respectively 1152 * interface, i.e. a GO or p2p-sta respectively
1116 * @csa_active: marks whether a channel switch is going on 1153 * @csa_active: marks whether a channel switch is going on. Internally it is
1154 * write-protected by sdata_lock and local->mtx so holding either is fine
1155 * for read access.
1117 * @driver_flags: flags/capabilities the driver has for this interface, 1156 * @driver_flags: flags/capabilities the driver has for this interface,
1118 * these need to be set (or cleared) when the interface is added 1157 * these need to be set (or cleared) when the interface is added
1119 * or, if supported by the driver, the interface type is changed 1158 * or, if supported by the driver, the interface type is changed
@@ -1202,14 +1241,18 @@ struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
1202 * fall back to software crypto. Note that this flag deals only with 1241 * fall back to software crypto. Note that this flag deals only with
1203 * RX, if your crypto engine can't deal with TX you can also set the 1242 * RX, if your crypto engine can't deal with TX you can also set the
1204 * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW. 1243 * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW.
1244 * @IEEE80211_KEY_FLAG_GENERATE_IV_MGMT: This flag should be set by the
1245 * driver for a CCMP key to indicate that is requires IV generation
1246 * only for managment frames (MFP).
1205 */ 1247 */
1206enum ieee80211_key_flags { 1248enum ieee80211_key_flags {
1207 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, 1249 IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(0),
1208 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, 1250 IEEE80211_KEY_FLAG_GENERATE_IV = BIT(1),
1209 IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, 1251 IEEE80211_KEY_FLAG_GENERATE_MMIC = BIT(2),
1210 IEEE80211_KEY_FLAG_SW_MGMT_TX = 1<<4, 1252 IEEE80211_KEY_FLAG_PAIRWISE = BIT(3),
1211 IEEE80211_KEY_FLAG_PUT_IV_SPACE = 1<<5, 1253 IEEE80211_KEY_FLAG_SW_MGMT_TX = BIT(4),
1212 IEEE80211_KEY_FLAG_RX_MGMT = 1<<6, 1254 IEEE80211_KEY_FLAG_PUT_IV_SPACE = BIT(5),
1255 IEEE80211_KEY_FLAG_RX_MGMT = BIT(6),
1213}; 1256};
1214 1257
1215/** 1258/**
@@ -1370,6 +1413,7 @@ struct ieee80211_sta_rates {
1370 * the station moves to associated state. 1413 * the station moves to associated state.
1371 * @smps_mode: current SMPS mode (off, static or dynamic) 1414 * @smps_mode: current SMPS mode (off, static or dynamic)
1372 * @rates: rate control selection table 1415 * @rates: rate control selection table
1416 * @tdls: indicates whether the STA is a TDLS peer
1373 */ 1417 */
1374struct ieee80211_sta { 1418struct ieee80211_sta {
1375 u32 supp_rates[IEEE80211_NUM_BANDS]; 1419 u32 supp_rates[IEEE80211_NUM_BANDS];
@@ -1384,6 +1428,7 @@ struct ieee80211_sta {
1384 enum ieee80211_sta_rx_bandwidth bandwidth; 1428 enum ieee80211_sta_rx_bandwidth bandwidth;
1385 enum ieee80211_smps_mode smps_mode; 1429 enum ieee80211_smps_mode smps_mode;
1386 struct ieee80211_sta_rates __rcu *rates; 1430 struct ieee80211_sta_rates __rcu *rates;
1431 bool tdls;
1387 1432
1388 /* must be last */ 1433 /* must be last */
1389 u8 drv_priv[0] __aligned(sizeof(void *)); 1434 u8 drv_priv[0] __aligned(sizeof(void *));
@@ -1555,6 +1600,12 @@ struct ieee80211_tx_control {
1555 * for a single active channel while using channel contexts. When support 1600 * for a single active channel while using channel contexts. When support
1556 * is not enabled the default action is to disconnect when getting the 1601 * is not enabled the default action is to disconnect when getting the
1557 * CSA frame. 1602 * CSA frame.
1603 *
1604 * @IEEE80211_HW_CHANGE_RUNNING_CHANCTX: The hardware can change a
1605 * channel context on-the-fly. This is needed for channel switch
1606 * on single-channel hardware. It can also be used as an
1607 * optimization in certain channel switch cases with
1608 * multi-channel.
1558 */ 1609 */
1559enum ieee80211_hw_flags { 1610enum ieee80211_hw_flags {
1560 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 1611 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -1586,6 +1637,7 @@ enum ieee80211_hw_flags {
1586 IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26, 1637 IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26,
1587 IEEE80211_HW_SUPPORTS_HT_CCK_RATES = 1<<27, 1638 IEEE80211_HW_SUPPORTS_HT_CCK_RATES = 1<<27,
1588 IEEE80211_HW_CHANCTX_STA_CSA = 1<<28, 1639 IEEE80211_HW_CHANCTX_STA_CSA = 1<<28,
1640 IEEE80211_HW_CHANGE_RUNNING_CHANCTX = 1<<29,
1589}; 1641};
1590 1642
1591/** 1643/**
@@ -2609,6 +2661,7 @@ enum ieee80211_roc_type {
2609 * of queues to flush, which is useful if different virtual interfaces 2661 * of queues to flush, which is useful if different virtual interfaces
2610 * use different hardware queues; it may also indicate all queues. 2662 * use different hardware queues; it may also indicate all queues.
2611 * If the parameter @drop is set to %true, pending frames may be dropped. 2663 * If the parameter @drop is set to %true, pending frames may be dropped.
2664 * Note that vif can be NULL.
2612 * The callback can sleep. 2665 * The callback can sleep.
2613 * 2666 *
2614 * @channel_switch: Drivers that need (or want) to offload the channel 2667 * @channel_switch: Drivers that need (or want) to offload the channel
@@ -2720,6 +2773,11 @@ enum ieee80211_roc_type {
2720 * to vif. Possible use is for hw queue remapping. 2773 * to vif. Possible use is for hw queue remapping.
2721 * @unassign_vif_chanctx: Notifies device driver about channel context being 2774 * @unassign_vif_chanctx: Notifies device driver about channel context being
2722 * unbound from vif. 2775 * unbound from vif.
2776 * @switch_vif_chanctx: switch a number of vifs from one chanctx to
2777 * another, as specified in the list of
2778 * @ieee80211_vif_chanctx_switch passed to the driver, according
2779 * to the mode defined in &ieee80211_chanctx_switch_mode.
2780 *
2723 * @start_ap: Start operation on the AP interface, this is called after all the 2781 * @start_ap: Start operation on the AP interface, this is called after all the
2724 * information in bss_conf is set and beacon can be retrieved. A channel 2782 * information in bss_conf is set and beacon can be retrieved. A channel
2725 * context is bound before this is called. Note that if the driver uses 2783 * context is bound before this is called. Note that if the driver uses
@@ -2753,6 +2811,10 @@ enum ieee80211_roc_type {
2753 * information in bss_conf is set up and the beacon can be retrieved. A 2811 * information in bss_conf is set up and the beacon can be retrieved. A
2754 * channel context is bound before this is called. 2812 * channel context is bound before this is called.
2755 * @leave_ibss: Leave the IBSS again. 2813 * @leave_ibss: Leave the IBSS again.
2814 *
2815 * @get_expected_throughput: extract the expected throughput towards the
2816 * specified station. The returned value is expressed in Kbps. It returns 0
2817 * if the RC algorithm does not have proper data to provide.
2756 */ 2818 */
2757struct ieee80211_ops { 2819struct ieee80211_ops {
2758 void (*tx)(struct ieee80211_hw *hw, 2820 void (*tx)(struct ieee80211_hw *hw,
@@ -2871,7 +2933,8 @@ struct ieee80211_ops {
2871 struct netlink_callback *cb, 2933 struct netlink_callback *cb,
2872 void *data, int len); 2934 void *data, int len);
2873#endif 2935#endif
2874 void (*flush)(struct ieee80211_hw *hw, u32 queues, bool drop); 2936 void (*flush)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2937 u32 queues, bool drop);
2875 void (*channel_switch)(struct ieee80211_hw *hw, 2938 void (*channel_switch)(struct ieee80211_hw *hw,
2876 struct ieee80211_channel_switch *ch_switch); 2939 struct ieee80211_channel_switch *ch_switch);
2877 int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant); 2940 int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant);
@@ -2931,6 +2994,10 @@ struct ieee80211_ops {
2931 void (*unassign_vif_chanctx)(struct ieee80211_hw *hw, 2994 void (*unassign_vif_chanctx)(struct ieee80211_hw *hw,
2932 struct ieee80211_vif *vif, 2995 struct ieee80211_vif *vif,
2933 struct ieee80211_chanctx_conf *ctx); 2996 struct ieee80211_chanctx_conf *ctx);
2997 int (*switch_vif_chanctx)(struct ieee80211_hw *hw,
2998 struct ieee80211_vif_chanctx_switch *vifs,
2999 int n_vifs,
3000 enum ieee80211_chanctx_switch_mode mode);
2934 3001
2935 void (*restart_complete)(struct ieee80211_hw *hw); 3002 void (*restart_complete)(struct ieee80211_hw *hw);
2936 3003
@@ -2945,6 +3012,7 @@ struct ieee80211_ops {
2945 3012
2946 int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 3013 int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
2947 void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 3014 void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
3015 u32 (*get_expected_throughput)(struct ieee80211_sta *sta);
2948}; 3016};
2949 3017
2950/** 3018/**
@@ -3394,6 +3462,47 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
3394 */ 3462 */
3395void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets); 3463void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets);
3396 3464
3465#define IEEE80211_MAX_CSA_COUNTERS_NUM 2
3466
3467/**
3468 * struct ieee80211_mutable_offsets - mutable beacon offsets
3469 * @tim_offset: position of TIM element
3470 * @tim_length: size of TIM element
3471 * @csa_counter_offs: array of IEEE80211_MAX_CSA_COUNTERS_NUM offsets
3472 * to CSA counters. This array can contain zero values which
3473 * should be ignored.
3474 */
3475struct ieee80211_mutable_offsets {
3476 u16 tim_offset;
3477 u16 tim_length;
3478
3479 u16 csa_counter_offs[IEEE80211_MAX_CSA_COUNTERS_NUM];
3480};
3481
3482/**
3483 * ieee80211_beacon_get_template - beacon template generation function
3484 * @hw: pointer obtained from ieee80211_alloc_hw().
3485 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3486 * @offs: &struct ieee80211_mutable_offsets pointer to struct that will
3487 * receive the offsets that may be updated by the driver.
3488 *
3489 * If the driver implements beaconing modes, it must use this function to
3490 * obtain the beacon template.
3491 *
3492 * This function should be used if the beacon frames are generated by the
3493 * device, and then the driver must use the returned beacon as the template
3494 * The driver or the device are responsible to update the DTIM and, when
3495 * applicable, the CSA count.
3496 *
3497 * The driver is responsible for freeing the returned skb.
3498 *
3499 * Return: The beacon template. %NULL on error.
3500 */
3501struct sk_buff *
3502ieee80211_beacon_get_template(struct ieee80211_hw *hw,
3503 struct ieee80211_vif *vif,
3504 struct ieee80211_mutable_offsets *offs);
3505
3397/** 3506/**
3398 * ieee80211_beacon_get_tim - beacon generation function 3507 * ieee80211_beacon_get_tim - beacon generation function
3399 * @hw: pointer obtained from ieee80211_alloc_hw(). 3508 * @hw: pointer obtained from ieee80211_alloc_hw().
@@ -3405,16 +3514,12 @@ void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets);
3405 * Set to 0 if invalid (in non-AP modes). 3514 * Set to 0 if invalid (in non-AP modes).
3406 * 3515 *
3407 * If the driver implements beaconing modes, it must use this function to 3516 * If the driver implements beaconing modes, it must use this function to
3408 * obtain the beacon frame/template. 3517 * obtain the beacon frame.
3409 * 3518 *
3410 * If the beacon frames are generated by the host system (i.e., not in 3519 * If the beacon frames are generated by the host system (i.e., not in
3411 * hardware/firmware), the driver uses this function to get each beacon 3520 * hardware/firmware), the driver uses this function to get each beacon
3412 * frame from mac80211 -- it is responsible for calling this function 3521 * frame from mac80211 -- it is responsible for calling this function exactly
3413 * before the beacon is needed (e.g. based on hardware interrupt). 3522 * once before the beacon is needed (e.g. based on hardware interrupt).
3414 *
3415 * If the beacon frames are generated by the device, then the driver
3416 * must use the returned beacon as the template and change the TIM IE
3417 * according to the current DTIM parameters/TIM bitmap.
3418 * 3523 *
3419 * The driver is responsible for freeing the returned skb. 3524 * The driver is responsible for freeing the returned skb.
3420 * 3525 *
@@ -3440,6 +3545,20 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
3440} 3545}
3441 3546
3442/** 3547/**
3548 * ieee80211_csa_update_counter - request mac80211 to decrement the csa counter
3549 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3550 *
3551 * The csa counter should be updated after each beacon transmission.
3552 * This function is called implicitly when
3553 * ieee80211_beacon_get/ieee80211_beacon_get_tim are called, however if the
3554 * beacon frames are generated by the device, the driver should call this
3555 * function after each beacon transmission to sync mac80211's csa counters.
3556 *
3557 * Return: new csa counter value
3558 */
3559u8 ieee80211_csa_update_counter(struct ieee80211_vif *vif);
3560
3561/**
3443 * ieee80211_csa_finish - notify mac80211 about channel switch 3562 * ieee80211_csa_finish - notify mac80211 about channel switch
3444 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3563 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3445 * 3564 *
@@ -4467,6 +4586,8 @@ struct rate_control_ops {
4467 void (*add_sta_debugfs)(void *priv, void *priv_sta, 4586 void (*add_sta_debugfs)(void *priv, void *priv_sta,
4468 struct dentry *dir); 4587 struct dentry *dir);
4469 void (*remove_sta_debugfs)(void *priv, void *priv_sta); 4588 void (*remove_sta_debugfs)(void *priv, void *priv_sta);
4589
4590 u32 (*get_expected_throughput)(void *priv_sta);
4470}; 4591};
4471 4592
4472static inline int rate_supported(struct ieee80211_sta *sta, 4593static inline int rate_supported(struct ieee80211_sta *sta,
@@ -4576,7 +4697,9 @@ conf_is_ht40(struct ieee80211_conf *conf)
4576static inline bool 4697static inline bool
4577conf_is_ht(struct ieee80211_conf *conf) 4698conf_is_ht(struct ieee80211_conf *conf)
4578{ 4699{
4579 return conf->chandef.width != NL80211_CHAN_WIDTH_20_NOHT; 4700 return (conf->chandef.width != NL80211_CHAN_WIDTH_5) &&
4701 (conf->chandef.width != NL80211_CHAN_WIDTH_10) &&
4702 (conf->chandef.width != NL80211_CHAN_WIDTH_20_NOHT);
4580} 4703}
4581 4704
4582static inline enum nl80211_iftype 4705static inline enum nl80211_iftype
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 5f9eb260990f..361d26077196 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -373,6 +373,14 @@ static inline void rt_genid_bump_ipv6(struct net *net)
373} 373}
374#endif 374#endif
375 375
376#if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN)
377static inline struct netns_ieee802154_lowpan *
378net_ieee802154_lowpan(struct net *net)
379{
380 return &net->ieee802154_lowpan;
381}
382#endif
383
376/* For callers who don't really care about whether it's IPv4 or IPv6 */ 384/* For callers who don't really care about whether it's IPv4 or IPv6 */
377static inline void rt_genid_bump_all(struct net *net) 385static inline void rt_genid_bump_all(struct net *net)
378{ 386{
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index 07eaaf604092..a71dd333ac68 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -48,6 +48,8 @@ unsigned int nf_nat_setup_info(struct nf_conn *ct,
48extern unsigned int nf_nat_alloc_null_binding(struct nf_conn *ct, 48extern unsigned int nf_nat_alloc_null_binding(struct nf_conn *ct,
49 unsigned int hooknum); 49 unsigned int hooknum);
50 50
51struct nf_conn_nat *nf_ct_nat_ext_add(struct nf_conn *ct);
52
51/* Is this tuple already taken? (not by us)*/ 53/* Is this tuple already taken? (not by us)*/
52int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple, 54int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple,
53 const struct nf_conn *ignored_conntrack); 55 const struct nf_conn *ignored_conntrack);
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index e6bc14d8fa9a..7ee6ce6564ae 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -72,21 +72,23 @@ static inline void nft_data_debug(const struct nft_data *data)
72 * struct nft_ctx - nf_tables rule/set context 72 * struct nft_ctx - nf_tables rule/set context
73 * 73 *
74 * @net: net namespace 74 * @net: net namespace
75 * @skb: netlink skb
76 * @nlh: netlink message header
77 * @afi: address family info 75 * @afi: address family info
78 * @table: the table the chain is contained in 76 * @table: the table the chain is contained in
79 * @chain: the chain the rule is contained in 77 * @chain: the chain the rule is contained in
80 * @nla: netlink attributes 78 * @nla: netlink attributes
79 * @portid: netlink portID of the original message
80 * @seq: netlink sequence number
81 * @report: notify via unicast netlink message
81 */ 82 */
82struct nft_ctx { 83struct nft_ctx {
83 struct net *net; 84 struct net *net;
84 const struct sk_buff *skb; 85 struct nft_af_info *afi;
85 const struct nlmsghdr *nlh; 86 struct nft_table *table;
86 const struct nft_af_info *afi; 87 struct nft_chain *chain;
87 const struct nft_table *table;
88 const struct nft_chain *chain;
89 const struct nlattr * const *nla; 88 const struct nlattr * const *nla;
89 u32 portid;
90 u32 seq;
91 bool report;
90}; 92};
91 93
92struct nft_data_desc { 94struct nft_data_desc {
@@ -146,6 +148,44 @@ struct nft_set_iter {
146}; 148};
147 149
148/** 150/**
151 * struct nft_set_desc - description of set elements
152 *
153 * @klen: key length
154 * @dlen: data length
155 * @size: number of set elements
156 */
157struct nft_set_desc {
158 unsigned int klen;
159 unsigned int dlen;
160 unsigned int size;
161};
162
163/**
164 * enum nft_set_class - performance class
165 *
166 * @NFT_LOOKUP_O_1: constant, O(1)
167 * @NFT_LOOKUP_O_LOG_N: logarithmic, O(log N)
168 * @NFT_LOOKUP_O_N: linear, O(N)
169 */
170enum nft_set_class {
171 NFT_SET_CLASS_O_1,
172 NFT_SET_CLASS_O_LOG_N,
173 NFT_SET_CLASS_O_N,
174};
175
176/**
177 * struct nft_set_estimate - estimation of memory and performance
178 * characteristics
179 *
180 * @size: required memory
181 * @class: lookup performance class
182 */
183struct nft_set_estimate {
184 unsigned int size;
185 enum nft_set_class class;
186};
187
188/**
149 * struct nft_set_ops - nf_tables set operations 189 * struct nft_set_ops - nf_tables set operations
150 * 190 *
151 * @lookup: look up an element within the set 191 * @lookup: look up an element within the set
@@ -174,7 +214,11 @@ struct nft_set_ops {
174 struct nft_set_iter *iter); 214 struct nft_set_iter *iter);
175 215
176 unsigned int (*privsize)(const struct nlattr * const nla[]); 216 unsigned int (*privsize)(const struct nlattr * const nla[]);
217 bool (*estimate)(const struct nft_set_desc *desc,
218 u32 features,
219 struct nft_set_estimate *est);
177 int (*init)(const struct nft_set *set, 220 int (*init)(const struct nft_set *set,
221 const struct nft_set_desc *desc,
178 const struct nlattr * const nla[]); 222 const struct nlattr * const nla[]);
179 void (*destroy)(const struct nft_set *set); 223 void (*destroy)(const struct nft_set *set);
180 224
@@ -194,6 +238,8 @@ void nft_unregister_set(struct nft_set_ops *ops);
194 * @name: name of the set 238 * @name: name of the set
195 * @ktype: key type (numeric type defined by userspace, not used in the kernel) 239 * @ktype: key type (numeric type defined by userspace, not used in the kernel)
196 * @dtype: data type (verdict or numeric type defined by userspace) 240 * @dtype: data type (verdict or numeric type defined by userspace)
241 * @size: maximum set size
242 * @nelems: number of elements
197 * @ops: set ops 243 * @ops: set ops
198 * @flags: set flags 244 * @flags: set flags
199 * @klen: key length 245 * @klen: key length
@@ -206,6 +252,8 @@ struct nft_set {
206 char name[IFNAMSIZ]; 252 char name[IFNAMSIZ];
207 u32 ktype; 253 u32 ktype;
208 u32 dtype; 254 u32 dtype;
255 u32 size;
256 u32 nelems;
209 /* runtime data below here */ 257 /* runtime data below here */
210 const struct nft_set_ops *ops ____cacheline_aligned; 258 const struct nft_set_ops *ops ____cacheline_aligned;
211 u16 flags; 259 u16 flags;
@@ -222,6 +270,8 @@ static inline void *nft_set_priv(const struct nft_set *set)
222 270
223struct nft_set *nf_tables_set_lookup(const struct nft_table *table, 271struct nft_set *nf_tables_set_lookup(const struct nft_table *table,
224 const struct nlattr *nla); 272 const struct nlattr *nla);
273struct nft_set *nf_tables_set_lookup_byid(const struct net *net,
274 const struct nlattr *nla);
225 275
226/** 276/**
227 * struct nft_set_binding - nf_tables set binding 277 * struct nft_set_binding - nf_tables set binding
@@ -341,18 +391,75 @@ struct nft_rule {
341}; 391};
342 392
343/** 393/**
344 * struct nft_rule_trans - nf_tables rule update in transaction 394 * struct nft_trans - nf_tables object update in transaction
345 * 395 *
396 * @rcu_head: rcu head to defer release of transaction data
346 * @list: used internally 397 * @list: used internally
347 * @ctx: rule context 398 * @msg_type: message type
348 * @rule: rule that needs to be updated 399 * @ctx: transaction context
400 * @data: internal information related to the transaction
349 */ 401 */
350struct nft_rule_trans { 402struct nft_trans {
403 struct rcu_head rcu_head;
351 struct list_head list; 404 struct list_head list;
405 int msg_type;
352 struct nft_ctx ctx; 406 struct nft_ctx ctx;
407 char data[0];
408};
409
410struct nft_trans_rule {
353 struct nft_rule *rule; 411 struct nft_rule *rule;
354}; 412};
355 413
414#define nft_trans_rule(trans) \
415 (((struct nft_trans_rule *)trans->data)->rule)
416
417struct nft_trans_set {
418 struct nft_set *set;
419 u32 set_id;
420};
421
422#define nft_trans_set(trans) \
423 (((struct nft_trans_set *)trans->data)->set)
424#define nft_trans_set_id(trans) \
425 (((struct nft_trans_set *)trans->data)->set_id)
426
427struct nft_trans_chain {
428 bool update;
429 char name[NFT_CHAIN_MAXNAMELEN];
430 struct nft_stats __percpu *stats;
431 u8 policy;
432};
433
434#define nft_trans_chain_update(trans) \
435 (((struct nft_trans_chain *)trans->data)->update)
436#define nft_trans_chain_name(trans) \
437 (((struct nft_trans_chain *)trans->data)->name)
438#define nft_trans_chain_stats(trans) \
439 (((struct nft_trans_chain *)trans->data)->stats)
440#define nft_trans_chain_policy(trans) \
441 (((struct nft_trans_chain *)trans->data)->policy)
442
443struct nft_trans_table {
444 bool update;
445 bool enable;
446};
447
448#define nft_trans_table_update(trans) \
449 (((struct nft_trans_table *)trans->data)->update)
450#define nft_trans_table_enable(trans) \
451 (((struct nft_trans_table *)trans->data)->enable)
452
453struct nft_trans_elem {
454 struct nft_set *set;
455 struct nft_set_elem elem;
456};
457
458#define nft_trans_elem_set(trans) \
459 (((struct nft_trans_elem *)trans->data)->set)
460#define nft_trans_elem(trans) \
461 (((struct nft_trans_elem *)trans->data)->elem)
462
356static inline struct nft_expr *nft_expr_first(const struct nft_rule *rule) 463static inline struct nft_expr *nft_expr_first(const struct nft_rule *rule)
357{ 464{
358 return (struct nft_expr *)&rule->data[0]; 465 return (struct nft_expr *)&rule->data[0];
@@ -385,6 +492,7 @@ static inline void *nft_userdata(const struct nft_rule *rule)
385 492
386enum nft_chain_flags { 493enum nft_chain_flags {
387 NFT_BASE_CHAIN = 0x1, 494 NFT_BASE_CHAIN = 0x1,
495 NFT_CHAIN_INACTIVE = 0x2,
388}; 496};
389 497
390/** 498/**
diff --git a/include/net/netfilter/nft_meta.h b/include/net/netfilter/nft_meta.h
new file mode 100644
index 000000000000..0ee47c3e2e31
--- /dev/null
+++ b/include/net/netfilter/nft_meta.h
@@ -0,0 +1,36 @@
1#ifndef _NFT_META_H_
2#define _NFT_META_H_
3
4struct nft_meta {
5 enum nft_meta_keys key:8;
6 union {
7 enum nft_registers dreg:8;
8 enum nft_registers sreg:8;
9 };
10};
11
12extern const struct nla_policy nft_meta_policy[];
13
14int nft_meta_get_init(const struct nft_ctx *ctx,
15 const struct nft_expr *expr,
16 const struct nlattr * const tb[]);
17
18int nft_meta_set_init(const struct nft_ctx *ctx,
19 const struct nft_expr *expr,
20 const struct nlattr * const tb[]);
21
22int nft_meta_get_dump(struct sk_buff *skb,
23 const struct nft_expr *expr);
24
25int nft_meta_set_dump(struct sk_buff *skb,
26 const struct nft_expr *expr);
27
28void nft_meta_get_eval(const struct nft_expr *expr,
29 struct nft_data data[NFT_REG_MAX + 1],
30 const struct nft_pktinfo *pkt);
31
32void nft_meta_set_eval(const struct nft_expr *expr,
33 struct nft_data data[NFT_REG_MAX + 1],
34 const struct nft_pktinfo *pkt);
35
36#endif
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index b2704fd0ec80..aec5e12f9f19 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -77,10 +77,17 @@ struct netns_ipv4 {
77 int sysctl_ip_no_pmtu_disc; 77 int sysctl_ip_no_pmtu_disc;
78 int sysctl_ip_fwd_use_pmtu; 78 int sysctl_ip_fwd_use_pmtu;
79 79
80 int sysctl_fwmark_reflect;
81 int sysctl_tcp_fwmark_accept;
82
80 struct ping_group_range ping_group_range; 83 struct ping_group_range ping_group_range;
81 84
82 atomic_t dev_addr_genid; 85 atomic_t dev_addr_genid;
83 86
87#ifdef CONFIG_SYSCTL
88 unsigned long *sysctl_local_reserved_ports;
89#endif
90
84#ifdef CONFIG_IP_MROUTE 91#ifdef CONFIG_IP_MROUTE
85#ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES 92#ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
86 struct mr_table *mrt; 93 struct mr_table *mrt;
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 21edaf1f7916..19d3446e59d2 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -30,6 +30,7 @@ struct netns_sysctl_ipv6 {
30 int flowlabel_consistency; 30 int flowlabel_consistency;
31 int icmpv6_time; 31 int icmpv6_time;
32 int anycast_src_echo_reply; 32 int anycast_src_echo_reply;
33 int fwmark_reflect;
33}; 34};
34 35
35struct netns_ipv6 { 36struct netns_ipv6 {
diff --git a/include/net/nfc/digital.h b/include/net/nfc/digital.h
index 7655cfe27c34..bdf55c3b7a19 100644
--- a/include/net/nfc/digital.h
+++ b/include/net/nfc/digital.h
@@ -36,6 +36,7 @@ enum {
36 NFC_DIGITAL_RF_TECH_212F, 36 NFC_DIGITAL_RF_TECH_212F,
37 NFC_DIGITAL_RF_TECH_424F, 37 NFC_DIGITAL_RF_TECH_424F,
38 NFC_DIGITAL_RF_TECH_ISO15693, 38 NFC_DIGITAL_RF_TECH_ISO15693,
39 NFC_DIGITAL_RF_TECH_106B,
39 40
40 NFC_DIGITAL_RF_TECH_LAST, 41 NFC_DIGITAL_RF_TECH_LAST,
41}; 42};
@@ -62,6 +63,9 @@ enum {
62 NFC_DIGITAL_FRAMING_ISO15693_INVENTORY, 63 NFC_DIGITAL_FRAMING_ISO15693_INVENTORY,
63 NFC_DIGITAL_FRAMING_ISO15693_T5T, 64 NFC_DIGITAL_FRAMING_ISO15693_T5T,
64 65
66 NFC_DIGITAL_FRAMING_NFCB,
67 NFC_DIGITAL_FRAMING_NFCB_T4T,
68
65 NFC_DIGITAL_FRAMING_LAST, 69 NFC_DIGITAL_FRAMING_LAST,
66}; 70};
67 71
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index 03c4650b548c..61286db54388 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -27,6 +27,7 @@ struct nfc_hci_dev;
27struct nfc_hci_ops { 27struct nfc_hci_ops {
28 int (*open) (struct nfc_hci_dev *hdev); 28 int (*open) (struct nfc_hci_dev *hdev);
29 void (*close) (struct nfc_hci_dev *hdev); 29 void (*close) (struct nfc_hci_dev *hdev);
30 int (*load_session) (struct nfc_hci_dev *hdev);
30 int (*hci_ready) (struct nfc_hci_dev *hdev); 31 int (*hci_ready) (struct nfc_hci_dev *hdev);
31 /* 32 /*
32 * xmit must always send the complete buffer before 33 * xmit must always send the complete buffer before
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 2e8b40c16274..6c583e244de2 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -264,4 +264,7 @@ int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type);
264int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); 264int nfc_remove_se(struct nfc_dev *dev, u32 se_idx);
265struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx); 265struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx);
266 266
267void nfc_send_to_raw_sock(struct nfc_dev *dev, struct sk_buff *skb,
268 u8 payload_type, u8 direction);
269
267#endif /* __NET_NFC_H */ 270#endif /* __NET_NFC_H */
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index a2441fb1428f..6da46dcf1049 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -136,7 +136,7 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
136 136
137int tcf_exts_validate(struct net *net, struct tcf_proto *tp, 137int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
138 struct nlattr **tb, struct nlattr *rate_tlv, 138 struct nlattr **tb, struct nlattr *rate_tlv,
139 struct tcf_exts *exts); 139 struct tcf_exts *exts, bool ovr);
140void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); 140void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts);
141void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, 141void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
142 struct tcf_exts *src); 142 struct tcf_exts *src);
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 891d80d2c4d2..ec030cd76616 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -96,7 +96,7 @@ struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
96 struct nlattr *tab); 96 struct nlattr *tab);
97void qdisc_put_rtab(struct qdisc_rate_table *tab); 97void qdisc_put_rtab(struct qdisc_rate_table *tab);
98void qdisc_put_stab(struct qdisc_size_table *tab); 98void qdisc_put_stab(struct qdisc_size_table *tab);
99void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); 99void qdisc_warn_nonwc(const char *txt, struct Qdisc *qdisc);
100int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q, 100int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,
101 struct net_device *dev, struct netdev_queue *txq, 101 struct net_device *dev, struct netdev_queue *txq,
102 spinlock_t *root_lock); 102 spinlock_t *root_lock);
diff --git a/include/net/protocol.h b/include/net/protocol.h
index a7e986b08147..d6fcc1fcdb5b 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -86,7 +86,6 @@ struct inet_protosw {
86 struct proto *prot; 86 struct proto *prot;
87 const struct proto_ops *ops; 87 const struct proto_ops *ops;
88 88
89 char no_check; /* checksum on rcv/xmit/none? */
90 unsigned char flags; /* See INET_PROTOSW_* below. */ 89 unsigned char flags; /* See INET_PROTOSW_* below. */
91}; 90};
92#define INET_PROTOSW_REUSE 0x01 /* Are ports automatically reusable? */ 91#define INET_PROTOSW_REUSE 0x01 /* Are ports automatically reusable? */
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index 75fc1f5a948d..259992444e80 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -131,6 +131,11 @@ struct regulatory_request {
131 * all country IE information processed by the regulatory core. This will 131 * all country IE information processed by the regulatory core. This will
132 * override %REGULATORY_COUNTRY_IE_FOLLOW_POWER as all country IEs will 132 * override %REGULATORY_COUNTRY_IE_FOLLOW_POWER as all country IEs will
133 * be ignored. 133 * be ignored.
134 * @REGULATORY_ENABLE_RELAX_NO_IR: for devices that wish to allow the
135 * NO_IR relaxation, which enables transmissions on channels on which
136 * otherwise initiating radiation is not allowed. This will enable the
137 * relaxations enabled under the CFG80211_REG_RELAX_NO_IR configuration
138 * option
134 */ 139 */
135enum ieee80211_regulatory_flags { 140enum ieee80211_regulatory_flags {
136 REGULATORY_CUSTOM_REG = BIT(0), 141 REGULATORY_CUSTOM_REG = BIT(0),
@@ -138,6 +143,7 @@ enum ieee80211_regulatory_flags {
138 REGULATORY_DISABLE_BEACON_HINTS = BIT(2), 143 REGULATORY_DISABLE_BEACON_HINTS = BIT(2),
139 REGULATORY_COUNTRY_IE_FOLLOW_POWER = BIT(3), 144 REGULATORY_COUNTRY_IE_FOLLOW_POWER = BIT(3),
140 REGULATORY_COUNTRY_IE_IGNORE = BIT(4), 145 REGULATORY_COUNTRY_IE_IGNORE = BIT(4),
146 REGULATORY_ENABLE_RELAX_NO_IR = BIT(5),
141}; 147};
142 148
143struct ieee80211_freq_range { 149struct ieee80211_freq_range {
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index d062f81c692f..624f9857c83e 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -199,7 +199,7 @@ struct tcf_proto_ops {
199 int (*change)(struct net *net, struct sk_buff *, 199 int (*change)(struct net *net, struct sk_buff *,
200 struct tcf_proto*, unsigned long, 200 struct tcf_proto*, unsigned long,
201 u32 handle, struct nlattr **, 201 u32 handle, struct nlattr **,
202 unsigned long *); 202 unsigned long *, bool);
203 int (*delete)(struct tcf_proto*, unsigned long); 203 int (*delete)(struct tcf_proto*, unsigned long);
204 void (*walk)(struct tcf_proto*, struct tcf_walker *arg); 204 void (*walk)(struct tcf_proto*, struct tcf_walker *arg);
205 205
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 0dfcc92600e8..f38588bf3462 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -838,10 +838,10 @@ struct sctp_transport {
838 unsigned long sackdelay; 838 unsigned long sackdelay;
839 __u32 sackfreq; 839 __u32 sackfreq;
840 840
841 /* When was the last time (in jiffies) that we heard from this 841 /* When was the last time that we heard from this transport? We use
842 * transport? We use this to pick new active and retran paths. 842 * this to pick new active and retran paths.
843 */ 843 */
844 unsigned long last_time_heard; 844 ktime_t last_time_heard;
845 845
846 /* Last time(in jiffies) when cwnd is reduced due to the congestion 846 /* Last time(in jiffies) when cwnd is reduced due to the congestion
847 * indication based on ECNE chunk. 847 * indication based on ECNE chunk.
diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h
index f257486f17be..3f36d45b714a 100644
--- a/include/net/secure_seq.h
+++ b/include/net/secure_seq.h
@@ -3,8 +3,6 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6__u32 secure_ip_id(__be32 daddr);
7__u32 secure_ipv6_id(const __be32 daddr[4]);
8u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); 6u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
9u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, 7u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
10 __be16 dport); 8 __be16 dport);
diff --git a/include/net/snmp.h b/include/net/snmp.h
index 71596261fa99..f1f27fdbb0d5 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -116,51 +116,49 @@ struct linux_xfrm_mib {
116 unsigned long mibs[LINUX_MIB_XFRMMAX]; 116 unsigned long mibs[LINUX_MIB_XFRMMAX];
117}; 117};
118 118
119#define SNMP_ARRAY_SZ 1
120
121#define DEFINE_SNMP_STAT(type, name) \ 119#define DEFINE_SNMP_STAT(type, name) \
122 __typeof__(type) __percpu *name[SNMP_ARRAY_SZ] 120 __typeof__(type) __percpu *name
123#define DEFINE_SNMP_STAT_ATOMIC(type, name) \ 121#define DEFINE_SNMP_STAT_ATOMIC(type, name) \
124 __typeof__(type) *name 122 __typeof__(type) *name
125#define DECLARE_SNMP_STAT(type, name) \ 123#define DECLARE_SNMP_STAT(type, name) \
126 extern __typeof__(type) __percpu *name[SNMP_ARRAY_SZ] 124 extern __typeof__(type) __percpu *name
127 125
128#define SNMP_INC_STATS_BH(mib, field) \ 126#define SNMP_INC_STATS_BH(mib, field) \
129 __this_cpu_inc(mib[0]->mibs[field]) 127 __this_cpu_inc(mib->mibs[field])
130 128
131#define SNMP_INC_STATS_USER(mib, field) \ 129#define SNMP_INC_STATS_USER(mib, field) \
132 this_cpu_inc(mib[0]->mibs[field]) 130 this_cpu_inc(mib->mibs[field])
133 131
134#define SNMP_INC_STATS_ATOMIC_LONG(mib, field) \ 132#define SNMP_INC_STATS_ATOMIC_LONG(mib, field) \
135 atomic_long_inc(&mib->mibs[field]) 133 atomic_long_inc(&mib->mibs[field])
136 134
137#define SNMP_INC_STATS(mib, field) \ 135#define SNMP_INC_STATS(mib, field) \
138 this_cpu_inc(mib[0]->mibs[field]) 136 this_cpu_inc(mib->mibs[field])
139 137
140#define SNMP_DEC_STATS(mib, field) \ 138#define SNMP_DEC_STATS(mib, field) \
141 this_cpu_dec(mib[0]->mibs[field]) 139 this_cpu_dec(mib->mibs[field])
142 140
143#define SNMP_ADD_STATS_BH(mib, field, addend) \ 141#define SNMP_ADD_STATS_BH(mib, field, addend) \
144 __this_cpu_add(mib[0]->mibs[field], addend) 142 __this_cpu_add(mib->mibs[field], addend)
145 143
146#define SNMP_ADD_STATS_USER(mib, field, addend) \ 144#define SNMP_ADD_STATS_USER(mib, field, addend) \
147 this_cpu_add(mib[0]->mibs[field], addend) 145 this_cpu_add(mib->mibs[field], addend)
148 146
149#define SNMP_ADD_STATS(mib, field, addend) \ 147#define SNMP_ADD_STATS(mib, field, addend) \
150 this_cpu_add(mib[0]->mibs[field], addend) 148 this_cpu_add(mib->mibs[field], addend)
151/* 149/*
152 * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr" 150 * Use "__typeof__(*mib) *ptr" instead of "__typeof__(mib) ptr"
153 * to make @ptr a non-percpu pointer. 151 * to make @ptr a non-percpu pointer.
154 */ 152 */
155#define SNMP_UPD_PO_STATS(mib, basefield, addend) \ 153#define SNMP_UPD_PO_STATS(mib, basefield, addend) \
156 do { \ 154 do { \
157 __typeof__(*mib[0]->mibs) *ptr = mib[0]->mibs; \ 155 __typeof__(*mib->mibs) *ptr = mib->mibs; \
158 this_cpu_inc(ptr[basefield##PKTS]); \ 156 this_cpu_inc(ptr[basefield##PKTS]); \
159 this_cpu_add(ptr[basefield##OCTETS], addend); \ 157 this_cpu_add(ptr[basefield##OCTETS], addend); \
160 } while (0) 158 } while (0)
161#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \ 159#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \
162 do { \ 160 do { \
163 __typeof__(*mib[0]->mibs) *ptr = mib[0]->mibs; \ 161 __typeof__(*mib->mibs) *ptr = mib->mibs; \
164 __this_cpu_inc(ptr[basefield##PKTS]); \ 162 __this_cpu_inc(ptr[basefield##PKTS]); \
165 __this_cpu_add(ptr[basefield##OCTETS], addend); \ 163 __this_cpu_add(ptr[basefield##OCTETS], addend); \
166 } while (0) 164 } while (0)
@@ -170,7 +168,7 @@ struct linux_xfrm_mib {
170 168
171#define SNMP_ADD_STATS64_BH(mib, field, addend) \ 169#define SNMP_ADD_STATS64_BH(mib, field, addend) \
172 do { \ 170 do { \
173 __typeof__(*mib[0]) *ptr = __this_cpu_ptr((mib)[0]); \ 171 __typeof__(*mib) *ptr = __this_cpu_ptr(mib); \
174 u64_stats_update_begin(&ptr->syncp); \ 172 u64_stats_update_begin(&ptr->syncp); \
175 ptr->mibs[field] += addend; \ 173 ptr->mibs[field] += addend; \
176 u64_stats_update_end(&ptr->syncp); \ 174 u64_stats_update_end(&ptr->syncp); \
@@ -191,8 +189,8 @@ struct linux_xfrm_mib {
191#define SNMP_INC_STATS64(mib, field) SNMP_ADD_STATS64(mib, field, 1) 189#define SNMP_INC_STATS64(mib, field) SNMP_ADD_STATS64(mib, field, 1)
192#define SNMP_UPD_PO_STATS64_BH(mib, basefield, addend) \ 190#define SNMP_UPD_PO_STATS64_BH(mib, basefield, addend) \
193 do { \ 191 do { \
194 __typeof__(*mib[0]) *ptr; \ 192 __typeof__(*mib) *ptr; \
195 ptr = __this_cpu_ptr((mib)[0]); \ 193 ptr = __this_cpu_ptr(mib); \
196 u64_stats_update_begin(&ptr->syncp); \ 194 u64_stats_update_begin(&ptr->syncp); \
197 ptr->mibs[basefield##PKTS]++; \ 195 ptr->mibs[basefield##PKTS]++; \
198 ptr->mibs[basefield##OCTETS] += addend; \ 196 ptr->mibs[basefield##OCTETS] += addend; \
diff --git a/include/net/sock.h b/include/net/sock.h
index 21569cf456ed..07b7fcd60d80 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -243,7 +243,8 @@ struct cg_proto;
243 * @sk_sndbuf: size of send buffer in bytes 243 * @sk_sndbuf: size of send buffer in bytes
244 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, 244 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE,
245 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings 245 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings
246 * @sk_no_check: %SO_NO_CHECK setting, whether or not checkup packets 246 * @sk_no_check_tx: %SO_NO_CHECK setting, set checksum in TX packets
247 * @sk_no_check_rx: allow zero checksum in RX packets
247 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) 248 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO)
248 * @sk_route_nocaps: forbidden route capabilities (e.g NETIF_F_GSO_MASK) 249 * @sk_route_nocaps: forbidden route capabilities (e.g NETIF_F_GSO_MASK)
249 * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) 250 * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4)
@@ -371,7 +372,8 @@ struct sock {
371 struct sk_buff_head sk_write_queue; 372 struct sk_buff_head sk_write_queue;
372 kmemcheck_bitfield_begin(flags); 373 kmemcheck_bitfield_begin(flags);
373 unsigned int sk_shutdown : 2, 374 unsigned int sk_shutdown : 2,
374 sk_no_check : 2, 375 sk_no_check_tx : 1,
376 sk_no_check_rx : 1,
375 sk_userlocks : 4, 377 sk_userlocks : 4,
376 sk_protocol : 8, 378 sk_protocol : 8,
377 sk_type : 16; 379 sk_type : 16;
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 87d877408188..7286db80e8b8 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -220,8 +220,6 @@ void tcp_time_wait(struct sock *sk, int state, int timeo);
220#define TFO_SERVER_ENABLE 2 220#define TFO_SERVER_ENABLE 2
221#define TFO_CLIENT_NO_COOKIE 4 /* Data in SYN w/o cookie option */ 221#define TFO_CLIENT_NO_COOKIE 4 /* Data in SYN w/o cookie option */
222 222
223/* Process SYN data but skip cookie validation */
224#define TFO_SERVER_COOKIE_NOT_CHKED 0x100
225/* Accept SYN data w/o any cookie option */ 223/* Accept SYN data w/o any cookie option */
226#define TFO_SERVER_COOKIE_NOT_REQD 0x200 224#define TFO_SERVER_COOKIE_NOT_REQD 0x200
227 225
@@ -230,10 +228,6 @@ void tcp_time_wait(struct sock *sk, int state, int timeo);
230 */ 228 */
231#define TFO_SERVER_WO_SOCKOPT1 0x400 229#define TFO_SERVER_WO_SOCKOPT1 0x400
232#define TFO_SERVER_WO_SOCKOPT2 0x800 230#define TFO_SERVER_WO_SOCKOPT2 0x800
233/* Always create TFO child sockets on a TFO listener even when
234 * cookie/data not present. (For testing purpose!)
235 */
236#define TFO_SERVER_ALWAYS 0x1000
237 231
238extern struct inet_timewait_death_row tcp_death_row; 232extern struct inet_timewait_death_row tcp_death_row;
239 233
@@ -541,7 +535,7 @@ void tcp_retransmit_timer(struct sock *sk);
541void tcp_xmit_retransmit_queue(struct sock *); 535void tcp_xmit_retransmit_queue(struct sock *);
542void tcp_simple_retransmit(struct sock *); 536void tcp_simple_retransmit(struct sock *);
543int tcp_trim_head(struct sock *, struct sk_buff *, u32); 537int tcp_trim_head(struct sock *, struct sk_buff *, u32);
544int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int); 538int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int, gfp_t);
545 539
546void tcp_send_probe0(struct sock *); 540void tcp_send_probe0(struct sock *);
547void tcp_send_partial(struct sock *); 541void tcp_send_partial(struct sock *);
@@ -558,7 +552,6 @@ void tcp_send_loss_probe(struct sock *sk);
558bool tcp_schedule_loss_probe(struct sock *sk); 552bool tcp_schedule_loss_probe(struct sock *sk);
559 553
560/* tcp_input.c */ 554/* tcp_input.c */
561void tcp_cwnd_application_limited(struct sock *sk);
562void tcp_resume_early_retransmit(struct sock *sk); 555void tcp_resume_early_retransmit(struct sock *sk);
563void tcp_rearm_rto(struct sock *sk); 556void tcp_rearm_rto(struct sock *sk);
564void tcp_reset(struct sock *sk); 557void tcp_reset(struct sock *sk);
@@ -797,7 +790,7 @@ struct tcp_congestion_ops {
797 /* return slow start threshold (required) */ 790 /* return slow start threshold (required) */
798 u32 (*ssthresh)(struct sock *sk); 791 u32 (*ssthresh)(struct sock *sk);
799 /* do new cwnd calculation (required) */ 792 /* do new cwnd calculation (required) */
800 void (*cong_avoid)(struct sock *sk, u32 ack, u32 acked, u32 in_flight); 793 void (*cong_avoid)(struct sock *sk, u32 ack, u32 acked);
801 /* call before changing ca_state (optional) */ 794 /* call before changing ca_state (optional) */
802 void (*set_state)(struct sock *sk, u8 new_state); 795 void (*set_state)(struct sock *sk, u8 new_state);
803 /* call when cwnd event occurs (optional) */ 796 /* call when cwnd event occurs (optional) */
@@ -829,7 +822,7 @@ void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w);
829 822
830extern struct tcp_congestion_ops tcp_init_congestion_ops; 823extern struct tcp_congestion_ops tcp_init_congestion_ops;
831u32 tcp_reno_ssthresh(struct sock *sk); 824u32 tcp_reno_ssthresh(struct sock *sk);
832void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 acked, u32 in_flight); 825void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 acked);
833extern struct tcp_congestion_ops tcp_reno; 826extern struct tcp_congestion_ops tcp_reno;
834 827
835static inline void tcp_set_ca_state(struct sock *sk, const u8 ca_state) 828static inline void tcp_set_ca_state(struct sock *sk, const u8 ca_state)
@@ -975,7 +968,30 @@ static inline u32 tcp_wnd_end(const struct tcp_sock *tp)
975{ 968{
976 return tp->snd_una + tp->snd_wnd; 969 return tp->snd_una + tp->snd_wnd;
977} 970}
978bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight); 971
972/* We follow the spirit of RFC2861 to validate cwnd but implement a more
973 * flexible approach. The RFC suggests cwnd should not be raised unless
974 * it was fully used previously. And that's exactly what we do in
975 * congestion avoidance mode. But in slow start we allow cwnd to grow
976 * as long as the application has used half the cwnd.
977 * Example :
978 * cwnd is 10 (IW10), but application sends 9 frames.
979 * We allow cwnd to reach 18 when all frames are ACKed.
980 * This check is safe because it's as aggressive as slow start which already
981 * risks 100% overshoot. The advantage is that we discourage application to
982 * either send more filler packets or data to artificially blow up the cwnd
983 * usage, and allow application-limited process to probe bw more aggressively.
984 */
985static inline bool tcp_is_cwnd_limited(const struct sock *sk)
986{
987 const struct tcp_sock *tp = tcp_sk(sk);
988
989 /* If in slow start, ensure cwnd grows to twice what was ACKed. */
990 if (tp->snd_cwnd <= tp->snd_ssthresh)
991 return tp->snd_cwnd < 2 * tp->max_packets_out;
992
993 return tp->is_cwnd_limited;
994}
979 995
980static inline void tcp_check_probe_timer(struct sock *sk) 996static inline void tcp_check_probe_timer(struct sock *sk)
981{ 997{
@@ -1103,6 +1119,9 @@ static inline void tcp_openreq_init(struct request_sock *req,
1103 ireq->ir_num = ntohs(tcp_hdr(skb)->dest); 1119 ireq->ir_num = ntohs(tcp_hdr(skb)->dest);
1104} 1120}
1105 1121
1122extern void tcp_openreq_init_rwin(struct request_sock *req,
1123 struct sock *sk, struct dst_entry *dst);
1124
1106void tcp_enter_memory_pressure(struct sock *sk); 1125void tcp_enter_memory_pressure(struct sock *sk);
1107 1126
1108static inline int keepalive_intvl_when(const struct tcp_sock *tp) 1127static inline int keepalive_intvl_when(const struct tcp_sock *tp)
@@ -1312,8 +1331,10 @@ void tcp_free_fastopen_req(struct tcp_sock *tp);
1312 1331
1313extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; 1332extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
1314int tcp_fastopen_reset_cipher(void *key, unsigned int len); 1333int tcp_fastopen_reset_cipher(void *key, unsigned int len);
1315void tcp_fastopen_cookie_gen(__be32 src, __be32 dst, 1334bool tcp_try_fastopen(struct sock *sk, struct sk_buff *skb,
1316 struct tcp_fastopen_cookie *foc); 1335 struct request_sock *req,
1336 struct tcp_fastopen_cookie *foc,
1337 struct dst_entry *dst);
1317void tcp_fastopen_init_key_once(bool publish); 1338void tcp_fastopen_init_key_once(bool publish);
1318#define TCP_FASTOPEN_KEY_LENGTH 16 1339#define TCP_FASTOPEN_KEY_LENGTH 16
1319 1340
diff --git a/include/net/tso.h b/include/net/tso.h
new file mode 100644
index 000000000000..47e5444f7d15
--- /dev/null
+++ b/include/net/tso.h
@@ -0,0 +1,20 @@
1#ifndef _TSO_H
2#define _TSO_H
3
4#include <net/ip.h>
5
6struct tso_t {
7 int next_frag_idx;
8 void *data;
9 size_t size;
10 u16 ip_id;
11 u32 tcp_seq;
12};
13
14int tso_count_descs(struct sk_buff *skb);
15void tso_build_hdr(struct sk_buff *skb, char *hdr, struct tso_t *tso,
16 int size, bool is_last);
17void tso_build_data(struct sk_buff *skb, struct tso_t *tso, int size);
18void tso_start(struct sk_buff *skb, struct tso_t *tso);
19
20#endif /* _TSO_H */
diff --git a/include/net/udp.h b/include/net/udp.h
index a24f0f3e107f..2ecfc6e15609 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -95,15 +95,6 @@ static inline struct udp_hslot *udp_hashslot2(struct udp_table *table,
95 return &table->hash2[hash & table->mask]; 95 return &table->hash2[hash & table->mask];
96} 96}
97 97
98/* Note: this must match 'valbool' in sock_setsockopt */
99#define UDP_CSUM_NOXMIT 1
100
101/* Used by SunRPC/xprt layer. */
102#define UDP_CSUM_NORCV 2
103
104/* Default, as per the RFC, is to always do csums. */
105#define UDP_CSUM_DEFAULT 0
106
107extern struct proto udp_prot; 98extern struct proto udp_prot;
108 99
109extern atomic_long_t udp_memory_allocated; 100extern atomic_long_t udp_memory_allocated;
@@ -156,6 +147,15 @@ static inline __wsum udp_csum(struct sk_buff *skb)
156 return csum; 147 return csum;
157} 148}
158 149
150static inline __sum16 udp_v4_check(int len, __be32 saddr,
151 __be32 daddr, __wsum base)
152{
153 return csum_tcpudp_magic(saddr, daddr, len, IPPROTO_UDP, base);
154}
155
156void udp_set_csum(bool nocheck, struct sk_buff *skb,
157 __be32 saddr, __be32 daddr, int len);
158
159/* hash routines shared between UDPv4/6 and UDP-Litev4/6 */ 159/* hash routines shared between UDPv4/6 and UDP-Litev4/6 */
160static inline void udp_lib_hash(struct sock *sk) 160static inline void udp_lib_hash(struct sock *sk)
161{ 161{
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 5deef1ae78c9..12196ce661d9 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -24,16 +24,26 @@ struct vxlan_sock {
24 struct udp_offload udp_offloads; 24 struct udp_offload udp_offloads;
25}; 25};
26 26
27#define VXLAN_F_LEARN 0x01
28#define VXLAN_F_PROXY 0x02
29#define VXLAN_F_RSC 0x04
30#define VXLAN_F_L2MISS 0x08
31#define VXLAN_F_L3MISS 0x10
32#define VXLAN_F_IPV6 0x20
33#define VXLAN_F_UDP_CSUM 0x40
34#define VXLAN_F_UDP_ZERO_CSUM6_TX 0x80
35#define VXLAN_F_UDP_ZERO_CSUM6_RX 0x100
36
27struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, 37struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
28 vxlan_rcv_t *rcv, void *data, 38 vxlan_rcv_t *rcv, void *data,
29 bool no_share, bool ipv6); 39 bool no_share, u32 flags);
30 40
31void vxlan_sock_release(struct vxlan_sock *vs); 41void vxlan_sock_release(struct vxlan_sock *vs);
32 42
33int vxlan_xmit_skb(struct vxlan_sock *vs, 43int vxlan_xmit_skb(struct vxlan_sock *vs,
34 struct rtable *rt, struct sk_buff *skb, 44 struct rtable *rt, struct sk_buff *skb,
35 __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, 45 __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df,
36 __be16 src_port, __be16 dst_port, __be32 vni); 46 __be16 src_port, __be16 dst_port, __be32 vni, bool xnet);
37 47
38__be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb); 48__be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb);
39 49
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 116e9c7e19cb..721e9c3b11bd 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -691,13 +691,6 @@ struct xfrm_spi_skb_cb {
691 691
692#define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0])) 692#define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0]))
693 693
694/* Audit Information */
695struct xfrm_audit {
696 u32 secid;
697 kuid_t loginuid;
698 unsigned int sessionid;
699};
700
701#ifdef CONFIG_AUDITSYSCALL 694#ifdef CONFIG_AUDITSYSCALL
702static inline struct audit_buffer *xfrm_audit_start(const char *op) 695static inline struct audit_buffer *xfrm_audit_start(const char *op)
703{ 696{
@@ -713,30 +706,24 @@ static inline struct audit_buffer *xfrm_audit_start(const char *op)
713 return audit_buf; 706 return audit_buf;
714} 707}
715 708
716static inline void xfrm_audit_helper_usrinfo(kuid_t auid, unsigned int ses, u32 secid, 709static inline void xfrm_audit_helper_usrinfo(bool task_valid,
717 struct audit_buffer *audit_buf) 710 struct audit_buffer *audit_buf)
718{ 711{
719 char *secctx; 712 const unsigned int auid = from_kuid(&init_user_ns, task_valid ?
720 u32 secctx_len; 713 audit_get_loginuid(current) :
721 714 INVALID_UID);
722 audit_log_format(audit_buf, " auid=%u ses=%u", 715 const unsigned int ses = task_valid ? audit_get_sessionid(current) :
723 from_kuid(&init_user_ns, auid), ses); 716 (unsigned int) -1;
724 if (secid != 0 && 717
725 security_secid_to_secctx(secid, &secctx, &secctx_len) == 0) { 718 audit_log_format(audit_buf, " auid=%u ses=%u", auid, ses);
726 audit_log_format(audit_buf, " subj=%s", secctx); 719 audit_log_task_context(audit_buf);
727 security_release_secctx(secctx, secctx_len); 720}
728 } else 721
729 audit_log_task_context(audit_buf); 722void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, bool task_valid);
730} 723void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result,
731 724 bool task_valid);
732void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid, 725void xfrm_audit_state_add(struct xfrm_state *x, int result, bool task_valid);
733 unsigned int ses, u32 secid); 726void xfrm_audit_state_delete(struct xfrm_state *x, int result, bool task_valid);
734void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid,
735 unsigned int ses, u32 secid);
736void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid,
737 unsigned int ses, u32 secid);
738void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid,
739 unsigned int ses, u32 secid);
740void xfrm_audit_state_replay_overflow(struct xfrm_state *x, 727void xfrm_audit_state_replay_overflow(struct xfrm_state *x,
741 struct sk_buff *skb); 728 struct sk_buff *skb);
742void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb, 729void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb,
@@ -749,22 +736,22 @@ void xfrm_audit_state_icvfail(struct xfrm_state *x, struct sk_buff *skb,
749#else 736#else
750 737
751static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, 738static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result,
752 kuid_t auid, unsigned int ses, u32 secid) 739 bool task_valid)
753{ 740{
754} 741}
755 742
756static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, 743static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result,
757 kuid_t auid, unsigned int ses, u32 secid) 744 bool task_valid)
758{ 745{
759} 746}
760 747
761static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, 748static inline void xfrm_audit_state_add(struct xfrm_state *x, int result,
762 kuid_t auid, unsigned int ses, u32 secid) 749 bool task_valid)
763{ 750{
764} 751}
765 752
766static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, 753static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result,
767 kuid_t auid, unsigned int ses, u32 secid) 754 bool task_valid)
768{ 755{
769} 756}
770 757
@@ -1508,7 +1495,7 @@ struct xfrmk_spdinfo {
1508 1495
1509struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 mark, u32 seq); 1496struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 mark, u32 seq);
1510int xfrm_state_delete(struct xfrm_state *x); 1497int xfrm_state_delete(struct xfrm_state *x);
1511int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info); 1498int xfrm_state_flush(struct net *net, u8 proto, bool task_valid);
1512void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si); 1499void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si);
1513void xfrm_spd_getinfo(struct net *net, struct xfrmk_spdinfo *si); 1500void xfrm_spd_getinfo(struct net *net, struct xfrmk_spdinfo *si);
1514u32 xfrm_replay_seqhi(struct xfrm_state *x, __be32 net_seq); 1501u32 xfrm_replay_seqhi(struct xfrm_state *x, __be32 net_seq);
@@ -1603,7 +1590,7 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark,
1603 int *err); 1590 int *err);
1604struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, 1591struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir,
1605 u32 id, int delete, int *err); 1592 u32 id, int delete, int *err);
1606int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); 1593int xfrm_policy_flush(struct net *net, u8 type, bool task_valid);
1607u32 xfrm_get_acqseq(void); 1594u32 xfrm_get_acqseq(void);
1608int verify_spi_info(u8 proto, u32 min, u32 max); 1595int verify_spi_info(u8 proto, u32 min, u32 max);
1609int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 1596int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index 4c31a366be16..cf6714752b69 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -385,6 +385,14 @@ enum {
385 */ 385 */
386#define AUDIT_MESSAGE_TEXT_MAX 8560 386#define AUDIT_MESSAGE_TEXT_MAX 8560
387 387
388/* Multicast Netlink socket groups (default up to 32) */
389enum audit_nlgrps {
390 AUDIT_NLGRP_NONE, /* Group 0 not used */
391 AUDIT_NLGRP_READLOG, /* "best effort" read only socket */
392 __AUDIT_NLGRP_MAX
393};
394#define AUDIT_NLGRP_MAX (__AUDIT_NLGRP_MAX - 1)
395
388struct audit_status { 396struct audit_status {
389 __u32 mask; /* Bit mask for valid entries */ 397 __u32 mask; /* Bit mask for valid entries */
390 __u32 enabled; /* 1 = enabled, 0 = disabled */ 398 __u32 enabled; /* 1 = enabled, 0 = disabled */
diff --git a/include/uapi/linux/can.h b/include/uapi/linux/can.h
index 5d9d1d140718..41892f720057 100644
--- a/include/uapi/linux/can.h
+++ b/include/uapi/linux/can.h
@@ -42,8 +42,8 @@
42 * DAMAGE. 42 * DAMAGE.
43 */ 43 */
44 44
45#ifndef CAN_H 45#ifndef _UAPI_CAN_H
46#define CAN_H 46#define _UAPI_CAN_H
47 47
48#include <linux/types.h> 48#include <linux/types.h>
49#include <linux/socket.h> 49#include <linux/socket.h>
@@ -191,4 +191,4 @@ struct can_filter {
191 191
192#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */ 192#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
193 193
194#endif /* CAN_H */ 194#endif /* !_UAPI_CAN_H */
diff --git a/include/uapi/linux/can/bcm.h b/include/uapi/linux/can/bcm.h
index 382251a1d214..89ddb9dc9bdf 100644
--- a/include/uapi/linux/can/bcm.h
+++ b/include/uapi/linux/can/bcm.h
@@ -41,8 +41,8 @@
41 * DAMAGE. 41 * DAMAGE.
42 */ 42 */
43 43
44#ifndef CAN_BCM_H 44#ifndef _UAPI_CAN_BCM_H
45#define CAN_BCM_H 45#define _UAPI_CAN_BCM_H
46 46
47#include <linux/types.h> 47#include <linux/types.h>
48#include <linux/can.h> 48#include <linux/can.h>
@@ -95,4 +95,4 @@ enum {
95#define TX_RESET_MULTI_IDX 0x0200 95#define TX_RESET_MULTI_IDX 0x0200
96#define RX_RTR_FRAME 0x0400 96#define RX_RTR_FRAME 0x0400
97 97
98#endif /* CAN_BCM_H */ 98#endif /* !_UAPI_CAN_BCM_H */
diff --git a/include/uapi/linux/can/error.h b/include/uapi/linux/can/error.h
index b63204545320..c247446ab25a 100644
--- a/include/uapi/linux/can/error.h
+++ b/include/uapi/linux/can/error.h
@@ -41,8 +41,8 @@
41 * DAMAGE. 41 * DAMAGE.
42 */ 42 */
43 43
44#ifndef CAN_ERROR_H 44#ifndef _UAPI_CAN_ERROR_H
45#define CAN_ERROR_H 45#define _UAPI_CAN_ERROR_H
46 46
47#define CAN_ERR_DLC 8 /* dlc for error message frames */ 47#define CAN_ERR_DLC 8 /* dlc for error message frames */
48 48
@@ -120,4 +120,4 @@
120 120
121/* controller specific additional information / data[5..7] */ 121/* controller specific additional information / data[5..7] */
122 122
123#endif /* CAN_ERROR_H */ 123#endif /* _UAPI_CAN_ERROR_H */
diff --git a/include/uapi/linux/can/gw.h b/include/uapi/linux/can/gw.h
index 844c8964bdfe..3e6184cf2f6d 100644
--- a/include/uapi/linux/can/gw.h
+++ b/include/uapi/linux/can/gw.h
@@ -41,8 +41,8 @@
41 * DAMAGE. 41 * DAMAGE.
42 */ 42 */
43 43
44#ifndef CAN_GW_H 44#ifndef _UAPI_CAN_GW_H
45#define CAN_GW_H 45#define _UAPI_CAN_GW_H
46 46
47#include <linux/types.h> 47#include <linux/types.h>
48#include <linux/can.h> 48#include <linux/can.h>
@@ -200,4 +200,4 @@ enum {
200 * Beware of sending unpacked or aligned structs! 200 * Beware of sending unpacked or aligned structs!
201 */ 201 */
202 202
203#endif 203#endif /* !_UAPI_CAN_GW_H */
diff --git a/include/uapi/linux/can/netlink.h b/include/uapi/linux/can/netlink.h
index 7e2e1863db16..813d11f54977 100644
--- a/include/uapi/linux/can/netlink.h
+++ b/include/uapi/linux/can/netlink.h
@@ -15,8 +15,8 @@
15 * GNU General Public License for more details. 15 * GNU General Public License for more details.
16 */ 16 */
17 17
18#ifndef CAN_NETLINK_H 18#ifndef _UAPI_CAN_NETLINK_H
19#define CAN_NETLINK_H 19#define _UAPI_CAN_NETLINK_H
20 20
21#include <linux/types.h> 21#include <linux/types.h>
22 22
@@ -130,4 +130,4 @@ enum {
130 130
131#define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1) 131#define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1)
132 132
133#endif /* CAN_NETLINK_H */ 133#endif /* !_UAPI_CAN_NETLINK_H */
diff --git a/include/uapi/linux/can/raw.h b/include/uapi/linux/can/raw.h
index c7d8c334e0ce..78ec76fd89a6 100644
--- a/include/uapi/linux/can/raw.h
+++ b/include/uapi/linux/can/raw.h
@@ -42,8 +42,8 @@
42 * DAMAGE. 42 * DAMAGE.
43 */ 43 */
44 44
45#ifndef CAN_RAW_H 45#ifndef _UAPI_CAN_RAW_H
46#define CAN_RAW_H 46#define _UAPI_CAN_RAW_H
47 47
48#include <linux/can.h> 48#include <linux/can.h>
49 49
@@ -59,4 +59,4 @@ enum {
59 CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */ 59 CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */
60}; 60};
61 61
62#endif 62#endif /* !_UAPI_CAN_RAW_H */
diff --git a/include/uapi/linux/capability.h b/include/uapi/linux/capability.h
index 154dd6d3c8fe..12c37a197d24 100644
--- a/include/uapi/linux/capability.h
+++ b/include/uapi/linux/capability.h
@@ -347,7 +347,12 @@ struct vfs_cap_data {
347 347
348#define CAP_BLOCK_SUSPEND 36 348#define CAP_BLOCK_SUSPEND 36
349 349
350#define CAP_LAST_CAP CAP_BLOCK_SUSPEND 350/* Allow reading the audit log via multicast netlink socket */
351
352#define CAP_AUDIT_READ 37
353
354
355#define CAP_LAST_CAP CAP_AUDIT_READ
351 356
352#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) 357#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
353 358
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index fd161e91b6d7..e3c7a719c76b 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -847,6 +847,38 @@ struct ethtool_rxfh_indir {
847}; 847};
848 848
849/** 849/**
850 * struct ethtool_rxfh - command to get/set RX flow hash indir or/and hash key.
851 * @cmd: Specific command number - %ETHTOOL_GRSSH or %ETHTOOL_SRSSH
852 * @rss_context: RSS context identifier.
853 * @indir_size: On entry, the array size of the user buffer for the
854 * indirection table, which may be zero, or (for %ETHTOOL_SRSSH),
855 * %ETH_RXFH_INDIR_NO_CHANGE. On return from %ETHTOOL_GRSSH,
856 * the array size of the hardware indirection table.
857 * @key_size: On entry, the array size of the user buffer for the hash key,
858 * which may be zero. On return from %ETHTOOL_GRSSH, the size of the
859 * hardware hash key.
860 * @rsvd: Reserved for future extensions.
861 * @rss_config: RX ring/queue index for each hash value i.e., indirection table
862 * of @indir_size __u32 elements, followed by hash key of @key_size
863 * bytes.
864 *
865 * For %ETHTOOL_GRSSH, a @indir_size and key_size of zero means that only the
866 * size should be returned. For %ETHTOOL_SRSSH, an @indir_size of
867 * %ETH_RXFH_INDIR_NO_CHANGE means that indir table setting is not requested
868 * and a @indir_size of zero means the indir table should be reset to default
869 * values.
870 */
871struct ethtool_rxfh {
872 __u32 cmd;
873 __u32 rss_context;
874 __u32 indir_size;
875 __u32 key_size;
876 __u32 rsvd[2];
877 __u32 rss_config[0];
878};
879#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff
880
881/**
850 * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter 882 * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
851 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW 883 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
852 * @h_u: Flow field values to match (dependent on @flow_type) 884 * @h_u: Flow field values to match (dependent on @flow_type)
@@ -1118,6 +1150,9 @@ enum ethtool_sfeatures_retval_bits {
1118#define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */ 1150#define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */
1119#define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */ 1151#define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */
1120 1152
1153#define ETHTOOL_GRSSH 0x00000046 /* Get RX flow hash configuration */
1154#define ETHTOOL_SRSSH 0x00000047 /* Set RX flow hash configuration */
1155
1121/* compatibility with older code */ 1156/* compatibility with older code */
1122#define SPARC_ETH_GSET ETHTOOL_GSET 1157#define SPARC_ETH_GSET ETHTOOL_GSET
1123#define SPARC_ETH_SSET ETHTOOL_SSET 1158#define SPARC_ETH_SSET ETHTOOL_SSET
diff --git a/include/uapi/linux/filter.h b/include/uapi/linux/filter.h
index 8eb9ccaa5b48..253b4d42cf2b 100644
--- a/include/uapi/linux/filter.h
+++ b/include/uapi/linux/filter.h
@@ -130,7 +130,8 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
130#define SKF_AD_VLAN_TAG 44 130#define SKF_AD_VLAN_TAG 44
131#define SKF_AD_VLAN_TAG_PRESENT 48 131#define SKF_AD_VLAN_TAG_PRESENT 48
132#define SKF_AD_PAY_OFFSET 52 132#define SKF_AD_PAY_OFFSET 52
133#define SKF_AD_MAX 56 133#define SKF_AD_RANDOM 56
134#define SKF_AD_MAX 60
134#define SKF_NET_OFF (-0x100000) 135#define SKF_NET_OFF (-0x100000)
135#define SKF_LL_OFF (-0x200000) 136#define SKF_LL_OFF (-0x200000)
136 137
diff --git a/include/uapi/linux/if_fddi.h b/include/uapi/linux/if_fddi.h
index 0d36909c3aef..1086cd9f6754 100644
--- a/include/uapi/linux/if_fddi.h
+++ b/include/uapi/linux/if_fddi.h
@@ -30,74 +30,76 @@
30 * Define max and min legal sizes. The frame sizes do not include 30 * Define max and min legal sizes. The frame sizes do not include
31 * 4 byte FCS/CRC (frame check sequence). 31 * 4 byte FCS/CRC (frame check sequence).
32 */ 32 */
33#define FDDI_K_ALEN 6 /* Octets in one FDDI address */ 33#define FDDI_K_ALEN 6 /* Octets in one FDDI address */
34#define FDDI_K_8022_HLEN 16 /* Total octets in 802.2 header */ 34#define FDDI_K_8022_HLEN 16 /* Total octets in 802.2 header */
35#define FDDI_K_SNAP_HLEN 21 /* Total octets in 802.2 SNAP header */ 35#define FDDI_K_SNAP_HLEN 21 /* Total octets in 802.2 SNAP header */
36#define FDDI_K_8022_ZLEN 16 /* Min octets in 802.2 frame sans FCS */ 36#define FDDI_K_8022_ZLEN 16 /* Min octets in 802.2 frame sans
37#define FDDI_K_SNAP_ZLEN 21 /* Min octets in 802.2 SNAP frame sans FCS */ 37 FCS */
38#define FDDI_K_SNAP_ZLEN 21 /* Min octets in 802.2 SNAP frame sans
39 FCS */
38#define FDDI_K_8022_DLEN 4475 /* Max octets in 802.2 payload */ 40#define FDDI_K_8022_DLEN 4475 /* Max octets in 802.2 payload */
39#define FDDI_K_SNAP_DLEN 4470 /* Max octets in 802.2 SNAP payload */ 41#define FDDI_K_SNAP_DLEN 4470 /* Max octets in 802.2 SNAP payload */
40#define FDDI_K_LLC_ZLEN 13 /* Min octets in LLC frame sans FCS */ 42#define FDDI_K_LLC_ZLEN 13 /* Min octets in LLC frame sans FCS */
41#define FDDI_K_LLC_LEN 4491 /* Max octets in LLC frame sans FCS */ 43#define FDDI_K_LLC_LEN 4491 /* Max octets in LLC frame sans FCS */
44#define FDDI_K_OUI_LEN 3 /* Octets in OUI in 802.2 SNAP
45 header */
42 46
43/* Define FDDI Frame Control (FC) Byte values */ 47/* Define FDDI Frame Control (FC) Byte values */
44#define FDDI_FC_K_VOID 0x00 48#define FDDI_FC_K_VOID 0x00
45#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80 49#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80
46#define FDDI_FC_K_RESTRICTED_TOKEN 0xC0 50#define FDDI_FC_K_RESTRICTED_TOKEN 0xC0
47#define FDDI_FC_K_SMT_MIN 0x41 51#define FDDI_FC_K_SMT_MIN 0x41
48#define FDDI_FC_K_SMT_MAX 0x4F 52#define FDDI_FC_K_SMT_MAX 0x4F
49#define FDDI_FC_K_MAC_MIN 0xC1 53#define FDDI_FC_K_MAC_MIN 0xC1
50#define FDDI_FC_K_MAC_MAX 0xCF 54#define FDDI_FC_K_MAC_MAX 0xCF
51#define FDDI_FC_K_ASYNC_LLC_MIN 0x50 55#define FDDI_FC_K_ASYNC_LLC_MIN 0x50
52#define FDDI_FC_K_ASYNC_LLC_DEF 0x54 56#define FDDI_FC_K_ASYNC_LLC_DEF 0x54
53#define FDDI_FC_K_ASYNC_LLC_MAX 0x5F 57#define FDDI_FC_K_ASYNC_LLC_MAX 0x5F
54#define FDDI_FC_K_SYNC_LLC_MIN 0xD0 58#define FDDI_FC_K_SYNC_LLC_MIN 0xD0
55#define FDDI_FC_K_SYNC_LLC_MAX 0xD7 59#define FDDI_FC_K_SYNC_LLC_MAX 0xD7
56#define FDDI_FC_K_IMPLEMENTOR_MIN 0x60 60#define FDDI_FC_K_IMPLEMENTOR_MIN 0x60
57#define FDDI_FC_K_IMPLEMENTOR_MAX 0x6F 61#define FDDI_FC_K_IMPLEMENTOR_MAX 0x6F
58#define FDDI_FC_K_RESERVED_MIN 0x70 62#define FDDI_FC_K_RESERVED_MIN 0x70
59#define FDDI_FC_K_RESERVED_MAX 0x7F 63#define FDDI_FC_K_RESERVED_MAX 0x7F
60 64
61/* Define LLC and SNAP constants */ 65/* Define LLC and SNAP constants */
62#define FDDI_EXTENDED_SAP 0xAA 66#define FDDI_EXTENDED_SAP 0xAA
63#define FDDI_UI_CMD 0x03 67#define FDDI_UI_CMD 0x03
64 68
65/* Define 802.2 Type 1 header */ 69/* Define 802.2 Type 1 header */
66struct fddi_8022_1_hdr { 70struct fddi_8022_1_hdr {
67 __u8 dsap; /* destination service access point */ 71 __u8 dsap; /* destination service access point */
68 __u8 ssap; /* source service access point */ 72 __u8 ssap; /* source service access point */
69 __u8 ctrl; /* control byte #1 */ 73 __u8 ctrl; /* control byte #1 */
70} __attribute__((packed)); 74} __attribute__((packed));
71 75
72/* Define 802.2 Type 2 header */ 76/* Define 802.2 Type 2 header */
73struct fddi_8022_2_hdr { 77struct fddi_8022_2_hdr {
74 __u8 dsap; /* destination service access point */ 78 __u8 dsap; /* destination service access point */
75 __u8 ssap; /* source service access point */ 79 __u8 ssap; /* source service access point */
76 __u8 ctrl_1; /* control byte #1 */ 80 __u8 ctrl_1; /* control byte #1 */
77 __u8 ctrl_2; /* control byte #2 */ 81 __u8 ctrl_2; /* control byte #2 */
78} __attribute__((packed)); 82} __attribute__((packed));
79 83
80/* Define 802.2 SNAP header */ 84/* Define 802.2 SNAP header */
81#define FDDI_K_OUI_LEN 3
82struct fddi_snap_hdr { 85struct fddi_snap_hdr {
83 __u8 dsap; /* always 0xAA */ 86 __u8 dsap; /* always 0xAA */
84 __u8 ssap; /* always 0xAA */ 87 __u8 ssap; /* always 0xAA */
85 __u8 ctrl; /* always 0x03 */ 88 __u8 ctrl; /* always 0x03 */
86 __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ 89 __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */
87 __be16 ethertype; /* packet type ID field */ 90 __be16 ethertype; /* packet type ID field */
88} __attribute__((packed)); 91} __attribute__((packed));
89 92
90/* Define FDDI LLC frame header */ 93/* Define FDDI LLC frame header */
91struct fddihdr { 94struct fddihdr {
92 __u8 fc; /* frame control */ 95 __u8 fc; /* frame control */
93 __u8 daddr[FDDI_K_ALEN]; /* destination address */ 96 __u8 daddr[FDDI_K_ALEN]; /* destination address */
94 __u8 saddr[FDDI_K_ALEN]; /* source address */ 97 __u8 saddr[FDDI_K_ALEN]; /* source address */
95 union 98 union {
96 { 99 struct fddi_8022_1_hdr llc_8022_1;
97 struct fddi_8022_1_hdr llc_8022_1; 100 struct fddi_8022_2_hdr llc_8022_2;
98 struct fddi_8022_2_hdr llc_8022_2; 101 struct fddi_snap_hdr llc_snap;
99 struct fddi_snap_hdr llc_snap; 102 } hdr;
100 } hdr;
101} __attribute__((packed)); 103} __attribute__((packed));
102 104
103 105
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 9a7f7ace6649..b38534895db5 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -319,6 +319,9 @@ enum {
319 IFLA_VXLAN_PORT, /* destination port */ 319 IFLA_VXLAN_PORT, /* destination port */
320 IFLA_VXLAN_GROUP6, 320 IFLA_VXLAN_GROUP6,
321 IFLA_VXLAN_LOCAL6, 321 IFLA_VXLAN_LOCAL6,
322 IFLA_VXLAN_UDP_CSUM,
323 IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
324 IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
322 __IFLA_VXLAN_MAX 325 __IFLA_VXLAN_MAX
323}; 326};
324#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) 327#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
@@ -399,9 +402,10 @@ enum {
399 IFLA_VF_UNSPEC, 402 IFLA_VF_UNSPEC,
400 IFLA_VF_MAC, /* Hardware queue specific attributes */ 403 IFLA_VF_MAC, /* Hardware queue specific attributes */
401 IFLA_VF_VLAN, 404 IFLA_VF_VLAN,
402 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */ 405 IFLA_VF_TX_RATE, /* Max TX Bandwidth Allocation */
403 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */ 406 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
404 IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */ 407 IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */
408 IFLA_VF_RATE, /* Min and Max TX Bandwidth Allocation */
405 __IFLA_VF_MAX, 409 __IFLA_VF_MAX,
406}; 410};
407 411
@@ -423,6 +427,12 @@ struct ifla_vf_tx_rate {
423 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */ 427 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
424}; 428};
425 429
430struct ifla_vf_rate {
431 __u32 vf;
432 __u32 min_tx_rate; /* Min Bandwidth in Mbps */
433 __u32 max_tx_rate; /* Max Bandwidth in Mbps */
434};
435
426struct ifla_vf_spoofchk { 436struct ifla_vf_spoofchk {
427 __u32 vf; 437 __u32 vf;
428 __u32 setting; 438 __u32 setting;
diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h
index aee73d0611fb..3bce9e9d9f7c 100644
--- a/include/uapi/linux/if_tunnel.h
+++ b/include/uapi/linux/if_tunnel.h
@@ -100,7 +100,7 @@ enum {
100#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1) 100#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
101 101
102/* VTI-mode i_flags */ 102/* VTI-mode i_flags */
103#define VTI_ISVTI 0x0001 103#define VTI_ISVTI ((__force __be16)0x0001)
104 104
105enum { 105enum {
106 IFLA_VTI_UNSPEC, 106 IFLA_VTI_UNSPEC,
diff --git a/include/uapi/linux/l2tp.h b/include/uapi/linux/l2tp.h
index 8adb68160327..21caa2631c20 100644
--- a/include/uapi/linux/l2tp.h
+++ b/include/uapi/linux/l2tp.h
@@ -124,6 +124,8 @@ enum {
124 L2TP_ATTR_STATS, /* nested */ 124 L2TP_ATTR_STATS, /* nested */
125 L2TP_ATTR_IP6_SADDR, /* struct in6_addr */ 125 L2TP_ATTR_IP6_SADDR, /* struct in6_addr */
126 L2TP_ATTR_IP6_DADDR, /* struct in6_addr */ 126 L2TP_ATTR_IP6_DADDR, /* struct in6_addr */
127 L2TP_ATTR_UDP_ZERO_CSUM6_TX, /* u8 */
128 L2TP_ATTR_UDP_ZERO_CSUM6_RX, /* u8 */
127 __L2TP_ATTR_MAX, 129 __L2TP_ATTR_MAX,
128}; 130};
129 131
diff --git a/include/uapi/linux/neighbour.h b/include/uapi/linux/neighbour.h
index d3ef583104e0..4a1d7e96dfe3 100644
--- a/include/uapi/linux/neighbour.h
+++ b/include/uapi/linux/neighbour.h
@@ -24,6 +24,7 @@ enum {
24 NDA_PORT, 24 NDA_PORT,
25 NDA_VNI, 25 NDA_VNI,
26 NDA_IFINDEX, 26 NDA_IFINDEX,
27 NDA_MASTER,
27 __NDA_MAX 28 __NDA_MAX
28}; 29};
29 30
diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
index c88ccbfda5f1..2a88f645a5d8 100644
--- a/include/uapi/linux/netfilter/nf_tables.h
+++ b/include/uapi/linux/netfilter/nf_tables.h
@@ -212,6 +212,29 @@ enum nft_set_flags {
212}; 212};
213 213
214/** 214/**
215 * enum nft_set_policies - set selection policy
216 *
217 * @NFT_SET_POL_PERFORMANCE: prefer high performance over low memory use
218 * @NFT_SET_POL_MEMORY: prefer low memory use over high performance
219 */
220enum nft_set_policies {
221 NFT_SET_POL_PERFORMANCE,
222 NFT_SET_POL_MEMORY,
223};
224
225/**
226 * enum nft_set_desc_attributes - set element description
227 *
228 * @NFTA_SET_DESC_SIZE: number of elements in set (NLA_U32)
229 */
230enum nft_set_desc_attributes {
231 NFTA_SET_DESC_UNSPEC,
232 NFTA_SET_DESC_SIZE,
233 __NFTA_SET_DESC_MAX
234};
235#define NFTA_SET_DESC_MAX (__NFTA_SET_DESC_MAX - 1)
236
237/**
215 * enum nft_set_attributes - nf_tables set netlink attributes 238 * enum nft_set_attributes - nf_tables set netlink attributes
216 * 239 *
217 * @NFTA_SET_TABLE: table name (NLA_STRING) 240 * @NFTA_SET_TABLE: table name (NLA_STRING)
@@ -221,6 +244,9 @@ enum nft_set_flags {
221 * @NFTA_SET_KEY_LEN: key data length (NLA_U32) 244 * @NFTA_SET_KEY_LEN: key data length (NLA_U32)
222 * @NFTA_SET_DATA_TYPE: mapping data type (NLA_U32) 245 * @NFTA_SET_DATA_TYPE: mapping data type (NLA_U32)
223 * @NFTA_SET_DATA_LEN: mapping data length (NLA_U32) 246 * @NFTA_SET_DATA_LEN: mapping data length (NLA_U32)
247 * @NFTA_SET_POLICY: selection policy (NLA_U32)
248 * @NFTA_SET_DESC: set description (NLA_NESTED)
249 * @NFTA_SET_ID: uniquely identifies a set in a transaction (NLA_U32)
224 */ 250 */
225enum nft_set_attributes { 251enum nft_set_attributes {
226 NFTA_SET_UNSPEC, 252 NFTA_SET_UNSPEC,
@@ -231,6 +257,9 @@ enum nft_set_attributes {
231 NFTA_SET_KEY_LEN, 257 NFTA_SET_KEY_LEN,
232 NFTA_SET_DATA_TYPE, 258 NFTA_SET_DATA_TYPE,
233 NFTA_SET_DATA_LEN, 259 NFTA_SET_DATA_LEN,
260 NFTA_SET_POLICY,
261 NFTA_SET_DESC,
262 NFTA_SET_ID,
234 __NFTA_SET_MAX 263 __NFTA_SET_MAX
235}; 264};
236#define NFTA_SET_MAX (__NFTA_SET_MAX - 1) 265#define NFTA_SET_MAX (__NFTA_SET_MAX - 1)
@@ -266,12 +295,14 @@ enum nft_set_elem_attributes {
266 * @NFTA_SET_ELEM_LIST_TABLE: table of the set to be changed (NLA_STRING) 295 * @NFTA_SET_ELEM_LIST_TABLE: table of the set to be changed (NLA_STRING)
267 * @NFTA_SET_ELEM_LIST_SET: name of the set to be changed (NLA_STRING) 296 * @NFTA_SET_ELEM_LIST_SET: name of the set to be changed (NLA_STRING)
268 * @NFTA_SET_ELEM_LIST_ELEMENTS: list of set elements (NLA_NESTED: nft_set_elem_attributes) 297 * @NFTA_SET_ELEM_LIST_ELEMENTS: list of set elements (NLA_NESTED: nft_set_elem_attributes)
298 * @NFTA_SET_ELEM_LIST_SET_ID: uniquely identifies a set in a transaction (NLA_U32)
269 */ 299 */
270enum nft_set_elem_list_attributes { 300enum nft_set_elem_list_attributes {
271 NFTA_SET_ELEM_LIST_UNSPEC, 301 NFTA_SET_ELEM_LIST_UNSPEC,
272 NFTA_SET_ELEM_LIST_TABLE, 302 NFTA_SET_ELEM_LIST_TABLE,
273 NFTA_SET_ELEM_LIST_SET, 303 NFTA_SET_ELEM_LIST_SET,
274 NFTA_SET_ELEM_LIST_ELEMENTS, 304 NFTA_SET_ELEM_LIST_ELEMENTS,
305 NFTA_SET_ELEM_LIST_SET_ID,
275 __NFTA_SET_ELEM_LIST_MAX 306 __NFTA_SET_ELEM_LIST_MAX
276}; 307};
277#define NFTA_SET_ELEM_LIST_MAX (__NFTA_SET_ELEM_LIST_MAX - 1) 308#define NFTA_SET_ELEM_LIST_MAX (__NFTA_SET_ELEM_LIST_MAX - 1)
@@ -457,12 +488,14 @@ enum nft_cmp_attributes {
457 * @NFTA_LOOKUP_SET: name of the set where to look for (NLA_STRING) 488 * @NFTA_LOOKUP_SET: name of the set where to look for (NLA_STRING)
458 * @NFTA_LOOKUP_SREG: source register of the data to look for (NLA_U32: nft_registers) 489 * @NFTA_LOOKUP_SREG: source register of the data to look for (NLA_U32: nft_registers)
459 * @NFTA_LOOKUP_DREG: destination register (NLA_U32: nft_registers) 490 * @NFTA_LOOKUP_DREG: destination register (NLA_U32: nft_registers)
491 * @NFTA_LOOKUP_SET_ID: uniquely identifies a set in a transaction (NLA_U32)
460 */ 492 */
461enum nft_lookup_attributes { 493enum nft_lookup_attributes {
462 NFTA_LOOKUP_UNSPEC, 494 NFTA_LOOKUP_UNSPEC,
463 NFTA_LOOKUP_SET, 495 NFTA_LOOKUP_SET,
464 NFTA_LOOKUP_SREG, 496 NFTA_LOOKUP_SREG,
465 NFTA_LOOKUP_DREG, 497 NFTA_LOOKUP_DREG,
498 NFTA_LOOKUP_SET_ID,
466 __NFTA_LOOKUP_MAX 499 __NFTA_LOOKUP_MAX
467}; 500};
468#define NFTA_LOOKUP_MAX (__NFTA_LOOKUP_MAX - 1) 501#define NFTA_LOOKUP_MAX (__NFTA_LOOKUP_MAX - 1)
@@ -536,6 +569,8 @@ enum nft_exthdr_attributes {
536 * @NFT_META_SECMARK: packet secmark (skb->secmark) 569 * @NFT_META_SECMARK: packet secmark (skb->secmark)
537 * @NFT_META_NFPROTO: netfilter protocol 570 * @NFT_META_NFPROTO: netfilter protocol
538 * @NFT_META_L4PROTO: layer 4 protocol number 571 * @NFT_META_L4PROTO: layer 4 protocol number
572 * @NFT_META_BRI_IIFNAME: packet input bridge interface name
573 * @NFT_META_BRI_OIFNAME: packet output bridge interface name
539 */ 574 */
540enum nft_meta_keys { 575enum nft_meta_keys {
541 NFT_META_LEN, 576 NFT_META_LEN,
@@ -555,6 +590,8 @@ enum nft_meta_keys {
555 NFT_META_SECMARK, 590 NFT_META_SECMARK,
556 NFT_META_NFPROTO, 591 NFT_META_NFPROTO,
557 NFT_META_L4PROTO, 592 NFT_META_L4PROTO,
593 NFT_META_BRI_IIFNAME,
594 NFT_META_BRI_OIFNAME,
558}; 595};
559 596
560/** 597/**
diff --git a/include/uapi/linux/netfilter/nfnetlink.h b/include/uapi/linux/netfilter/nfnetlink.h
index 596ddd45253c..354a7e5e50f2 100644
--- a/include/uapi/linux/netfilter/nfnetlink.h
+++ b/include/uapi/linux/netfilter/nfnetlink.h
@@ -20,6 +20,8 @@ enum nfnetlink_groups {
20#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY 20#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY
21 NFNLGRP_NFTABLES, 21 NFNLGRP_NFTABLES,
22#define NFNLGRP_NFTABLES NFNLGRP_NFTABLES 22#define NFNLGRP_NFTABLES NFNLGRP_NFTABLES
23 NFNLGRP_ACCT_QUOTA,
24#define NFNLGRP_ACCT_QUOTA NFNLGRP_ACCT_QUOTA
23 __NFNLGRP_MAX, 25 __NFNLGRP_MAX,
24}; 26};
25#define NFNLGRP_MAX (__NFNLGRP_MAX - 1) 27#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
diff --git a/include/uapi/linux/netfilter/nfnetlink_acct.h b/include/uapi/linux/netfilter/nfnetlink_acct.h
index c7b6269e760b..51404ec19022 100644
--- a/include/uapi/linux/netfilter/nfnetlink_acct.h
+++ b/include/uapi/linux/netfilter/nfnetlink_acct.h
@@ -10,15 +10,24 @@ enum nfnl_acct_msg_types {
10 NFNL_MSG_ACCT_GET, 10 NFNL_MSG_ACCT_GET,
11 NFNL_MSG_ACCT_GET_CTRZERO, 11 NFNL_MSG_ACCT_GET_CTRZERO,
12 NFNL_MSG_ACCT_DEL, 12 NFNL_MSG_ACCT_DEL,
13 NFNL_MSG_ACCT_OVERQUOTA,
13 NFNL_MSG_ACCT_MAX 14 NFNL_MSG_ACCT_MAX
14}; 15};
15 16
17enum nfnl_acct_flags {
18 NFACCT_F_QUOTA_PKTS = (1 << 0),
19 NFACCT_F_QUOTA_BYTES = (1 << 1),
20 NFACCT_F_OVERQUOTA = (1 << 2), /* can't be set from userspace */
21};
22
16enum nfnl_acct_type { 23enum nfnl_acct_type {
17 NFACCT_UNSPEC, 24 NFACCT_UNSPEC,
18 NFACCT_NAME, 25 NFACCT_NAME,
19 NFACCT_PKTS, 26 NFACCT_PKTS,
20 NFACCT_BYTES, 27 NFACCT_BYTES,
21 NFACCT_USE, 28 NFACCT_USE,
29 NFACCT_FLAGS,
30 NFACCT_QUOTA,
22 __NFACCT_MAX 31 __NFACCT_MAX
23}; 32};
24#define NFACCT_MAX (__NFACCT_MAX - 1) 33#define NFACCT_MAX (__NFACCT_MAX - 1)
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index 9789dc95b6a8..9b19b4461928 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -273,11 +273,19 @@ struct sockaddr_nfc_llcp {
273 * First byte is the adapter index 273 * First byte is the adapter index
274 * Second byte contains flags 274 * Second byte contains flags
275 * - 0x01 - Direction (0=RX, 1=TX) 275 * - 0x01 - Direction (0=RX, 1=TX)
276 * - 0x02-0x80 - Reserved 276 * - 0x02-0x04 - Payload type (000=LLCP, 001=NCI, 010=HCI, 011=Digital,
277 * 100=Proprietary)
278 * - 0x05-0x80 - Reserved
277 **/ 279 **/
278#define NFC_LLCP_RAW_HEADER_SIZE 2 280#define NFC_RAW_HEADER_SIZE 2
279#define NFC_LLCP_DIRECTION_RX 0x00 281#define NFC_DIRECTION_RX 0x00
280#define NFC_LLCP_DIRECTION_TX 0x01 282#define NFC_DIRECTION_TX 0x01
283
284#define RAW_PAYLOAD_LLCP 0
285#define RAW_PAYLOAD_NCI 1
286#define RAW_PAYLOAD_HCI 2
287#define RAW_PAYLOAD_DIGITAL 3
288#define RAW_PAYLOAD_PROPRIETARY 4
281 289
282/* socket option names */ 290/* socket option names */
283#define NFC_LLCP_RW 0 291#define NFC_LLCP_RW 0
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 194c1eab04d8..be9519b52bb1 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -503,6 +503,9 @@
503 * TX status event pertaining to the TX request. 503 * TX status event pertaining to the TX request.
504 * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the 504 * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
505 * management frames at CCK rate or not in 2GHz band. 505 * management frames at CCK rate or not in 2GHz band.
506 * %NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA
507 * counters which will be updated to the current value. This attribute
508 * is used during CSA period.
506 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this 509 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
507 * command may be used with the corresponding cookie to cancel the wait 510 * command may be used with the corresponding cookie to cancel the wait
508 * time if it is known that it is no longer necessary. 511 * time if it is known that it is no longer necessary.
@@ -1525,10 +1528,10 @@ enum nl80211_commands {
1525 * operation). 1528 * operation).
1526 * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information 1529 * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information
1527 * for the time while performing a channel switch. 1530 * for the time while performing a channel switch.
1528 * @NL80211_ATTR_CSA_C_OFF_BEACON: Offset of the channel switch counter 1531 * @NL80211_ATTR_CSA_C_OFF_BEACON: An array of offsets (u16) to the channel
1529 * field in the beacons tail (%NL80211_ATTR_BEACON_TAIL). 1532 * switch counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL).
1530 * @NL80211_ATTR_CSA_C_OFF_PRESP: Offset of the channel switch counter 1533 * @NL80211_ATTR_CSA_C_OFF_PRESP: An array of offsets (u16) to the channel
1531 * field in the probe response (%NL80211_ATTR_PROBE_RESP). 1534 * switch counters in the probe response (%NL80211_ATTR_PROBE_RESP).
1532 * 1535 *
1533 * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32. 1536 * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
1534 * As specified in the &enum nl80211_rxmgmt_flags. 1537 * As specified in the &enum nl80211_rxmgmt_flags.
@@ -1576,9 +1579,18 @@ enum nl80211_commands {
1576 * advertise values that cannot always be met. In such cases, an attempt 1579 * advertise values that cannot always be met. In such cases, an attempt
1577 * to add a new station entry with @NL80211_CMD_NEW_STATION may fail. 1580 * to add a new station entry with @NL80211_CMD_NEW_STATION may fail.
1578 * 1581 *
1582 * @NL80211_ATTR_CSA_C_OFFSETS_TX: An array of csa counter offsets (u16) which
1583 * should be updated when the frame is transmitted.
1584 * @NL80211_ATTR_MAX_CSA_COUNTERS: U8 attribute used to advertise the maximum
1585 * supported number of csa counters.
1586 *
1579 * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32. 1587 * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
1580 * As specified in the &enum nl80211_tdls_peer_capability. 1588 * As specified in the &enum nl80211_tdls_peer_capability.
1581 * 1589 *
1590 * @NL80211_ATTR_IFACE_SOCKET_OWNER: flag attribute, if set during interface
1591 * creation then the new interface will be owned by the netlink socket
1592 * that created it and will be destroyed when the socket is closed
1593 *
1582 * @NL80211_ATTR_MAX: highest attribute number currently defined 1594 * @NL80211_ATTR_MAX: highest attribute number currently defined
1583 * @__NL80211_ATTR_AFTER_LAST: internal use 1595 * @__NL80211_ATTR_AFTER_LAST: internal use
1584 */ 1596 */
@@ -1914,6 +1926,11 @@ enum nl80211_attrs {
1914 1926
1915 NL80211_ATTR_TDLS_PEER_CAPABILITY, 1927 NL80211_ATTR_TDLS_PEER_CAPABILITY,
1916 1928
1929 NL80211_ATTR_IFACE_SOCKET_OWNER,
1930
1931 NL80211_ATTR_CSA_C_OFFSETS_TX,
1932 NL80211_ATTR_MAX_CSA_COUNTERS,
1933
1917 /* add attributes here, update the policy in nl80211.c */ 1934 /* add attributes here, update the policy in nl80211.c */
1918 1935
1919 __NL80211_ATTR_AFTER_LAST, 1936 __NL80211_ATTR_AFTER_LAST,
@@ -2182,6 +2199,8 @@ enum nl80211_sta_bss_param {
2182 * Contains a nested array of signal strength attributes (u8, dBm) 2199 * Contains a nested array of signal strength attributes (u8, dBm)
2183 * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average 2200 * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average
2184 * Same format as NL80211_STA_INFO_CHAIN_SIGNAL. 2201 * Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
2202 * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the
2203 * 802.11 header (u32, kbps)
2185 * @__NL80211_STA_INFO_AFTER_LAST: internal 2204 * @__NL80211_STA_INFO_AFTER_LAST: internal
2186 * @NL80211_STA_INFO_MAX: highest possible station info attribute 2205 * @NL80211_STA_INFO_MAX: highest possible station info attribute
2187 */ 2206 */
@@ -2213,6 +2232,7 @@ enum nl80211_sta_info {
2213 NL80211_STA_INFO_TX_BYTES64, 2232 NL80211_STA_INFO_TX_BYTES64,
2214 NL80211_STA_INFO_CHAIN_SIGNAL, 2233 NL80211_STA_INFO_CHAIN_SIGNAL,
2215 NL80211_STA_INFO_CHAIN_SIGNAL_AVG, 2234 NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
2235 NL80211_STA_INFO_EXPECTED_THROUGHPUT,
2216 2236
2217 /* keep last */ 2237 /* keep last */
2218 __NL80211_STA_INFO_AFTER_LAST, 2238 __NL80211_STA_INFO_AFTER_LAST,
@@ -2336,9 +2356,34 @@ enum nl80211_band_attr {
2336 * using this channel as the primary or any of the secondary channels 2356 * using this channel as the primary or any of the secondary channels
2337 * isn't possible 2357 * isn't possible
2338 * @NL80211_FREQUENCY_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds. 2358 * @NL80211_FREQUENCY_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
2359 * @NL80211_FREQUENCY_ATTR_INDOOR_ONLY: Only indoor use is permitted on this
2360 * channel. A channel that has the INDOOR_ONLY attribute can only be
2361 * used when there is a clear assessment that the device is operating in
2362 * an indoor surroundings, i.e., it is connected to AC power (and not
2363 * through portable DC inverters) or is under the control of a master
2364 * that is acting as an AP and is connected to AC power.
2365 * @NL80211_FREQUENCY_ATTR_GO_CONCURRENT: GO operation is allowed on this
2366 * channel if it's connected concurrently to a BSS on the same channel on
2367 * the 2 GHz band or to a channel in the same UNII band (on the 5 GHz
2368 * band), and IEEE80211_CHAN_RADAR is not set. Instantiating a GO on a
2369 * channel that has the GO_CONCURRENT attribute set can be done when there
2370 * is a clear assessment that the device is operating under the guidance of
2371 * an authorized master, i.e., setting up a GO while the device is also
2372 * connected to an AP with DFS and radar detection on the UNII band (it is
2373 * up to user-space, i.e., wpa_supplicant to perform the required
2374 * verifications)
2375 * @NL80211_FREQUENCY_ATTR_NO_20MHZ: 20 MHz operation is not allowed
2376 * on this channel in current regulatory domain.
2377 * @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed
2378 * on this channel in current regulatory domain.
2339 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number 2379 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
2340 * currently defined 2380 * currently defined
2341 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use 2381 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
2382 *
2383 * See https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122
2384 * for more information on the FCC description of the relaxations allowed
2385 * by NL80211_FREQUENCY_ATTR_INDOOR_ONLY and
2386 * NL80211_FREQUENCY_ATTR_GO_CONCURRENT.
2342 */ 2387 */
2343enum nl80211_frequency_attr { 2388enum nl80211_frequency_attr {
2344 __NL80211_FREQUENCY_ATTR_INVALID, 2389 __NL80211_FREQUENCY_ATTR_INVALID,
@@ -2355,6 +2400,10 @@ enum nl80211_frequency_attr {
2355 NL80211_FREQUENCY_ATTR_NO_80MHZ, 2400 NL80211_FREQUENCY_ATTR_NO_80MHZ,
2356 NL80211_FREQUENCY_ATTR_NO_160MHZ, 2401 NL80211_FREQUENCY_ATTR_NO_160MHZ,
2357 NL80211_FREQUENCY_ATTR_DFS_CAC_TIME, 2402 NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,
2403 NL80211_FREQUENCY_ATTR_INDOOR_ONLY,
2404 NL80211_FREQUENCY_ATTR_GO_CONCURRENT,
2405 NL80211_FREQUENCY_ATTR_NO_20MHZ,
2406 NL80211_FREQUENCY_ATTR_NO_10MHZ,
2358 2407
2359 /* keep last */ 2408 /* keep last */
2360 __NL80211_FREQUENCY_ATTR_AFTER_LAST, 2409 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
@@ -2573,10 +2622,13 @@ enum nl80211_dfs_regions {
2573 * present has been registered with the wireless core that 2622 * present has been registered with the wireless core that
2574 * has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a 2623 * has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a
2575 * supported feature. 2624 * supported feature.
2625 * @NL80211_USER_REG_HINT_INDOOR: a user sent an hint indicating that the
2626 * platform is operating in an indoor environment.
2576 */ 2627 */
2577enum nl80211_user_reg_hint_type { 2628enum nl80211_user_reg_hint_type {
2578 NL80211_USER_REG_HINT_USER = 0, 2629 NL80211_USER_REG_HINT_USER = 0,
2579 NL80211_USER_REG_HINT_CELL_BASE = 1, 2630 NL80211_USER_REG_HINT_CELL_BASE = 1,
2631 NL80211_USER_REG_HINT_INDOOR = 2,
2580}; 2632};
2581 2633
2582/** 2634/**
@@ -3650,6 +3702,8 @@ enum nl80211_iface_limit_attrs {
3650 * different channels may be used within this group. 3702 * different channels may be used within this group.
3651 * @NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS: u32 attribute containing the bitmap 3703 * @NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS: u32 attribute containing the bitmap
3652 * of supported channel widths for radar detection. 3704 * of supported channel widths for radar detection.
3705 * @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap
3706 * of supported regulatory regions for radar detection.
3653 * @NUM_NL80211_IFACE_COMB: number of attributes 3707 * @NUM_NL80211_IFACE_COMB: number of attributes
3654 * @MAX_NL80211_IFACE_COMB: highest attribute number 3708 * @MAX_NL80211_IFACE_COMB: highest attribute number
3655 * 3709 *
@@ -3683,6 +3737,7 @@ enum nl80211_if_combination_attrs {
3683 NL80211_IFACE_COMB_STA_AP_BI_MATCH, 3737 NL80211_IFACE_COMB_STA_AP_BI_MATCH,
3684 NL80211_IFACE_COMB_NUM_CHANNELS, 3738 NL80211_IFACE_COMB_NUM_CHANNELS,
3685 NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, 3739 NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS,
3740 NL80211_IFACE_COMB_RADAR_DETECT_REGIONS,
3686 3741
3687 /* keep last */ 3742 /* keep last */
3688 NUM_NL80211_IFACE_COMB, 3743 NUM_NL80211_IFACE_COMB,
@@ -3893,6 +3948,9 @@ enum nl80211_ap_sme_features {
3893 * interface. An active monitor interface behaves like a normal monitor 3948 * interface. An active monitor interface behaves like a normal monitor
3894 * interface, but gets added to the driver. It ensures that incoming 3949 * interface, but gets added to the driver. It ensures that incoming
3895 * unicast packets directed at the configured interface address get ACKed. 3950 * unicast packets directed at the configured interface address get ACKed.
3951 * @NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE: This driver supports dynamic
3952 * channel bandwidth change (e.g., HT 20 <-> 40 MHz channel) during the
3953 * lifetime of a BSS.
3896 */ 3954 */
3897enum nl80211_feature_flags { 3955enum nl80211_feature_flags {
3898 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 3956 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3913,6 +3971,7 @@ enum nl80211_feature_flags {
3913 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15, 3971 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
3914 NL80211_FEATURE_USERSPACE_MPM = 1 << 16, 3972 NL80211_FEATURE_USERSPACE_MPM = 1 << 16,
3915 NL80211_FEATURE_ACTIVE_MONITOR = 1 << 17, 3973 NL80211_FEATURE_ACTIVE_MONITOR = 1 << 17,
3974 NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE = 1 << 18,
3916}; 3975};
3917 3976
3918/** 3977/**
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index 970553cbbc8e..0b979ee4bfc0 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -395,7 +395,9 @@ struct ovs_key_nd {
395 * @OVS_FLOW_ATTR_ACTIONS: Nested %OVS_ACTION_ATTR_* attributes specifying 395 * @OVS_FLOW_ATTR_ACTIONS: Nested %OVS_ACTION_ATTR_* attributes specifying
396 * the actions to take for packets that match the key. Always present in 396 * the actions to take for packets that match the key. Always present in
397 * notifications. Required for %OVS_FLOW_CMD_NEW requests, optional for 397 * notifications. Required for %OVS_FLOW_CMD_NEW requests, optional for
398 * %OVS_FLOW_CMD_SET requests. 398 * %OVS_FLOW_CMD_SET requests. An %OVS_FLOW_CMD_SET without
399 * %OVS_FLOW_ATTR_ACTIONS will not modify the actions. To clear the actions,
400 * an %OVS_FLOW_ATTR_ACTIONS without any nested attributes must be given.
399 * @OVS_FLOW_ATTR_STATS: &struct ovs_flow_stats giving statistics for this 401 * @OVS_FLOW_ATTR_STATS: &struct ovs_flow_stats giving statistics for this
400 * flow. Present in notifications if the stats would be nonzero. Ignored in 402 * flow. Present in notifications if the stats would be nonzero. Ignored in
401 * requests. 403 * requests.
diff --git a/include/uapi/linux/tipc.h b/include/uapi/linux/tipc.h
index 852373d27dbb..6f71b9b41595 100644
--- a/include/uapi/linux/tipc.h
+++ b/include/uapi/linux/tipc.h
@@ -38,6 +38,7 @@
38#define _LINUX_TIPC_H_ 38#define _LINUX_TIPC_H_
39 39
40#include <linux/types.h> 40#include <linux/types.h>
41#include <linux/sockios.h>
41 42
42/* 43/*
43 * TIPC addressing primitives 44 * TIPC addressing primitives
@@ -87,6 +88,7 @@ static inline unsigned int tipc_node(__u32 addr)
87 88
88#define TIPC_CFG_SRV 0 /* configuration service name type */ 89#define TIPC_CFG_SRV 0 /* configuration service name type */
89#define TIPC_TOP_SRV 1 /* topology service name type */ 90#define TIPC_TOP_SRV 1 /* topology service name type */
91#define TIPC_LINK_STATE 2 /* link state name type */
90#define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */ 92#define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */
91 93
92/* 94/*
@@ -206,4 +208,25 @@ struct sockaddr_tipc {
206#define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */ 208#define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */
207#define TIPC_SOCK_RECVQ_DEPTH 132 /* Default: none (read only) */ 209#define TIPC_SOCK_RECVQ_DEPTH 132 /* Default: none (read only) */
208 210
211/*
212 * Maximum sizes of TIPC bearer-related names (including terminating NULL)
213 * The string formatting for each name element is:
214 * media: media
215 * interface: media:interface name
216 * link: Z.C.N:interface-Z.C.N:interface
217 *
218 */
219
220#define TIPC_MAX_MEDIA_NAME 16
221#define TIPC_MAX_IF_NAME 16
222#define TIPC_MAX_BEARER_NAME 32
223#define TIPC_MAX_LINK_NAME 60
224
225#define SIOCGETLINKNAME SIOCPROTOPRIVATE
226
227struct tipc_sioc_ln_req {
228 __u32 peer;
229 __u32 bearer_id;
230 char linkname[TIPC_MAX_LINK_NAME];
231};
209#endif 232#endif
diff --git a/include/uapi/linux/tipc_config.h b/include/uapi/linux/tipc_config.h
index 6b0bff09b3a7..41a76acbb305 100644
--- a/include/uapi/linux/tipc_config.h
+++ b/include/uapi/linux/tipc_config.h
@@ -39,6 +39,7 @@
39 39
40#include <linux/types.h> 40#include <linux/types.h>
41#include <linux/string.h> 41#include <linux/string.h>
42#include <linux/tipc.h>
42#include <asm/byteorder.h> 43#include <asm/byteorder.h>
43 44
44#ifndef __KERNEL__ 45#ifndef __KERNEL__
@@ -155,15 +156,6 @@
155#define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */ 156#define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */
156 157
157/* 158/*
158 * Maximum sizes of TIPC bearer-related names (including terminating NUL)
159 */
160
161#define TIPC_MAX_MEDIA_NAME 16 /* format = media */
162#define TIPC_MAX_IF_NAME 16 /* format = interface */
163#define TIPC_MAX_BEARER_NAME 32 /* format = media:interface */
164#define TIPC_MAX_LINK_NAME 60 /* format = Z.C.N:interface-Z.C.N:interface */
165
166/*
167 * Link priority limits (min, default, max, media default) 159 * Link priority limits (min, default, max, media default)
168 */ 160 */
169 161
diff --git a/include/uapi/linux/udp.h b/include/uapi/linux/udp.h
index e2bcfd75a30d..16574ea18f0c 100644
--- a/include/uapi/linux/udp.h
+++ b/include/uapi/linux/udp.h
@@ -29,6 +29,8 @@ struct udphdr {
29/* UDP socket options */ 29/* UDP socket options */
30#define UDP_CORK 1 /* Never send partially complete segments */ 30#define UDP_CORK 1 /* Never send partially complete segments */
31#define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */ 31#define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */
32#define UDP_NO_CHECK6_TX 101 /* Disable sending checksum for UDP6X */
33#define UDP_NO_CHECK6_RX 102 /* Disable accpeting checksum for UDP6 */
32 34
33/* UDP encapsulation types */ 35/* UDP encapsulation types */
34#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ 36#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
diff --git a/include/xen/interface/io/netif.h b/include/xen/interface/io/netif.h
index c50061db6098..70054cc0708d 100644
--- a/include/xen/interface/io/netif.h
+++ b/include/xen/interface/io/netif.h
@@ -51,6 +51,59 @@
51 */ 51 */
52 52
53/* 53/*
54 * Multiple transmit and receive queues:
55 * If supported, the backend will write the key "multi-queue-max-queues" to
56 * the directory for that vif, and set its value to the maximum supported
57 * number of queues.
58 * Frontends that are aware of this feature and wish to use it can write the
59 * key "multi-queue-num-queues", set to the number they wish to use, which
60 * must be greater than zero, and no more than the value reported by the backend
61 * in "multi-queue-max-queues".
62 *
63 * Queues replicate the shared rings and event channels.
64 * "feature-split-event-channels" may optionally be used when using
65 * multiple queues, but is not mandatory.
66 *
67 * Each queue consists of one shared ring pair, i.e. there must be the same
68 * number of tx and rx rings.
69 *
70 * For frontends requesting just one queue, the usual event-channel and
71 * ring-ref keys are written as before, simplifying the backend processing
72 * to avoid distinguishing between a frontend that doesn't understand the
73 * multi-queue feature, and one that does, but requested only one queue.
74 *
75 * Frontends requesting two or more queues must not write the toplevel
76 * event-channel (or event-channel-{tx,rx}) and {tx,rx}-ring-ref keys,
77 * instead writing those keys under sub-keys having the name "queue-N" where
78 * N is the integer ID of the queue for which those keys belong. Queues
79 * are indexed from zero. For example, a frontend with two queues and split
80 * event channels must write the following set of queue-related keys:
81 *
82 * /local/domain/1/device/vif/0/multi-queue-num-queues = "2"
83 * /local/domain/1/device/vif/0/queue-0 = ""
84 * /local/domain/1/device/vif/0/queue-0/tx-ring-ref = "<ring-ref-tx0>"
85 * /local/domain/1/device/vif/0/queue-0/rx-ring-ref = "<ring-ref-rx0>"
86 * /local/domain/1/device/vif/0/queue-0/event-channel-tx = "<evtchn-tx0>"
87 * /local/domain/1/device/vif/0/queue-0/event-channel-rx = "<evtchn-rx0>"
88 * /local/domain/1/device/vif/0/queue-1 = ""
89 * /local/domain/1/device/vif/0/queue-1/tx-ring-ref = "<ring-ref-tx1>"
90 * /local/domain/1/device/vif/0/queue-1/rx-ring-ref = "<ring-ref-rx1"
91 * /local/domain/1/device/vif/0/queue-1/event-channel-tx = "<evtchn-tx1>"
92 * /local/domain/1/device/vif/0/queue-1/event-channel-rx = "<evtchn-rx1>"
93 *
94 * If there is any inconsistency in the XenStore data, the backend may
95 * choose not to connect any queues, instead treating the request as an
96 * error. This includes scenarios where more (or fewer) queues were
97 * requested than the frontend provided details for.
98 *
99 * Mapping of packets to queues is considered to be a function of the
100 * transmitting system (backend or frontend) and is not negotiated
101 * between the two. Guests are free to transmit packets on any queue
102 * they choose, provided it has been set up correctly. Guests must be
103 * prepared to receive packets on any queue they have requested be set up.
104 */
105
106/*
54 * "feature-no-csum-offload" should be used to turn IPv4 TCP/UDP checksum 107 * "feature-no-csum-offload" should be used to turn IPv4 TCP/UDP checksum
55 * offload off or on. If it is missing then the feature is assumed to be on. 108 * offload off or on. If it is missing then the feature is assumed to be on.
56 * "feature-ipv6-csum-offload" should be used to turn IPv6 TCP/UDP checksum 109 * "feature-ipv6-csum-offload" should be used to turn IPv6 TCP/UDP checksum