aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 23:53:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 23:53:45 -0400
commitcd6362befe4cc7bf589a5236d2a780af2d47bcc9 (patch)
tree3bd4e13ec3f92a00dc4f6c3d65e820b54dbfe46e /include/linux
parent0f1b1e6d73cb989ce2c071edc57deade3b084dfe (diff)
parentb1586f099ba897542ece36e8a23c1a62907261ef (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "Here is my initial pull request for the networking subsystem during this merge window: 1) Support for ESN in AH (RFC 4302) from Fan Du. 2) Add full kernel doc for ethtool command structures, from Ben Hutchings. 3) Add BCM7xxx PHY driver, from Florian Fainelli. 4) Export computed TCP rate information in netlink socket dumps, from Eric Dumazet. 5) Allow IPSEC SA to be dumped partially using a filter, from Nicolas Dichtel. 6) Convert many drivers to pci_enable_msix_range(), from Alexander Gordeev. 7) Record SKB timestamps more efficiently, from Eric Dumazet. 8) Switch to microsecond resolution for TCP round trip times, also from Eric Dumazet. 9) Clean up and fix 6lowpan fragmentation handling by making use of the existing inet_frag api for it's implementation. 10) Add TX grant mapping to xen-netback driver, from Zoltan Kiss. 11) Auto size SKB lengths when composing netlink messages based upon past message sizes used, from Eric Dumazet. 12) qdisc dumps can take a long time, add a cond_resched(), From Eric Dumazet. 13) Sanitize netpoll core and drivers wrt. SKB handling semantics. Get rid of never-used-in-tree netpoll RX handling. From Eric W Biederman. 14) Support inter-address-family and namespace changing in VTI tunnel driver(s). From Steffen Klassert. 15) Add Altera TSE driver, from Vince Bridgers. 16) Optimizing csum_replace2() so that it doesn't adjust the checksum by checksumming the entire header, from Eric Dumazet. 17) Expand BPF internal implementation for faster interpreting, more direct translations into JIT'd code, and much cleaner uses of BPF filtering in non-socket ocntexts. From Daniel Borkmann and Alexei Starovoitov" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1976 commits) netpoll: Use skb_irq_freeable to make zap_completion_queue safe. net: Add a test to see if a skb is freeable in irq context qlcnic: Fix build failure due to undefined reference to `vxlan_get_rx_port' net: ptp: move PTP classifier in its own file net: sxgbe: make "core_ops" static net: sxgbe: fix logical vs bitwise operation net: sxgbe: sxgbe_mdio_register() frees the bus Call efx_set_channels() before efx->type->dimension_resources() xen-netback: disable rogue vif in kthread context net/mlx4: Set proper build dependancy with vxlan be2net: fix build dependency on VxLAN mac802154: make csma/cca parameters per-wpan mac802154: allow only one WPAN to be up at any given time net: filter: minor: fix kdoc in __sk_run_filter netlink: don't compare the nul-termination in nla_strcmp can: c_can: Avoid led toggling for every packet. can: c_can: Simplify TX interrupt cleanup can: c_can: Store dlc private can: c_can: Reduce register access can: c_can: Make the code readable ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/brcmphy.h60
-rw-r--r--include/linux/can/dev.h9
-rw-r--r--include/linux/ethtool.h3
-rw-r--r--include/linux/filter.h118
-rw-r--r--include/linux/ieee80211.h239
-rw-r--r--include/linux/if_vlan.h9
-rw-r--r--include/linux/isdn_ppp.h5
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mlx4/cmd.h8
-rw-r--r--include/linux/mlx4/device.h50
-rw-r--r--include/linux/mlx4/driver.h12
-rw-r--r--include/linux/mlx4/qp.h11
-rw-r--r--include/linux/mmc/sdio_ids.h1
-rw-r--r--include/linux/mpls.h6
-rw-r--r--include/linux/netdevice.h157
-rw-r--r--include/linux/netfilter/ipset/ip_set.h15
-rw-r--r--include/linux/netfilter/nfnetlink.h21
-rw-r--r--include/linux/netpoll.h71
-rw-r--r--include/linux/nl802154.h12
-rw-r--r--include/linux/phy.h56
-rw-r--r--include/linux/ptp_classify.h103
-rw-r--r--include/linux/ptp_clock_kernel.h33
-rw-r--r--include/linux/seccomp.h1
-rw-r--r--include/linux/skbuff.h104
-rw-r--r--include/linux/sxgbe_platform.h54
-rw-r--r--include/linux/tcp.h8
-rw-r--r--include/linux/tty.h6
-rw-r--r--include/linux/u64_stats_sync.h16
-rw-r--r--include/linux/usb/cdc_ncm.h1
-rw-r--r--include/linux/wl12xx.h24
30 files changed, 848 insertions, 366 deletions
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index 677b4f01b2d0..6f76277baf39 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -13,10 +13,17 @@
13#define PHY_ID_BCM5461 0x002060c0 13#define PHY_ID_BCM5461 0x002060c0
14#define PHY_ID_BCM57780 0x03625d90 14#define PHY_ID_BCM57780 0x03625d90
15 15
16#define PHY_ID_BCM7366 0x600d8490
17#define PHY_ID_BCM7439 0x600d8480
18#define PHY_ID_BCM7445 0x600d8510
19#define PHY_ID_BCM7XXX_28 0x600d8400
20
16#define PHY_BCM_OUI_MASK 0xfffffc00 21#define PHY_BCM_OUI_MASK 0xfffffc00
17#define PHY_BCM_OUI_1 0x00206000 22#define PHY_BCM_OUI_1 0x00206000
18#define PHY_BCM_OUI_2 0x0143bc00 23#define PHY_BCM_OUI_2 0x0143bc00
19#define PHY_BCM_OUI_3 0x03625c00 24#define PHY_BCM_OUI_3 0x03625c00
25#define PHY_BCM_OUI_4 0x600d0000
26#define PHY_BCM_OUI_5 0x03625e00
20 27
21 28
22#define PHY_BCM_FLAGS_MODE_COPPER 0x00000001 29#define PHY_BCM_FLAGS_MODE_COPPER 0x00000001
@@ -31,6 +38,59 @@
31#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000 38#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000
32#define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000 39#define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000
33#define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000 40#define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000
41/* Broadcom BCM7xxx specific workarounds */
42#define PHY_BRCM_100MBPS_WAR 0x00010000
34#define PHY_BCM_FLAGS_VALID 0x80000000 43#define PHY_BCM_FLAGS_VALID 0x80000000
35 44
45/* Broadcom BCM54XX register definitions, common to most Broadcom PHYs */
46#define MII_BCM54XX_ECR 0x10 /* BCM54xx extended control register */
47#define MII_BCM54XX_ECR_IM 0x1000 /* Interrupt mask */
48#define MII_BCM54XX_ECR_IF 0x0800 /* Interrupt force */
49
50#define MII_BCM54XX_ESR 0x11 /* BCM54xx extended status register */
51#define MII_BCM54XX_ESR_IS 0x1000 /* Interrupt status */
52
53#define MII_BCM54XX_EXP_DATA 0x15 /* Expansion register data */
54#define MII_BCM54XX_EXP_SEL 0x17 /* Expansion register select */
55#define MII_BCM54XX_EXP_SEL_SSD 0x0e00 /* Secondary SerDes select */
56#define MII_BCM54XX_EXP_SEL_ER 0x0f00 /* Expansion register select */
57
58#define MII_BCM54XX_AUX_CTL 0x18 /* Auxiliary control register */
59#define MII_BCM54XX_ISR 0x1a /* BCM54xx interrupt status register */
60#define MII_BCM54XX_IMR 0x1b /* BCM54xx interrupt mask register */
61#define MII_BCM54XX_INT_CRCERR 0x0001 /* CRC error */
62#define MII_BCM54XX_INT_LINK 0x0002 /* Link status changed */
63#define MII_BCM54XX_INT_SPEED 0x0004 /* Link speed change */
64#define MII_BCM54XX_INT_DUPLEX 0x0008 /* Duplex mode changed */
65#define MII_BCM54XX_INT_LRS 0x0010 /* Local receiver status changed */
66#define MII_BCM54XX_INT_RRS 0x0020 /* Remote receiver status changed */
67#define MII_BCM54XX_INT_SSERR 0x0040 /* Scrambler synchronization error */
68#define MII_BCM54XX_INT_UHCD 0x0080 /* Unsupported HCD negotiated */
69#define MII_BCM54XX_INT_NHCD 0x0100 /* No HCD */
70#define MII_BCM54XX_INT_NHCDL 0x0200 /* No HCD link */
71#define MII_BCM54XX_INT_ANPR 0x0400 /* Auto-negotiation page received */
72#define MII_BCM54XX_INT_LC 0x0800 /* All counters below 128 */
73#define MII_BCM54XX_INT_HC 0x1000 /* Counter above 32768 */
74#define MII_BCM54XX_INT_MDIX 0x2000 /* MDIX status change */
75#define MII_BCM54XX_INT_PSERR 0x4000 /* Pair swap error */
76
77#define MII_BCM54XX_SHD 0x1c /* 0x1c shadow registers */
78#define MII_BCM54XX_SHD_WRITE 0x8000
79#define MII_BCM54XX_SHD_VAL(x) ((x & 0x1f) << 10)
80#define MII_BCM54XX_SHD_DATA(x) ((x & 0x3ff) << 0)
81
82/*
83 * AUXILIARY CONTROL SHADOW ACCESS REGISTERS. (PHY REG 0x18)
84 */
85#define MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL 0x0000
86#define MII_BCM54XX_AUXCTL_ACTL_TX_6DB 0x0400
87#define MII_BCM54XX_AUXCTL_ACTL_SMDSP_ENA 0x0800
88
89#define MII_BCM54XX_AUXCTL_MISC_WREN 0x8000
90#define MII_BCM54XX_AUXCTL_MISC_FORCE_AMDIX 0x0200
91#define MII_BCM54XX_AUXCTL_MISC_RDSEL_MISC 0x7000
92#define MII_BCM54XX_AUXCTL_SHDWSEL_MISC 0x0007
93
94#define MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL 0x0000
95
36#endif /* _LINUX_BRCMPHY_H */ 96#endif /* _LINUX_BRCMPHY_H */
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index fb0ab651a041..3ce5e526525f 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -33,8 +33,9 @@ enum can_mode {
33struct can_priv { 33struct can_priv {
34 struct can_device_stats can_stats; 34 struct can_device_stats can_stats;
35 35
36 struct can_bittiming bittiming; 36 struct can_bittiming bittiming, data_bittiming;
37 const struct can_bittiming_const *bittiming_const; 37 const struct can_bittiming_const *bittiming_const,
38 *data_bittiming_const;
38 struct can_clock clock; 39 struct can_clock clock;
39 40
40 enum can_state state; 41 enum can_state state;
@@ -45,6 +46,7 @@ struct can_priv {
45 struct timer_list restart_timer; 46 struct timer_list restart_timer;
46 47
47 int (*do_set_bittiming)(struct net_device *dev); 48 int (*do_set_bittiming)(struct net_device *dev);
49 int (*do_set_data_bittiming)(struct net_device *dev);
48 int (*do_set_mode)(struct net_device *dev, enum can_mode mode); 50 int (*do_set_mode)(struct net_device *dev, enum can_mode mode);
49 int (*do_get_state)(const struct net_device *dev, 51 int (*do_get_state)(const struct net_device *dev,
50 enum can_state *state); 52 enum can_state *state);
@@ -111,6 +113,7 @@ struct can_priv *safe_candev_priv(struct net_device *dev);
111 113
112int open_candev(struct net_device *dev); 114int open_candev(struct net_device *dev);
113void close_candev(struct net_device *dev); 115void close_candev(struct net_device *dev);
116int can_change_mtu(struct net_device *dev, int new_mtu);
114 117
115int register_candev(struct net_device *dev); 118int register_candev(struct net_device *dev);
116void unregister_candev(struct net_device *dev); 119void unregister_candev(struct net_device *dev);
@@ -124,6 +127,8 @@ unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx);
124void can_free_echo_skb(struct net_device *dev, unsigned int idx); 127void can_free_echo_skb(struct net_device *dev, unsigned int idx);
125 128
126struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf); 129struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf);
130struct sk_buff *alloc_canfd_skb(struct net_device *dev,
131 struct canfd_frame **cfd);
127struct sk_buff *alloc_can_err_skb(struct net_device *dev, 132struct sk_buff *alloc_can_err_skb(struct net_device *dev,
128 struct can_frame **cf); 133 struct can_frame **cf);
129 134
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c8e3e7e39c6b..0a114d05f68d 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -183,6 +183,9 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
183 * hold the RTNL lock. 183 * hold the RTNL lock.
184 * 184 *
185 * See the structures used by these operations for further documentation. 185 * See the structures used by these operations for further documentation.
186 * Note that for all operations using a structure ending with a zero-
187 * length array, the array is allocated separately in the kernel and
188 * is passed to the driver as an additional parameter.
186 * 189 *
187 * See &struct net_device and &struct net_device_ops for documentation 190 * See &struct net_device and &struct net_device_ops for documentation
188 * of the generic netdev features interface. 191 * of the generic netdev features interface.
diff --git a/include/linux/filter.h b/include/linux/filter.h
index e568c8ef896b..262dcbb75ffe 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -9,28 +9,81 @@
9#include <linux/workqueue.h> 9#include <linux/workqueue.h>
10#include <uapi/linux/filter.h> 10#include <uapi/linux/filter.h>
11 11
12#ifdef CONFIG_COMPAT 12/* Internally used and optimized filter representation with extended
13/* 13 * instruction set based on top of classic BPF.
14 * A struct sock_filter is architecture independent.
15 */ 14 */
15
16/* instruction classes */
17#define BPF_ALU64 0x07 /* alu mode in double word width */
18
19/* ld/ldx fields */
20#define BPF_DW 0x18 /* double word */
21#define BPF_XADD 0xc0 /* exclusive add */
22
23/* alu/jmp fields */
24#define BPF_MOV 0xb0 /* mov reg to reg */
25#define BPF_ARSH 0xc0 /* sign extending arithmetic shift right */
26
27/* change endianness of a register */
28#define BPF_END 0xd0 /* flags for endianness conversion: */
29#define BPF_TO_LE 0x00 /* convert to little-endian */
30#define BPF_TO_BE 0x08 /* convert to big-endian */
31#define BPF_FROM_LE BPF_TO_LE
32#define BPF_FROM_BE BPF_TO_BE
33
34#define BPF_JNE 0x50 /* jump != */
35#define BPF_JSGT 0x60 /* SGT is signed '>', GT in x86 */
36#define BPF_JSGE 0x70 /* SGE is signed '>=', GE in x86 */
37#define BPF_CALL 0x80 /* function call */
38#define BPF_EXIT 0x90 /* function return */
39
40/* BPF has 10 general purpose 64-bit registers and stack frame. */
41#define MAX_BPF_REG 11
42
43/* BPF program can access up to 512 bytes of stack space. */
44#define MAX_BPF_STACK 512
45
46/* Arg1, context and stack frame pointer register positions. */
47#define ARG1_REG 1
48#define CTX_REG 6
49#define FP_REG 10
50
51struct sock_filter_int {
52 __u8 code; /* opcode */
53 __u8 a_reg:4; /* dest register */
54 __u8 x_reg:4; /* source register */
55 __s16 off; /* signed offset */
56 __s32 imm; /* signed immediate constant */
57};
58
59#ifdef CONFIG_COMPAT
60/* A struct sock_filter is architecture independent. */
16struct compat_sock_fprog { 61struct compat_sock_fprog {
17 u16 len; 62 u16 len;
18 compat_uptr_t filter; /* struct sock_filter * */ 63 compat_uptr_t filter; /* struct sock_filter * */
19}; 64};
20#endif 65#endif
21 66
67struct sock_fprog_kern {
68 u16 len;
69 struct sock_filter *filter;
70};
71
22struct sk_buff; 72struct sk_buff;
23struct sock; 73struct sock;
74struct seccomp_data;
24 75
25struct sk_filter 76struct sk_filter {
26{
27 atomic_t refcnt; 77 atomic_t refcnt;
28 unsigned int len; /* Number of filter blocks */ 78 u32 jited:1, /* Is our filter JIT'ed? */
79 len:31; /* Number of filter blocks */
80 struct sock_fprog_kern *orig_prog; /* Original BPF program */
29 struct rcu_head rcu; 81 struct rcu_head rcu;
30 unsigned int (*bpf_func)(const struct sk_buff *skb, 82 unsigned int (*bpf_func)(const struct sk_buff *skb,
31 const struct sock_filter *filter); 83 const struct sock_filter_int *filter);
32 union { 84 union {
33 struct sock_filter insns[0]; 85 struct sock_filter insns[0];
86 struct sock_filter_int insnsi[0];
34 struct work_struct work; 87 struct work_struct work;
35 }; 88 };
36}; 89};
@@ -41,25 +94,44 @@ static inline unsigned int sk_filter_size(unsigned int proglen)
41 offsetof(struct sk_filter, insns[proglen])); 94 offsetof(struct sk_filter, insns[proglen]));
42} 95}
43 96
44extern int sk_filter(struct sock *sk, struct sk_buff *skb); 97#define sk_filter_proglen(fprog) \
45extern unsigned int sk_run_filter(const struct sk_buff *skb, 98 (fprog->len * sizeof(fprog->filter[0]))
46 const struct sock_filter *filter); 99
47extern int sk_unattached_filter_create(struct sk_filter **pfp, 100#define SK_RUN_FILTER(filter, ctx) \
48 struct sock_fprog *fprog); 101 (*filter->bpf_func)(ctx, filter->insnsi)
49extern void sk_unattached_filter_destroy(struct sk_filter *fp); 102
50extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 103int sk_filter(struct sock *sk, struct sk_buff *skb);
51extern int sk_detach_filter(struct sock *sk); 104
52extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen); 105u32 sk_run_filter_int_seccomp(const struct seccomp_data *ctx,
53extern int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, unsigned len); 106 const struct sock_filter_int *insni);
54extern void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to); 107u32 sk_run_filter_int_skb(const struct sk_buff *ctx,
108 const struct sock_filter_int *insni);
109
110int sk_convert_filter(struct sock_filter *prog, int len,
111 struct sock_filter_int *new_prog, int *new_len);
112
113int sk_unattached_filter_create(struct sk_filter **pfp,
114 struct sock_fprog *fprog);
115void sk_unattached_filter_destroy(struct sk_filter *fp);
116
117int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
118int sk_detach_filter(struct sock *sk);
119
120int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
121int sk_get_filter(struct sock *sk, struct sock_filter __user *filter,
122 unsigned int len);
123void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to);
124
125void sk_filter_charge(struct sock *sk, struct sk_filter *fp);
126void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp);
55 127
56#ifdef CONFIG_BPF_JIT 128#ifdef CONFIG_BPF_JIT
57#include <stdarg.h> 129#include <stdarg.h>
58#include <linux/linkage.h> 130#include <linux/linkage.h>
59#include <linux/printk.h> 131#include <linux/printk.h>
60 132
61extern void bpf_jit_compile(struct sk_filter *fp); 133void bpf_jit_compile(struct sk_filter *fp);
62extern void bpf_jit_free(struct sk_filter *fp); 134void bpf_jit_free(struct sk_filter *fp);
63 135
64static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, 136static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
65 u32 pass, void *image) 137 u32 pass, void *image)
@@ -70,7 +142,6 @@ static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
70 print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_OFFSET, 142 print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_OFFSET,
71 16, 1, image, proglen, false); 143 16, 1, image, proglen, false);
72} 144}
73#define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns)
74#else 145#else
75#include <linux/slab.h> 146#include <linux/slab.h>
76static inline void bpf_jit_compile(struct sk_filter *fp) 147static inline void bpf_jit_compile(struct sk_filter *fp)
@@ -80,7 +151,6 @@ static inline void bpf_jit_free(struct sk_filter *fp)
80{ 151{
81 kfree(fp); 152 kfree(fp);
82} 153}
83#define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns)
84#endif 154#endif
85 155
86static inline int bpf_tell_extensions(void) 156static inline int bpf_tell_extensions(void)
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index e526a8cecb70..f194ccb8539c 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -154,6 +154,10 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
154 802.11e clarifies the figure in section 7.1.2. The frame body is 154 802.11e clarifies the figure in section 7.1.2. The frame body is
155 up to 2304 octets long (maximum MSDU size) plus any crypt overhead. */ 155 up to 2304 octets long (maximum MSDU size) plus any crypt overhead. */
156#define IEEE80211_MAX_DATA_LEN 2304 156#define IEEE80211_MAX_DATA_LEN 2304
157/* 802.11ad extends maximum MSDU size for DMG (freq > 40Ghz) networks
158 * to 7920 bytes, see 8.2.3 General frame format
159 */
160#define IEEE80211_MAX_DATA_LEN_DMG 7920
157/* 30 byte 4 addr hdr, 2 byte QoS, 2304 byte MSDU, 12 byte crypt, 4 byte FCS */ 161/* 30 byte 4 addr hdr, 2 byte QoS, 2304 byte MSDU, 12 byte crypt, 4 byte FCS */
158#define IEEE80211_MAX_FRAME_LEN 2352 162#define IEEE80211_MAX_FRAME_LEN 2352
159 163
@@ -597,6 +601,20 @@ static inline int ieee80211_is_qos_nullfunc(__le16 fc)
597} 601}
598 602
599/** 603/**
604 * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU
605 * @fc: frame control field in little-endian byteorder
606 */
607static inline bool ieee80211_is_bufferable_mmpdu(__le16 fc)
608{
609 /* IEEE 802.11-2012, definition of "bufferable management frame";
610 * note that this ignores the IBSS special case. */
611 return ieee80211_is_mgmt(fc) &&
612 (ieee80211_is_action(fc) ||
613 ieee80211_is_disassoc(fc) ||
614 ieee80211_is_deauth(fc));
615}
616
617/**
600 * ieee80211_is_first_frag - check if IEEE80211_SCTL_FRAG is not set 618 * ieee80211_is_first_frag - check if IEEE80211_SCTL_FRAG is not set
601 * @seq_ctrl: frame sequence control bytes in little-endian byteorder 619 * @seq_ctrl: frame sequence control bytes in little-endian byteorder
602 */ 620 */
@@ -1636,51 +1654,22 @@ enum ieee80211_reasoncode {
1636enum ieee80211_eid { 1654enum ieee80211_eid {
1637 WLAN_EID_SSID = 0, 1655 WLAN_EID_SSID = 0,
1638 WLAN_EID_SUPP_RATES = 1, 1656 WLAN_EID_SUPP_RATES = 1,
1639 WLAN_EID_FH_PARAMS = 2, 1657 WLAN_EID_FH_PARAMS = 2, /* reserved now */
1640 WLAN_EID_DS_PARAMS = 3, 1658 WLAN_EID_DS_PARAMS = 3,
1641 WLAN_EID_CF_PARAMS = 4, 1659 WLAN_EID_CF_PARAMS = 4,
1642 WLAN_EID_TIM = 5, 1660 WLAN_EID_TIM = 5,
1643 WLAN_EID_IBSS_PARAMS = 6, 1661 WLAN_EID_IBSS_PARAMS = 6,
1644 WLAN_EID_CHALLENGE = 16,
1645
1646 WLAN_EID_COUNTRY = 7, 1662 WLAN_EID_COUNTRY = 7,
1647 WLAN_EID_HP_PARAMS = 8, 1663 WLAN_EID_HP_PARAMS = 8,
1648 WLAN_EID_HP_TABLE = 9, 1664 WLAN_EID_HP_TABLE = 9,
1649 WLAN_EID_REQUEST = 10, 1665 WLAN_EID_REQUEST = 10,
1650
1651 WLAN_EID_QBSS_LOAD = 11, 1666 WLAN_EID_QBSS_LOAD = 11,
1652 WLAN_EID_EDCA_PARAM_SET = 12, 1667 WLAN_EID_EDCA_PARAM_SET = 12,
1653 WLAN_EID_TSPEC = 13, 1668 WLAN_EID_TSPEC = 13,
1654 WLAN_EID_TCLAS = 14, 1669 WLAN_EID_TCLAS = 14,
1655 WLAN_EID_SCHEDULE = 15, 1670 WLAN_EID_SCHEDULE = 15,
1656 WLAN_EID_TS_DELAY = 43, 1671 WLAN_EID_CHALLENGE = 16,
1657 WLAN_EID_TCLAS_PROCESSING = 44, 1672 /* 17-31 reserved for challenge text extension */
1658 WLAN_EID_QOS_CAPA = 46,
1659 /* 802.11z */
1660 WLAN_EID_LINK_ID = 101,
1661 /* 802.11s */
1662 WLAN_EID_MESH_CONFIG = 113,
1663 WLAN_EID_MESH_ID = 114,
1664 WLAN_EID_LINK_METRIC_REPORT = 115,
1665 WLAN_EID_CONGESTION_NOTIFICATION = 116,
1666 WLAN_EID_PEER_MGMT = 117,
1667 WLAN_EID_CHAN_SWITCH_PARAM = 118,
1668 WLAN_EID_MESH_AWAKE_WINDOW = 119,
1669 WLAN_EID_BEACON_TIMING = 120,
1670 WLAN_EID_MCCAOP_SETUP_REQ = 121,
1671 WLAN_EID_MCCAOP_SETUP_RESP = 122,
1672 WLAN_EID_MCCAOP_ADVERT = 123,
1673 WLAN_EID_MCCAOP_TEARDOWN = 124,
1674 WLAN_EID_GANN = 125,
1675 WLAN_EID_RANN = 126,
1676 WLAN_EID_PREQ = 130,
1677 WLAN_EID_PREP = 131,
1678 WLAN_EID_PERR = 132,
1679 WLAN_EID_PXU = 137,
1680 WLAN_EID_PXUC = 138,
1681 WLAN_EID_AUTH_MESH_PEER_EXCH = 139,
1682 WLAN_EID_MIC = 140,
1683
1684 WLAN_EID_PWR_CONSTRAINT = 32, 1673 WLAN_EID_PWR_CONSTRAINT = 32,
1685 WLAN_EID_PWR_CAPABILITY = 33, 1674 WLAN_EID_PWR_CAPABILITY = 33,
1686 WLAN_EID_TPC_REQUEST = 34, 1675 WLAN_EID_TPC_REQUEST = 34,
@@ -1691,66 +1680,114 @@ enum ieee80211_eid {
1691 WLAN_EID_MEASURE_REPORT = 39, 1680 WLAN_EID_MEASURE_REPORT = 39,
1692 WLAN_EID_QUIET = 40, 1681 WLAN_EID_QUIET = 40,
1693 WLAN_EID_IBSS_DFS = 41, 1682 WLAN_EID_IBSS_DFS = 41,
1694
1695 WLAN_EID_ERP_INFO = 42, 1683 WLAN_EID_ERP_INFO = 42,
1696 WLAN_EID_EXT_SUPP_RATES = 50, 1684 WLAN_EID_TS_DELAY = 43,
1697 1685 WLAN_EID_TCLAS_PROCESSING = 44,
1698 WLAN_EID_HT_CAPABILITY = 45, 1686 WLAN_EID_HT_CAPABILITY = 45,
1699 WLAN_EID_HT_OPERATION = 61, 1687 WLAN_EID_QOS_CAPA = 46,
1700 WLAN_EID_SECONDARY_CHANNEL_OFFSET = 62, 1688 /* 47 reserved for Broadcom */
1701
1702 WLAN_EID_RSN = 48, 1689 WLAN_EID_RSN = 48,
1703 WLAN_EID_MMIE = 76, 1690 WLAN_EID_802_15_COEX = 49,
1704 WLAN_EID_VENDOR_SPECIFIC = 221, 1691 WLAN_EID_EXT_SUPP_RATES = 50,
1705 WLAN_EID_QOS_PARAMETER = 222,
1706
1707 WLAN_EID_AP_CHAN_REPORT = 51, 1692 WLAN_EID_AP_CHAN_REPORT = 51,
1708 WLAN_EID_NEIGHBOR_REPORT = 52, 1693 WLAN_EID_NEIGHBOR_REPORT = 52,
1709 WLAN_EID_RCPI = 53, 1694 WLAN_EID_RCPI = 53,
1695 WLAN_EID_MOBILITY_DOMAIN = 54,
1696 WLAN_EID_FAST_BSS_TRANSITION = 55,
1697 WLAN_EID_TIMEOUT_INTERVAL = 56,
1698 WLAN_EID_RIC_DATA = 57,
1699 WLAN_EID_DSE_REGISTERED_LOCATION = 58,
1700 WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59,
1701 WLAN_EID_EXT_CHANSWITCH_ANN = 60,
1702 WLAN_EID_HT_OPERATION = 61,
1703 WLAN_EID_SECONDARY_CHANNEL_OFFSET = 62,
1710 WLAN_EID_BSS_AVG_ACCESS_DELAY = 63, 1704 WLAN_EID_BSS_AVG_ACCESS_DELAY = 63,
1711 WLAN_EID_ANTENNA_INFO = 64, 1705 WLAN_EID_ANTENNA_INFO = 64,
1712 WLAN_EID_RSNI = 65, 1706 WLAN_EID_RSNI = 65,
1713 WLAN_EID_MEASUREMENT_PILOT_TX_INFO = 66, 1707 WLAN_EID_MEASUREMENT_PILOT_TX_INFO = 66,
1714 WLAN_EID_BSS_AVAILABLE_CAPACITY = 67, 1708 WLAN_EID_BSS_AVAILABLE_CAPACITY = 67,
1715 WLAN_EID_BSS_AC_ACCESS_DELAY = 68, 1709 WLAN_EID_BSS_AC_ACCESS_DELAY = 68,
1710 WLAN_EID_TIME_ADVERTISEMENT = 69,
1716 WLAN_EID_RRM_ENABLED_CAPABILITIES = 70, 1711 WLAN_EID_RRM_ENABLED_CAPABILITIES = 70,
1717 WLAN_EID_MULTIPLE_BSSID = 71, 1712 WLAN_EID_MULTIPLE_BSSID = 71,
1718 WLAN_EID_BSS_COEX_2040 = 72, 1713 WLAN_EID_BSS_COEX_2040 = 72,
1719 WLAN_EID_OVERLAP_BSS_SCAN_PARAM = 74, 1714 WLAN_EID_OVERLAP_BSS_SCAN_PARAM = 74,
1720 WLAN_EID_EXT_CAPABILITY = 127,
1721
1722 WLAN_EID_MOBILITY_DOMAIN = 54,
1723 WLAN_EID_FAST_BSS_TRANSITION = 55,
1724 WLAN_EID_TIMEOUT_INTERVAL = 56,
1725 WLAN_EID_RIC_DATA = 57,
1726 WLAN_EID_RIC_DESCRIPTOR = 75, 1715 WLAN_EID_RIC_DESCRIPTOR = 75,
1727 1716 WLAN_EID_MMIE = 76,
1728 WLAN_EID_DSE_REGISTERED_LOCATION = 58, 1717 WLAN_EID_ASSOC_COMEBACK_TIME = 77,
1729 WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59, 1718 WLAN_EID_EVENT_REQUEST = 78,
1730 WLAN_EID_EXT_CHANSWITCH_ANN = 60, 1719 WLAN_EID_EVENT_REPORT = 79,
1731 1720 WLAN_EID_DIAGNOSTIC_REQUEST = 80,
1732 WLAN_EID_VHT_CAPABILITY = 191, 1721 WLAN_EID_DIAGNOSTIC_REPORT = 81,
1733 WLAN_EID_VHT_OPERATION = 192, 1722 WLAN_EID_LOCATION_PARAMS = 82,
1734 WLAN_EID_OPMODE_NOTIF = 199,
1735 WLAN_EID_WIDE_BW_CHANNEL_SWITCH = 194,
1736 WLAN_EID_CHANNEL_SWITCH_WRAPPER = 196,
1737 WLAN_EID_EXTENDED_BSS_LOAD = 193,
1738 WLAN_EID_VHT_TX_POWER_ENVELOPE = 195,
1739 WLAN_EID_AID = 197,
1740 WLAN_EID_QUIET_CHANNEL = 198,
1741
1742 /* 802.11ad */
1743 WLAN_EID_NON_TX_BSSID_CAP = 83, 1723 WLAN_EID_NON_TX_BSSID_CAP = 83,
1724 WLAN_EID_SSID_LIST = 84,
1725 WLAN_EID_MULTI_BSSID_IDX = 85,
1726 WLAN_EID_FMS_DESCRIPTOR = 86,
1727 WLAN_EID_FMS_REQUEST = 87,
1728 WLAN_EID_FMS_RESPONSE = 88,
1729 WLAN_EID_QOS_TRAFFIC_CAPA = 89,
1730 WLAN_EID_BSS_MAX_IDLE_PERIOD = 90,
1731 WLAN_EID_TSF_REQUEST = 91,
1732 WLAN_EID_TSF_RESPOSNE = 92,
1733 WLAN_EID_WNM_SLEEP_MODE = 93,
1734 WLAN_EID_TIM_BCAST_REQ = 94,
1735 WLAN_EID_TIM_BCAST_RESP = 95,
1736 WLAN_EID_COLL_IF_REPORT = 96,
1737 WLAN_EID_CHANNEL_USAGE = 97,
1738 WLAN_EID_TIME_ZONE = 98,
1739 WLAN_EID_DMS_REQUEST = 99,
1740 WLAN_EID_DMS_RESPONSE = 100,
1741 WLAN_EID_LINK_ID = 101,
1742 WLAN_EID_WAKEUP_SCHEDUL = 102,
1743 /* 103 reserved */
1744 WLAN_EID_CHAN_SWITCH_TIMING = 104,
1745 WLAN_EID_PTI_CONTROL = 105,
1746 WLAN_EID_PU_BUFFER_STATUS = 106,
1747 WLAN_EID_INTERWORKING = 107,
1748 WLAN_EID_ADVERTISEMENT_PROTOCOL = 108,
1749 WLAN_EID_EXPEDITED_BW_REQ = 109,
1750 WLAN_EID_QOS_MAP_SET = 110,
1751 WLAN_EID_ROAMING_CONSORTIUM = 111,
1752 WLAN_EID_EMERGENCY_ALERT = 112,
1753 WLAN_EID_MESH_CONFIG = 113,
1754 WLAN_EID_MESH_ID = 114,
1755 WLAN_EID_LINK_METRIC_REPORT = 115,
1756 WLAN_EID_CONGESTION_NOTIFICATION = 116,
1757 WLAN_EID_PEER_MGMT = 117,
1758 WLAN_EID_CHAN_SWITCH_PARAM = 118,
1759 WLAN_EID_MESH_AWAKE_WINDOW = 119,
1760 WLAN_EID_BEACON_TIMING = 120,
1761 WLAN_EID_MCCAOP_SETUP_REQ = 121,
1762 WLAN_EID_MCCAOP_SETUP_RESP = 122,
1763 WLAN_EID_MCCAOP_ADVERT = 123,
1764 WLAN_EID_MCCAOP_TEARDOWN = 124,
1765 WLAN_EID_GANN = 125,
1766 WLAN_EID_RANN = 126,
1767 WLAN_EID_EXT_CAPABILITY = 127,
1768 /* 128, 129 reserved for Agere */
1769 WLAN_EID_PREQ = 130,
1770 WLAN_EID_PREP = 131,
1771 WLAN_EID_PERR = 132,
1772 /* 133-136 reserved for Cisco */
1773 WLAN_EID_PXU = 137,
1774 WLAN_EID_PXUC = 138,
1775 WLAN_EID_AUTH_MESH_PEER_EXCH = 139,
1776 WLAN_EID_MIC = 140,
1777 WLAN_EID_DESTINATION_URI = 141,
1778 WLAN_EID_UAPSD_COEX = 142,
1744 WLAN_EID_WAKEUP_SCHEDULE = 143, 1779 WLAN_EID_WAKEUP_SCHEDULE = 143,
1745 WLAN_EID_EXT_SCHEDULE = 144, 1780 WLAN_EID_EXT_SCHEDULE = 144,
1746 WLAN_EID_STA_AVAILABILITY = 145, 1781 WLAN_EID_STA_AVAILABILITY = 145,
1747 WLAN_EID_DMG_TSPEC = 146, 1782 WLAN_EID_DMG_TSPEC = 146,
1748 WLAN_EID_DMG_AT = 147, 1783 WLAN_EID_DMG_AT = 147,
1749 WLAN_EID_DMG_CAP = 148, 1784 WLAN_EID_DMG_CAP = 148,
1785 /* 149-150 reserved for Cisco */
1750 WLAN_EID_DMG_OPERATION = 151, 1786 WLAN_EID_DMG_OPERATION = 151,
1751 WLAN_EID_DMG_BSS_PARAM_CHANGE = 152, 1787 WLAN_EID_DMG_BSS_PARAM_CHANGE = 152,
1752 WLAN_EID_DMG_BEAM_REFINEMENT = 153, 1788 WLAN_EID_DMG_BEAM_REFINEMENT = 153,
1753 WLAN_EID_CHANNEL_MEASURE_FEEDBACK = 154, 1789 WLAN_EID_CHANNEL_MEASURE_FEEDBACK = 154,
1790 /* 155-156 reserved for Cisco */
1754 WLAN_EID_AWAKE_WINDOW = 157, 1791 WLAN_EID_AWAKE_WINDOW = 157,
1755 WLAN_EID_MULTI_BAND = 158, 1792 WLAN_EID_MULTI_BAND = 158,
1756 WLAN_EID_ADDBA_EXT = 159, 1793 WLAN_EID_ADDBA_EXT = 159,
@@ -1767,11 +1804,34 @@ enum ieee80211_eid {
1767 WLAN_EID_MULTIPLE_MAC_ADDR = 170, 1804 WLAN_EID_MULTIPLE_MAC_ADDR = 170,
1768 WLAN_EID_U_PID = 171, 1805 WLAN_EID_U_PID = 171,
1769 WLAN_EID_DMG_LINK_ADAPT_ACK = 172, 1806 WLAN_EID_DMG_LINK_ADAPT_ACK = 172,
1807 /* 173 reserved for Symbol */
1808 WLAN_EID_MCCAOP_ADV_OVERVIEW = 174,
1770 WLAN_EID_QUIET_PERIOD_REQ = 175, 1809 WLAN_EID_QUIET_PERIOD_REQ = 175,
1810 /* 176 reserved for Symbol */
1771 WLAN_EID_QUIET_PERIOD_RESP = 177, 1811 WLAN_EID_QUIET_PERIOD_RESP = 177,
1812 /* 178-179 reserved for Symbol */
1813 /* 180 reserved for ISO/IEC 20011 */
1772 WLAN_EID_EPAC_POLICY = 182, 1814 WLAN_EID_EPAC_POLICY = 182,
1773 WLAN_EID_CLISTER_TIME_OFF = 183, 1815 WLAN_EID_CLISTER_TIME_OFF = 183,
1816 WLAN_EID_INTER_AC_PRIO = 184,
1817 WLAN_EID_SCS_DESCRIPTOR = 185,
1818 WLAN_EID_QLOAD_REPORT = 186,
1819 WLAN_EID_HCCA_TXOP_UPDATE_COUNT = 187,
1820 WLAN_EID_HL_STREAM_ID = 188,
1821 WLAN_EID_GCR_GROUP_ADDR = 189,
1774 WLAN_EID_ANTENNA_SECTOR_ID_PATTERN = 190, 1822 WLAN_EID_ANTENNA_SECTOR_ID_PATTERN = 190,
1823 WLAN_EID_VHT_CAPABILITY = 191,
1824 WLAN_EID_VHT_OPERATION = 192,
1825 WLAN_EID_EXTENDED_BSS_LOAD = 193,
1826 WLAN_EID_WIDE_BW_CHANNEL_SWITCH = 194,
1827 WLAN_EID_VHT_TX_POWER_ENVELOPE = 195,
1828 WLAN_EID_CHANNEL_SWITCH_WRAPPER = 196,
1829 WLAN_EID_AID = 197,
1830 WLAN_EID_QUIET_CHANNEL = 198,
1831 WLAN_EID_OPMODE_NOTIF = 199,
1832
1833 WLAN_EID_VENDOR_SPECIFIC = 221,
1834 WLAN_EID_QOS_PARAMETER = 222,
1775}; 1835};
1776 1836
1777/* Action category code */ 1837/* Action category code */
@@ -2192,10 +2252,10 @@ static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
2192} 2252}
2193 2253
2194/** 2254/**
2195 * ieee80211_is_robust_mgmt_frame - check if frame is a robust management frame 2255 * _ieee80211_is_robust_mgmt_frame - check if frame is a robust management frame
2196 * @hdr: the frame (buffer must include at least the first octet of payload) 2256 * @hdr: the frame (buffer must include at least the first octet of payload)
2197 */ 2257 */
2198static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr) 2258static inline bool _ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
2199{ 2259{
2200 if (ieee80211_is_disassoc(hdr->frame_control) || 2260 if (ieee80211_is_disassoc(hdr->frame_control) ||
2201 ieee80211_is_deauth(hdr->frame_control)) 2261 ieee80211_is_deauth(hdr->frame_control))
@@ -2224,6 +2284,17 @@ static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
2224} 2284}
2225 2285
2226/** 2286/**
2287 * ieee80211_is_robust_mgmt_frame - check if skb contains a robust mgmt frame
2288 * @skb: the skb containing the frame, length will be checked
2289 */
2290static inline bool ieee80211_is_robust_mgmt_frame(struct sk_buff *skb)
2291{
2292 if (skb->len < 25)
2293 return false;
2294 return _ieee80211_is_robust_mgmt_frame((void *)skb->data);
2295}
2296
2297/**
2227 * ieee80211_is_public_action - check if frame is a public action frame 2298 * ieee80211_is_public_action - check if frame is a public action frame
2228 * @hdr: the frame 2299 * @hdr: the frame
2229 * @len: length of the frame 2300 * @len: length of the frame
@@ -2241,42 +2312,6 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr,
2241} 2312}
2242 2313
2243/** 2314/**
2244 * ieee80211_dsss_chan_to_freq - get channel center frequency
2245 * @channel: the DSSS channel
2246 *
2247 * Convert IEEE802.11 DSSS channel to the center frequency (MHz).
2248 * Ref IEEE 802.11-2007 section 15.6
2249 */
2250static inline int ieee80211_dsss_chan_to_freq(int channel)
2251{
2252 if ((channel > 0) && (channel < 14))
2253 return 2407 + (channel * 5);
2254 else if (channel == 14)
2255 return 2484;
2256 else
2257 return -1;
2258}
2259
2260/**
2261 * ieee80211_freq_to_dsss_chan - get channel
2262 * @freq: the frequency
2263 *
2264 * Convert frequency (MHz) to IEEE802.11 DSSS channel
2265 * Ref IEEE 802.11-2007 section 15.6
2266 *
2267 * This routine selects the channel with the closest center frequency.
2268 */
2269static inline int ieee80211_freq_to_dsss_chan(int freq)
2270{
2271 if ((freq >= 2410) && (freq < 2475))
2272 return (freq - 2405) / 5;
2273 else if ((freq >= 2482) && (freq < 2487))
2274 return 14;
2275 else
2276 return -1;
2277}
2278
2279/**
2280 * ieee80211_tu_to_usec - convert time units (TU) to microseconds 2315 * ieee80211_tu_to_usec - convert time units (TU) to microseconds
2281 * @tu: the TUs 2316 * @tu: the TUs
2282 */ 2317 */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index bbedfb56bd66..13bbbde00e68 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -110,6 +110,7 @@ extern struct net_device *__vlan_find_dev_deep(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);
113extern __be16 vlan_dev_vlan_proto(const struct net_device *dev);
113 114
114/** 115/**
115 * struct vlan_priority_tci_mapping - vlan egress priority mappings 116 * struct vlan_priority_tci_mapping - vlan egress priority mappings
@@ -216,6 +217,12 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
216 return 0; 217 return 0;
217} 218}
218 219
220static inline __be16 vlan_dev_vlan_proto(const struct net_device *dev)
221{
222 BUG();
223 return 0;
224}
225
219static inline u16 vlan_dev_get_egress_qos_mask(struct net_device *dev, 226static inline u16 vlan_dev_get_egress_qos_mask(struct net_device *dev,
220 u32 skprio) 227 u32 skprio)
221{ 228{
@@ -288,7 +295,7 @@ static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb,
288 struct vlan_ethhdr *veth; 295 struct vlan_ethhdr *veth;
289 296
290 if (skb_cow_head(skb, VLAN_HLEN) < 0) { 297 if (skb_cow_head(skb, VLAN_HLEN) < 0) {
291 kfree_skb(skb); 298 dev_kfree_skb_any(skb);
292 return NULL; 299 return NULL;
293 } 300 }
294 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); 301 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN);
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h
index d5f62bc5f4be..8e10f57f109f 100644
--- a/include/linux/isdn_ppp.h
+++ b/include/linux/isdn_ppp.h
@@ -180,9 +180,8 @@ struct ippp_struct {
180 struct slcompress *slcomp; 180 struct slcompress *slcomp;
181#endif 181#endif
182#ifdef CONFIG_IPPP_FILTER 182#ifdef CONFIG_IPPP_FILTER
183 struct sock_filter *pass_filter; /* filter for packets to pass */ 183 struct sk_filter *pass_filter; /* filter for packets to pass */
184 struct sock_filter *active_filter; /* filter for pkts to reset idle */ 184 struct sk_filter *active_filter; /* filter for pkts to reset idle */
185 unsigned pass_len, active_len;
186#endif 185#endif
187 unsigned long debug; 186 unsigned long debug;
188 struct isdn_ppp_compressor *compressor,*decompressor; 187 struct isdn_ppp_compressor *compressor,*decompressor;
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 2cf1547096d9..51e26f3cd3b3 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -23,6 +23,7 @@
23#define TEMP_MINOR 131 /* Temperature Sensor */ 23#define TEMP_MINOR 131 /* Temperature Sensor */
24#define RTC_MINOR 135 24#define RTC_MINOR 135
25#define EFI_RTC_MINOR 136 /* EFI Time services */ 25#define EFI_RTC_MINOR 136 /* EFI Time services */
26#define VHCI_MINOR 137
26#define SUN_OPENPROM_MINOR 139 27#define SUN_OPENPROM_MINOR 139
27#define DMAPI_MINOR 140 /* unused */ 28#define DMAPI_MINOR 140 /* unused */
28#define NVRAM_MINOR 144 29#define NVRAM_MINOR 144
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 79a347238168..c8450366c130 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -125,6 +125,7 @@ enum {
125 /* miscellaneous commands */ 125 /* miscellaneous commands */
126 MLX4_CMD_DIAG_RPRT = 0x30, 126 MLX4_CMD_DIAG_RPRT = 0x30,
127 MLX4_CMD_NOP = 0x31, 127 MLX4_CMD_NOP = 0x31,
128 MLX4_CMD_CONFIG_DEV = 0x3a,
128 MLX4_CMD_ACCESS_MEM = 0x2e, 129 MLX4_CMD_ACCESS_MEM = 0x2e,
129 MLX4_CMD_SET_VEP = 0x52, 130 MLX4_CMD_SET_VEP = 0x52,
130 131
@@ -240,6 +241,13 @@ int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos);
240int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting); 241int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting);
241int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_info *ivf); 242int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_info *ivf);
242int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state); 243int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state);
244/*
245 * mlx4_get_slave_default_vlan -
246 * return true if VST ( default vlan)
247 * if VST, will return vlan & qos (if not NULL)
248 */
249bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave,
250 u16 *vlan, u8 *qos);
243 251
244#define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) 252#define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8)
245 253
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 5edd2c68274d..ba87bd21295a 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -48,6 +48,9 @@
48#define MSIX_LEGACY_SZ 4 48#define MSIX_LEGACY_SZ 4
49#define MIN_MSIX_P_PORT 5 49#define MIN_MSIX_P_PORT 5
50 50
51#define MLX4_ROCE_MAX_GIDS 128
52#define MLX4_ROCE_PF_GIDS 16
53
51enum { 54enum {
52 MLX4_FLAG_MSI_X = 1 << 0, 55 MLX4_FLAG_MSI_X = 1 << 0,
53 MLX4_FLAG_OLD_PORT_CMDS = 1 << 1, 56 MLX4_FLAG_OLD_PORT_CMDS = 1 << 1,
@@ -81,6 +84,7 @@ enum {
81enum { 84enum {
82 MLX4_MAX_NUM_PF = 16, 85 MLX4_MAX_NUM_PF = 16,
83 MLX4_MAX_NUM_VF = 64, 86 MLX4_MAX_NUM_VF = 64,
87 MLX4_MAX_NUM_VF_P_PORT = 64,
84 MLX4_MFUNC_MAX = 80, 88 MLX4_MFUNC_MAX = 80,
85 MLX4_MAX_EQ_NUM = 1024, 89 MLX4_MAX_EQ_NUM = 1024,
86 MLX4_MFUNC_EQ_NUM = 4, 90 MLX4_MFUNC_EQ_NUM = 4,
@@ -629,7 +633,8 @@ struct mlx4_eth_av {
629 u8 hop_limit; 633 u8 hop_limit;
630 __be32 sl_tclass_flowlabel; 634 __be32 sl_tclass_flowlabel;
631 u8 dgid[16]; 635 u8 dgid[16];
632 u32 reserved4[2]; 636 u8 s_mac[6];
637 u8 reserved4[2];
633 __be16 vlan; 638 __be16 vlan;
634 u8 mac[ETH_ALEN]; 639 u8 mac[ETH_ALEN];
635}; 640};
@@ -660,6 +665,11 @@ struct mlx4_quotas {
660 int xrcd; 665 int xrcd;
661}; 666};
662 667
668struct mlx4_vf_dev {
669 u8 min_port;
670 u8 n_ports;
671};
672
663struct mlx4_dev { 673struct mlx4_dev {
664 struct pci_dev *pdev; 674 struct pci_dev *pdev;
665 unsigned long flags; 675 unsigned long flags;
@@ -675,6 +685,7 @@ struct mlx4_dev {
675 int oper_log_mgm_entry_size; 685 int oper_log_mgm_entry_size;
676 u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; 686 u64 regid_promisc_array[MLX4_MAX_PORTS + 1];
677 u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; 687 u64 regid_allmulti_array[MLX4_MAX_PORTS + 1];
688 struct mlx4_vf_dev *dev_vfs;
678}; 689};
679 690
680struct mlx4_eqe { 691struct mlx4_eqe {
@@ -1131,7 +1142,7 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
1131int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc); 1142int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc);
1132int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, 1143int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw,
1133 u8 *pg, u16 *ratelimit); 1144 u8 *pg, u16 *ratelimit);
1134int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering); 1145int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering, int enable);
1135int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx); 1146int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx);
1136int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); 1147int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
1137int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 1148int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
@@ -1183,9 +1194,44 @@ int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, u8 port, int
1183void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid); 1194void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid);
1184__be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave); 1195__be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave);
1185 1196
1197int mlx4_get_slave_from_roce_gid(struct mlx4_dev *dev, int port, u8 *gid,
1198 int *slave_id);
1199int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev, int port, int slave_id,
1200 u8 *gid);
1201
1186int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn, 1202int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn,
1187 u32 max_range_qpn); 1203 u32 max_range_qpn);
1188 1204
1189cycle_t mlx4_read_clock(struct mlx4_dev *dev); 1205cycle_t mlx4_read_clock(struct mlx4_dev *dev);
1190 1206
1207struct mlx4_active_ports {
1208 DECLARE_BITMAP(ports, MLX4_MAX_PORTS);
1209};
1210/* Returns a bitmap of the physical ports which are assigned to slave */
1211struct mlx4_active_ports mlx4_get_active_ports(struct mlx4_dev *dev, int slave);
1212
1213/* Returns the physical port that represents the virtual port of the slave, */
1214/* or a value < 0 in case of an error. If a slave has 2 ports, the identity */
1215/* mapping is returned. */
1216int mlx4_slave_convert_port(struct mlx4_dev *dev, int slave, int port);
1217
1218struct mlx4_slaves_pport {
1219 DECLARE_BITMAP(slaves, MLX4_MFUNC_MAX);
1220};
1221/* Returns a bitmap of all slaves that are assigned to port. */
1222struct mlx4_slaves_pport mlx4_phys_to_slaves_pport(struct mlx4_dev *dev,
1223 int port);
1224
1225/* Returns a bitmap of all slaves that are assigned exactly to all the */
1226/* the ports that are set in crit_ports. */
1227struct mlx4_slaves_pport mlx4_phys_to_slaves_pport_actv(
1228 struct mlx4_dev *dev,
1229 const struct mlx4_active_ports *crit_ports);
1230
1231/* Returns the slave's virtual port that represents the physical port. */
1232int mlx4_phys_to_slave_port(struct mlx4_dev *dev, int slave, int port);
1233
1234int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port);
1235
1236int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port);
1191#endif /* MLX4_DEVICE_H */ 1237#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h
index c257e1b211be..022055c8fb26 100644
--- a/include/linux/mlx4/driver.h
+++ b/include/linux/mlx4/driver.h
@@ -64,4 +64,16 @@ void mlx4_unregister_interface(struct mlx4_interface *intf);
64 64
65void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); 65void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port);
66 66
67static inline u64 mlx4_mac_to_u64(u8 *addr)
68{
69 u64 mac = 0;
70 int i;
71
72 for (i = 0; i < ETH_ALEN; i++) {
73 mac <<= 8;
74 mac |= addr[i];
75 }
76 return mac;
77}
78
67#endif /* MLX4_DRIVER_H */ 79#endif /* MLX4_DRIVER_H */
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 59f8ba84568b..b66e7610d4ee 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -270,9 +270,14 @@ enum {
270 270
271struct mlx4_wqe_ctrl_seg { 271struct mlx4_wqe_ctrl_seg {
272 __be32 owner_opcode; 272 __be32 owner_opcode;
273 __be16 vlan_tag; 273 union {
274 u8 ins_vlan; 274 struct {
275 u8 fence_size; 275 __be16 vlan_tag;
276 u8 ins_vlan;
277 u8 fence_size;
278 };
279 __be32 bf_qpn;
280 };
276 /* 281 /*
277 * High 24 bits are SRC remote buffer; low 8 bits are flags: 282 * High 24 bits are SRC remote buffer; low 8 bits are flags:
278 * [7] SO (strong ordering) 283 * [7] SO (strong ordering)
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index d8836623f36a..0f01fe065424 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -31,6 +31,7 @@
31#define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 31#define SDIO_DEVICE_ID_BROADCOM_4334 0x4334
32#define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 32#define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335
33#define SDIO_DEVICE_ID_BROADCOM_43362 43362 33#define SDIO_DEVICE_ID_BROADCOM_43362 43362
34#define SDIO_DEVICE_ID_BROADCOM_4354 0x4354
34 35
35#define SDIO_VENDOR_ID_INTEL 0x0089 36#define SDIO_VENDOR_ID_INTEL 0x0089
36#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402 37#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402
diff --git a/include/linux/mpls.h b/include/linux/mpls.h
new file mode 100644
index 000000000000..9999145bc190
--- /dev/null
+++ b/include/linux/mpls.h
@@ -0,0 +1,6 @@
1#ifndef _LINUX_MPLS_H
2#define _LINUX_MPLS_H
3
4#include <uapi/linux/mpls.h>
5
6#endif /* _LINUX_MPLS_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index daafd9561cbc..775cc956ff78 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -63,13 +63,6 @@ struct wireless_dev;
63void netdev_set_default_ethtool_ops(struct net_device *dev, 63void netdev_set_default_ethtool_ops(struct net_device *dev,
64 const struct ethtool_ops *ops); 64 const struct ethtool_ops *ops);
65 65
66/* hardware address assignment types */
67#define NET_ADDR_PERM 0 /* address is permanent (default) */
68#define NET_ADDR_RANDOM 1 /* address is generated randomly */
69#define NET_ADDR_STOLEN 2 /* address is stolen from other device */
70#define NET_ADDR_SET 3 /* address is set using
71 * dev_set_mac_address() */
72
73/* Backlog congestion levels */ 66/* Backlog congestion levels */
74#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ 67#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */
75#define NET_RX_DROP 1 /* packet dropped */ 68#define NET_RX_DROP 1 /* packet dropped */
@@ -1037,8 +1030,7 @@ struct net_device_ops {
1037#ifdef CONFIG_NET_POLL_CONTROLLER 1030#ifdef CONFIG_NET_POLL_CONTROLLER
1038 void (*ndo_poll_controller)(struct net_device *dev); 1031 void (*ndo_poll_controller)(struct net_device *dev);
1039 int (*ndo_netpoll_setup)(struct net_device *dev, 1032 int (*ndo_netpoll_setup)(struct net_device *dev,
1040 struct netpoll_info *info, 1033 struct netpoll_info *info);
1041 gfp_t gfp);
1042 void (*ndo_netpoll_cleanup)(struct net_device *dev); 1034 void (*ndo_netpoll_cleanup)(struct net_device *dev);
1043#endif 1035#endif
1044#ifdef CONFIG_NET_RX_BUSY_POLL 1036#ifdef CONFIG_NET_RX_BUSY_POLL
@@ -1147,6 +1139,89 @@ struct net_device_ops {
1147 void *priv); 1139 void *priv);
1148}; 1140};
1149 1141
1142/**
1143 * enum net_device_priv_flags - &struct net_device priv_flags
1144 *
1145 * These are the &struct net_device, they are only set internally
1146 * by drivers and used in the kernel. These flags are invisible to
1147 * userspace, this means that the order of these flags can change
1148 * during any kernel release.
1149 *
1150 * You should have a pretty good reason to be extending these flags.
1151 *
1152 * @IFF_802_1Q_VLAN: 802.1Q VLAN device
1153 * @IFF_EBRIDGE: Ethernet bridging device
1154 * @IFF_SLAVE_INACTIVE: bonding slave not the curr. active
1155 * @IFF_MASTER_8023AD: bonding master, 802.3ad
1156 * @IFF_MASTER_ALB: bonding master, balance-alb
1157 * @IFF_BONDING: bonding master or slave
1158 * @IFF_SLAVE_NEEDARP: need ARPs for validation
1159 * @IFF_ISATAP: ISATAP interface (RFC4214)
1160 * @IFF_MASTER_ARPMON: bonding master, ARP mon in use
1161 * @IFF_WAN_HDLC: WAN HDLC device
1162 * @IFF_XMIT_DST_RELEASE: dev_hard_start_xmit() is allowed to
1163 * release skb->dst
1164 * @IFF_DONT_BRIDGE: disallow bridging this ether dev
1165 * @IFF_DISABLE_NETPOLL: disable netpoll at run-time
1166 * @IFF_MACVLAN_PORT: device used as macvlan port
1167 * @IFF_BRIDGE_PORT: device used as bridge port
1168 * @IFF_OVS_DATAPATH: device used as Open vSwitch datapath port
1169 * @IFF_TX_SKB_SHARING: The interface supports sharing skbs on transmit
1170 * @IFF_UNICAST_FLT: Supports unicast filtering
1171 * @IFF_TEAM_PORT: device used as team port
1172 * @IFF_SUPP_NOFCS: device supports sending custom FCS
1173 * @IFF_LIVE_ADDR_CHANGE: device supports hardware address
1174 * change when it's running
1175 * @IFF_MACVLAN: Macvlan device
1176 */
1177enum netdev_priv_flags {
1178 IFF_802_1Q_VLAN = 1<<0,
1179 IFF_EBRIDGE = 1<<1,
1180 IFF_SLAVE_INACTIVE = 1<<2,
1181 IFF_MASTER_8023AD = 1<<3,
1182 IFF_MASTER_ALB = 1<<4,
1183 IFF_BONDING = 1<<5,
1184 IFF_SLAVE_NEEDARP = 1<<6,
1185 IFF_ISATAP = 1<<7,
1186 IFF_MASTER_ARPMON = 1<<8,
1187 IFF_WAN_HDLC = 1<<9,
1188 IFF_XMIT_DST_RELEASE = 1<<10,
1189 IFF_DONT_BRIDGE = 1<<11,
1190 IFF_DISABLE_NETPOLL = 1<<12,
1191 IFF_MACVLAN_PORT = 1<<13,
1192 IFF_BRIDGE_PORT = 1<<14,
1193 IFF_OVS_DATAPATH = 1<<15,
1194 IFF_TX_SKB_SHARING = 1<<16,
1195 IFF_UNICAST_FLT = 1<<17,
1196 IFF_TEAM_PORT = 1<<18,
1197 IFF_SUPP_NOFCS = 1<<19,
1198 IFF_LIVE_ADDR_CHANGE = 1<<20,
1199 IFF_MACVLAN = 1<<21,
1200};
1201
1202#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
1203#define IFF_EBRIDGE IFF_EBRIDGE
1204#define IFF_SLAVE_INACTIVE IFF_SLAVE_INACTIVE
1205#define IFF_MASTER_8023AD IFF_MASTER_8023AD
1206#define IFF_MASTER_ALB IFF_MASTER_ALB
1207#define IFF_BONDING IFF_BONDING
1208#define IFF_SLAVE_NEEDARP IFF_SLAVE_NEEDARP
1209#define IFF_ISATAP IFF_ISATAP
1210#define IFF_MASTER_ARPMON IFF_MASTER_ARPMON
1211#define IFF_WAN_HDLC IFF_WAN_HDLC
1212#define IFF_XMIT_DST_RELEASE IFF_XMIT_DST_RELEASE
1213#define IFF_DONT_BRIDGE IFF_DONT_BRIDGE
1214#define IFF_DISABLE_NETPOLL IFF_DISABLE_NETPOLL
1215#define IFF_MACVLAN_PORT IFF_MACVLAN_PORT
1216#define IFF_BRIDGE_PORT IFF_BRIDGE_PORT
1217#define IFF_OVS_DATAPATH IFF_OVS_DATAPATH
1218#define IFF_TX_SKB_SHARING IFF_TX_SKB_SHARING
1219#define IFF_UNICAST_FLT IFF_UNICAST_FLT
1220#define IFF_TEAM_PORT IFF_TEAM_PORT
1221#define IFF_SUPP_NOFCS IFF_SUPP_NOFCS
1222#define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE
1223#define IFF_MACVLAN IFF_MACVLAN
1224
1150/* 1225/*
1151 * The DEVICE structure. 1226 * The DEVICE structure.
1152 * Actually, this whole structure is a big mistake. It mixes I/O 1227 * Actually, this whole structure is a big mistake. It mixes I/O
@@ -1228,9 +1303,13 @@ struct net_device {
1228 int iflink; 1303 int iflink;
1229 1304
1230 struct net_device_stats stats; 1305 struct net_device_stats stats;
1231 atomic_long_t rx_dropped; /* dropped packets by core network 1306
1232 * Do not use this in drivers. 1307 /* dropped packets by core network, Do not use this in drivers */
1233 */ 1308 atomic_long_t rx_dropped;
1309 atomic_long_t tx_dropped;
1310
1311 /* Stats to monitor carrier on<->off transitions */
1312 atomic_t carrier_changes;
1234 1313
1235#ifdef CONFIG_WIRELESS_EXT 1314#ifdef CONFIG_WIRELESS_EXT
1236 /* List of functions to handle Wireless Extensions (instead of ioctl). 1315 /* List of functions to handle Wireless Extensions (instead of ioctl).
@@ -1279,6 +1358,10 @@ struct net_device {
1279 * that share the same link 1358 * that share the same link
1280 * layer address 1359 * layer address
1281 */ 1360 */
1361 unsigned short dev_port; /* Used to differentiate
1362 * devices that share the same
1363 * function
1364 */
1282 spinlock_t addr_list_lock; 1365 spinlock_t addr_list_lock;
1283 struct netdev_hw_addr_list uc; /* Unicast mac addresses */ 1366 struct netdev_hw_addr_list uc; /* Unicast mac addresses */
1284 struct netdev_hw_addr_list mc; /* Multicast mac addresses */ 1367 struct netdev_hw_addr_list mc; /* Multicast mac addresses */
@@ -1316,13 +1399,7 @@ struct net_device {
1316/* 1399/*
1317 * Cache lines mostly used on receive path (including eth_type_trans()) 1400 * Cache lines mostly used on receive path (including eth_type_trans())
1318 */ 1401 */
1319 unsigned long last_rx; /* Time of last Rx 1402 unsigned long last_rx; /* Time of last Rx */
1320 * This should not be set in
1321 * drivers, unless really needed,
1322 * because network stack (bonding)
1323 * use it if/when necessary, to
1324 * avoid dirtying this cache line.
1325 */
1326 1403
1327 /* Interface address info used in eth_type_trans() */ 1404 /* Interface address info used in eth_type_trans() */
1328 unsigned char *dev_addr; /* hw address, (before bcast 1405 unsigned char *dev_addr; /* hw address, (before bcast
@@ -1729,6 +1806,20 @@ struct pcpu_sw_netstats {
1729 struct u64_stats_sync syncp; 1806 struct u64_stats_sync syncp;
1730}; 1807};
1731 1808
1809#define netdev_alloc_pcpu_stats(type) \
1810({ \
1811 typeof(type) __percpu *pcpu_stats = alloc_percpu(type); \
1812 if (pcpu_stats) { \
1813 int i; \
1814 for_each_possible_cpu(i) { \
1815 typeof(type) *stat; \
1816 stat = per_cpu_ptr(pcpu_stats, i); \
1817 u64_stats_init(&stat->syncp); \
1818 } \
1819 } \
1820 pcpu_stats; \
1821})
1822
1732#include <linux/notifier.h> 1823#include <linux/notifier.h>
1733 1824
1734/* netdevice notifier chain. Please remember to update the rtnetlink 1825/* netdevice notifier chain. Please remember to update the rtnetlink
@@ -1884,9 +1975,6 @@ struct net_device *__dev_get_by_index(struct net *net, int ifindex);
1884struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); 1975struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
1885int netdev_get_name(struct net *net, char *name, int ifindex); 1976int netdev_get_name(struct net *net, char *name, int ifindex);
1886int dev_restart(struct net_device *dev); 1977int dev_restart(struct net_device *dev);
1887#ifdef CONFIG_NETPOLL_TRAP
1888int netpoll_trap(void);
1889#endif
1890int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb); 1978int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb);
1891 1979
1892static inline unsigned int skb_gro_offset(const struct sk_buff *skb) 1980static inline unsigned int skb_gro_offset(const struct sk_buff *skb)
@@ -1926,11 +2014,6 @@ static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen,
1926 return skb->data + offset; 2014 return skb->data + offset;
1927} 2015}
1928 2016
1929static inline void *skb_gro_mac_header(struct sk_buff *skb)
1930{
1931 return NAPI_GRO_CB(skb)->frag0 ?: skb_mac_header(skb);
1932}
1933
1934static inline void *skb_gro_network_header(struct sk_buff *skb) 2017static inline void *skb_gro_network_header(struct sk_buff *skb)
1935{ 2018{
1936 return (NAPI_GRO_CB(skb)->frag0 ?: skb->data) + 2019 return (NAPI_GRO_CB(skb)->frag0 ?: skb->data) +
@@ -2091,12 +2174,6 @@ static inline void netif_tx_start_all_queues(struct net_device *dev)
2091 2174
2092static inline void netif_tx_wake_queue(struct netdev_queue *dev_queue) 2175static inline void netif_tx_wake_queue(struct netdev_queue *dev_queue)
2093{ 2176{
2094#ifdef CONFIG_NETPOLL_TRAP
2095 if (netpoll_trap()) {
2096 netif_tx_start_queue(dev_queue);
2097 return;
2098 }
2099#endif
2100 if (test_and_clear_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state)) 2177 if (test_and_clear_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state))
2101 __netif_schedule(dev_queue->qdisc); 2178 __netif_schedule(dev_queue->qdisc);
2102} 2179}
@@ -2340,10 +2417,6 @@ static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
2340static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index) 2417static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
2341{ 2418{
2342 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); 2419 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
2343#ifdef CONFIG_NETPOLL_TRAP
2344 if (netpoll_trap())
2345 return;
2346#endif
2347 netif_tx_stop_queue(txq); 2420 netif_tx_stop_queue(txq);
2348} 2421}
2349 2422
@@ -2378,10 +2451,6 @@ static inline bool netif_subqueue_stopped(const struct net_device *dev,
2378static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) 2451static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
2379{ 2452{
2380 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); 2453 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
2381#ifdef CONFIG_NETPOLL_TRAP
2382 if (netpoll_trap())
2383 return;
2384#endif
2385 if (test_and_clear_bit(__QUEUE_STATE_DRV_XOFF, &txq->state)) 2454 if (test_and_clear_bit(__QUEUE_STATE_DRV_XOFF, &txq->state))
2386 __netif_schedule(txq->qdisc); 2455 __netif_schedule(txq->qdisc);
2387} 2456}
@@ -2551,6 +2620,7 @@ int dev_get_phys_port_id(struct net_device *dev,
2551int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, 2620int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
2552 struct netdev_queue *txq); 2621 struct netdev_queue *txq);
2553int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); 2622int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
2623bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb);
2554 2624
2555extern int netdev_budget; 2625extern int netdev_budget;
2556 2626
@@ -2831,6 +2901,11 @@ static inline void netif_tx_unlock_bh(struct net_device *dev)
2831 } \ 2901 } \
2832} 2902}
2833 2903
2904#define HARD_TX_TRYLOCK(dev, txq) \
2905 (((dev->features & NETIF_F_LLTX) == 0) ? \
2906 __netif_tx_trylock(txq) : \
2907 true )
2908
2834#define HARD_TX_UNLOCK(dev, txq) { \ 2909#define HARD_TX_UNLOCK(dev, txq) { \
2835 if ((dev->features & NETIF_F_LLTX) == 0) { \ 2910 if ((dev->features & NETIF_F_LLTX) == 0) { \
2836 __netif_tx_unlock(txq); \ 2911 __netif_tx_unlock(txq); \
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index 0c7d01eae56c..96afc29184be 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -39,11 +39,13 @@ enum ip_set_feature {
39 IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG), 39 IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG),
40 IPSET_TYPE_IFACE_FLAG = 5, 40 IPSET_TYPE_IFACE_FLAG = 5,
41 IPSET_TYPE_IFACE = (1 << IPSET_TYPE_IFACE_FLAG), 41 IPSET_TYPE_IFACE = (1 << IPSET_TYPE_IFACE_FLAG),
42 IPSET_TYPE_NOMATCH_FLAG = 6, 42 IPSET_TYPE_MARK_FLAG = 6,
43 IPSET_TYPE_MARK = (1 << IPSET_TYPE_MARK_FLAG),
44 IPSET_TYPE_NOMATCH_FLAG = 7,
43 IPSET_TYPE_NOMATCH = (1 << IPSET_TYPE_NOMATCH_FLAG), 45 IPSET_TYPE_NOMATCH = (1 << IPSET_TYPE_NOMATCH_FLAG),
44 /* Strictly speaking not a feature, but a flag for dumping: 46 /* Strictly speaking not a feature, but a flag for dumping:
45 * this settype must be dumped last */ 47 * this settype must be dumped last */
46 IPSET_DUMP_LAST_FLAG = 7, 48 IPSET_DUMP_LAST_FLAG = 8,
47 IPSET_DUMP_LAST = (1 << IPSET_DUMP_LAST_FLAG), 49 IPSET_DUMP_LAST = (1 << IPSET_DUMP_LAST_FLAG),
48}; 50};
49 51
@@ -63,6 +65,7 @@ enum ip_set_extension {
63#define SET_WITH_TIMEOUT(s) ((s)->extensions & IPSET_EXT_TIMEOUT) 65#define SET_WITH_TIMEOUT(s) ((s)->extensions & IPSET_EXT_TIMEOUT)
64#define SET_WITH_COUNTER(s) ((s)->extensions & IPSET_EXT_COUNTER) 66#define SET_WITH_COUNTER(s) ((s)->extensions & IPSET_EXT_COUNTER)
65#define SET_WITH_COMMENT(s) ((s)->extensions & IPSET_EXT_COMMENT) 67#define SET_WITH_COMMENT(s) ((s)->extensions & IPSET_EXT_COMMENT)
68#define SET_WITH_FORCEADD(s) ((s)->flags & IPSET_CREATE_FLAG_FORCEADD)
66 69
67/* Extension id, in size order */ 70/* Extension id, in size order */
68enum ip_set_ext_id { 71enum ip_set_ext_id {
@@ -171,8 +174,6 @@ struct ip_set_type {
171 char name[IPSET_MAXNAMELEN]; 174 char name[IPSET_MAXNAMELEN];
172 /* Protocol version */ 175 /* Protocol version */
173 u8 protocol; 176 u8 protocol;
174 /* Set features to control swapping */
175 u8 features;
176 /* Set type dimension */ 177 /* Set type dimension */
177 u8 dimension; 178 u8 dimension;
178 /* 179 /*
@@ -182,6 +183,8 @@ struct ip_set_type {
182 u8 family; 183 u8 family;
183 /* Type revisions */ 184 /* Type revisions */
184 u8 revision_min, revision_max; 185 u8 revision_min, revision_max;
186 /* Set features to control swapping */
187 u16 features;
185 188
186 /* Create set */ 189 /* Create set */
187 int (*create)(struct net *net, struct ip_set *set, 190 int (*create)(struct net *net, struct ip_set *set,
@@ -217,6 +220,8 @@ struct ip_set {
217 u8 revision; 220 u8 revision;
218 /* Extensions */ 221 /* Extensions */
219 u8 extensions; 222 u8 extensions;
223 /* Create flags */
224 u8 flags;
220 /* Default timeout value, if enabled */ 225 /* Default timeout value, if enabled */
221 u32 timeout; 226 u32 timeout;
222 /* Element data size */ 227 /* Element data size */
@@ -251,6 +256,8 @@ ip_set_put_flags(struct sk_buff *skb, struct ip_set *set)
251 cadt_flags |= IPSET_FLAG_WITH_COUNTERS; 256 cadt_flags |= IPSET_FLAG_WITH_COUNTERS;
252 if (SET_WITH_COMMENT(set)) 257 if (SET_WITH_COMMENT(set))
253 cadt_flags |= IPSET_FLAG_WITH_COMMENT; 258 cadt_flags |= IPSET_FLAG_WITH_COMMENT;
259 if (SET_WITH_FORCEADD(set))
260 cadt_flags |= IPSET_FLAG_WITH_FORCEADD;
254 261
255 if (!cadt_flags) 262 if (!cadt_flags)
256 return 0; 263 return 0;
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 28c74367e900..e955d4730625 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -44,6 +44,27 @@ int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid,
44 44
45void nfnl_lock(__u8 subsys_id); 45void nfnl_lock(__u8 subsys_id);
46void nfnl_unlock(__u8 subsys_id); 46void nfnl_unlock(__u8 subsys_id);
47#ifdef CONFIG_PROVE_LOCKING
48int lockdep_nfnl_is_held(__u8 subsys_id);
49#else
50static inline int lockdep_nfnl_is_held(__u8 subsys_id)
51{
52 return 1;
53}
54#endif /* CONFIG_PROVE_LOCKING */
55
56/*
57 * nfnl_dereference - fetch RCU pointer when updates are prevented by subsys mutex
58 *
59 * @p: The pointer to read, prior to dereferencing
60 * @ss: The nfnetlink subsystem ID
61 *
62 * Return the value of the specified RCU-protected pointer, but omit
63 * both the smp_read_barrier_depends() and the ACCESS_ONCE(), because
64 * caller holds the NFNL subsystem mutex.
65 */
66#define nfnl_dereference(p, ss) \
67 rcu_dereference_protected(p, lockdep_nfnl_is_held(ss))
47 68
48#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ 69#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
49 MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) 70 MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index fbfdb9d8d3a7..b25ee9ffdbe6 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -24,27 +24,20 @@ struct netpoll {
24 struct net_device *dev; 24 struct net_device *dev;
25 char dev_name[IFNAMSIZ]; 25 char dev_name[IFNAMSIZ];
26 const char *name; 26 const char *name;
27 void (*rx_skb_hook)(struct netpoll *np, int source, struct sk_buff *skb,
28 int offset, int len);
29 27
30 union inet_addr local_ip, remote_ip; 28 union inet_addr local_ip, remote_ip;
31 bool ipv6; 29 bool ipv6;
32 u16 local_port, remote_port; 30 u16 local_port, remote_port;
33 u8 remote_mac[ETH_ALEN]; 31 u8 remote_mac[ETH_ALEN];
34 32
35 struct list_head rx; /* rx_np list element */
36 struct work_struct cleanup_work; 33 struct work_struct cleanup_work;
37}; 34};
38 35
39struct netpoll_info { 36struct netpoll_info {
40 atomic_t refcnt; 37 atomic_t refcnt;
41 38
42 unsigned long rx_flags;
43 spinlock_t rx_lock;
44 struct semaphore dev_lock; 39 struct semaphore dev_lock;
45 struct list_head rx_np; /* netpolls that registered an rx_skb_hook */
46 40
47 struct sk_buff_head neigh_tx; /* list of neigh requests to reply to */
48 struct sk_buff_head txq; 41 struct sk_buff_head txq;
49 42
50 struct delayed_work tx_work; 43 struct delayed_work tx_work;
@@ -54,24 +47,21 @@ struct netpoll_info {
54}; 47};
55 48
56#ifdef CONFIG_NETPOLL 49#ifdef CONFIG_NETPOLL
57extern void netpoll_rx_disable(struct net_device *dev); 50extern void netpoll_poll_disable(struct net_device *dev);
58extern void netpoll_rx_enable(struct net_device *dev); 51extern void netpoll_poll_enable(struct net_device *dev);
59#else 52#else
60static inline void netpoll_rx_disable(struct net_device *dev) { return; } 53static inline void netpoll_poll_disable(struct net_device *dev) { return; }
61static inline void netpoll_rx_enable(struct net_device *dev) { return; } 54static inline void netpoll_poll_enable(struct net_device *dev) { return; }
62#endif 55#endif
63 56
64void netpoll_send_udp(struct netpoll *np, const char *msg, int len); 57void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
65void netpoll_print_options(struct netpoll *np); 58void netpoll_print_options(struct netpoll *np);
66int netpoll_parse_options(struct netpoll *np, char *opt); 59int netpoll_parse_options(struct netpoll *np, char *opt);
67int __netpoll_setup(struct netpoll *np, struct net_device *ndev, gfp_t gfp); 60int __netpoll_setup(struct netpoll *np, struct net_device *ndev);
68int netpoll_setup(struct netpoll *np); 61int netpoll_setup(struct netpoll *np);
69int netpoll_trap(void);
70void netpoll_set_trap(int trap);
71void __netpoll_cleanup(struct netpoll *np); 62void __netpoll_cleanup(struct netpoll *np);
72void __netpoll_free_async(struct netpoll *np); 63void __netpoll_free_async(struct netpoll *np);
73void netpoll_cleanup(struct netpoll *np); 64void netpoll_cleanup(struct netpoll *np);
74int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo);
75void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, 65void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
76 struct net_device *dev); 66 struct net_device *dev);
77static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) 67static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
@@ -82,46 +72,7 @@ static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
82 local_irq_restore(flags); 72 local_irq_restore(flags);
83} 73}
84 74
85
86
87#ifdef CONFIG_NETPOLL 75#ifdef CONFIG_NETPOLL
88static inline bool netpoll_rx_on(struct sk_buff *skb)
89{
90 struct netpoll_info *npinfo = rcu_dereference_bh(skb->dev->npinfo);
91
92 return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags);
93}
94
95static inline bool netpoll_rx(struct sk_buff *skb)
96{
97 struct netpoll_info *npinfo;
98 unsigned long flags;
99 bool ret = false;
100
101 local_irq_save(flags);
102
103 if (!netpoll_rx_on(skb))
104 goto out;
105
106 npinfo = rcu_dereference_bh(skb->dev->npinfo);
107 spin_lock(&npinfo->rx_lock);
108 /* check rx_flags again with the lock held */
109 if (npinfo->rx_flags && __netpoll_rx(skb, npinfo))
110 ret = true;
111 spin_unlock(&npinfo->rx_lock);
112
113out:
114 local_irq_restore(flags);
115 return ret;
116}
117
118static inline int netpoll_receive_skb(struct sk_buff *skb)
119{
120 if (!list_empty(&skb->dev->napi_list))
121 return netpoll_rx(skb);
122 return 0;
123}
124
125static inline void *netpoll_poll_lock(struct napi_struct *napi) 76static inline void *netpoll_poll_lock(struct napi_struct *napi)
126{ 77{
127 struct net_device *dev = napi->dev; 78 struct net_device *dev = napi->dev;
@@ -150,18 +101,6 @@ static inline bool netpoll_tx_running(struct net_device *dev)
150} 101}
151 102
152#else 103#else
153static inline bool netpoll_rx(struct sk_buff *skb)
154{
155 return false;
156}
157static inline bool netpoll_rx_on(struct sk_buff *skb)
158{
159 return false;
160}
161static inline int netpoll_receive_skb(struct sk_buff *skb)
162{
163 return 0;
164}
165static inline void *netpoll_poll_lock(struct napi_struct *napi) 104static inline void *netpoll_poll_lock(struct napi_struct *napi)
166{ 105{
167 return NULL; 106 return NULL;
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h
index fd4f2d1cdf6c..c8d7f3965fff 100644
--- a/include/linux/nl802154.h
+++ b/include/linux/nl802154.h
@@ -70,6 +70,16 @@ enum {
70 IEEE802154_ATTR_PHY_NAME, 70 IEEE802154_ATTR_PHY_NAME,
71 IEEE802154_ATTR_DEV_TYPE, 71 IEEE802154_ATTR_DEV_TYPE,
72 72
73 IEEE802154_ATTR_TXPOWER,
74 IEEE802154_ATTR_LBT_ENABLED,
75 IEEE802154_ATTR_CCA_MODE,
76 IEEE802154_ATTR_CCA_ED_LEVEL,
77 IEEE802154_ATTR_CSMA_RETRIES,
78 IEEE802154_ATTR_CSMA_MIN_BE,
79 IEEE802154_ATTR_CSMA_MAX_BE,
80
81 IEEE802154_ATTR_FRAME_RETRIES,
82
73 __IEEE802154_ATTR_MAX, 83 __IEEE802154_ATTR_MAX,
74}; 84};
75 85
@@ -122,6 +132,8 @@ enum {
122 IEEE802154_ADD_IFACE, 132 IEEE802154_ADD_IFACE,
123 IEEE802154_DEL_IFACE, 133 IEEE802154_DEL_IFACE,
124 134
135 IEEE802154_SET_MACPARAMS,
136
125 __IEEE802154_CMD_MAX, 137 __IEEE802154_CMD_MAX,
126}; 138};
127 139
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 565188ca328f..24126c4b27b5 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -74,8 +74,53 @@ typedef enum {
74 PHY_INTERFACE_MODE_RTBI, 74 PHY_INTERFACE_MODE_RTBI,
75 PHY_INTERFACE_MODE_SMII, 75 PHY_INTERFACE_MODE_SMII,
76 PHY_INTERFACE_MODE_XGMII, 76 PHY_INTERFACE_MODE_XGMII,
77 PHY_INTERFACE_MODE_MOCA,
78 PHY_INTERFACE_MODE_MAX,
77} phy_interface_t; 79} phy_interface_t;
78 80
81/**
82 * It maps 'enum phy_interface_t' found in include/linux/phy.h
83 * into the device tree binding of 'phy-mode', so that Ethernet
84 * device driver can get phy interface from device tree.
85 */
86static inline const char *phy_modes(phy_interface_t interface)
87{
88 switch (interface) {
89 case PHY_INTERFACE_MODE_NA:
90 return "";
91 case PHY_INTERFACE_MODE_MII:
92 return "mii";
93 case PHY_INTERFACE_MODE_GMII:
94 return "gmii";
95 case PHY_INTERFACE_MODE_SGMII:
96 return "sgmii";
97 case PHY_INTERFACE_MODE_TBI:
98 return "tbi";
99 case PHY_INTERFACE_MODE_REVMII:
100 return "rev-mii";
101 case PHY_INTERFACE_MODE_RMII:
102 return "rmii";
103 case PHY_INTERFACE_MODE_RGMII:
104 return "rgmii";
105 case PHY_INTERFACE_MODE_RGMII_ID:
106 return "rgmii-id";
107 case PHY_INTERFACE_MODE_RGMII_RXID:
108 return "rgmii-rxid";
109 case PHY_INTERFACE_MODE_RGMII_TXID:
110 return "rgmii-txid";
111 case PHY_INTERFACE_MODE_RTBI:
112 return "rtbi";
113 case PHY_INTERFACE_MODE_SMII:
114 return "smii";
115 case PHY_INTERFACE_MODE_XGMII:
116 return "xgmii";
117 case PHY_INTERFACE_MODE_MOCA:
118 return "moca";
119 default:
120 return "unknown";
121 }
122}
123
79 124
80#define PHY_INIT_TIMEOUT 100000 125#define PHY_INIT_TIMEOUT 100000
81#define PHY_STATE_TIME 1 126#define PHY_STATE_TIME 1
@@ -308,6 +353,7 @@ struct phy_device {
308 struct phy_c45_device_ids c45_ids; 353 struct phy_c45_device_ids c45_ids;
309 bool is_c45; 354 bool is_c45;
310 bool is_internal; 355 bool is_internal;
356 bool has_fixups;
311 357
312 enum phy_state state; 358 enum phy_state state;
313 359
@@ -394,6 +440,11 @@ struct phy_driver {
394 u32 flags; 440 u32 flags;
395 441
396 /* 442 /*
443 * Called to issue a PHY software reset
444 */
445 int (*soft_reset)(struct phy_device *phydev);
446
447 /*
397 * Called to initialize the PHY, 448 * Called to initialize the PHY,
398 * including after a reset 449 * including after a reset
399 */ 450 */
@@ -417,6 +468,9 @@ struct phy_driver {
417 */ 468 */
418 int (*config_aneg)(struct phy_device *phydev); 469 int (*config_aneg)(struct phy_device *phydev);
419 470
471 /* Determines the auto negotiation result */
472 int (*aneg_done)(struct phy_device *phydev);
473
420 /* Determines the negotiated speed and duplex */ 474 /* Determines the negotiated speed and duplex */
421 int (*read_status)(struct phy_device *phydev); 475 int (*read_status)(struct phy_device *phydev);
422 476
@@ -612,10 +666,12 @@ static inline int phy_read_status(struct phy_device *phydev)
612int genphy_setup_forced(struct phy_device *phydev); 666int genphy_setup_forced(struct phy_device *phydev);
613int genphy_restart_aneg(struct phy_device *phydev); 667int genphy_restart_aneg(struct phy_device *phydev);
614int genphy_config_aneg(struct phy_device *phydev); 668int genphy_config_aneg(struct phy_device *phydev);
669int genphy_aneg_done(struct phy_device *phydev);
615int genphy_update_link(struct phy_device *phydev); 670int genphy_update_link(struct phy_device *phydev);
616int genphy_read_status(struct phy_device *phydev); 671int genphy_read_status(struct phy_device *phydev);
617int genphy_suspend(struct phy_device *phydev); 672int genphy_suspend(struct phy_device *phydev);
618int genphy_resume(struct phy_device *phydev); 673int genphy_resume(struct phy_device *phydev);
674int genphy_soft_reset(struct phy_device *phydev);
619void phy_driver_unregister(struct phy_driver *drv); 675void phy_driver_unregister(struct phy_driver *drv);
620void phy_drivers_unregister(struct phy_driver *drv, int n); 676void phy_drivers_unregister(struct phy_driver *drv, int n);
621int phy_driver_register(struct phy_driver *new_driver); 677int phy_driver_register(struct phy_driver *new_driver);
diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h
index 1dc420ba213a..7dfed71d76a6 100644
--- a/include/linux/ptp_classify.h
+++ b/include/linux/ptp_classify.h
@@ -23,15 +23,8 @@
23#ifndef _PTP_CLASSIFY_H_ 23#ifndef _PTP_CLASSIFY_H_
24#define _PTP_CLASSIFY_H_ 24#define _PTP_CLASSIFY_H_
25 25
26#include <linux/if_ether.h>
27#include <linux/if_vlan.h>
28#include <linux/ip.h> 26#include <linux/ip.h>
29#include <linux/filter.h> 27#include <linux/skbuff.h>
30#ifdef __KERNEL__
31#include <linux/in.h>
32#else
33#include <netinet/in.h>
34#endif
35 28
36#define PTP_CLASS_NONE 0x00 /* not a PTP event message */ 29#define PTP_CLASS_NONE 0x00 /* not a PTP event message */
37#define PTP_CLASS_V1 0x01 /* protocol version 1 */ 30#define PTP_CLASS_V1 0x01 /* protocol version 1 */
@@ -44,7 +37,7 @@
44#define PTP_CLASS_PMASK 0xf0 /* mask for the packet type field */ 37#define PTP_CLASS_PMASK 0xf0 /* mask for the packet type field */
45 38
46#define PTP_CLASS_V1_IPV4 (PTP_CLASS_V1 | PTP_CLASS_IPV4) 39#define PTP_CLASS_V1_IPV4 (PTP_CLASS_V1 | PTP_CLASS_IPV4)
47#define PTP_CLASS_V1_IPV6 (PTP_CLASS_V1 | PTP_CLASS_IPV6) /*probably DNE*/ 40#define PTP_CLASS_V1_IPV6 (PTP_CLASS_V1 | PTP_CLASS_IPV6) /* probably DNE */
48#define PTP_CLASS_V2_IPV4 (PTP_CLASS_V2 | PTP_CLASS_IPV4) 41#define PTP_CLASS_V2_IPV4 (PTP_CLASS_V2 | PTP_CLASS_IPV4)
49#define PTP_CLASS_V2_IPV6 (PTP_CLASS_V2 | PTP_CLASS_IPV6) 42#define PTP_CLASS_V2_IPV6 (PTP_CLASS_V2 | PTP_CLASS_IPV6)
50#define PTP_CLASS_V2_L2 (PTP_CLASS_V2 | PTP_CLASS_L2) 43#define PTP_CLASS_V2_L2 (PTP_CLASS_V2 | PTP_CLASS_L2)
@@ -53,88 +46,34 @@
53#define PTP_EV_PORT 319 46#define PTP_EV_PORT 319
54#define PTP_GEN_BIT 0x08 /* indicates general message, if set in message type */ 47#define PTP_GEN_BIT 0x08 /* indicates general message, if set in message type */
55 48
56#define OFF_ETYPE 12
57#define OFF_IHL 14
58#define OFF_FRAG 20
59#define OFF_PROTO4 23
60#define OFF_NEXT 6
61#define OFF_UDP_DST 2
62
63#define OFF_PTP_SOURCE_UUID 22 /* PTPv1 only */ 49#define OFF_PTP_SOURCE_UUID 22 /* PTPv1 only */
64#define OFF_PTP_SEQUENCE_ID 30 50#define OFF_PTP_SEQUENCE_ID 30
65#define OFF_PTP_CONTROL 32 /* PTPv1 only */ 51#define OFF_PTP_CONTROL 32 /* PTPv1 only */
66 52
67#define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2) 53/* Below defines should actually be removed at some point in time. */
68
69#define IP6_HLEN 40 54#define IP6_HLEN 40
70#define UDP_HLEN 8 55#define UDP_HLEN 8
71 56#define OFF_IHL 14
72#define RELOFF_DST4 (ETH_HLEN + OFF_UDP_DST)
73#define OFF_DST6 (ETH_HLEN + IP6_HLEN + OFF_UDP_DST)
74#define OFF_PTP6 (ETH_HLEN + IP6_HLEN + UDP_HLEN) 57#define OFF_PTP6 (ETH_HLEN + IP6_HLEN + UDP_HLEN)
58#define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2)
75 59
76#define OP_AND (BPF_ALU | BPF_AND | BPF_K) 60#if defined(CONFIG_NET_PTP_CLASSIFY)
77#define OP_JEQ (BPF_JMP | BPF_JEQ | BPF_K) 61/**
78#define OP_JSET (BPF_JMP | BPF_JSET | BPF_K) 62 * ptp_classify_raw - classify a PTP packet
79#define OP_LDB (BPF_LD | BPF_B | BPF_ABS) 63 * @skb: buffer
80#define OP_LDH (BPF_LD | BPF_H | BPF_ABS) 64 *
81#define OP_LDHI (BPF_LD | BPF_H | BPF_IND) 65 * Runs a minimal BPF dissector to classify a network packet to
82#define OP_LDX (BPF_LDX | BPF_B | BPF_MSH) 66 * determine the PTP class. In case the skb does not contain any
83#define OP_OR (BPF_ALU | BPF_OR | BPF_K) 67 * PTP protocol data, PTP_CLASS_NONE will be returned, otherwise
84#define OP_RETA (BPF_RET | BPF_A) 68 * PTP_CLASS_V1_IPV{4,6}, PTP_CLASS_V2_IPV{4,6} or
85#define OP_RETK (BPF_RET | BPF_K) 69 * PTP_CLASS_V2_{L2,VLAN}, depending on the packet content.
70 */
71unsigned int ptp_classify_raw(const struct sk_buff *skb);
86 72
87static inline int ptp_filter_init(struct sock_filter *f, int len) 73void __init ptp_classifier_init(void);
74#else
75static inline void ptp_classifier_init(void)
88{ 76{
89 if (OP_LDH == f[0].code)
90 return sk_chk_filter(f, len);
91 else
92 return 0;
93} 77}
94
95#define PTP_FILTER \
96 {OP_LDH, 0, 0, OFF_ETYPE }, /* */ \
97 {OP_JEQ, 0, 12, ETH_P_IP }, /* f goto L20 */ \
98 {OP_LDB, 0, 0, OFF_PROTO4 }, /* */ \
99 {OP_JEQ, 0, 9, IPPROTO_UDP }, /* f goto L10 */ \
100 {OP_LDH, 0, 0, OFF_FRAG }, /* */ \
101 {OP_JSET, 7, 0, 0x1fff }, /* t goto L11 */ \
102 {OP_LDX, 0, 0, OFF_IHL }, /* */ \
103 {OP_LDHI, 0, 0, RELOFF_DST4 }, /* */ \
104 {OP_JEQ, 0, 4, PTP_EV_PORT }, /* f goto L12 */ \
105 {OP_LDHI, 0, 0, ETH_HLEN + UDP_HLEN }, /* */ \
106 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
107 {OP_OR, 0, 0, PTP_CLASS_IPV4 }, /* */ \
108 {OP_RETA, 0, 0, 0 }, /* */ \
109/*L1x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \
110/*L20*/ {OP_JEQ, 0, 9, ETH_P_IPV6 }, /* f goto L40 */ \
111 {OP_LDB, 0, 0, ETH_HLEN + OFF_NEXT }, /* */ \
112 {OP_JEQ, 0, 6, IPPROTO_UDP }, /* f goto L30 */ \
113 {OP_LDH, 0, 0, OFF_DST6 }, /* */ \
114 {OP_JEQ, 0, 4, PTP_EV_PORT }, /* f goto L31 */ \
115 {OP_LDH, 0, 0, OFF_PTP6 }, /* */ \
116 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
117 {OP_OR, 0, 0, PTP_CLASS_IPV6 }, /* */ \
118 {OP_RETA, 0, 0, 0 }, /* */ \
119/*L3x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \
120/*L40*/ {OP_JEQ, 0, 9, ETH_P_8021Q }, /* f goto L50 */ \
121 {OP_LDH, 0, 0, OFF_ETYPE + 4 }, /* */ \
122 {OP_JEQ, 0, 15, ETH_P_1588 }, /* f goto L60 */ \
123 {OP_LDB, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \
124 {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \
125 {OP_JEQ, 0, 12, 0 }, /* f goto L6x */ \
126 {OP_LDH, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \
127 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
128 {OP_OR, 0, 0, PTP_CLASS_VLAN }, /* */ \
129 {OP_RETA, 0, 0, 0 }, /* */ \
130/*L50*/ {OP_JEQ, 0, 7, ETH_P_1588 }, /* f goto L61 */ \
131 {OP_LDB, 0, 0, ETH_HLEN }, /* */ \
132 {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \
133 {OP_JEQ, 0, 4, 0 }, /* f goto L6x */ \
134 {OP_LDH, 0, 0, ETH_HLEN }, /* */ \
135 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
136 {OP_OR, 0, 0, PTP_CLASS_L2 }, /* */ \
137 {OP_RETA, 0, 0, 0 }, /* */ \
138/*L6x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE },
139
140#endif 78#endif
79#endif /* _PTP_CLASSIFY_H_ */
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
index 38a993508327..0d8ff3fb84ba 100644
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -49,7 +49,11 @@ struct ptp_clock_request {
49 * @n_alarm: The number of programmable alarms. 49 * @n_alarm: The number of programmable alarms.
50 * @n_ext_ts: The number of external time stamp channels. 50 * @n_ext_ts: The number of external time stamp channels.
51 * @n_per_out: The number of programmable periodic signals. 51 * @n_per_out: The number of programmable periodic signals.
52 * @n_pins: The number of programmable pins.
52 * @pps: Indicates whether the clock supports a PPS callback. 53 * @pps: Indicates whether the clock supports a PPS callback.
54 * @pin_config: Array of length 'n_pins'. If the number of
55 * programmable pins is nonzero, then drivers must
56 * allocate and initialize this array.
53 * 57 *
54 * clock operations 58 * clock operations
55 * 59 *
@@ -70,6 +74,18 @@ struct ptp_clock_request {
70 * parameter request: Desired resource to enable or disable. 74 * parameter request: Desired resource to enable or disable.
71 * parameter on: Caller passes one to enable or zero to disable. 75 * parameter on: Caller passes one to enable or zero to disable.
72 * 76 *
77 * @verify: Confirm that a pin can perform a given function. The PTP
78 * Hardware Clock subsystem maintains the 'pin_config'
79 * array on behalf of the drivers, but the PHC subsystem
80 * assumes that every pin can perform every function. This
81 * hook gives drivers a way of telling the core about
82 * limitations on specific pins. This function must return
83 * zero if the function can be assigned to this pin, and
84 * nonzero otherwise.
85 * parameter pin: index of the pin in question.
86 * parameter func: the desired function to use.
87 * parameter chan: the function channel index to use.
88 *
73 * Drivers should embed their ptp_clock_info within a private 89 * Drivers should embed their ptp_clock_info within a private
74 * structure, obtaining a reference to it using container_of(). 90 * structure, obtaining a reference to it using container_of().
75 * 91 *
@@ -83,13 +99,17 @@ struct ptp_clock_info {
83 int n_alarm; 99 int n_alarm;
84 int n_ext_ts; 100 int n_ext_ts;
85 int n_per_out; 101 int n_per_out;
102 int n_pins;
86 int pps; 103 int pps;
104 struct ptp_pin_desc *pin_config;
87 int (*adjfreq)(struct ptp_clock_info *ptp, s32 delta); 105 int (*adjfreq)(struct ptp_clock_info *ptp, s32 delta);
88 int (*adjtime)(struct ptp_clock_info *ptp, s64 delta); 106 int (*adjtime)(struct ptp_clock_info *ptp, s64 delta);
89 int (*gettime)(struct ptp_clock_info *ptp, struct timespec *ts); 107 int (*gettime)(struct ptp_clock_info *ptp, struct timespec *ts);
90 int (*settime)(struct ptp_clock_info *ptp, const struct timespec *ts); 108 int (*settime)(struct ptp_clock_info *ptp, const struct timespec *ts);
91 int (*enable)(struct ptp_clock_info *ptp, 109 int (*enable)(struct ptp_clock_info *ptp,
92 struct ptp_clock_request *request, int on); 110 struct ptp_clock_request *request, int on);
111 int (*verify)(struct ptp_clock_info *ptp, unsigned int pin,
112 enum ptp_pin_function func, unsigned int chan);
93}; 113};
94 114
95struct ptp_clock; 115struct ptp_clock;
@@ -156,4 +176,17 @@ extern void ptp_clock_event(struct ptp_clock *ptp,
156 176
157extern int ptp_clock_index(struct ptp_clock *ptp); 177extern int ptp_clock_index(struct ptp_clock *ptp);
158 178
179/**
180 * ptp_find_pin() - obtain the pin index of a given auxiliary function
181 *
182 * @ptp: The clock obtained from ptp_clock_register().
183 * @func: One of the ptp_pin_function enumerated values.
184 * @chan: The particular functional channel to find.
185 * Return: Pin index in the range of zero to ptp_clock_caps.n_pins - 1,
186 * or -1 if the auxiliary function cannot be found.
187 */
188
189int ptp_find_pin(struct ptp_clock *ptp,
190 enum ptp_pin_function func, unsigned int chan);
191
159#endif 192#endif
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index 6f19cfd1840e..4054b0994071 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -76,7 +76,6 @@ static inline int seccomp_mode(struct seccomp *s)
76#ifdef CONFIG_SECCOMP_FILTER 76#ifdef CONFIG_SECCOMP_FILTER
77extern void put_seccomp_filter(struct task_struct *tsk); 77extern void put_seccomp_filter(struct task_struct *tsk);
78extern void get_seccomp_filter(struct task_struct *tsk); 78extern void get_seccomp_filter(struct task_struct *tsk);
79extern u32 seccomp_bpf_load(int off);
80#else /* CONFIG_SECCOMP_FILTER */ 79#else /* CONFIG_SECCOMP_FILTER */
81static inline void put_seccomp_filter(struct task_struct *tsk) 80static inline void put_seccomp_filter(struct task_struct *tsk)
82{ 81{
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 6b8466365fbd..08074a810164 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -32,6 +32,7 @@
32#include <linux/hrtimer.h> 32#include <linux/hrtimer.h>
33#include <linux/dma-mapping.h> 33#include <linux/dma-mapping.h>
34#include <linux/netdev_features.h> 34#include <linux/netdev_features.h>
35#include <linux/sched.h>
35#include <net/flow_keys.h> 36#include <net/flow_keys.h>
36 37
37/* A. Checksumming of received packets by device. 38/* A. Checksumming of received packets by device.
@@ -356,11 +357,62 @@ typedef unsigned int sk_buff_data_t;
356typedef unsigned char *sk_buff_data_t; 357typedef unsigned char *sk_buff_data_t;
357#endif 358#endif
358 359
360/**
361 * struct skb_mstamp - multi resolution time stamps
362 * @stamp_us: timestamp in us resolution
363 * @stamp_jiffies: timestamp in jiffies
364 */
365struct skb_mstamp {
366 union {
367 u64 v64;
368 struct {
369 u32 stamp_us;
370 u32 stamp_jiffies;
371 };
372 };
373};
374
375/**
376 * skb_mstamp_get - get current timestamp
377 * @cl: place to store timestamps
378 */
379static inline void skb_mstamp_get(struct skb_mstamp *cl)
380{
381 u64 val = local_clock();
382
383 do_div(val, NSEC_PER_USEC);
384 cl->stamp_us = (u32)val;
385 cl->stamp_jiffies = (u32)jiffies;
386}
387
388/**
389 * skb_mstamp_delta - compute the difference in usec between two skb_mstamp
390 * @t1: pointer to newest sample
391 * @t0: pointer to oldest sample
392 */
393static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1,
394 const struct skb_mstamp *t0)
395{
396 s32 delta_us = t1->stamp_us - t0->stamp_us;
397 u32 delta_jiffies = t1->stamp_jiffies - t0->stamp_jiffies;
398
399 /* If delta_us is negative, this might be because interval is too big,
400 * or local_clock() drift is too big : fallback using jiffies.
401 */
402 if (delta_us <= 0 ||
403 delta_jiffies >= (INT_MAX / (USEC_PER_SEC / HZ)))
404
405 delta_us = jiffies_to_usecs(delta_jiffies);
406
407 return delta_us;
408}
409
410
359/** 411/**
360 * struct sk_buff - socket buffer 412 * struct sk_buff - socket buffer
361 * @next: Next buffer in list 413 * @next: Next buffer in list
362 * @prev: Previous buffer in list 414 * @prev: Previous buffer in list
363 * @tstamp: Time we arrived 415 * @tstamp: Time we arrived/left
364 * @sk: Socket we are owned by 416 * @sk: Socket we are owned by
365 * @dev: Device we arrived on/are leaving by 417 * @dev: Device we arrived on/are leaving by
366 * @cb: Control buffer. Free for use by every layer. Put private vars here 418 * @cb: Control buffer. Free for use by every layer. Put private vars here
@@ -392,11 +444,11 @@ typedef unsigned char *sk_buff_data_t;
392 * @skb_iif: ifindex of device we arrived on 444 * @skb_iif: ifindex of device we arrived on
393 * @tc_index: Traffic control index 445 * @tc_index: Traffic control index
394 * @tc_verd: traffic control verdict 446 * @tc_verd: traffic control verdict
395 * @rxhash: the packet hash computed on receive 447 * @hash: the packet hash
396 * @queue_mapping: Queue mapping for multiqueue devices 448 * @queue_mapping: Queue mapping for multiqueue devices
397 * @ndisc_nodetype: router type (from link layer) 449 * @ndisc_nodetype: router type (from link layer)
398 * @ooo_okay: allow the mapping of a socket to a queue to be changed 450 * @ooo_okay: allow the mapping of a socket to a queue to be changed
399 * @l4_rxhash: indicate rxhash is a canonical 4-tuple hash over transport 451 * @l4_hash: indicate hash is a canonical 4-tuple hash over transport
400 * ports. 452 * ports.
401 * @wifi_acked_valid: wifi_acked was set 453 * @wifi_acked_valid: wifi_acked was set
402 * @wifi_acked: whether frame was acked on wifi or not 454 * @wifi_acked: whether frame was acked on wifi or not
@@ -429,7 +481,10 @@ struct sk_buff {
429 struct sk_buff *next; 481 struct sk_buff *next;
430 struct sk_buff *prev; 482 struct sk_buff *prev;
431 483
432 ktime_t tstamp; 484 union {
485 ktime_t tstamp;
486 struct skb_mstamp skb_mstamp;
487 };
433 488
434 struct sock *sk; 489 struct sock *sk;
435 struct net_device *dev; 490 struct net_device *dev;
@@ -482,7 +537,7 @@ struct sk_buff {
482 537
483 int skb_iif; 538 int skb_iif;
484 539
485 __u32 rxhash; 540 __u32 hash;
486 541
487 __be16 vlan_proto; 542 __be16 vlan_proto;
488 __u16 vlan_tci; 543 __u16 vlan_tci;
@@ -501,7 +556,7 @@ struct sk_buff {
501#endif 556#endif
502 __u8 pfmemalloc:1; 557 __u8 pfmemalloc:1;
503 __u8 ooo_okay:1; 558 __u8 ooo_okay:1;
504 __u8 l4_rxhash:1; 559 __u8 l4_hash:1;
505 __u8 wifi_acked_valid:1; 560 __u8 wifi_acked_valid:1;
506 __u8 wifi_acked:1; 561 __u8 wifi_acked:1;
507 __u8 no_fcs:1; 562 __u8 no_fcs:1;
@@ -691,6 +746,8 @@ struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
691 unsigned int headroom); 746 unsigned int headroom);
692struct sk_buff *skb_copy_expand(const struct sk_buff *skb, int newheadroom, 747struct sk_buff *skb_copy_expand(const struct sk_buff *skb, int newheadroom,
693 int newtailroom, gfp_t priority); 748 int newtailroom, gfp_t priority);
749int skb_to_sgvec_nomark(struct sk_buff *skb, struct scatterlist *sg,
750 int offset, int len);
694int skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, 751int skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset,
695 int len); 752 int len);
696int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer); 753int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer);
@@ -758,40 +815,40 @@ enum pkt_hash_types {
758static inline void 815static inline void
759skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type) 816skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type)
760{ 817{
761 skb->l4_rxhash = (type == PKT_HASH_TYPE_L4); 818 skb->l4_hash = (type == PKT_HASH_TYPE_L4);
762 skb->rxhash = hash; 819 skb->hash = hash;
763} 820}
764 821
765void __skb_get_hash(struct sk_buff *skb); 822void __skb_get_hash(struct sk_buff *skb);
766static inline __u32 skb_get_hash(struct sk_buff *skb) 823static inline __u32 skb_get_hash(struct sk_buff *skb)
767{ 824{
768 if (!skb->l4_rxhash) 825 if (!skb->l4_hash)
769 __skb_get_hash(skb); 826 __skb_get_hash(skb);
770 827
771 return skb->rxhash; 828 return skb->hash;
772} 829}
773 830
774static inline __u32 skb_get_hash_raw(const struct sk_buff *skb) 831static inline __u32 skb_get_hash_raw(const struct sk_buff *skb)
775{ 832{
776 return skb->rxhash; 833 return skb->hash;
777} 834}
778 835
779static inline void skb_clear_hash(struct sk_buff *skb) 836static inline void skb_clear_hash(struct sk_buff *skb)
780{ 837{
781 skb->rxhash = 0; 838 skb->hash = 0;
782 skb->l4_rxhash = 0; 839 skb->l4_hash = 0;
783} 840}
784 841
785static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb) 842static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb)
786{ 843{
787 if (!skb->l4_rxhash) 844 if (!skb->l4_hash)
788 skb_clear_hash(skb); 845 skb_clear_hash(skb);
789} 846}
790 847
791static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from) 848static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from)
792{ 849{
793 to->rxhash = from->rxhash; 850 to->hash = from->hash;
794 to->l4_rxhash = from->l4_rxhash; 851 to->l4_hash = from->l4_hash;
795}; 852};
796 853
797#ifdef NET_SKBUFF_DATA_USES_OFFSET 854#ifdef NET_SKBUFF_DATA_USES_OFFSET
@@ -2573,8 +2630,6 @@ static inline ktime_t net_invalid_timestamp(void)
2573 return ktime_set(0, 0); 2630 return ktime_set(0, 0);
2574} 2631}
2575 2632
2576void skb_timestamping_init(void);
2577
2578#ifdef CONFIG_NETWORK_PHY_TIMESTAMPING 2633#ifdef CONFIG_NETWORK_PHY_TIMESTAMPING
2579 2634
2580void skb_clone_tx_timestamp(struct sk_buff *skb); 2635void skb_clone_tx_timestamp(struct sk_buff *skb);
@@ -2776,6 +2831,19 @@ static inline void skb_init_secmark(struct sk_buff *skb)
2776{ } 2831{ }
2777#endif 2832#endif
2778 2833
2834static inline bool skb_irq_freeable(const struct sk_buff *skb)
2835{
2836 return !skb->destructor &&
2837#if IS_ENABLED(CONFIG_XFRM)
2838 !skb->sp &&
2839#endif
2840#if IS_ENABLED(CONFIG_NF_CONNTRACK)
2841 !skb->nfct &&
2842#endif
2843 !skb->_skb_refdst &&
2844 !skb_has_frag_list(skb);
2845}
2846
2779static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping) 2847static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
2780{ 2848{
2781 skb->queue_mapping = queue_mapping; 2849 skb->queue_mapping = queue_mapping;
diff --git a/include/linux/sxgbe_platform.h b/include/linux/sxgbe_platform.h
new file mode 100644
index 000000000000..a62442cf0037
--- /dev/null
+++ b/include/linux/sxgbe_platform.h
@@ -0,0 +1,54 @@
1/*
2 * 10G controller driver for Samsung EXYNOS SoCs
3 *
4 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 *
7 * Author: Siva Reddy Kallam <siva.kallam@samsung.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#ifndef __SXGBE_PLATFORM_H__
14#define __SXGBE_PLATFORM_H__
15
16/* MDC Clock Selection define*/
17#define SXGBE_CSR_100_150M 0x0 /* MDC = clk_scr_i/62 */
18#define SXGBE_CSR_150_250M 0x1 /* MDC = clk_scr_i/102 */
19#define SXGBE_CSR_250_300M 0x2 /* MDC = clk_scr_i/122 */
20#define SXGBE_CSR_300_350M 0x3 /* MDC = clk_scr_i/142 */
21#define SXGBE_CSR_350_400M 0x4 /* MDC = clk_scr_i/162 */
22#define SXGBE_CSR_400_500M 0x5 /* MDC = clk_scr_i/202 */
23
24/* Platfrom data for platform device structure's
25 * platform_data field
26 */
27struct sxgbe_mdio_bus_data {
28 unsigned int phy_mask;
29 int *irqs;
30 int probed_phy_irq;
31};
32
33struct sxgbe_dma_cfg {
34 int pbl;
35 int fixed_burst;
36 int burst_map;
37 int adv_addr_mode;
38};
39
40struct sxgbe_plat_data {
41 char *phy_bus_name;
42 int bus_id;
43 int phy_addr;
44 int interface;
45 struct sxgbe_mdio_bus_data *mdio_bus_data;
46 struct sxgbe_dma_cfg *dma_cfg;
47 int clk_csr;
48 int pmt;
49 int force_sf_dma_mode;
50 int force_thresh_dma_mode;
51 int riwt_off;
52};
53
54#endif /* __SXGBE_PLATFORM_H__ */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 4ad0706d40eb..239946868142 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -201,10 +201,10 @@ struct tcp_sock {
201 u32 tlp_high_seq; /* snd_nxt at the time of TLP retransmit. */ 201 u32 tlp_high_seq; /* snd_nxt at the time of TLP retransmit. */
202 202
203/* RTT measurement */ 203/* RTT measurement */
204 u32 srtt; /* smoothed round trip time << 3 */ 204 u32 srtt_us; /* smoothed round trip time << 3 in usecs */
205 u32 mdev; /* medium deviation */ 205 u32 mdev_us; /* medium deviation */
206 u32 mdev_max; /* maximal mdev for the last rtt period */ 206 u32 mdev_max_us; /* maximal mdev for the last rtt period */
207 u32 rttvar; /* smoothed mdev_max */ 207 u32 rttvar_us; /* smoothed mdev_max */
208 u32 rtt_seq; /* sequence number to update rttvar */ 208 u32 rtt_seq; /* sequence number to update rttvar */
209 209
210 u32 packets_out; /* Packets which are "in flight" */ 210 u32 packets_out; /* Packets which are "in flight" */
diff --git a/include/linux/tty.h b/include/linux/tty.h
index b90b5c221ff0..1c3316a47d7e 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -518,9 +518,9 @@ extern void tty_port_put(struct tty_port *port);
518 518
519static inline struct tty_port *tty_port_get(struct tty_port *port) 519static inline struct tty_port *tty_port_get(struct tty_port *port)
520{ 520{
521 if (port) 521 if (port && kref_get_unless_zero(&port->kref))
522 kref_get(&port->kref); 522 return port;
523 return port; 523 return NULL;
524} 524}
525 525
526/* If the cts flow control is enabled, return true. */ 526/* If the cts flow control is enabled, return true. */
diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h
index 7bfabd20204c..4b4439e75f45 100644
--- a/include/linux/u64_stats_sync.h
+++ b/include/linux/u64_stats_sync.h
@@ -27,8 +27,8 @@
27 * (On UP, there is no seqcount_t protection, a reader allowing interrupts could 27 * (On UP, there is no seqcount_t protection, a reader allowing interrupts could
28 * read partial values) 28 * read partial values)
29 * 29 *
30 * 7) For softirq uses, readers can use u64_stats_fetch_begin_bh() and 30 * 7) For irq and softirq uses, readers can use u64_stats_fetch_begin_irq() and
31 * u64_stats_fetch_retry_bh() helpers 31 * u64_stats_fetch_retry_irq() helpers
32 * 32 *
33 * Usage : 33 * Usage :
34 * 34 *
@@ -114,31 +114,31 @@ static inline bool u64_stats_fetch_retry(const struct u64_stats_sync *syncp,
114} 114}
115 115
116/* 116/*
117 * In case softirq handlers can update u64 counters, readers can use following helpers 117 * In case irq handlers can update u64 counters, readers can use following helpers
118 * - SMP 32bit arches use seqcount protection, irq safe. 118 * - SMP 32bit arches use seqcount protection, irq safe.
119 * - UP 32bit must disable BH. 119 * - UP 32bit must disable irqs.
120 * - 64bit have no problem atomically reading u64 values, irq safe. 120 * - 64bit have no problem atomically reading u64 values, irq safe.
121 */ 121 */
122static inline unsigned int u64_stats_fetch_begin_bh(const struct u64_stats_sync *syncp) 122static inline unsigned int u64_stats_fetch_begin_irq(const struct u64_stats_sync *syncp)
123{ 123{
124#if BITS_PER_LONG==32 && defined(CONFIG_SMP) 124#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
125 return read_seqcount_begin(&syncp->seq); 125 return read_seqcount_begin(&syncp->seq);
126#else 126#else
127#if BITS_PER_LONG==32 127#if BITS_PER_LONG==32
128 local_bh_disable(); 128 local_irq_disable();
129#endif 129#endif
130 return 0; 130 return 0;
131#endif 131#endif
132} 132}
133 133
134static inline bool u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp, 134static inline bool u64_stats_fetch_retry_irq(const struct u64_stats_sync *syncp,
135 unsigned int start) 135 unsigned int start)
136{ 136{
137#if BITS_PER_LONG==32 && defined(CONFIG_SMP) 137#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
138 return read_seqcount_retry(&syncp->seq, start); 138 return read_seqcount_retry(&syncp->seq, start);
139#else 139#else
140#if BITS_PER_LONG==32 140#if BITS_PER_LONG==32
141 local_bh_enable(); 141 local_irq_enable();
142#endif 142#endif
143 return false; 143 return false;
144#endif 144#endif
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
index 2c14d9cdd57a..44b38b92236a 100644
--- a/include/linux/usb/cdc_ncm.h
+++ b/include/linux/usb/cdc_ncm.h
@@ -94,6 +94,7 @@ struct cdc_ncm_ctx {
94 94
95 const struct usb_cdc_ncm_desc *func_desc; 95 const struct usb_cdc_ncm_desc *func_desc;
96 const struct usb_cdc_mbim_desc *mbim_desc; 96 const struct usb_cdc_mbim_desc *mbim_desc;
97 const struct usb_cdc_mbim_extended_desc *mbim_extended_desc;
97 const struct usb_cdc_ether_desc *ether_desc; 98 const struct usb_cdc_ether_desc *ether_desc;
98 99
99 struct usb_interface *control; 100 struct usb_interface *control;
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index a54fe82e704b..a9c723be1acf 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -48,11 +48,15 @@ enum {
48 WL12XX_TCXOCLOCK_33_6 = 7, /* 33.6 MHz */ 48 WL12XX_TCXOCLOCK_33_6 = 7, /* 33.6 MHz */
49}; 49};
50 50
51struct wl12xx_platform_data { 51struct wl1251_platform_data {
52 void (*set_power)(bool enable); 52 int power_gpio;
53 /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ 53 /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
54 int irq; 54 int irq;
55 bool use_eeprom; 55 bool use_eeprom;
56};
57
58struct wl12xx_platform_data {
59 int irq;
56 int board_ref_clock; 60 int board_ref_clock;
57 int board_tcxo_clock; 61 int board_tcxo_clock;
58 unsigned long platform_quirks; 62 unsigned long platform_quirks;
@@ -68,6 +72,10 @@ int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
68 72
69struct wl12xx_platform_data *wl12xx_get_platform_data(void); 73struct wl12xx_platform_data *wl12xx_get_platform_data(void);
70 74
75int wl1251_set_platform_data(const struct wl1251_platform_data *data);
76
77struct wl1251_platform_data *wl1251_get_platform_data(void);
78
71#else 79#else
72 80
73static inline 81static inline
@@ -82,6 +90,18 @@ struct wl12xx_platform_data *wl12xx_get_platform_data(void)
82 return ERR_PTR(-ENODATA); 90 return ERR_PTR(-ENODATA);
83} 91}
84 92
93static inline
94int wl1251_set_platform_data(const struct wl1251_platform_data *data)
95{
96 return -ENOSYS;
97}
98
99static inline
100struct wl1251_platform_data *wl1251_get_platform_data(void)
101{
102 return ERR_PTR(-ENODATA);
103}
104
85#endif 105#endif
86 106
87#endif 107#endif