aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 12:38:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 12:38:14 -0400
commitae045e2455429c418a418a3376301a9e5753a0a8 (patch)
treeb445bdeecd3f38aa0d0a29c9585cee49e4ccb0f1 /include/linux
parentf4f142ed4ef835709c7e6d12eaca10d190bcebed (diff)
parentd247b6ab3ce6dd43665780865ec5fa145d9ab6bd (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "Highlights: 1) Steady transitioning of the BPF instructure to a generic spot so all kernel subsystems can make use of it, from Alexei Starovoitov. 2) SFC driver supports busy polling, from Alexandre Rames. 3) Take advantage of hash table in UDP multicast delivery, from David Held. 4) Lighten locking, in particular by getting rid of the LRU lists, in inet frag handling. From Florian Westphal. 5) Add support for various RFC6458 control messages in SCTP, from Geir Ola Vaagland. 6) Allow to filter bridge forwarding database dumps by device, from Jamal Hadi Salim. 7) virtio-net also now supports busy polling, from Jason Wang. 8) Some low level optimization tweaks in pktgen from Jesper Dangaard Brouer. 9) Add support for ipv6 address generation modes, so that userland can have some input into the process. From Jiri Pirko. 10) Consolidate common TCP connection request code in ipv4 and ipv6, from Octavian Purdila. 11) New ARP packet logger in netfilter, from Pablo Neira Ayuso. 12) Generic resizable RCU hash table, with intial users in netlink and nftables. From Thomas Graf. 13) Maintain a name assignment type so that userspace can see where a network device name came from (enumerated by kernel, assigned explicitly by userspace, etc.) From Tom Gundersen. 14) Automatic flow label generation on transmit in ipv6, from Tom Herbert. 15) New packet timestamping facilities from Willem de Bruijn, meant to assist in measuring latencies going into/out-of the packet scheduler, latency from TCP data transmission to ACK, etc" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1536 commits) cxgb4 : Disable recursive mailbox commands when enabling vi net: reduce USB network driver config options. tg3: Modify tg3_tso_bug() to handle multiple TX rings amd-xgbe: Perform phy connect/disconnect at dev open/stop amd-xgbe: Use dma_set_mask_and_coherent to set DMA mask net: sun4i-emac: fix memory leak on bad packet sctp: fix possible seqlock seadlock in sctp_packet_transmit() Revert "net: phy: Set the driver when registering an MDIO bus device" cxgb4vf: Turn off SGE RX/TX Callback Timers and interrupts in PCI shutdown routine team: Simplify return path of team_newlink bridge: Update outdated comment on promiscuous mode net-timestamp: ACK timestamp for bytestreams net-timestamp: TCP timestamping net-timestamp: SCHED timestamp on entering packet scheduler net-timestamp: add key to disambiguate concurrent datagrams net-timestamp: move timestamp flags out of sk_flags net-timestamp: extend SCM_TIMESTAMPING ancillary data struct cxgb4i : Move stray CPL definitions to cxgb4 driver tcp: reduce spurious retransmits due to transient SACK reneging qlcnic: Initialize dcbnl_ops before register_netdev ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/arcdevice.h10
-rw-r--r--include/linux/bcma/bcma.h27
-rw-r--r--include/linux/bcma/bcma_driver_pcie2.h158
-rw-r--r--include/linux/crc32.h20
-rw-r--r--include/linux/filter.h112
-rw-r--r--include/linux/ieee80211.h23
-rw-r--r--include/linux/if_bridge.h20
-rw-r--r--include/linux/ipv6.h24
-rw-r--r--include/linux/isdn_ppp.h4
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/mlx4/device.h18
-rw-r--r--include/linux/mlx5/device.h4
-rw-r--r--include/linux/mlx5/driver.h27
-rw-r--r--include/linux/netdev_features.h8
-rw-r--r--include/linux/netdevice.h421
-rw-r--r--include/linux/phy.h18
-rw-r--r--include/linux/platform_data/st21nfcb.h32
-rw-r--r--include/linux/ptp_classify.h5
-rw-r--r--include/linux/rhashtable.h213
-rw-r--r--include/linux/rndis.h1
-rw-r--r--include/linux/rtnetlink.h1
-rw-r--r--include/linux/skbuff.h44
-rw-r--r--include/linux/spi/cc2520.h26
-rw-r--r--include/linux/ssb/ssb_regs.h37
-rw-r--r--include/linux/stmmac.h2
-rw-r--r--include/linux/tcp.h3
-rw-r--r--include/linux/usb/usbnet.h3
27 files changed, 1000 insertions, 263 deletions
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index 7216b0daf544..df0356220730 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -22,10 +22,6 @@
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23#include <linux/irqreturn.h> 23#include <linux/irqreturn.h>
24 24
25#ifndef bool
26#define bool int
27#endif
28
29/* 25/*
30 * RECON_THRESHOLD is the maximum number of RECON messages to receive 26 * RECON_THRESHOLD is the maximum number of RECON messages to receive
31 * within one minute before printing a "cabling problem" warning. The 27 * within one minute before printing a "cabling problem" warning. The
@@ -285,9 +281,9 @@ struct arcnet_local {
285 unsigned long first_recon; /* time of "first" RECON message to count */ 281 unsigned long first_recon; /* time of "first" RECON message to count */
286 unsigned long last_recon; /* time of most recent RECON */ 282 unsigned long last_recon; /* time of most recent RECON */
287 int num_recons; /* number of RECONs between first and last. */ 283 int num_recons; /* number of RECONs between first and last. */
288 bool network_down; /* do we think the network is down? */ 284 int network_down; /* do we think the network is down? */
289 285
290 bool excnak_pending; /* We just got an excesive nak interrupt */ 286 int excnak_pending; /* We just got an excesive nak interrupt */
291 287
292 struct { 288 struct {
293 uint16_t sequence; /* sequence number (incs with each packet) */ 289 uint16_t sequence; /* sequence number (incs with each packet) */
@@ -305,7 +301,7 @@ struct arcnet_local {
305 void (*command) (struct net_device * dev, int cmd); 301 void (*command) (struct net_device * dev, int cmd);
306 int (*status) (struct net_device * dev); 302 int (*status) (struct net_device * dev);
307 void (*intmask) (struct net_device * dev, int mask); 303 void (*intmask) (struct net_device * dev, int mask);
308 bool (*reset) (struct net_device * dev, bool really_reset); 304 int (*reset) (struct net_device * dev, int really_reset);
309 void (*open) (struct net_device * dev); 305 void (*open) (struct net_device * dev);
310 void (*close) (struct net_device * dev); 306 void (*close) (struct net_device * dev);
311 307
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 0b3bb16c705a..0272e49135d0 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -6,6 +6,7 @@
6 6
7#include <linux/bcma/bcma_driver_chipcommon.h> 7#include <linux/bcma/bcma_driver_chipcommon.h>
8#include <linux/bcma/bcma_driver_pci.h> 8#include <linux/bcma/bcma_driver_pci.h>
9#include <linux/bcma/bcma_driver_pcie2.h>
9#include <linux/bcma/bcma_driver_mips.h> 10#include <linux/bcma/bcma_driver_mips.h>
10#include <linux/bcma/bcma_driver_gmac_cmn.h> 11#include <linux/bcma/bcma_driver_gmac_cmn.h>
11#include <linux/ssb/ssb.h> /* SPROM sharing */ 12#include <linux/ssb/ssb.h> /* SPROM sharing */
@@ -72,17 +73,17 @@ struct bcma_host_ops {
72/* Core-ID values. */ 73/* Core-ID values. */
73#define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */ 74#define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */
74#define BCMA_CORE_4706_CHIPCOMMON 0x500 75#define BCMA_CORE_4706_CHIPCOMMON 0x500
75#define BCMA_CORE_PCIEG2 0x501 76#define BCMA_CORE_NS_PCIEG2 0x501
76#define BCMA_CORE_DMA 0x502 77#define BCMA_CORE_NS_DMA 0x502
77#define BCMA_CORE_SDIO3 0x503 78#define BCMA_CORE_NS_SDIO3 0x503
78#define BCMA_CORE_USB20 0x504 79#define BCMA_CORE_NS_USB20 0x504
79#define BCMA_CORE_USB30 0x505 80#define BCMA_CORE_NS_USB30 0x505
80#define BCMA_CORE_A9JTAG 0x506 81#define BCMA_CORE_NS_A9JTAG 0x506
81#define BCMA_CORE_DDR23 0x507 82#define BCMA_CORE_NS_DDR23 0x507
82#define BCMA_CORE_ROM 0x508 83#define BCMA_CORE_NS_ROM 0x508
83#define BCMA_CORE_NAND 0x509 84#define BCMA_CORE_NS_NAND 0x509
84#define BCMA_CORE_QSPI 0x50A 85#define BCMA_CORE_NS_QSPI 0x50A
85#define BCMA_CORE_CHIPCOMMON_B 0x50B 86#define BCMA_CORE_NS_CHIPCOMMON_B 0x50B
86#define BCMA_CORE_4706_SOC_RAM 0x50E 87#define BCMA_CORE_4706_SOC_RAM 0x50E
87#define BCMA_CORE_ARMCA9 0x510 88#define BCMA_CORE_ARMCA9 0x510
88#define BCMA_CORE_4706_MAC_GBIT 0x52D 89#define BCMA_CORE_4706_MAC_GBIT 0x52D
@@ -157,6 +158,9 @@ struct bcma_host_ops {
157/* Chip IDs of PCIe devices */ 158/* Chip IDs of PCIe devices */
158#define BCMA_CHIP_ID_BCM4313 0x4313 159#define BCMA_CHIP_ID_BCM4313 0x4313
159#define BCMA_CHIP_ID_BCM43142 43142 160#define BCMA_CHIP_ID_BCM43142 43142
161#define BCMA_CHIP_ID_BCM43131 43131
162#define BCMA_CHIP_ID_BCM43217 43217
163#define BCMA_CHIP_ID_BCM43222 43222
160#define BCMA_CHIP_ID_BCM43224 43224 164#define BCMA_CHIP_ID_BCM43224 43224
161#define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8 165#define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8
162#define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa 166#define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa
@@ -333,6 +337,7 @@ struct bcma_bus {
333 337
334 struct bcma_drv_cc drv_cc; 338 struct bcma_drv_cc drv_cc;
335 struct bcma_drv_pci drv_pci[2]; 339 struct bcma_drv_pci drv_pci[2];
340 struct bcma_drv_pcie2 drv_pcie2;
336 struct bcma_drv_mips drv_mips; 341 struct bcma_drv_mips drv_mips;
337 struct bcma_drv_gmac_cmn drv_gmac_cmn; 342 struct bcma_drv_gmac_cmn drv_gmac_cmn;
338 343
diff --git a/include/linux/bcma/bcma_driver_pcie2.h b/include/linux/bcma/bcma_driver_pcie2.h
new file mode 100644
index 000000000000..5988b05781c3
--- /dev/null
+++ b/include/linux/bcma/bcma_driver_pcie2.h
@@ -0,0 +1,158 @@
1#ifndef LINUX_BCMA_DRIVER_PCIE2_H_
2#define LINUX_BCMA_DRIVER_PCIE2_H_
3
4#define BCMA_CORE_PCIE2_CLK_CONTROL 0x0000
5#define PCIE2_CLKC_RST_OE 0x0001 /* When set, drives PCI_RESET out to pin */
6#define PCIE2_CLKC_RST 0x0002 /* Value driven out to pin */
7#define PCIE2_CLKC_SPERST 0x0004 /* SurvivePeRst */
8#define PCIE2_CLKC_DISABLE_L1CLK_GATING 0x0010
9#define PCIE2_CLKC_DLYPERST 0x0100 /* Delay PeRst to CoE Core */
10#define PCIE2_CLKC_DISSPROMLD 0x0200 /* DisableSpromLoadOnPerst */
11#define PCIE2_CLKC_WAKE_MODE_L2 0x1000 /* Wake on L2 */
12#define BCMA_CORE_PCIE2_RC_PM_CONTROL 0x0004
13#define BCMA_CORE_PCIE2_RC_PM_STATUS 0x0008
14#define BCMA_CORE_PCIE2_EP_PM_CONTROL 0x000C
15#define BCMA_CORE_PCIE2_EP_PM_STATUS 0x0010
16#define BCMA_CORE_PCIE2_EP_LTR_CONTROL 0x0014
17#define BCMA_CORE_PCIE2_EP_LTR_STATUS 0x0018
18#define BCMA_CORE_PCIE2_EP_OBFF_STATUS 0x001C
19#define BCMA_CORE_PCIE2_PCIE_ERR_STATUS 0x0020
20#define BCMA_CORE_PCIE2_RC_AXI_CONFIG 0x0100
21#define BCMA_CORE_PCIE2_EP_AXI_CONFIG 0x0104
22#define BCMA_CORE_PCIE2_RXDEBUG_STATUS0 0x0108
23#define BCMA_CORE_PCIE2_RXDEBUG_CONTROL0 0x010C
24#define BCMA_CORE_PCIE2_CONFIGINDADDR 0x0120
25#define BCMA_CORE_PCIE2_CONFIGINDDATA 0x0124
26#define BCMA_CORE_PCIE2_MDIOCONTROL 0x0128
27#define BCMA_CORE_PCIE2_MDIOWRDATA 0x012C
28#define BCMA_CORE_PCIE2_MDIORDDATA 0x0130
29#define BCMA_CORE_PCIE2_DATAINTF 0x0180
30#define BCMA_CORE_PCIE2_D2H_INTRLAZY_0 0x0188
31#define BCMA_CORE_PCIE2_H2D_INTRLAZY_0 0x018c
32#define BCMA_CORE_PCIE2_H2D_INTSTAT_0 0x0190
33#define BCMA_CORE_PCIE2_H2D_INTMASK_0 0x0194
34#define BCMA_CORE_PCIE2_D2H_INTSTAT_0 0x0198
35#define BCMA_CORE_PCIE2_D2H_INTMASK_0 0x019c
36#define BCMA_CORE_PCIE2_LTR_STATE 0x01A0 /* Latency Tolerance Reporting */
37#define PCIE2_LTR_ACTIVE 2
38#define PCIE2_LTR_ACTIVE_IDLE 1
39#define PCIE2_LTR_SLEEP 0
40#define PCIE2_LTR_FINAL_MASK 0x300
41#define PCIE2_LTR_FINAL_SHIFT 8
42#define BCMA_CORE_PCIE2_PWR_INT_STATUS 0x01A4
43#define BCMA_CORE_PCIE2_PWR_INT_MASK 0x01A8
44#define BCMA_CORE_PCIE2_CFG_ADDR 0x01F8
45#define BCMA_CORE_PCIE2_CFG_DATA 0x01FC
46#define BCMA_CORE_PCIE2_SYS_EQ_PAGE 0x0200
47#define BCMA_CORE_PCIE2_SYS_MSI_PAGE 0x0204
48#define BCMA_CORE_PCIE2_SYS_MSI_INTREN 0x0208
49#define BCMA_CORE_PCIE2_SYS_MSI_CTRL0 0x0210
50#define BCMA_CORE_PCIE2_SYS_MSI_CTRL1 0x0214
51#define BCMA_CORE_PCIE2_SYS_MSI_CTRL2 0x0218
52#define BCMA_CORE_PCIE2_SYS_MSI_CTRL3 0x021C
53#define BCMA_CORE_PCIE2_SYS_MSI_CTRL4 0x0220
54#define BCMA_CORE_PCIE2_SYS_MSI_CTRL5 0x0224
55#define BCMA_CORE_PCIE2_SYS_EQ_HEAD0 0x0250
56#define BCMA_CORE_PCIE2_SYS_EQ_TAIL0 0x0254
57#define BCMA_CORE_PCIE2_SYS_EQ_HEAD1 0x0258
58#define BCMA_CORE_PCIE2_SYS_EQ_TAIL1 0x025C
59#define BCMA_CORE_PCIE2_SYS_EQ_HEAD2 0x0260
60#define BCMA_CORE_PCIE2_SYS_EQ_TAIL2 0x0264
61#define BCMA_CORE_PCIE2_SYS_EQ_HEAD3 0x0268
62#define BCMA_CORE_PCIE2_SYS_EQ_TAIL3 0x026C
63#define BCMA_CORE_PCIE2_SYS_EQ_HEAD4 0x0270
64#define BCMA_CORE_PCIE2_SYS_EQ_TAIL4 0x0274
65#define BCMA_CORE_PCIE2_SYS_EQ_HEAD5 0x0278
66#define BCMA_CORE_PCIE2_SYS_EQ_TAIL5 0x027C
67#define BCMA_CORE_PCIE2_SYS_RC_INTX_EN 0x0330
68#define BCMA_CORE_PCIE2_SYS_RC_INTX_CSR 0x0334
69#define BCMA_CORE_PCIE2_SYS_MSI_REQ 0x0340
70#define BCMA_CORE_PCIE2_SYS_HOST_INTR_EN 0x0344
71#define BCMA_CORE_PCIE2_SYS_HOST_INTR_CSR 0x0348
72#define BCMA_CORE_PCIE2_SYS_HOST_INTR0 0x0350
73#define BCMA_CORE_PCIE2_SYS_HOST_INTR1 0x0354
74#define BCMA_CORE_PCIE2_SYS_HOST_INTR2 0x0358
75#define BCMA_CORE_PCIE2_SYS_HOST_INTR3 0x035C
76#define BCMA_CORE_PCIE2_SYS_EP_INT_EN0 0x0360
77#define BCMA_CORE_PCIE2_SYS_EP_INT_EN1 0x0364
78#define BCMA_CORE_PCIE2_SYS_EP_INT_CSR0 0x0370
79#define BCMA_CORE_PCIE2_SYS_EP_INT_CSR1 0x0374
80#define BCMA_CORE_PCIE2_SPROM(wordoffset) (0x0800 + ((wordoffset) * 2))
81#define BCMA_CORE_PCIE2_FUNC0_IMAP0_0 0x0C00
82#define BCMA_CORE_PCIE2_FUNC0_IMAP0_1 0x0C04
83#define BCMA_CORE_PCIE2_FUNC0_IMAP0_2 0x0C08
84#define BCMA_CORE_PCIE2_FUNC0_IMAP0_3 0x0C0C
85#define BCMA_CORE_PCIE2_FUNC0_IMAP0_4 0x0C10
86#define BCMA_CORE_PCIE2_FUNC0_IMAP0_5 0x0C14
87#define BCMA_CORE_PCIE2_FUNC0_IMAP0_6 0x0C18
88#define BCMA_CORE_PCIE2_FUNC0_IMAP0_7 0x0C1C
89#define BCMA_CORE_PCIE2_FUNC1_IMAP0_0 0x0C20
90#define BCMA_CORE_PCIE2_FUNC1_IMAP0_1 0x0C24
91#define BCMA_CORE_PCIE2_FUNC1_IMAP0_2 0x0C28
92#define BCMA_CORE_PCIE2_FUNC1_IMAP0_3 0x0C2C
93#define BCMA_CORE_PCIE2_FUNC1_IMAP0_4 0x0C30
94#define BCMA_CORE_PCIE2_FUNC1_IMAP0_5 0x0C34
95#define BCMA_CORE_PCIE2_FUNC1_IMAP0_6 0x0C38
96#define BCMA_CORE_PCIE2_FUNC1_IMAP0_7 0x0C3C
97#define BCMA_CORE_PCIE2_FUNC0_IMAP1 0x0C80
98#define BCMA_CORE_PCIE2_FUNC1_IMAP1 0x0C88
99#define BCMA_CORE_PCIE2_FUNC0_IMAP2 0x0CC0
100#define BCMA_CORE_PCIE2_FUNC1_IMAP2 0x0CC8
101#define BCMA_CORE_PCIE2_IARR0_LOWER 0x0D00
102#define BCMA_CORE_PCIE2_IARR0_UPPER 0x0D04
103#define BCMA_CORE_PCIE2_IARR1_LOWER 0x0D08
104#define BCMA_CORE_PCIE2_IARR1_UPPER 0x0D0C
105#define BCMA_CORE_PCIE2_IARR2_LOWER 0x0D10
106#define BCMA_CORE_PCIE2_IARR2_UPPER 0x0D14
107#define BCMA_CORE_PCIE2_OARR0 0x0D20
108#define BCMA_CORE_PCIE2_OARR1 0x0D28
109#define BCMA_CORE_PCIE2_OARR2 0x0D30
110#define BCMA_CORE_PCIE2_OMAP0_LOWER 0x0D40
111#define BCMA_CORE_PCIE2_OMAP0_UPPER 0x0D44
112#define BCMA_CORE_PCIE2_OMAP1_LOWER 0x0D48
113#define BCMA_CORE_PCIE2_OMAP1_UPPER 0x0D4C
114#define BCMA_CORE_PCIE2_OMAP2_LOWER 0x0D50
115#define BCMA_CORE_PCIE2_OMAP2_UPPER 0x0D54
116#define BCMA_CORE_PCIE2_FUNC1_IARR1_SIZE 0x0D58
117#define BCMA_CORE_PCIE2_FUNC1_IARR2_SIZE 0x0D5C
118#define BCMA_CORE_PCIE2_MEM_CONTROL 0x0F00
119#define BCMA_CORE_PCIE2_MEM_ECC_ERRLOG0 0x0F04
120#define BCMA_CORE_PCIE2_MEM_ECC_ERRLOG1 0x0F08
121#define BCMA_CORE_PCIE2_LINK_STATUS 0x0F0C
122#define BCMA_CORE_PCIE2_STRAP_STATUS 0x0F10
123#define BCMA_CORE_PCIE2_RESET_STATUS 0x0F14
124#define BCMA_CORE_PCIE2_RESETEN_IN_LINKDOWN 0x0F18
125#define BCMA_CORE_PCIE2_MISC_INTR_EN 0x0F1C
126#define BCMA_CORE_PCIE2_TX_DEBUG_CFG 0x0F20
127#define BCMA_CORE_PCIE2_MISC_CONFIG 0x0F24
128#define BCMA_CORE_PCIE2_MISC_STATUS 0x0F28
129#define BCMA_CORE_PCIE2_INTR_EN 0x0F30
130#define BCMA_CORE_PCIE2_INTR_CLEAR 0x0F34
131#define BCMA_CORE_PCIE2_INTR_STATUS 0x0F38
132
133/* PCIE gen2 config regs */
134#define PCIE2_INTSTATUS 0x090
135#define PCIE2_INTMASK 0x094
136#define PCIE2_SBMBX 0x098
137
138#define PCIE2_PMCR_REFUP 0x1814 /* Trefup time */
139
140#define PCIE2_CAP_DEVSTSCTRL2_OFFSET 0xD4
141#define PCIE2_CAP_DEVSTSCTRL2_LTRENAB 0x400
142#define PCIE2_PVT_REG_PM_CLK_PERIOD 0x184c
143
144struct bcma_drv_pcie2 {
145 struct bcma_device *core;
146};
147
148#define pcie2_read16(pcie2, offset) bcma_read16((pcie2)->core, offset)
149#define pcie2_read32(pcie2, offset) bcma_read32((pcie2)->core, offset)
150#define pcie2_write16(pcie2, offset, val) bcma_write16((pcie2)->core, offset, val)
151#define pcie2_write32(pcie2, offset, val) bcma_write32((pcie2)->core, offset, val)
152
153#define pcie2_set32(pcie2, offset, set) bcma_set32((pcie2)->core, offset, set)
154#define pcie2_mask32(pcie2, offset, mask) bcma_mask32((pcie2)->core, offset, mask)
155
156void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2);
157
158#endif /* LINUX_BCMA_DRIVER_PCIE2_H_ */
diff --git a/include/linux/crc32.h b/include/linux/crc32.h
index 7d275c4fc011..9e8a032c1788 100644
--- a/include/linux/crc32.h
+++ b/include/linux/crc32.h
@@ -8,8 +8,8 @@
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/bitrev.h> 9#include <linux/bitrev.h>
10 10
11extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len); 11u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len);
12extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); 12u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len);
13 13
14/** 14/**
15 * crc32_le_combine - Combine two crc32 check values into one. For two 15 * crc32_le_combine - Combine two crc32 check values into one. For two
@@ -29,9 +29,14 @@ extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len);
29 * with the same initializer as crc1, and crc2 seed was 0. See 29 * with the same initializer as crc1, and crc2 seed was 0. See
30 * also crc32_combine_test(). 30 * also crc32_combine_test().
31 */ 31 */
32extern u32 crc32_le_combine(u32 crc1, u32 crc2, size_t len2); 32u32 __attribute_const__ crc32_le_shift(u32 crc, size_t len);
33 33
34extern u32 __crc32c_le(u32 crc, unsigned char const *p, size_t len); 34static inline u32 crc32_le_combine(u32 crc1, u32 crc2, size_t len2)
35{
36 return crc32_le_shift(crc1, len2) ^ crc2;
37}
38
39u32 __pure __crc32c_le(u32 crc, unsigned char const *p, size_t len);
35 40
36/** 41/**
37 * __crc32c_le_combine - Combine two crc32c check values into one. For two 42 * __crc32c_le_combine - Combine two crc32c check values into one. For two
@@ -51,7 +56,12 @@ extern u32 __crc32c_le(u32 crc, unsigned char const *p, size_t len);
51 * seeded with the same initializer as crc1, and crc2 seed 56 * seeded with the same initializer as crc1, and crc2 seed
52 * was 0. See also crc32c_combine_test(). 57 * was 0. See also crc32c_combine_test().
53 */ 58 */
54extern u32 __crc32c_le_combine(u32 crc1, u32 crc2, size_t len2); 59u32 __attribute_const__ __crc32c_le_shift(u32 crc, size_t len);
60
61static inline u32 __crc32c_le_combine(u32 crc1, u32 crc2, size_t len2)
62{
63 return __crc32c_le_shift(crc1, len2) ^ crc2;
64}
55 65
56#define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)(data), length) 66#define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)(data), length)
57 67
diff --git a/include/linux/filter.h b/include/linux/filter.h
index a7e3c48d73a7..a5227ab8ccb1 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -6,6 +6,7 @@
6 6
7#include <linux/atomic.h> 7#include <linux/atomic.h>
8#include <linux/compat.h> 8#include <linux/compat.h>
9#include <linux/skbuff.h>
9#include <linux/workqueue.h> 10#include <linux/workqueue.h>
10#include <uapi/linux/filter.h> 11#include <uapi/linux/filter.h>
11 12
@@ -81,7 +82,7 @@ enum {
81/* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */ 82/* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */
82 83
83#define BPF_ALU64_REG(OP, DST, SRC) \ 84#define BPF_ALU64_REG(OP, DST, SRC) \
84 ((struct sock_filter_int) { \ 85 ((struct bpf_insn) { \
85 .code = BPF_ALU64 | BPF_OP(OP) | BPF_X, \ 86 .code = BPF_ALU64 | BPF_OP(OP) | BPF_X, \
86 .dst_reg = DST, \ 87 .dst_reg = DST, \
87 .src_reg = SRC, \ 88 .src_reg = SRC, \
@@ -89,7 +90,7 @@ enum {
89 .imm = 0 }) 90 .imm = 0 })
90 91
91#define BPF_ALU32_REG(OP, DST, SRC) \ 92#define BPF_ALU32_REG(OP, DST, SRC) \
92 ((struct sock_filter_int) { \ 93 ((struct bpf_insn) { \
93 .code = BPF_ALU | BPF_OP(OP) | BPF_X, \ 94 .code = BPF_ALU | BPF_OP(OP) | BPF_X, \
94 .dst_reg = DST, \ 95 .dst_reg = DST, \
95 .src_reg = SRC, \ 96 .src_reg = SRC, \
@@ -99,7 +100,7 @@ enum {
99/* ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 */ 100/* ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 */
100 101
101#define BPF_ALU64_IMM(OP, DST, IMM) \ 102#define BPF_ALU64_IMM(OP, DST, IMM) \
102 ((struct sock_filter_int) { \ 103 ((struct bpf_insn) { \
103 .code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \ 104 .code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \
104 .dst_reg = DST, \ 105 .dst_reg = DST, \
105 .src_reg = 0, \ 106 .src_reg = 0, \
@@ -107,7 +108,7 @@ enum {
107 .imm = IMM }) 108 .imm = IMM })
108 109
109#define BPF_ALU32_IMM(OP, DST, IMM) \ 110#define BPF_ALU32_IMM(OP, DST, IMM) \
110 ((struct sock_filter_int) { \ 111 ((struct bpf_insn) { \
111 .code = BPF_ALU | BPF_OP(OP) | BPF_K, \ 112 .code = BPF_ALU | BPF_OP(OP) | BPF_K, \
112 .dst_reg = DST, \ 113 .dst_reg = DST, \
113 .src_reg = 0, \ 114 .src_reg = 0, \
@@ -117,7 +118,7 @@ enum {
117/* Endianess conversion, cpu_to_{l,b}e(), {l,b}e_to_cpu() */ 118/* Endianess conversion, cpu_to_{l,b}e(), {l,b}e_to_cpu() */
118 119
119#define BPF_ENDIAN(TYPE, DST, LEN) \ 120#define BPF_ENDIAN(TYPE, DST, LEN) \
120 ((struct sock_filter_int) { \ 121 ((struct bpf_insn) { \
121 .code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \ 122 .code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \
122 .dst_reg = DST, \ 123 .dst_reg = DST, \
123 .src_reg = 0, \ 124 .src_reg = 0, \
@@ -127,7 +128,7 @@ enum {
127/* Short form of mov, dst_reg = src_reg */ 128/* Short form of mov, dst_reg = src_reg */
128 129
129#define BPF_MOV64_REG(DST, SRC) \ 130#define BPF_MOV64_REG(DST, SRC) \
130 ((struct sock_filter_int) { \ 131 ((struct bpf_insn) { \
131 .code = BPF_ALU64 | BPF_MOV | BPF_X, \ 132 .code = BPF_ALU64 | BPF_MOV | BPF_X, \
132 .dst_reg = DST, \ 133 .dst_reg = DST, \
133 .src_reg = SRC, \ 134 .src_reg = SRC, \
@@ -135,7 +136,7 @@ enum {
135 .imm = 0 }) 136 .imm = 0 })
136 137
137#define BPF_MOV32_REG(DST, SRC) \ 138#define BPF_MOV32_REG(DST, SRC) \
138 ((struct sock_filter_int) { \ 139 ((struct bpf_insn) { \
139 .code = BPF_ALU | BPF_MOV | BPF_X, \ 140 .code = BPF_ALU | BPF_MOV | BPF_X, \
140 .dst_reg = DST, \ 141 .dst_reg = DST, \
141 .src_reg = SRC, \ 142 .src_reg = SRC, \
@@ -145,7 +146,7 @@ enum {
145/* Short form of mov, dst_reg = imm32 */ 146/* Short form of mov, dst_reg = imm32 */
146 147
147#define BPF_MOV64_IMM(DST, IMM) \ 148#define BPF_MOV64_IMM(DST, IMM) \
148 ((struct sock_filter_int) { \ 149 ((struct bpf_insn) { \
149 .code = BPF_ALU64 | BPF_MOV | BPF_K, \ 150 .code = BPF_ALU64 | BPF_MOV | BPF_K, \
150 .dst_reg = DST, \ 151 .dst_reg = DST, \
151 .src_reg = 0, \ 152 .src_reg = 0, \
@@ -153,7 +154,7 @@ enum {
153 .imm = IMM }) 154 .imm = IMM })
154 155
155#define BPF_MOV32_IMM(DST, IMM) \ 156#define BPF_MOV32_IMM(DST, IMM) \
156 ((struct sock_filter_int) { \ 157 ((struct bpf_insn) { \
157 .code = BPF_ALU | BPF_MOV | BPF_K, \ 158 .code = BPF_ALU | BPF_MOV | BPF_K, \
158 .dst_reg = DST, \ 159 .dst_reg = DST, \
159 .src_reg = 0, \ 160 .src_reg = 0, \
@@ -163,7 +164,7 @@ enum {
163/* Short form of mov based on type, BPF_X: dst_reg = src_reg, BPF_K: dst_reg = imm32 */ 164/* Short form of mov based on type, BPF_X: dst_reg = src_reg, BPF_K: dst_reg = imm32 */
164 165
165#define BPF_MOV64_RAW(TYPE, DST, SRC, IMM) \ 166#define BPF_MOV64_RAW(TYPE, DST, SRC, IMM) \
166 ((struct sock_filter_int) { \ 167 ((struct bpf_insn) { \
167 .code = BPF_ALU64 | BPF_MOV | BPF_SRC(TYPE), \ 168 .code = BPF_ALU64 | BPF_MOV | BPF_SRC(TYPE), \
168 .dst_reg = DST, \ 169 .dst_reg = DST, \
169 .src_reg = SRC, \ 170 .src_reg = SRC, \
@@ -171,7 +172,7 @@ enum {
171 .imm = IMM }) 172 .imm = IMM })
172 173
173#define BPF_MOV32_RAW(TYPE, DST, SRC, IMM) \ 174#define BPF_MOV32_RAW(TYPE, DST, SRC, IMM) \
174 ((struct sock_filter_int) { \ 175 ((struct bpf_insn) { \
175 .code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \ 176 .code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \
176 .dst_reg = DST, \ 177 .dst_reg = DST, \
177 .src_reg = SRC, \ 178 .src_reg = SRC, \
@@ -181,7 +182,7 @@ enum {
181/* Direct packet access, R0 = *(uint *) (skb->data + imm32) */ 182/* Direct packet access, R0 = *(uint *) (skb->data + imm32) */
182 183
183#define BPF_LD_ABS(SIZE, IMM) \ 184#define BPF_LD_ABS(SIZE, IMM) \
184 ((struct sock_filter_int) { \ 185 ((struct bpf_insn) { \
185 .code = BPF_LD | BPF_SIZE(SIZE) | BPF_ABS, \ 186 .code = BPF_LD | BPF_SIZE(SIZE) | BPF_ABS, \
186 .dst_reg = 0, \ 187 .dst_reg = 0, \
187 .src_reg = 0, \ 188 .src_reg = 0, \
@@ -191,7 +192,7 @@ enum {
191/* Indirect packet access, R0 = *(uint *) (skb->data + src_reg + imm32) */ 192/* Indirect packet access, R0 = *(uint *) (skb->data + src_reg + imm32) */
192 193
193#define BPF_LD_IND(SIZE, SRC, IMM) \ 194#define BPF_LD_IND(SIZE, SRC, IMM) \
194 ((struct sock_filter_int) { \ 195 ((struct bpf_insn) { \
195 .code = BPF_LD | BPF_SIZE(SIZE) | BPF_IND, \ 196 .code = BPF_LD | BPF_SIZE(SIZE) | BPF_IND, \
196 .dst_reg = 0, \ 197 .dst_reg = 0, \
197 .src_reg = SRC, \ 198 .src_reg = SRC, \
@@ -201,7 +202,7 @@ enum {
201/* Memory load, dst_reg = *(uint *) (src_reg + off16) */ 202/* Memory load, dst_reg = *(uint *) (src_reg + off16) */
202 203
203#define BPF_LDX_MEM(SIZE, DST, SRC, OFF) \ 204#define BPF_LDX_MEM(SIZE, DST, SRC, OFF) \
204 ((struct sock_filter_int) { \ 205 ((struct bpf_insn) { \
205 .code = BPF_LDX | BPF_SIZE(SIZE) | BPF_MEM, \ 206 .code = BPF_LDX | BPF_SIZE(SIZE) | BPF_MEM, \
206 .dst_reg = DST, \ 207 .dst_reg = DST, \
207 .src_reg = SRC, \ 208 .src_reg = SRC, \
@@ -211,7 +212,7 @@ enum {
211/* Memory store, *(uint *) (dst_reg + off16) = src_reg */ 212/* Memory store, *(uint *) (dst_reg + off16) = src_reg */
212 213
213#define BPF_STX_MEM(SIZE, DST, SRC, OFF) \ 214#define BPF_STX_MEM(SIZE, DST, SRC, OFF) \
214 ((struct sock_filter_int) { \ 215 ((struct bpf_insn) { \
215 .code = BPF_STX | BPF_SIZE(SIZE) | BPF_MEM, \ 216 .code = BPF_STX | BPF_SIZE(SIZE) | BPF_MEM, \
216 .dst_reg = DST, \ 217 .dst_reg = DST, \
217 .src_reg = SRC, \ 218 .src_reg = SRC, \
@@ -221,7 +222,7 @@ enum {
221/* Memory store, *(uint *) (dst_reg + off16) = imm32 */ 222/* Memory store, *(uint *) (dst_reg + off16) = imm32 */
222 223
223#define BPF_ST_MEM(SIZE, DST, OFF, IMM) \ 224#define BPF_ST_MEM(SIZE, DST, OFF, IMM) \
224 ((struct sock_filter_int) { \ 225 ((struct bpf_insn) { \
225 .code = BPF_ST | BPF_SIZE(SIZE) | BPF_MEM, \ 226 .code = BPF_ST | BPF_SIZE(SIZE) | BPF_MEM, \
226 .dst_reg = DST, \ 227 .dst_reg = DST, \
227 .src_reg = 0, \ 228 .src_reg = 0, \
@@ -231,7 +232,7 @@ enum {
231/* Conditional jumps against registers, if (dst_reg 'op' src_reg) goto pc + off16 */ 232/* Conditional jumps against registers, if (dst_reg 'op' src_reg) goto pc + off16 */
232 233
233#define BPF_JMP_REG(OP, DST, SRC, OFF) \ 234#define BPF_JMP_REG(OP, DST, SRC, OFF) \
234 ((struct sock_filter_int) { \ 235 ((struct bpf_insn) { \
235 .code = BPF_JMP | BPF_OP(OP) | BPF_X, \ 236 .code = BPF_JMP | BPF_OP(OP) | BPF_X, \
236 .dst_reg = DST, \ 237 .dst_reg = DST, \
237 .src_reg = SRC, \ 238 .src_reg = SRC, \
@@ -241,7 +242,7 @@ enum {
241/* Conditional jumps against immediates, if (dst_reg 'op' imm32) goto pc + off16 */ 242/* Conditional jumps against immediates, if (dst_reg 'op' imm32) goto pc + off16 */
242 243
243#define BPF_JMP_IMM(OP, DST, IMM, OFF) \ 244#define BPF_JMP_IMM(OP, DST, IMM, OFF) \
244 ((struct sock_filter_int) { \ 245 ((struct bpf_insn) { \
245 .code = BPF_JMP | BPF_OP(OP) | BPF_K, \ 246 .code = BPF_JMP | BPF_OP(OP) | BPF_K, \
246 .dst_reg = DST, \ 247 .dst_reg = DST, \
247 .src_reg = 0, \ 248 .src_reg = 0, \
@@ -251,7 +252,7 @@ enum {
251/* Function call */ 252/* Function call */
252 253
253#define BPF_EMIT_CALL(FUNC) \ 254#define BPF_EMIT_CALL(FUNC) \
254 ((struct sock_filter_int) { \ 255 ((struct bpf_insn) { \
255 .code = BPF_JMP | BPF_CALL, \ 256 .code = BPF_JMP | BPF_CALL, \
256 .dst_reg = 0, \ 257 .dst_reg = 0, \
257 .src_reg = 0, \ 258 .src_reg = 0, \
@@ -261,7 +262,7 @@ enum {
261/* Raw code statement block */ 262/* Raw code statement block */
262 263
263#define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \ 264#define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \
264 ((struct sock_filter_int) { \ 265 ((struct bpf_insn) { \
265 .code = CODE, \ 266 .code = CODE, \
266 .dst_reg = DST, \ 267 .dst_reg = DST, \
267 .src_reg = SRC, \ 268 .src_reg = SRC, \
@@ -271,7 +272,7 @@ enum {
271/* Program exit */ 272/* Program exit */
272 273
273#define BPF_EXIT_INSN() \ 274#define BPF_EXIT_INSN() \
274 ((struct sock_filter_int) { \ 275 ((struct bpf_insn) { \
275 .code = BPF_JMP | BPF_EXIT, \ 276 .code = BPF_JMP | BPF_EXIT, \
276 .dst_reg = 0, \ 277 .dst_reg = 0, \
277 .src_reg = 0, \ 278 .src_reg = 0, \
@@ -295,9 +296,10 @@ enum {
295}) 296})
296 297
297/* Macro to invoke filter function. */ 298/* Macro to invoke filter function. */
298#define SK_RUN_FILTER(filter, ctx) (*filter->bpf_func)(ctx, filter->insnsi) 299#define SK_RUN_FILTER(filter, ctx) \
300 (*filter->prog->bpf_func)(ctx, filter->prog->insnsi)
299 301
300struct sock_filter_int { 302struct bpf_insn {
301 __u8 code; /* opcode */ 303 __u8 code; /* opcode */
302 __u8 dst_reg:4; /* dest register */ 304 __u8 dst_reg:4; /* dest register */
303 __u8 src_reg:4; /* source register */ 305 __u8 src_reg:4; /* source register */
@@ -322,54 +324,58 @@ struct sk_buff;
322struct sock; 324struct sock;
323struct seccomp_data; 325struct seccomp_data;
324 326
325struct sk_filter { 327struct bpf_prog {
326 atomic_t refcnt;
327 u32 jited:1, /* Is our filter JIT'ed? */ 328 u32 jited:1, /* Is our filter JIT'ed? */
328 len:31; /* Number of filter blocks */ 329 len:31; /* Number of filter blocks */
329 struct sock_fprog_kern *orig_prog; /* Original BPF program */ 330 struct sock_fprog_kern *orig_prog; /* Original BPF program */
330 struct rcu_head rcu;
331 unsigned int (*bpf_func)(const struct sk_buff *skb, 331 unsigned int (*bpf_func)(const struct sk_buff *skb,
332 const struct sock_filter_int *filter); 332 const struct bpf_insn *filter);
333 union { 333 union {
334 struct sock_filter insns[0]; 334 struct sock_filter insns[0];
335 struct sock_filter_int insnsi[0]; 335 struct bpf_insn insnsi[0];
336 struct work_struct work; 336 struct work_struct work;
337 }; 337 };
338}; 338};
339 339
340static inline unsigned int sk_filter_size(unsigned int proglen) 340struct sk_filter {
341 atomic_t refcnt;
342 struct rcu_head rcu;
343 struct bpf_prog *prog;
344};
345
346#define BPF_PROG_RUN(filter, ctx) (*filter->bpf_func)(ctx, filter->insnsi)
347
348static inline unsigned int bpf_prog_size(unsigned int proglen)
341{ 349{
342 return max(sizeof(struct sk_filter), 350 return max(sizeof(struct bpf_prog),
343 offsetof(struct sk_filter, insns[proglen])); 351 offsetof(struct bpf_prog, insns[proglen]));
344} 352}
345 353
346#define sk_filter_proglen(fprog) \ 354#define bpf_classic_proglen(fprog) (fprog->len * sizeof(fprog->filter[0]))
347 (fprog->len * sizeof(fprog->filter[0]))
348 355
349int sk_filter(struct sock *sk, struct sk_buff *skb); 356int sk_filter(struct sock *sk, struct sk_buff *skb);
350 357
351void sk_filter_select_runtime(struct sk_filter *fp); 358void bpf_prog_select_runtime(struct bpf_prog *fp);
352void sk_filter_free(struct sk_filter *fp); 359void bpf_prog_free(struct bpf_prog *fp);
353 360
354int sk_convert_filter(struct sock_filter *prog, int len, 361int bpf_convert_filter(struct sock_filter *prog, int len,
355 struct sock_filter_int *new_prog, int *new_len); 362 struct bpf_insn *new_prog, int *new_len);
356 363
357int sk_unattached_filter_create(struct sk_filter **pfp, 364int bpf_prog_create(struct bpf_prog **pfp, struct sock_fprog_kern *fprog);
358 struct sock_fprog_kern *fprog); 365void bpf_prog_destroy(struct bpf_prog *fp);
359void sk_unattached_filter_destroy(struct sk_filter *fp);
360 366
361int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 367int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
362int sk_detach_filter(struct sock *sk); 368int sk_detach_filter(struct sock *sk);
363 369
364int sk_chk_filter(struct sock_filter *filter, unsigned int flen); 370int bpf_check_classic(const struct sock_filter *filter, unsigned int flen);
365int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, 371int sk_get_filter(struct sock *sk, struct sock_filter __user *filter,
366 unsigned int len); 372 unsigned int len);
367 373
368void sk_filter_charge(struct sock *sk, struct sk_filter *fp); 374bool sk_filter_charge(struct sock *sk, struct sk_filter *fp);
369void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp); 375void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp);
370 376
371u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5); 377u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);
372void bpf_int_jit_compile(struct sk_filter *fp); 378void bpf_int_jit_compile(struct bpf_prog *fp);
373 379
374#define BPF_ANC BIT(15) 380#define BPF_ANC BIT(15)
375 381
@@ -406,13 +412,25 @@ static inline u16 bpf_anc_helper(const struct sock_filter *ftest)
406 } 412 }
407} 413}
408 414
415void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb,
416 int k, unsigned int size);
417
418static inline void *bpf_load_pointer(const struct sk_buff *skb, int k,
419 unsigned int size, void *buffer)
420{
421 if (k >= 0)
422 return skb_header_pointer(skb, k, size, buffer);
423
424 return bpf_internal_load_pointer_neg_helper(skb, k, size);
425}
426
409#ifdef CONFIG_BPF_JIT 427#ifdef CONFIG_BPF_JIT
410#include <stdarg.h> 428#include <stdarg.h>
411#include <linux/linkage.h> 429#include <linux/linkage.h>
412#include <linux/printk.h> 430#include <linux/printk.h>
413 431
414void bpf_jit_compile(struct sk_filter *fp); 432void bpf_jit_compile(struct bpf_prog *fp);
415void bpf_jit_free(struct sk_filter *fp); 433void bpf_jit_free(struct bpf_prog *fp);
416 434
417static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, 435static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
418 u32 pass, void *image) 436 u32 pass, void *image)
@@ -426,11 +444,11 @@ static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
426#else 444#else
427#include <linux/slab.h> 445#include <linux/slab.h>
428 446
429static inline void bpf_jit_compile(struct sk_filter *fp) 447static inline void bpf_jit_compile(struct bpf_prog *fp)
430{ 448{
431} 449}
432 450
433static inline void bpf_jit_free(struct sk_filter *fp) 451static inline void bpf_jit_free(struct bpf_prog *fp)
434{ 452{
435 kfree(fp); 453 kfree(fp);
436} 454}
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 6bff13f74050..63ab3873c5ed 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1001,6 +1001,26 @@ struct ieee80211_vendor_ie {
1001 u8 oui_type; 1001 u8 oui_type;
1002} __packed; 1002} __packed;
1003 1003
1004struct ieee80211_wmm_ac_param {
1005 u8 aci_aifsn; /* AIFSN, ACM, ACI */
1006 u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */
1007 __le16 txop_limit;
1008} __packed;
1009
1010struct ieee80211_wmm_param_ie {
1011 u8 element_id; /* Element ID: 221 (0xdd); */
1012 u8 len; /* Length: 24 */
1013 /* required fields for WMM version 1 */
1014 u8 oui[3]; /* 00:50:f2 */
1015 u8 oui_type; /* 2 */
1016 u8 oui_subtype; /* 1 */
1017 u8 version; /* 1 for WMM version 1.0 */
1018 u8 qos_info; /* AP/STA specific QoS info */
1019 u8 reserved; /* 0 */
1020 /* AC_BE, AC_BK, AC_VI, AC_VO */
1021 struct ieee80211_wmm_ac_param ac[4];
1022} __packed;
1023
1004/* Control frames */ 1024/* Control frames */
1005struct ieee80211_rts { 1025struct ieee80211_rts {
1006 __le16 frame_control; 1026 __le16 frame_control;
@@ -1621,6 +1641,9 @@ enum ieee80211_reasoncode {
1621 WLAN_REASON_INVALID_RSN_IE_CAP = 22, 1641 WLAN_REASON_INVALID_RSN_IE_CAP = 22,
1622 WLAN_REASON_IEEE8021X_FAILED = 23, 1642 WLAN_REASON_IEEE8021X_FAILED = 23,
1623 WLAN_REASON_CIPHER_SUITE_REJECTED = 24, 1643 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
1644 /* TDLS (802.11z) */
1645 WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE = 25,
1646 WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED = 26,
1624 /* 802.11e */ 1647 /* 802.11e */
1625 WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32, 1648 WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32,
1626 WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33, 1649 WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33,
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index fd22789d7b2e..808dcb8cc04f 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -36,8 +36,28 @@ extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __use
36 36
37typedef int br_should_route_hook_t(struct sk_buff *skb); 37typedef int br_should_route_hook_t(struct sk_buff *skb);
38extern br_should_route_hook_t __rcu *br_should_route_hook; 38extern br_should_route_hook_t __rcu *br_should_route_hook;
39
40#if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING)
39int br_multicast_list_adjacent(struct net_device *dev, 41int br_multicast_list_adjacent(struct net_device *dev,
40 struct list_head *br_ip_list); 42 struct list_head *br_ip_list);
43bool br_multicast_has_querier_anywhere(struct net_device *dev, int proto);
41bool br_multicast_has_querier_adjacent(struct net_device *dev, int proto); 44bool br_multicast_has_querier_adjacent(struct net_device *dev, int proto);
45#else
46static inline int br_multicast_list_adjacent(struct net_device *dev,
47 struct list_head *br_ip_list)
48{
49 return 0;
50}
51static inline bool br_multicast_has_querier_anywhere(struct net_device *dev,
52 int proto)
53{
54 return false;
55}
56static inline bool br_multicast_has_querier_adjacent(struct net_device *dev,
57 int proto)
58{
59 return false;
60}
61#endif
42 62
43#endif 63#endif
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 2faef339d8f2..ff560537dd61 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -39,6 +39,7 @@ struct ipv6_devconf {
39#endif 39#endif
40 __s32 proxy_ndp; 40 __s32 proxy_ndp;
41 __s32 accept_source_route; 41 __s32 accept_source_route;
42 __s32 accept_ra_from_local;
42#ifdef CONFIG_IPV6_OPTIMISTIC_DAD 43#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
43 __s32 optimistic_dad; 44 __s32 optimistic_dad;
44#endif 45#endif
@@ -193,12 +194,13 @@ struct ipv6_pinfo {
193 sndflow:1, 194 sndflow:1,
194 repflow:1, 195 repflow:1,
195 pmtudisc:3, 196 pmtudisc:3,
196 ipv6only:1, 197 padding:1, /* 1 bit hole */
197 srcprefs:3, /* 001: prefer temporary address 198 srcprefs:3, /* 001: prefer temporary address
198 * 010: prefer public address 199 * 010: prefer public address
199 * 100: prefer care-of address 200 * 100: prefer care-of address
200 */ 201 */
201 dontfrag:1; 202 dontfrag:1,
203 autoflowlabel:1;
202 __u8 min_hopcount; 204 __u8 min_hopcount;
203 __u8 tclass; 205 __u8 tclass;
204 __be32 rcv_flowinfo; 206 __be32 rcv_flowinfo;
@@ -256,16 +258,6 @@ static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
256 return inet_sk(__sk)->pinet6; 258 return inet_sk(__sk)->pinet6;
257} 259}
258 260
259static inline struct request_sock *inet6_reqsk_alloc(struct request_sock_ops *ops)
260{
261 struct request_sock *req = reqsk_alloc(ops);
262
263 if (req)
264 inet_rsk(req)->pktopts = NULL;
265
266 return req;
267}
268
269static inline struct raw6_sock *raw6_sk(const struct sock *sk) 261static inline struct raw6_sock *raw6_sk(const struct sock *sk)
270{ 262{
271 return (struct raw6_sock *)sk; 263 return (struct raw6_sock *)sk;
@@ -282,8 +274,8 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
282 __inet_sk_copy_descendant(sk_to, sk_from, ancestor_size); 274 __inet_sk_copy_descendant(sk_to, sk_from, ancestor_size);
283} 275}
284 276
285#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) 277#define __ipv6_only_sock(sk) (sk->sk_ipv6only)
286#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) 278#define ipv6_only_sock(sk) (__ipv6_only_sock(sk))
287#define ipv6_sk_rxinfo(sk) ((sk)->sk_family == PF_INET6 && \ 279#define ipv6_sk_rxinfo(sk) ((sk)->sk_family == PF_INET6 && \
288 inet6_sk(sk)->rxopt.bits.rxinfo) 280 inet6_sk(sk)->rxopt.bits.rxinfo)
289 281
@@ -296,8 +288,8 @@ static inline const struct in6_addr *inet6_rcv_saddr(const struct sock *sk)
296 288
297static inline int inet_v6_ipv6only(const struct sock *sk) 289static inline int inet_v6_ipv6only(const struct sock *sk)
298{ 290{
299 return likely(sk->sk_state != TCP_TIME_WAIT) ? 291 /* ipv6only field is at same position for timewait and other sockets */
300 ipv6_only_sock(sk) : inet_twsk(sk)->tw_ipv6only; 292 return ipv6_only_sock(sk);
301} 293}
302#else 294#else
303#define __ipv6_only_sock(sk) 0 295#define __ipv6_only_sock(sk) 0
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h
index 8e10f57f109f..a0070c6dfaf8 100644
--- a/include/linux/isdn_ppp.h
+++ b/include/linux/isdn_ppp.h
@@ -180,8 +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 sk_filter *pass_filter; /* filter for packets to pass */ 183 struct bpf_prog *pass_filter; /* filter for packets to pass */
184 struct sk_filter *active_filter; /* filter for pkts to reset idle */ 184 struct bpf_prog *active_filter; /* filter for pkts to reset idle */
185#endif 185#endif
186 unsigned long debug; 186 unsigned long debug;
187 struct isdn_ppp_compressor *compressor,*decompressor; 187 struct isdn_ppp_compressor *compressor,*decompressor;
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 4c52907a6d8b..a9e2268ecccb 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -501,7 +501,7 @@ static inline char * __deprecated pack_hex_byte(char *buf, u8 byte)
501extern int hex_to_bin(char ch); 501extern int hex_to_bin(char ch);
502extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); 502extern int __must_check hex2bin(u8 *dst, const char *src, size_t count);
503 503
504int mac_pton(const char *s, u8 *mac); 504bool mac_pton(const char *s, u8 *mac);
505 505
506/* 506/*
507 * General tracing related utility functions - trace_printk(), 507 * General tracing related utility functions - trace_printk(),
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 35b51e7af886..e15b1544ea83 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -48,6 +48,17 @@
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_NUM_UP 8
52#define MLX4_NUM_TC 8
53#define MLX4_MAX_100M_UNITS_VAL 255 /*
54 * work around: can't set values
55 * greater then this value when
56 * using 100 Mbps units.
57 */
58#define MLX4_RATELIMIT_100M_UNITS 3 /* 100 Mbps */
59#define MLX4_RATELIMIT_1G_UNITS 4 /* 1 Gbps */
60#define MLX4_RATELIMIT_DEFAULT 0x00ff
61
51#define MLX4_ROCE_MAX_GIDS 128 62#define MLX4_ROCE_MAX_GIDS 128
52#define MLX4_ROCE_PF_GIDS 16 63#define MLX4_ROCE_PF_GIDS 16
53 64
@@ -1243,4 +1254,11 @@ int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port);
1243int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port); 1254int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port);
1244int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, 1255int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port,
1245 int enable); 1256 int enable);
1257
1258/* Returns true if running in low memory profile (kdump kernel) */
1259static inline bool mlx4_low_memory_profile(void)
1260{
1261 return reset_devices;
1262}
1263
1246#endif /* MLX4_DEVICE_H */ 1264#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 3406cfb1267a..334947151dfc 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -456,9 +456,6 @@ struct mlx5_eqe_cq_err {
456 u8 syndrome; 456 u8 syndrome;
457}; 457};
458 458
459struct mlx5_eqe_dropped_packet {
460};
461
462struct mlx5_eqe_port_state { 459struct mlx5_eqe_port_state {
463 u8 reserved0[8]; 460 u8 reserved0[8];
464 u8 port; 461 u8 port;
@@ -498,7 +495,6 @@ union ev_data {
498 struct mlx5_eqe_comp comp; 495 struct mlx5_eqe_comp comp;
499 struct mlx5_eqe_qp_srq qp_srq; 496 struct mlx5_eqe_qp_srq qp_srq;
500 struct mlx5_eqe_cq_err cq_err; 497 struct mlx5_eqe_cq_err cq_err;
501 struct mlx5_eqe_dropped_packet dp;
502 struct mlx5_eqe_port_state port; 498 struct mlx5_eqe_port_state port;
503 struct mlx5_eqe_gpio gpio; 499 struct mlx5_eqe_gpio gpio;
504 struct mlx5_eqe_congestion cong; 500 struct mlx5_eqe_congestion cong;
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 52d631ca32cf..b88e9b46d957 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -381,8 +381,8 @@ struct mlx5_buf {
381 struct mlx5_buf_list *page_list; 381 struct mlx5_buf_list *page_list;
382 int nbufs; 382 int nbufs;
383 int npages; 383 int npages;
384 int page_shift;
385 int size; 384 int size;
385 u8 page_shift;
386}; 386};
387 387
388struct mlx5_eq { 388struct mlx5_eq {
@@ -543,6 +543,10 @@ struct mlx5_priv {
543 /* protect mkey key part */ 543 /* protect mkey key part */
544 spinlock_t mkey_lock; 544 spinlock_t mkey_lock;
545 u8 mkey_key; 545 u8 mkey_key;
546
547 struct list_head dev_list;
548 struct list_head ctx_list;
549 spinlock_t ctx_lock;
546}; 550};
547 551
548struct mlx5_core_dev { 552struct mlx5_core_dev {
@@ -555,7 +559,7 @@ struct mlx5_core_dev {
555 struct mlx5_init_seg __iomem *iseg; 559 struct mlx5_init_seg __iomem *iseg;
556 void (*event) (struct mlx5_core_dev *dev, 560 void (*event) (struct mlx5_core_dev *dev,
557 enum mlx5_dev_event event, 561 enum mlx5_dev_event event,
558 void *data); 562 unsigned long param);
559 struct mlx5_priv priv; 563 struct mlx5_priv priv;
560 struct mlx5_profile *profile; 564 struct mlx5_profile *profile;
561 atomic_t num_qps; 565 atomic_t num_qps;
@@ -686,8 +690,6 @@ static inline u32 mlx5_base_mkey(const u32 key)
686 return key & 0xffffff00u; 690 return key & 0xffffff00u;
687} 691}
688 692
689int mlx5_dev_init(struct mlx5_core_dev *dev, struct pci_dev *pdev);
690void mlx5_dev_cleanup(struct mlx5_core_dev *dev);
691int mlx5_cmd_init(struct mlx5_core_dev *dev); 693int mlx5_cmd_init(struct mlx5_core_dev *dev);
692void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); 694void mlx5_cmd_cleanup(struct mlx5_core_dev *dev);
693void mlx5_cmd_use_events(struct mlx5_core_dev *dev); 695void mlx5_cmd_use_events(struct mlx5_core_dev *dev);
@@ -734,7 +736,7 @@ int mlx5_core_dump_fill_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr,
734int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn); 736int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn);
735int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn); 737int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn);
736int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb, 738int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb,
737 u16 opmod, int port); 739 u16 opmod, u8 port);
738void mlx5_pagealloc_init(struct mlx5_core_dev *dev); 740void mlx5_pagealloc_init(struct mlx5_core_dev *dev);
739void mlx5_pagealloc_cleanup(struct mlx5_core_dev *dev); 741void mlx5_pagealloc_cleanup(struct mlx5_core_dev *dev);
740int mlx5_pagealloc_start(struct mlx5_core_dev *dev); 742int mlx5_pagealloc_start(struct mlx5_core_dev *dev);
@@ -767,7 +769,7 @@ void mlx5_qp_debugfs_cleanup(struct mlx5_core_dev *dev);
767int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in, 769int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in,
768 int size_in, void *data_out, int size_out, 770 int size_in, void *data_out, int size_out,
769 u16 reg_num, int arg, int write); 771 u16 reg_num, int arg, int write);
770int mlx5_set_port_caps(struct mlx5_core_dev *dev, int port_num, u32 caps); 772int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps);
771 773
772int mlx5_debug_eq_add(struct mlx5_core_dev *dev, struct mlx5_eq *eq); 774int mlx5_debug_eq_add(struct mlx5_core_dev *dev, struct mlx5_eq *eq);
773void mlx5_debug_eq_remove(struct mlx5_core_dev *dev, struct mlx5_eq *eq); 775void mlx5_debug_eq_remove(struct mlx5_core_dev *dev, struct mlx5_eq *eq);
@@ -811,9 +813,20 @@ enum {
811 MAX_MR_CACHE_ENTRIES = 16, 813 MAX_MR_CACHE_ENTRIES = 16,
812}; 814};
813 815
816struct mlx5_interface {
817 void * (*add)(struct mlx5_core_dev *dev);
818 void (*remove)(struct mlx5_core_dev *dev, void *context);
819 void (*event)(struct mlx5_core_dev *dev, void *context,
820 enum mlx5_dev_event event, unsigned long param);
821 struct list_head list;
822};
823
824int mlx5_register_interface(struct mlx5_interface *intf);
825void mlx5_unregister_interface(struct mlx5_interface *intf);
826
814struct mlx5_profile { 827struct mlx5_profile {
815 u64 mask; 828 u64 mask;
816 u32 log_max_qp; 829 u8 log_max_qp;
817 struct { 830 struct {
818 int size; 831 int size;
819 int limit; 832 int limit;
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index d99800cbdcf3..dcfdecbfa0b7 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -176,4 +176,12 @@ enum {
176 NETIF_F_HW_VLAN_STAG_RX | \ 176 NETIF_F_HW_VLAN_STAG_RX | \
177 NETIF_F_HW_VLAN_STAG_TX) 177 NETIF_F_HW_VLAN_STAG_TX)
178 178
179#define NETIF_F_GSO_ENCAP_ALL (NETIF_F_GSO_GRE | \
180 NETIF_F_GSO_GRE_CSUM | \
181 NETIF_F_GSO_IPIP | \
182 NETIF_F_GSO_SIT | \
183 NETIF_F_GSO_UDP_TUNNEL | \
184 NETIF_F_GSO_UDP_TUNNEL_CSUM | \
185 NETIF_F_GSO_MPLS)
186
179#endif /* _LINUX_NETDEV_FEATURES_H */ 187#endif /* _LINUX_NETDEV_FEATURES_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 66f9a04ec270..38377392d082 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -943,7 +943,8 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
943 * const unsigned char *addr) 943 * const unsigned char *addr)
944 * Deletes the FDB entry from dev coresponding to addr. 944 * Deletes the FDB entry from dev coresponding to addr.
945 * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, 945 * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb,
946 * struct net_device *dev, int idx) 946 * struct net_device *dev, struct net_device *filter_dev,
947 * int idx)
947 * Used to add FDB entries to dump requests. Implementers should add 948 * Used to add FDB entries to dump requests. Implementers should add
948 * entries to skb and update idx with the number of entries. 949 * entries to skb and update idx with the number of entries.
949 * 950 *
@@ -1114,6 +1115,7 @@ struct net_device_ops {
1114 int (*ndo_fdb_dump)(struct sk_buff *skb, 1115 int (*ndo_fdb_dump)(struct sk_buff *skb,
1115 struct netlink_callback *cb, 1116 struct netlink_callback *cb,
1116 struct net_device *dev, 1117 struct net_device *dev,
1118 struct net_device *filter_dev,
1117 int idx); 1119 int idx);
1118 1120
1119 int (*ndo_bridge_setlink)(struct net_device *dev, 1121 int (*ndo_bridge_setlink)(struct net_device *dev,
@@ -1229,42 +1231,228 @@ enum netdev_priv_flags {
1229#define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE 1231#define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE
1230#define IFF_MACVLAN IFF_MACVLAN 1232#define IFF_MACVLAN IFF_MACVLAN
1231 1233
1232/* 1234/**
1233 * The DEVICE structure. 1235 * struct net_device - The DEVICE structure.
1234 * Actually, this whole structure is a big mistake. It mixes I/O 1236 * Actually, this whole structure is a big mistake. It mixes I/O
1235 * data with strictly "high-level" data, and it has to know about 1237 * data with strictly "high-level" data, and it has to know about
1236 * almost every data structure used in the INET module. 1238 * almost every data structure used in the INET module.
1239 *
1240 * @name: This is the first field of the "visible" part of this structure
1241 * (i.e. as seen by users in the "Space.c" file). It is the name
1242 * of the interface.
1243 *
1244 * @name_hlist: Device name hash chain, please keep it close to name[]
1245 * @ifalias: SNMP alias
1246 * @mem_end: Shared memory end
1247 * @mem_start: Shared memory start
1248 * @base_addr: Device I/O address
1249 * @irq: Device IRQ number
1250 *
1251 * @state: Generic network queuing layer state, see netdev_state_t
1252 * @dev_list: The global list of network devices
1253 * @napi_list: List entry, that is used for polling napi devices
1254 * @unreg_list: List entry, that is used, when we are unregistering the
1255 * device, see the function unregister_netdev
1256 * @close_list: List entry, that is used, when we are closing the device
1257 *
1258 * @adj_list: Directly linked devices, like slaves for bonding
1259 * @all_adj_list: All linked devices, *including* neighbours
1260 * @features: Currently active device features
1261 * @hw_features: User-changeable features
1262 *
1263 * @wanted_features: User-requested features
1264 * @vlan_features: Mask of features inheritable by VLAN devices
1265 *
1266 * @hw_enc_features: Mask of features inherited by encapsulating devices
1267 * This field indicates what encapsulation
1268 * offloads the hardware is capable of doing,
1269 * and drivers will need to set them appropriately.
1270 *
1271 * @mpls_features: Mask of features inheritable by MPLS
1272 *
1273 * @ifindex: interface index
1274 * @iflink: unique device identifier
1275 *
1276 * @stats: Statistics struct, which was left as a legacy, use
1277 * rtnl_link_stats64 instead
1278 *
1279 * @rx_dropped: Dropped packets by core network,
1280 * do not use this in drivers
1281 * @tx_dropped: Dropped packets by core network,
1282 * do not use this in drivers
1283 *
1284 * @carrier_changes: Stats to monitor carrier on<->off transitions
1285 *
1286 * @wireless_handlers: List of functions to handle Wireless Extensions,
1287 * instead of ioctl,
1288 * see <net/iw_handler.h> for details.
1289 * @wireless_data: Instance data managed by the core of wireless extensions
1290 *
1291 * @netdev_ops: Includes several pointers to callbacks,
1292 * if one wants to override the ndo_*() functions
1293 * @ethtool_ops: Management operations
1294 * @fwd_ops: Management operations
1295 * @header_ops: Includes callbacks for creating,parsing,rebuilding,etc
1296 * of Layer 2 headers.
1297 *
1298 * @flags: Interface flags (a la BSD)
1299 * @priv_flags: Like 'flags' but invisible to userspace,
1300 * see if.h for the definitions
1301 * @gflags: Global flags ( kept as legacy )
1302 * @padded: How much padding added by alloc_netdev()
1303 * @operstate: RFC2863 operstate
1304 * @link_mode: Mapping policy to operstate
1305 * @if_port: Selectable AUI, TP, ...
1306 * @dma: DMA channel
1307 * @mtu: Interface MTU value
1308 * @type: Interface hardware type
1309 * @hard_header_len: Hardware header length
1310 *
1311 * @needed_headroom: Extra headroom the hardware may need, but not in all
1312 * cases can this be guaranteed
1313 * @needed_tailroom: Extra tailroom the hardware may need, but not in all
1314 * cases can this be guaranteed. Some cases also use
1315 * LL_MAX_HEADER instead to allocate the skb
1316 *
1317 * interface address info:
1318 *
1319 * @perm_addr: Permanent hw address
1320 * @addr_assign_type: Hw address assignment type
1321 * @addr_len: Hardware address length
1322 * @neigh_priv_len; Used in neigh_alloc(),
1323 * initialized only in atm/clip.c
1324 * @dev_id: Used to differentiate devices that share
1325 * the same link layer address
1326 * @dev_port: Used to differentiate devices that share
1327 * the same function
1328 * @addr_list_lock: XXX: need comments on this one
1329 * @uc: unicast mac addresses
1330 * @mc: multicast mac addresses
1331 * @dev_addrs: list of device hw addresses
1332 * @queues_kset: Group of all Kobjects in the Tx and RX queues
1333 * @uc_promisc: Counter, that indicates, that promiscuous mode
1334 * has been enabled due to the need to listen to
1335 * additional unicast addresses in a device that
1336 * does not implement ndo_set_rx_mode()
1337 * @promiscuity: Number of times, the NIC is told to work in
1338 * Promiscuous mode, if it becomes 0 the NIC will
1339 * exit from working in Promiscuous mode
1340 * @allmulti: Counter, enables or disables allmulticast mode
1341 *
1342 * @vlan_info: VLAN info
1343 * @dsa_ptr: dsa specific data
1344 * @tipc_ptr: TIPC specific data
1345 * @atalk_ptr: AppleTalk link
1346 * @ip_ptr: IPv4 specific data
1347 * @dn_ptr: DECnet specific data
1348 * @ip6_ptr: IPv6 specific data
1349 * @ax25_ptr: AX.25 specific data
1350 * @ieee80211_ptr: IEEE 802.11 specific data, assign before registering
1351 *
1352 * @last_rx: Time of last Rx
1353 * @dev_addr: Hw address (before bcast,
1354 * because most packets are unicast)
1355 *
1356 * @_rx: Array of RX queues
1357 * @num_rx_queues: Number of RX queues
1358 * allocated at register_netdev() time
1359 * @real_num_rx_queues: Number of RX queues currently active in device
1360 *
1361 * @rx_handler: handler for received packets
1362 * @rx_handler_data: XXX: need comments on this one
1363 * @ingress_queue: XXX: need comments on this one
1364 * @broadcast: hw bcast address
1365 *
1366 * @_tx: Array of TX queues
1367 * @num_tx_queues: Number of TX queues allocated at alloc_netdev_mq() time
1368 * @real_num_tx_queues: Number of TX queues currently active in device
1369 * @qdisc: Root qdisc from userspace point of view
1370 * @tx_queue_len: Max frames per queue allowed
1371 * @tx_global_lock: XXX: need comments on this one
1372 *
1373 * @xps_maps: XXX: need comments on this one
1374 *
1375 * @rx_cpu_rmap: CPU reverse-mapping for RX completion interrupts,
1376 * indexed by RX queue number. Assigned by driver.
1377 * This must only be set if the ndo_rx_flow_steer
1378 * operation is defined
1379 *
1380 * @trans_start: Time (in jiffies) of last Tx
1381 * @watchdog_timeo: Represents the timeout that is used by
1382 * the watchdog ( see dev_watchdog() )
1383 * @watchdog_timer: List of timers
1384 *
1385 * @pcpu_refcnt: Number of references to this device
1386 * @todo_list: Delayed register/unregister
1387 * @index_hlist: Device index hash chain
1388 * @link_watch_list: XXX: need comments on this one
1389 *
1390 * @reg_state: Register/unregister state machine
1391 * @dismantle: Device is going to be freed
1392 * @rtnl_link_state: This enum represents the phases of creating
1393 * a new link
1394 *
1395 * @destructor: Called from unregister,
1396 * can be used to call free_netdev
1397 * @npinfo: XXX: need comments on this one
1398 * @nd_net: Network namespace this network device is inside
1399 *
1400 * @ml_priv: Mid-layer private
1401 * @lstats: Loopback statistics
1402 * @tstats: Tunnel statistics
1403 * @dstats: Dummy statistics
1404 * @vstats: Virtual ethernet statistics
1405 *
1406 * @garp_port: GARP
1407 * @mrp_port: MRP
1408 *
1409 * @dev: Class/net/name entry
1410 * @sysfs_groups: Space for optional device, statistics and wireless
1411 * sysfs groups
1412 *
1413 * @sysfs_rx_queue_group: Space for optional per-rx queue attributes
1414 * @rtnl_link_ops: Rtnl_link_ops
1415 *
1416 * @gso_max_size: Maximum size of generic segmentation offload
1417 * @gso_max_segs: Maximum number of segments that can be passed to the
1418 * NIC for GSO
1419 *
1420 * @dcbnl_ops: Data Center Bridging netlink ops
1421 * @num_tc: Number of traffic classes in the net device
1422 * @tc_to_txq: XXX: need comments on this one
1423 * @prio_tc_map XXX: need comments on this one
1424 *
1425 * @fcoe_ddp_xid: Max exchange id for FCoE LRO by ddp
1426 *
1427 * @priomap: XXX: need comments on this one
1428 * @phydev: Physical device may attach itself
1429 * for hardware timestamping
1430 *
1431 * @qdisc_tx_busylock: XXX: need comments on this one
1432 *
1433 * @group: The group, that the device belongs to
1434 * @pm_qos_req: Power Management QoS object
1237 * 1435 *
1238 * FIXME: cleanup struct net_device such that network protocol info 1436 * FIXME: cleanup struct net_device such that network protocol info
1239 * moves out. 1437 * moves out.
1240 */ 1438 */
1241 1439
1242struct net_device { 1440struct net_device {
1243
1244 /*
1245 * This is the first field of the "visible" part of this structure
1246 * (i.e. as seen by users in the "Space.c" file). It is the name
1247 * of the interface.
1248 */
1249 char name[IFNAMSIZ]; 1441 char name[IFNAMSIZ];
1250
1251 /* device name hash chain, please keep it close to name[] */
1252 struct hlist_node name_hlist; 1442 struct hlist_node name_hlist;
1253
1254 /* snmp alias */
1255 char *ifalias; 1443 char *ifalias;
1256
1257 /* 1444 /*
1258 * I/O specific fields 1445 * I/O specific fields
1259 * FIXME: Merge these and struct ifmap into one 1446 * FIXME: Merge these and struct ifmap into one
1260 */ 1447 */
1261 unsigned long mem_end; /* shared mem end */ 1448 unsigned long mem_end;
1262 unsigned long mem_start; /* shared mem start */ 1449 unsigned long mem_start;
1263 unsigned long base_addr; /* device I/O address */ 1450 unsigned long base_addr;
1264 int irq; /* device IRQ number */ 1451 int irq;
1265 1452
1266 /* 1453 /*
1267 * Some hardware also needs these fields, but they are not 1454 * Some hardware also needs these fields (state,dev_list,
1455 * napi_list,unreg_list,close_list) but they are not
1268 * part of the usual set specified in Space.c. 1456 * part of the usual set specified in Space.c.
1269 */ 1457 */
1270 1458
@@ -1275,110 +1463,80 @@ struct net_device {
1275 struct list_head unreg_list; 1463 struct list_head unreg_list;
1276 struct list_head close_list; 1464 struct list_head close_list;
1277 1465
1278 /* directly linked devices, like slaves for bonding */
1279 struct { 1466 struct {
1280 struct list_head upper; 1467 struct list_head upper;
1281 struct list_head lower; 1468 struct list_head lower;
1282 } adj_list; 1469 } adj_list;
1283 1470
1284 /* all linked devices, *including* neighbours */
1285 struct { 1471 struct {
1286 struct list_head upper; 1472 struct list_head upper;
1287 struct list_head lower; 1473 struct list_head lower;
1288 } all_adj_list; 1474 } all_adj_list;
1289 1475
1290
1291 /* currently active device features */
1292 netdev_features_t features; 1476 netdev_features_t features;
1293 /* user-changeable features */
1294 netdev_features_t hw_features; 1477 netdev_features_t hw_features;
1295 /* user-requested features */
1296 netdev_features_t wanted_features; 1478 netdev_features_t wanted_features;
1297 /* mask of features inheritable by VLAN devices */
1298 netdev_features_t vlan_features; 1479 netdev_features_t vlan_features;
1299 /* mask of features inherited by encapsulating devices
1300 * This field indicates what encapsulation offloads
1301 * the hardware is capable of doing, and drivers will
1302 * need to set them appropriately.
1303 */
1304 netdev_features_t hw_enc_features; 1480 netdev_features_t hw_enc_features;
1305 /* mask of fetures inheritable by MPLS */
1306 netdev_features_t mpls_features; 1481 netdev_features_t mpls_features;
1307 1482
1308 /* Interface index. Unique device identifier */
1309 int ifindex; 1483 int ifindex;
1310 int iflink; 1484 int iflink;
1311 1485
1312 struct net_device_stats stats; 1486 struct net_device_stats stats;
1313 1487
1314 /* dropped packets by core network, Do not use this in drivers */
1315 atomic_long_t rx_dropped; 1488 atomic_long_t rx_dropped;
1316 atomic_long_t tx_dropped; 1489 atomic_long_t tx_dropped;
1317 1490
1318 /* Stats to monitor carrier on<->off transitions */
1319 atomic_t carrier_changes; 1491 atomic_t carrier_changes;
1320 1492
1321#ifdef CONFIG_WIRELESS_EXT 1493#ifdef CONFIG_WIRELESS_EXT
1322 /* List of functions to handle Wireless Extensions (instead of ioctl).
1323 * See <net/iw_handler.h> for details. Jean II */
1324 const struct iw_handler_def * wireless_handlers; 1494 const struct iw_handler_def * wireless_handlers;
1325 /* Instance data managed by the core of Wireless Extensions. */
1326 struct iw_public_data * wireless_data; 1495 struct iw_public_data * wireless_data;
1327#endif 1496#endif
1328 /* Management operations */
1329 const struct net_device_ops *netdev_ops; 1497 const struct net_device_ops *netdev_ops;
1330 const struct ethtool_ops *ethtool_ops; 1498 const struct ethtool_ops *ethtool_ops;
1331 const struct forwarding_accel_ops *fwd_ops; 1499 const struct forwarding_accel_ops *fwd_ops;
1332 1500
1333 /* Hardware header description */
1334 const struct header_ops *header_ops; 1501 const struct header_ops *header_ops;
1335 1502
1336 unsigned int flags; /* interface flags (a la BSD) */ 1503 unsigned int flags;
1337 unsigned int priv_flags; /* Like 'flags' but invisible to userspace. 1504 unsigned int priv_flags;
1338 * See if.h for definitions. */ 1505
1339 unsigned short gflags; 1506 unsigned short gflags;
1340 unsigned short padded; /* How much padding added by alloc_netdev() */ 1507 unsigned short padded;
1341 1508
1342 unsigned char operstate; /* RFC2863 operstate */ 1509 unsigned char operstate;
1343 unsigned char link_mode; /* mapping policy to operstate */ 1510 unsigned char link_mode;
1344 1511
1345 unsigned char if_port; /* Selectable AUI, TP,..*/ 1512 unsigned char if_port;
1346 unsigned char dma; /* DMA channel */ 1513 unsigned char dma;
1347 1514
1348 unsigned int mtu; /* interface MTU value */ 1515 unsigned int mtu;
1349 unsigned short type; /* interface hardware type */ 1516 unsigned short type;
1350 unsigned short hard_header_len; /* hardware hdr length */ 1517 unsigned short hard_header_len;
1351 1518
1352 /* extra head- and tailroom the hardware may need, but not in all cases
1353 * can this be guaranteed, especially tailroom. Some cases also use
1354 * LL_MAX_HEADER instead to allocate the skb.
1355 */
1356 unsigned short needed_headroom; 1519 unsigned short needed_headroom;
1357 unsigned short needed_tailroom; 1520 unsigned short needed_tailroom;
1358 1521
1359 /* Interface address info. */ 1522 /* Interface address info. */
1360 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ 1523 unsigned char perm_addr[MAX_ADDR_LEN];
1361 unsigned char addr_assign_type; /* hw address assignment type */ 1524 unsigned char addr_assign_type;
1362 unsigned char addr_len; /* hardware address length */ 1525 unsigned char addr_len;
1363 unsigned short neigh_priv_len; 1526 unsigned short neigh_priv_len;
1364 unsigned short dev_id; /* Used to differentiate devices 1527 unsigned short dev_id;
1365 * that share the same link 1528 unsigned short dev_port;
1366 * layer address
1367 */
1368 unsigned short dev_port; /* Used to differentiate
1369 * devices that share the same
1370 * function
1371 */
1372 spinlock_t addr_list_lock; 1529 spinlock_t addr_list_lock;
1373 struct netdev_hw_addr_list uc; /* Unicast mac addresses */ 1530 struct netdev_hw_addr_list uc;
1374 struct netdev_hw_addr_list mc; /* Multicast mac addresses */ 1531 struct netdev_hw_addr_list mc;
1375 struct netdev_hw_addr_list dev_addrs; /* list of device 1532 struct netdev_hw_addr_list dev_addrs;
1376 * hw addresses 1533
1377 */
1378#ifdef CONFIG_SYSFS 1534#ifdef CONFIG_SYSFS
1379 struct kset *queues_kset; 1535 struct kset *queues_kset;
1380#endif 1536#endif
1381 1537
1538 unsigned char name_assign_type;
1539
1382 bool uc_promisc; 1540 bool uc_promisc;
1383 unsigned int promiscuity; 1541 unsigned int promiscuity;
1384 unsigned int allmulti; 1542 unsigned int allmulti;
@@ -1387,40 +1545,34 @@ struct net_device {
1387 /* Protocol specific pointers */ 1545 /* Protocol specific pointers */
1388 1546
1389#if IS_ENABLED(CONFIG_VLAN_8021Q) 1547#if IS_ENABLED(CONFIG_VLAN_8021Q)
1390 struct vlan_info __rcu *vlan_info; /* VLAN info */ 1548 struct vlan_info __rcu *vlan_info;
1391#endif 1549#endif
1392#if IS_ENABLED(CONFIG_NET_DSA) 1550#if IS_ENABLED(CONFIG_NET_DSA)
1393 struct dsa_switch_tree *dsa_ptr; /* dsa specific data */ 1551 struct dsa_switch_tree *dsa_ptr;
1394#endif 1552#endif
1395#if IS_ENABLED(CONFIG_TIPC) 1553#if IS_ENABLED(CONFIG_TIPC)
1396 struct tipc_bearer __rcu *tipc_ptr; /* TIPC specific data */ 1554 struct tipc_bearer __rcu *tipc_ptr;
1397#endif 1555#endif
1398 void *atalk_ptr; /* AppleTalk link */ 1556 void *atalk_ptr;
1399 struct in_device __rcu *ip_ptr; /* IPv4 specific data */ 1557 struct in_device __rcu *ip_ptr;
1400 struct dn_dev __rcu *dn_ptr; /* DECnet specific data */ 1558 struct dn_dev __rcu *dn_ptr;
1401 struct inet6_dev __rcu *ip6_ptr; /* IPv6 specific data */ 1559 struct inet6_dev __rcu *ip6_ptr;
1402 void *ax25_ptr; /* AX.25 specific data */ 1560 void *ax25_ptr;
1403 struct wireless_dev *ieee80211_ptr; /* IEEE 802.11 specific data, 1561 struct wireless_dev *ieee80211_ptr;
1404 assign before registering */
1405 1562
1406/* 1563/*
1407 * Cache lines mostly used on receive path (including eth_type_trans()) 1564 * Cache lines mostly used on receive path (including eth_type_trans())
1408 */ 1565 */
1409 unsigned long last_rx; /* Time of last Rx */ 1566 unsigned long last_rx;
1410 1567
1411 /* Interface address info used in eth_type_trans() */ 1568 /* Interface address info used in eth_type_trans() */
1412 unsigned char *dev_addr; /* hw address, (before bcast 1569 unsigned char *dev_addr;
1413 because most packets are
1414 unicast) */
1415 1570
1416 1571
1417#ifdef CONFIG_SYSFS 1572#ifdef CONFIG_SYSFS
1418 struct netdev_rx_queue *_rx; 1573 struct netdev_rx_queue *_rx;
1419 1574
1420 /* Number of RX queues allocated at register_netdev() time */
1421 unsigned int num_rx_queues; 1575 unsigned int num_rx_queues;
1422
1423 /* Number of RX queues currently active in device */
1424 unsigned int real_num_rx_queues; 1576 unsigned int real_num_rx_queues;
1425 1577
1426#endif 1578#endif
@@ -1429,33 +1581,23 @@ struct net_device {
1429 void __rcu *rx_handler_data; 1581 void __rcu *rx_handler_data;
1430 1582
1431 struct netdev_queue __rcu *ingress_queue; 1583 struct netdev_queue __rcu *ingress_queue;
1432 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ 1584 unsigned char broadcast[MAX_ADDR_LEN];
1433 1585
1434 1586
1435/* 1587/*
1436 * Cache lines mostly used on transmit path 1588 * Cache lines mostly used on transmit path
1437 */ 1589 */
1438 struct netdev_queue *_tx ____cacheline_aligned_in_smp; 1590 struct netdev_queue *_tx ____cacheline_aligned_in_smp;
1439
1440 /* Number of TX queues allocated at alloc_netdev_mq() time */
1441 unsigned int num_tx_queues; 1591 unsigned int num_tx_queues;
1442
1443 /* Number of TX queues currently active in device */
1444 unsigned int real_num_tx_queues; 1592 unsigned int real_num_tx_queues;
1445
1446 /* root qdisc from userspace point of view */
1447 struct Qdisc *qdisc; 1593 struct Qdisc *qdisc;
1448 1594 unsigned long tx_queue_len;
1449 unsigned long tx_queue_len; /* Max frames per queue allowed */
1450 spinlock_t tx_global_lock; 1595 spinlock_t tx_global_lock;
1451 1596
1452#ifdef CONFIG_XPS 1597#ifdef CONFIG_XPS
1453 struct xps_dev_maps __rcu *xps_maps; 1598 struct xps_dev_maps __rcu *xps_maps;
1454#endif 1599#endif
1455#ifdef CONFIG_RFS_ACCEL 1600#ifdef CONFIG_RFS_ACCEL
1456 /* CPU reverse-mapping for RX completion interrupts, indexed
1457 * by RX queue number. Assigned by driver. This must only be
1458 * set if the ndo_rx_flow_steer operation is defined. */
1459 struct cpu_rmap *rx_cpu_rmap; 1601 struct cpu_rmap *rx_cpu_rmap;
1460#endif 1602#endif
1461 1603
@@ -1465,22 +1607,17 @@ struct net_device {
1465 * trans_start here is expensive for high speed devices on SMP, 1607 * trans_start here is expensive for high speed devices on SMP,
1466 * please use netdev_queue->trans_start instead. 1608 * please use netdev_queue->trans_start instead.
1467 */ 1609 */
1468 unsigned long trans_start; /* Time (in jiffies) of last Tx */ 1610 unsigned long trans_start;
1469 1611
1470 int watchdog_timeo; /* used by dev_watchdog() */ 1612 int watchdog_timeo;
1471 struct timer_list watchdog_timer; 1613 struct timer_list watchdog_timer;
1472 1614
1473 /* Number of references to this device */
1474 int __percpu *pcpu_refcnt; 1615 int __percpu *pcpu_refcnt;
1475
1476 /* delayed register/unregister */
1477 struct list_head todo_list; 1616 struct list_head todo_list;
1478 /* device index hash chain */
1479 struct hlist_node index_hlist;
1480 1617
1618 struct hlist_node index_hlist;
1481 struct list_head link_watch_list; 1619 struct list_head link_watch_list;
1482 1620
1483 /* register/unregister state machine */
1484 enum { NETREG_UNINITIALIZED=0, 1621 enum { NETREG_UNINITIALIZED=0,
1485 NETREG_REGISTERED, /* completed register_netdevice */ 1622 NETREG_REGISTERED, /* completed register_netdevice */
1486 NETREG_UNREGISTERING, /* called unregister_netdevice */ 1623 NETREG_UNREGISTERING, /* called unregister_netdevice */
@@ -1489,14 +1626,13 @@ struct net_device {
1489 NETREG_DUMMY, /* dummy device for NAPI poll */ 1626 NETREG_DUMMY, /* dummy device for NAPI poll */
1490 } reg_state:8; 1627 } reg_state:8;
1491 1628
1492 bool dismantle; /* device is going do be freed */ 1629 bool dismantle;
1493 1630
1494 enum { 1631 enum {
1495 RTNL_LINK_INITIALIZED, 1632 RTNL_LINK_INITIALIZED,
1496 RTNL_LINK_INITIALIZING, 1633 RTNL_LINK_INITIALIZING,
1497 } rtnl_link_state:16; 1634 } rtnl_link_state:16;
1498 1635
1499 /* Called from unregister, can be used to call free_netdev */
1500 void (*destructor)(struct net_device *dev); 1636 void (*destructor)(struct net_device *dev);
1501 1637
1502#ifdef CONFIG_NETPOLL 1638#ifdef CONFIG_NETPOLL
@@ -1504,31 +1640,25 @@ struct net_device {
1504#endif 1640#endif
1505 1641
1506#ifdef CONFIG_NET_NS 1642#ifdef CONFIG_NET_NS
1507 /* Network namespace this network device is inside */
1508 struct net *nd_net; 1643 struct net *nd_net;
1509#endif 1644#endif
1510 1645
1511 /* mid-layer private */ 1646 /* mid-layer private */
1512 union { 1647 union {
1513 void *ml_priv; 1648 void *ml_priv;
1514 struct pcpu_lstats __percpu *lstats; /* loopback stats */ 1649 struct pcpu_lstats __percpu *lstats;
1515 struct pcpu_sw_netstats __percpu *tstats; 1650 struct pcpu_sw_netstats __percpu *tstats;
1516 struct pcpu_dstats __percpu *dstats; /* dummy stats */ 1651 struct pcpu_dstats __percpu *dstats;
1517 struct pcpu_vstats __percpu *vstats; /* veth stats */ 1652 struct pcpu_vstats __percpu *vstats;
1518 }; 1653 };
1519 /* GARP */ 1654
1520 struct garp_port __rcu *garp_port; 1655 struct garp_port __rcu *garp_port;
1521 /* MRP */
1522 struct mrp_port __rcu *mrp_port; 1656 struct mrp_port __rcu *mrp_port;
1523 1657
1524 /* class/net/name entry */ 1658 struct device dev;
1525 struct device dev;
1526 /* space for optional device, statistics, and wireless sysfs groups */
1527 const struct attribute_group *sysfs_groups[4]; 1659 const struct attribute_group *sysfs_groups[4];
1528 /* space for optional per-rx queue attributes */
1529 const struct attribute_group *sysfs_rx_queue_group; 1660 const struct attribute_group *sysfs_rx_queue_group;
1530 1661
1531 /* rtnetlink link ops */
1532 const struct rtnl_link_ops *rtnl_link_ops; 1662 const struct rtnl_link_ops *rtnl_link_ops;
1533 1663
1534 /* for setting kernel sock attribute on TCP connection setup */ 1664 /* for setting kernel sock attribute on TCP connection setup */
@@ -1538,7 +1668,6 @@ struct net_device {
1538 u16 gso_max_segs; 1668 u16 gso_max_segs;
1539 1669
1540#ifdef CONFIG_DCB 1670#ifdef CONFIG_DCB
1541 /* Data Center Bridging netlink ops */
1542 const struct dcbnl_rtnl_ops *dcbnl_ops; 1671 const struct dcbnl_rtnl_ops *dcbnl_ops;
1543#endif 1672#endif
1544 u8 num_tc; 1673 u8 num_tc;
@@ -1546,20 +1675,14 @@ struct net_device {
1546 u8 prio_tc_map[TC_BITMASK + 1]; 1675 u8 prio_tc_map[TC_BITMASK + 1];
1547 1676
1548#if IS_ENABLED(CONFIG_FCOE) 1677#if IS_ENABLED(CONFIG_FCOE)
1549 /* max exchange id for FCoE LRO by ddp */
1550 unsigned int fcoe_ddp_xid; 1678 unsigned int fcoe_ddp_xid;
1551#endif 1679#endif
1552#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO) 1680#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
1553 struct netprio_map __rcu *priomap; 1681 struct netprio_map __rcu *priomap;
1554#endif 1682#endif
1555 /* phy device may attach itself for hardware timestamping */
1556 struct phy_device *phydev; 1683 struct phy_device *phydev;
1557
1558 struct lock_class_key *qdisc_tx_busylock; 1684 struct lock_class_key *qdisc_tx_busylock;
1559
1560 /* group the device belongs to */
1561 int group; 1685 int group;
1562
1563 struct pm_qos_request pm_qos_req; 1686 struct pm_qos_request pm_qos_req;
1564}; 1687};
1565#define to_net_dev(d) container_of(d, struct net_device, dev) 1688#define to_net_dev(d) container_of(d, struct net_device, dev)
@@ -2486,7 +2609,7 @@ static inline int netif_set_xps_queue(struct net_device *dev,
2486 * as a distribution range limit for the returned value. 2609 * as a distribution range limit for the returned value.
2487 */ 2610 */
2488static inline u16 skb_tx_hash(const struct net_device *dev, 2611static inline u16 skb_tx_hash(const struct net_device *dev,
2489 const struct sk_buff *skb) 2612 struct sk_buff *skb)
2490{ 2613{
2491 return __skb_tx_hash(dev, skb, dev->real_num_tx_queues); 2614 return __skb_tx_hash(dev, skb, dev->real_num_tx_queues);
2492} 2615}
@@ -2987,13 +3110,15 @@ void ether_setup(struct net_device *dev);
2987 3110
2988/* Support for loadable net-drivers */ 3111/* Support for loadable net-drivers */
2989struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, 3112struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
3113 unsigned char name_assign_type,
2990 void (*setup)(struct net_device *), 3114 void (*setup)(struct net_device *),
2991 unsigned int txqs, unsigned int rxqs); 3115 unsigned int txqs, unsigned int rxqs);
2992#define alloc_netdev(sizeof_priv, name, setup) \ 3116#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
2993 alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1) 3117 alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, 1, 1)
2994 3118
2995#define alloc_netdev_mq(sizeof_priv, name, setup, count) \ 3119#define alloc_netdev_mq(sizeof_priv, name, name_assign_type, setup, count) \
2996 alloc_netdev_mqs(sizeof_priv, name, setup, count, count) 3120 alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, count, \
3121 count)
2997 3122
2998int register_netdev(struct net_device *dev); 3123int register_netdev(struct net_device *dev);
2999void unregister_netdev(struct net_device *dev); 3124void unregister_netdev(struct net_device *dev);
@@ -3377,11 +3502,26 @@ extern struct pernet_operations __net_initdata loopback_net_ops;
3377 3502
3378static inline const char *netdev_name(const struct net_device *dev) 3503static inline const char *netdev_name(const struct net_device *dev)
3379{ 3504{
3380 if (dev->reg_state != NETREG_REGISTERED) 3505 if (!dev->name[0] || strchr(dev->name, '%'))
3381 return "(unregistered net_device)"; 3506 return "(unnamed net_device)";
3382 return dev->name; 3507 return dev->name;
3383} 3508}
3384 3509
3510static inline const char *netdev_reg_state(const struct net_device *dev)
3511{
3512 switch (dev->reg_state) {
3513 case NETREG_UNINITIALIZED: return " (uninitialized)";
3514 case NETREG_REGISTERED: return "";
3515 case NETREG_UNREGISTERING: return " (unregistering)";
3516 case NETREG_UNREGISTERED: return " (unregistered)";
3517 case NETREG_RELEASED: return " (released)";
3518 case NETREG_DUMMY: return " (dummy)";
3519 }
3520
3521 WARN_ONCE(1, "%s: unknown reg_state %d\n", dev->name, dev->reg_state);
3522 return " (unknown)";
3523}
3524
3385__printf(3, 4) 3525__printf(3, 4)
3386int netdev_printk(const char *level, const struct net_device *dev, 3526int netdev_printk(const char *level, const struct net_device *dev,
3387 const char *format, ...); 3527 const char *format, ...);
@@ -3438,7 +3578,8 @@ do { \
3438 * file/line information and a backtrace. 3578 * file/line information and a backtrace.
3439 */ 3579 */
3440#define netdev_WARN(dev, format, args...) \ 3580#define netdev_WARN(dev, format, args...) \
3441 WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args) 3581 WARN(1, "netdevice: %s%s\n" format, netdev_name(dev), \
3582 netdev_reg_state(dev), ##args)
3442 3583
3443/* netif printk helpers, similar to netdev_printk */ 3584/* netif printk helpers, similar to netdev_printk */
3444 3585
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 68041446c450..ed39956b5613 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -545,6 +545,24 @@ struct phy_driver {
545 */ 545 */
546 void (*link_change_notify)(struct phy_device *dev); 546 void (*link_change_notify)(struct phy_device *dev);
547 547
548 /* A function provided by a phy specific driver to override the
549 * the PHY driver framework support for reading a MMD register
550 * from the PHY. If not supported, return -1. This function is
551 * optional for PHY specific drivers, if not provided then the
552 * default MMD read function is used by the PHY framework.
553 */
554 int (*read_mmd_indirect)(struct phy_device *dev, int ptrad,
555 int devnum, int regnum);
556
557 /* A function provided by a phy specific driver to override the
558 * the PHY driver framework support for writing a MMD register
559 * from the PHY. This function is optional for PHY specific drivers,
560 * if not provided then the default MMD read function is used by
561 * the PHY framework.
562 */
563 void (*write_mmd_indirect)(struct phy_device *dev, int ptrad,
564 int devnum, int regnum, u32 val);
565
548 struct device_driver driver; 566 struct device_driver driver;
549}; 567};
550#define to_phy_driver(d) container_of(d, struct phy_driver, driver) 568#define to_phy_driver(d) container_of(d, struct phy_driver, driver)
diff --git a/include/linux/platform_data/st21nfcb.h b/include/linux/platform_data/st21nfcb.h
new file mode 100644
index 000000000000..2d11f1f5efab
--- /dev/null
+++ b/include/linux/platform_data/st21nfcb.h
@@ -0,0 +1,32 @@
1/*
2 * Driver include for the ST21NFCB NFC chip.
3 *
4 * Copyright (C) 2014 STMicroelectronics SAS. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef _ST21NFCB_NCI_H_
20#define _ST21NFCB_NCI_H_
21
22#include <linux/i2c.h>
23
24#define ST21NFCB_NCI_DRIVER_NAME "st21nfcb_nci"
25
26struct st21nfcb_nfc_platform_data {
27 unsigned int gpio_irq;
28 unsigned int gpio_reset;
29 unsigned int irq_polarity;
30};
31
32#endif /* _ST21NFCA_HCI_H_ */
diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h
index 7dfed71d76a6..159c987b1853 100644
--- a/include/linux/ptp_classify.h
+++ b/include/linux/ptp_classify.h
@@ -33,8 +33,8 @@
33#define PTP_CLASS_IPV4 0x10 /* event in an IPV4 UDP packet */ 33#define PTP_CLASS_IPV4 0x10 /* event in an IPV4 UDP packet */
34#define PTP_CLASS_IPV6 0x20 /* event in an IPV6 UDP packet */ 34#define PTP_CLASS_IPV6 0x20 /* event in an IPV6 UDP packet */
35#define PTP_CLASS_L2 0x30 /* event in a L2 packet */ 35#define PTP_CLASS_L2 0x30 /* event in a L2 packet */
36#define PTP_CLASS_VLAN 0x40 /* event in a VLAN tagged L2 packet */ 36#define PTP_CLASS_PMASK 0x30 /* mask for the packet type field */
37#define PTP_CLASS_PMASK 0xf0 /* mask for the packet type field */ 37#define PTP_CLASS_VLAN 0x40 /* event in a VLAN tagged packet */
38 38
39#define PTP_CLASS_V1_IPV4 (PTP_CLASS_V1 | PTP_CLASS_IPV4) 39#define PTP_CLASS_V1_IPV4 (PTP_CLASS_V1 | PTP_CLASS_IPV4)
40#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 */
@@ -54,7 +54,6 @@
54#define IP6_HLEN 40 54#define IP6_HLEN 40
55#define UDP_HLEN 8 55#define UDP_HLEN 8
56#define OFF_IHL 14 56#define OFF_IHL 14
57#define OFF_PTP6 (ETH_HLEN + IP6_HLEN + UDP_HLEN)
58#define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2) 57#define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2)
59 58
60#if defined(CONFIG_NET_PTP_CLASSIFY) 59#if defined(CONFIG_NET_PTP_CLASSIFY)
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
new file mode 100644
index 000000000000..9cda293c867d
--- /dev/null
+++ b/include/linux/rhashtable.h
@@ -0,0 +1,213 @@
1/*
2 * Resizable, Scalable, Concurrent Hash Table
3 *
4 * Copyright (c) 2014 Thomas Graf <tgraf@suug.ch>
5 * Copyright (c) 2008-2014 Patrick McHardy <kaber@trash.net>
6 *
7 * Based on the following paper by Josh Triplett, Paul E. McKenney
8 * and Jonathan Walpole:
9 * https://www.usenix.org/legacy/event/atc11/tech/final_files/Triplett.pdf
10 *
11 * Code partially derived from nft_hash
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17
18#ifndef _LINUX_RHASHTABLE_H
19#define _LINUX_RHASHTABLE_H
20
21#include <linux/rculist.h>
22
23struct rhash_head {
24 struct rhash_head *next;
25};
26
27#define INIT_HASH_HEAD(ptr) ((ptr)->next = NULL)
28
29struct bucket_table {
30 size_t size;
31 struct rhash_head __rcu *buckets[];
32};
33
34typedef u32 (*rht_hashfn_t)(const void *data, u32 len, u32 seed);
35typedef u32 (*rht_obj_hashfn_t)(const void *data, u32 seed);
36
37struct rhashtable;
38
39/**
40 * struct rhashtable_params - Hash table construction parameters
41 * @nelem_hint: Hint on number of elements, should be 75% of desired size
42 * @key_len: Length of key
43 * @key_offset: Offset of key in struct to be hashed
44 * @head_offset: Offset of rhash_head in struct to be hashed
45 * @hash_rnd: Seed to use while hashing
46 * @max_shift: Maximum number of shifts while expanding
47 * @hashfn: Function to hash key
48 * @obj_hashfn: Function to hash object
49 * @grow_decision: If defined, may return true if table should expand
50 * @shrink_decision: If defined, may return true if table should shrink
51 * @mutex_is_held: Must return true if protecting mutex is held
52 */
53struct rhashtable_params {
54 size_t nelem_hint;
55 size_t key_len;
56 size_t key_offset;
57 size_t head_offset;
58 u32 hash_rnd;
59 size_t max_shift;
60 rht_hashfn_t hashfn;
61 rht_obj_hashfn_t obj_hashfn;
62 bool (*grow_decision)(const struct rhashtable *ht,
63 size_t new_size);
64 bool (*shrink_decision)(const struct rhashtable *ht,
65 size_t new_size);
66 int (*mutex_is_held)(void);
67};
68
69/**
70 * struct rhashtable - Hash table handle
71 * @tbl: Bucket table
72 * @nelems: Number of elements in table
73 * @shift: Current size (1 << shift)
74 * @p: Configuration parameters
75 */
76struct rhashtable {
77 struct bucket_table __rcu *tbl;
78 size_t nelems;
79 size_t shift;
80 struct rhashtable_params p;
81};
82
83#ifdef CONFIG_PROVE_LOCKING
84int lockdep_rht_mutex_is_held(const struct rhashtable *ht);
85#else
86static inline int lockdep_rht_mutex_is_held(const struct rhashtable *ht)
87{
88 return 1;
89}
90#endif /* CONFIG_PROVE_LOCKING */
91
92int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params);
93
94u32 rhashtable_hashfn(const struct rhashtable *ht, const void *key, u32 len);
95u32 rhashtable_obj_hashfn(const struct rhashtable *ht, void *ptr);
96
97void rhashtable_insert(struct rhashtable *ht, struct rhash_head *node, gfp_t);
98bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *node, gfp_t);
99void rhashtable_remove_pprev(struct rhashtable *ht, struct rhash_head *obj,
100 struct rhash_head **pprev, gfp_t flags);
101
102bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size);
103bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size);
104
105int rhashtable_expand(struct rhashtable *ht, gfp_t flags);
106int rhashtable_shrink(struct rhashtable *ht, gfp_t flags);
107
108void *rhashtable_lookup(const struct rhashtable *ht, const void *key);
109void *rhashtable_lookup_compare(const struct rhashtable *ht, u32 hash,
110 bool (*compare)(void *, void *), void *arg);
111
112void rhashtable_destroy(const struct rhashtable *ht);
113
114#define rht_dereference(p, ht) \
115 rcu_dereference_protected(p, lockdep_rht_mutex_is_held(ht))
116
117#define rht_dereference_rcu(p, ht) \
118 rcu_dereference_check(p, lockdep_rht_mutex_is_held(ht))
119
120/* Internal, use rht_obj() instead */
121#define rht_entry(ptr, type, member) container_of(ptr, type, member)
122#define rht_entry_safe(ptr, type, member) \
123({ \
124 typeof(ptr) __ptr = (ptr); \
125 __ptr ? rht_entry(__ptr, type, member) : NULL; \
126})
127#define rht_entry_safe_rcu(ptr, type, member) \
128({ \
129 typeof(*ptr) __rcu *__ptr = (typeof(*ptr) __rcu __force *)ptr; \
130 __ptr ? container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member) : NULL; \
131})
132
133#define rht_next_entry_safe(pos, ht, member) \
134({ \
135 pos ? rht_entry_safe(rht_dereference((pos)->member.next, ht), \
136 typeof(*(pos)), member) : NULL; \
137})
138
139/**
140 * rht_for_each - iterate over hash chain
141 * @pos: &struct rhash_head to use as a loop cursor.
142 * @head: head of the hash chain (struct rhash_head *)
143 * @ht: pointer to your struct rhashtable
144 */
145#define rht_for_each(pos, head, ht) \
146 for (pos = rht_dereference(head, ht); \
147 pos; \
148 pos = rht_dereference((pos)->next, ht))
149
150/**
151 * rht_for_each_entry - iterate over hash chain of given type
152 * @pos: type * to use as a loop cursor.
153 * @head: head of the hash chain (struct rhash_head *)
154 * @ht: pointer to your struct rhashtable
155 * @member: name of the rhash_head within the hashable struct.
156 */
157#define rht_for_each_entry(pos, head, ht, member) \
158 for (pos = rht_entry_safe(rht_dereference(head, ht), \
159 typeof(*(pos)), member); \
160 pos; \
161 pos = rht_next_entry_safe(pos, ht, member))
162
163/**
164 * rht_for_each_entry_safe - safely iterate over hash chain of given type
165 * @pos: type * to use as a loop cursor.
166 * @n: type * to use for temporary next object storage
167 * @head: head of the hash chain (struct rhash_head *)
168 * @ht: pointer to your struct rhashtable
169 * @member: name of the rhash_head within the hashable struct.
170 *
171 * This hash chain list-traversal primitive allows for the looped code to
172 * remove the loop cursor from the list.
173 */
174#define rht_for_each_entry_safe(pos, n, head, ht, member) \
175 for (pos = rht_entry_safe(rht_dereference(head, ht), \
176 typeof(*(pos)), member), \
177 n = rht_next_entry_safe(pos, ht, member); \
178 pos; \
179 pos = n, \
180 n = rht_next_entry_safe(pos, ht, member))
181
182/**
183 * rht_for_each_rcu - iterate over rcu hash chain
184 * @pos: &struct rhash_head to use as a loop cursor.
185 * @head: head of the hash chain (struct rhash_head *)
186 * @ht: pointer to your struct rhashtable
187 *
188 * This hash chain list-traversal primitive may safely run concurrently with
189 * the _rcu fkht mutation primitives such as rht_insert() as long as the
190 * traversal is guarded by rcu_read_lock().
191 */
192#define rht_for_each_rcu(pos, head, ht) \
193 for (pos = rht_dereference_rcu(head, ht); \
194 pos; \
195 pos = rht_dereference_rcu((pos)->next, ht))
196
197/**
198 * rht_for_each_entry_rcu - iterate over rcu hash chain of given type
199 * @pos: type * to use as a loop cursor.
200 * @head: head of the hash chain (struct rhash_head *)
201 * @member: name of the rhash_head within the hashable struct.
202 *
203 * This hash chain list-traversal primitive may safely run concurrently with
204 * the _rcu fkht mutation primitives such as rht_insert() as long as the
205 * traversal is guarded by rcu_read_lock().
206 */
207#define rht_for_each_entry_rcu(pos, head, member) \
208 for (pos = rht_entry_safe_rcu(head, typeof(*(pos)), member); \
209 pos; \
210 pos = rht_entry_safe_rcu((pos)->member.next, \
211 typeof(*(pos)), member))
212
213#endif /* _LINUX_RHASHTABLE_H */
diff --git a/include/linux/rndis.h b/include/linux/rndis.h
index 0c8dc7195cdb..93c0a64aefa6 100644
--- a/include/linux/rndis.h
+++ b/include/linux/rndis.h
@@ -65,6 +65,7 @@
65#define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION 0x40010012 65#define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION 0x40010012
66#define RNDIS_STATUS_WW_INDICATION RDIA_SPECIFIC_INDICATION 66#define RNDIS_STATUS_WW_INDICATION RDIA_SPECIFIC_INDICATION
67#define RNDIS_STATUS_LINK_SPEED_CHANGE 0x40010013L 67#define RNDIS_STATUS_LINK_SPEED_CHANGE 0x40010013L
68#define RNDIS_STATUS_NETWORK_CHANGE 0x40010018
68 69
69#define RNDIS_STATUS_NOT_RESETTABLE 0x80010001 70#define RNDIS_STATUS_NOT_RESETTABLE 0x80010001
70#define RNDIS_STATUS_SOFT_ERRORS 0x80010003 71#define RNDIS_STATUS_SOFT_ERRORS 0x80010003
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 953937ea5233..167bae7bdfa4 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -78,6 +78,7 @@ extern void __rtnl_unlock(void);
78extern int ndo_dflt_fdb_dump(struct sk_buff *skb, 78extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
79 struct netlink_callback *cb, 79 struct netlink_callback *cb,
80 struct net_device *dev, 80 struct net_device *dev,
81 struct net_device *filter_dev,
81 int idx); 82 int idx);
82extern int ndo_dflt_fdb_add(struct ndmsg *ndm, 83extern int ndo_dflt_fdb_add(struct ndmsg *ndm,
83 struct nlattr *tb[], 84 struct nlattr *tb[],
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ec89301ada41..11c270551d25 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -112,8 +112,7 @@
112#define CHECKSUM_COMPLETE 2 112#define CHECKSUM_COMPLETE 2
113#define CHECKSUM_PARTIAL 3 113#define CHECKSUM_PARTIAL 3
114 114
115#define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \ 115#define SKB_DATA_ALIGN(X) ALIGN(X, SMP_CACHE_BYTES)
116 ~(SMP_CACHE_BYTES - 1))
117#define SKB_WITH_OVERHEAD(X) \ 116#define SKB_WITH_OVERHEAD(X) \
118 ((X) - SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) 117 ((X) - SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
119#define SKB_MAX_ORDER(X, ORDER) \ 118#define SKB_MAX_ORDER(X, ORDER) \
@@ -211,18 +210,9 @@ static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
211 * struct skb_shared_hwtstamps - hardware time stamps 210 * struct skb_shared_hwtstamps - hardware time stamps
212 * @hwtstamp: hardware time stamp transformed into duration 211 * @hwtstamp: hardware time stamp transformed into duration
213 * since arbitrary point in time 212 * since arbitrary point in time
214 * @syststamp: hwtstamp transformed to system time base
215 * 213 *
216 * Software time stamps generated by ktime_get_real() are stored in 214 * Software time stamps generated by ktime_get_real() are stored in
217 * skb->tstamp. The relation between the different kinds of time 215 * skb->tstamp.
218 * stamps is as follows:
219 *
220 * syststamp and tstamp can be compared against each other in
221 * arbitrary combinations. The accuracy of a
222 * syststamp/tstamp/"syststamp from other device" comparison is
223 * limited by the accuracy of the transformation into system time
224 * base. This depends on the device driver and its underlying
225 * hardware.
226 * 216 *
227 * hwtstamps can only be compared against other hwtstamps from 217 * hwtstamps can only be compared against other hwtstamps from
228 * the same device. 218 * the same device.
@@ -232,7 +222,6 @@ static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
232 */ 222 */
233struct skb_shared_hwtstamps { 223struct skb_shared_hwtstamps {
234 ktime_t hwtstamp; 224 ktime_t hwtstamp;
235 ktime_t syststamp;
236}; 225};
237 226
238/* Definitions for tx_flags in struct skb_shared_info */ 227/* Definitions for tx_flags in struct skb_shared_info */
@@ -240,7 +229,7 @@ enum {
240 /* generate hardware time stamp */ 229 /* generate hardware time stamp */
241 SKBTX_HW_TSTAMP = 1 << 0, 230 SKBTX_HW_TSTAMP = 1 << 0,
242 231
243 /* generate software time stamp */ 232 /* generate software time stamp when queueing packet to NIC */
244 SKBTX_SW_TSTAMP = 1 << 1, 233 SKBTX_SW_TSTAMP = 1 << 1,
245 234
246 /* device driver is going to provide hardware time stamp */ 235 /* device driver is going to provide hardware time stamp */
@@ -258,8 +247,19 @@ enum {
258 * all frags to avoid possible bad checksum 247 * all frags to avoid possible bad checksum
259 */ 248 */
260 SKBTX_SHARED_FRAG = 1 << 5, 249 SKBTX_SHARED_FRAG = 1 << 5,
250
251 /* generate software time stamp when entering packet scheduling */
252 SKBTX_SCHED_TSTAMP = 1 << 6,
253
254 /* generate software timestamp on peer data acknowledgment */
255 SKBTX_ACK_TSTAMP = 1 << 7,
261}; 256};
262 257
258#define SKBTX_ANY_SW_TSTAMP (SKBTX_SW_TSTAMP | \
259 SKBTX_SCHED_TSTAMP | \
260 SKBTX_ACK_TSTAMP)
261#define SKBTX_ANY_TSTAMP (SKBTX_HW_TSTAMP | SKBTX_ANY_SW_TSTAMP)
262
263/* 263/*
264 * The callback notifies userspace to release buffers when skb DMA is done in 264 * The callback notifies userspace to release buffers when skb DMA is done in
265 * lower device, the skb last reference should be 0 when calling this. 265 * lower device, the skb last reference should be 0 when calling this.
@@ -286,6 +286,7 @@ struct skb_shared_info {
286 unsigned short gso_type; 286 unsigned short gso_type;
287 struct sk_buff *frag_list; 287 struct sk_buff *frag_list;
288 struct skb_shared_hwtstamps hwtstamps; 288 struct skb_shared_hwtstamps hwtstamps;
289 u32 tskey;
289 __be32 ip6_frag_id; 290 __be32 ip6_frag_id;
290 291
291 /* 292 /*
@@ -455,6 +456,7 @@ static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1,
455 * @ooo_okay: allow the mapping of a socket to a queue to be changed 456 * @ooo_okay: allow the mapping of a socket to a queue to be changed
456 * @l4_hash: indicate hash is a canonical 4-tuple hash over transport 457 * @l4_hash: indicate hash is a canonical 4-tuple hash over transport
457 * ports. 458 * ports.
459 * @sw_hash: indicates hash was computed in software stack
458 * @wifi_acked_valid: wifi_acked was set 460 * @wifi_acked_valid: wifi_acked was set
459 * @wifi_acked: whether frame was acked on wifi or not 461 * @wifi_acked: whether frame was acked on wifi or not
460 * @no_fcs: Request NIC to treat last 4 bytes as Ethernet FCS 462 * @no_fcs: Request NIC to treat last 4 bytes as Ethernet FCS
@@ -562,6 +564,7 @@ struct sk_buff {
562 __u8 pfmemalloc:1; 564 __u8 pfmemalloc:1;
563 __u8 ooo_okay:1; 565 __u8 ooo_okay:1;
564 __u8 l4_hash:1; 566 __u8 l4_hash:1;
567 __u8 sw_hash:1;
565 __u8 wifi_acked_valid:1; 568 __u8 wifi_acked_valid:1;
566 __u8 wifi_acked:1; 569 __u8 wifi_acked:1;
567 __u8 no_fcs:1; 570 __u8 no_fcs:1;
@@ -575,7 +578,7 @@ struct sk_buff {
575 __u8 encap_hdr_csum:1; 578 __u8 encap_hdr_csum:1;
576 __u8 csum_valid:1; 579 __u8 csum_valid:1;
577 __u8 csum_complete_sw:1; 580 __u8 csum_complete_sw:1;
578 /* 3/5 bit hole (depending on ndisc_nodetype presence) */ 581 /* 2/4 bit hole (depending on ndisc_nodetype presence) */
579 kmemcheck_bitfield_end(flags2); 582 kmemcheck_bitfield_end(flags2);
580 583
581#if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL 584#if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL
@@ -830,13 +833,14 @@ static inline void
830skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type) 833skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type)
831{ 834{
832 skb->l4_hash = (type == PKT_HASH_TYPE_L4); 835 skb->l4_hash = (type == PKT_HASH_TYPE_L4);
836 skb->sw_hash = 0;
833 skb->hash = hash; 837 skb->hash = hash;
834} 838}
835 839
836void __skb_get_hash(struct sk_buff *skb); 840void __skb_get_hash(struct sk_buff *skb);
837static inline __u32 skb_get_hash(struct sk_buff *skb) 841static inline __u32 skb_get_hash(struct sk_buff *skb)
838{ 842{
839 if (!skb->l4_hash) 843 if (!skb->l4_hash && !skb->sw_hash)
840 __skb_get_hash(skb); 844 __skb_get_hash(skb);
841 845
842 return skb->hash; 846 return skb->hash;
@@ -850,6 +854,7 @@ static inline __u32 skb_get_hash_raw(const struct sk_buff *skb)
850static inline void skb_clear_hash(struct sk_buff *skb) 854static inline void skb_clear_hash(struct sk_buff *skb)
851{ 855{
852 skb->hash = 0; 856 skb->hash = 0;
857 skb->sw_hash = 0;
853 skb->l4_hash = 0; 858 skb->l4_hash = 0;
854} 859}
855 860
@@ -862,6 +867,7 @@ static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb)
862static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from) 867static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from)
863{ 868{
864 to->hash = from->hash; 869 to->hash = from->hash;
870 to->sw_hash = from->sw_hash;
865 to->l4_hash = from->l4_hash; 871 to->l4_hash = from->l4_hash;
866}; 872};
867 873
@@ -2697,6 +2703,10 @@ static inline bool skb_defer_rx_timestamp(struct sk_buff *skb)
2697void skb_complete_tx_timestamp(struct sk_buff *skb, 2703void skb_complete_tx_timestamp(struct sk_buff *skb,
2698 struct skb_shared_hwtstamps *hwtstamps); 2704 struct skb_shared_hwtstamps *hwtstamps);
2699 2705
2706void __skb_tstamp_tx(struct sk_buff *orig_skb,
2707 struct skb_shared_hwtstamps *hwtstamps,
2708 struct sock *sk, int tstype);
2709
2700/** 2710/**
2701 * skb_tstamp_tx - queue clone of skb with send time stamps 2711 * skb_tstamp_tx - queue clone of skb with send time stamps
2702 * @orig_skb: the original outgoing packet 2712 * @orig_skb: the original outgoing packet
@@ -3005,7 +3015,7 @@ static inline bool skb_rx_queue_recorded(const struct sk_buff *skb)
3005 return skb->queue_mapping != 0; 3015 return skb->queue_mapping != 0;
3006} 3016}
3007 3017
3008u16 __skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb, 3018u16 __skb_tx_hash(const struct net_device *dev, struct sk_buff *skb,
3009 unsigned int num_tx_queues); 3019 unsigned int num_tx_queues);
3010 3020
3011static inline struct sec_path *skb_sec_path(struct sk_buff *skb) 3021static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
diff --git a/include/linux/spi/cc2520.h b/include/linux/spi/cc2520.h
new file mode 100644
index 000000000000..85b8ee67e937
--- /dev/null
+++ b/include/linux/spi/cc2520.h
@@ -0,0 +1,26 @@
1/* Header file for cc2520 radio driver
2 *
3 * Copyright (C) 2014 Varka Bhadram <varkab@cdac.in>
4 * Md.Jamal Mohiuddin <mjmohiuddin@cdac.in>
5 * P Sowjanya <sowjanyap@cdac.in>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 */
13
14#ifndef __CC2520_H
15#define __CC2520_H
16
17struct cc2520_platform_data {
18 int fifo;
19 int fifop;
20 int cca;
21 int sfd;
22 int reset;
23 int vreg;
24};
25
26#endif
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index f9f931c89e3e..f7b9100686c3 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -345,6 +345,43 @@
345#define SSB_SPROM4_TXPID5GH2_SHIFT 0 345#define SSB_SPROM4_TXPID5GH2_SHIFT 0
346#define SSB_SPROM4_TXPID5GH3 0xFF00 346#define SSB_SPROM4_TXPID5GH3 0xFF00
347#define SSB_SPROM4_TXPID5GH3_SHIFT 8 347#define SSB_SPROM4_TXPID5GH3_SHIFT 8
348
349/* There are 4 blocks with power info sharing the same layout */
350#define SSB_SPROM4_PWR_INFO_CORE0 0x0080
351#define SSB_SPROM4_PWR_INFO_CORE1 0x00AE
352#define SSB_SPROM4_PWR_INFO_CORE2 0x00DC
353#define SSB_SPROM4_PWR_INFO_CORE3 0x010A
354
355#define SSB_SPROM4_2G_MAXP_ITSSI 0x00 /* 2 GHz ITSSI and 2 GHz Max Power */
356#define SSB_SPROM4_2G_MAXP 0x00FF
357#define SSB_SPROM4_2G_ITSSI 0xFF00
358#define SSB_SPROM4_2G_ITSSI_SHIFT 8
359#define SSB_SPROM4_2G_PA_0 0x02 /* 2 GHz power amp */
360#define SSB_SPROM4_2G_PA_1 0x04
361#define SSB_SPROM4_2G_PA_2 0x06
362#define SSB_SPROM4_2G_PA_3 0x08
363#define SSB_SPROM4_5G_MAXP_ITSSI 0x0A /* 5 GHz ITSSI and 5.3 GHz Max Power */
364#define SSB_SPROM4_5G_MAXP 0x00FF
365#define SSB_SPROM4_5G_ITSSI 0xFF00
366#define SSB_SPROM4_5G_ITSSI_SHIFT 8
367#define SSB_SPROM4_5GHL_MAXP 0x0C /* 5.2 GHz and 5.8 GHz Max Power */
368#define SSB_SPROM4_5GH_MAXP 0x00FF
369#define SSB_SPROM4_5GL_MAXP 0xFF00
370#define SSB_SPROM4_5GL_MAXP_SHIFT 8
371#define SSB_SPROM4_5G_PA_0 0x0E /* 5.3 GHz power amp */
372#define SSB_SPROM4_5G_PA_1 0x10
373#define SSB_SPROM4_5G_PA_2 0x12
374#define SSB_SPROM4_5G_PA_3 0x14
375#define SSB_SPROM4_5GL_PA_0 0x16 /* 5.2 GHz power amp */
376#define SSB_SPROM4_5GL_PA_1 0x18
377#define SSB_SPROM4_5GL_PA_2 0x1A
378#define SSB_SPROM4_5GL_PA_3 0x1C
379#define SSB_SPROM4_5GH_PA_0 0x1E /* 5.8 GHz power amp */
380#define SSB_SPROM4_5GH_PA_1 0x20
381#define SSB_SPROM4_5GH_PA_2 0x22
382#define SSB_SPROM4_5GH_PA_3 0x24
383
384/* TODO: Make it deprecated */
348#define SSB_SPROM4_MAXP_BG 0x0080 /* Max Power BG in path 1 */ 385#define SSB_SPROM4_MAXP_BG 0x0080 /* Max Power BG in path 1 */
349#define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ 386#define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */
350#define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ 387#define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 6f27d4f957bd..cd63851b57f2 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -112,6 +112,8 @@ struct plat_stmmacenet_data {
112 int riwt_off; 112 int riwt_off;
113 int max_speed; 113 int max_speed;
114 int maxmtu; 114 int maxmtu;
115 int multicast_filter_bins;
116 int unicast_filter_entries;
115 void (*fix_mac_speed)(void *priv, unsigned int speed); 117 void (*fix_mac_speed)(void *priv, unsigned int speed);
116 void (*bus_setup)(void __iomem *ioaddr); 118 void (*bus_setup)(void __iomem *ioaddr);
117 void *(*setup)(struct platform_device *pdev); 119 void *(*setup)(struct platform_device *pdev);
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index a0513210798f..fa5258f322e7 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -111,10 +111,7 @@ struct tcp_request_sock_ops;
111 111
112struct tcp_request_sock { 112struct tcp_request_sock {
113 struct inet_request_sock req; 113 struct inet_request_sock req;
114#ifdef CONFIG_TCP_MD5SIG
115 /* Only used by TCP MD5 Signature so far. */
116 const struct tcp_request_sock_ops *af_specific; 114 const struct tcp_request_sock_ops *af_specific;
117#endif
118 struct sock *listener; /* needed for TFO */ 115 struct sock *listener; /* needed for TFO */
119 u32 rcv_isn; 116 u32 rcv_isn;
120 u32 snt_isn; 117 u32 snt_isn;
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 0662e98fef72..26088feb6608 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -148,6 +148,9 @@ struct driver_info {
148 struct sk_buff *(*tx_fixup)(struct usbnet *dev, 148 struct sk_buff *(*tx_fixup)(struct usbnet *dev,
149 struct sk_buff *skb, gfp_t flags); 149 struct sk_buff *skb, gfp_t flags);
150 150
151 /* recover from timeout */
152 void (*recover)(struct usbnet *dev);
153
151 /* early initialization code, can sleep. This is for minidrivers 154 /* early initialization code, can sleep. This is for minidrivers
152 * having 'subminidrivers' that need to do extra initialization 155 * having 'subminidrivers' that need to do extra initialization
153 * right after minidriver have initialized hardware. */ 156 * right after minidriver have initialized hardware. */