aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild2
-rw-r--r--include/linux/bcma/bcma.h9
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h26
-rw-r--r--include/linux/bcma/bcma_driver_pci.h125
-rw-r--r--include/linux/bcma/bcma_regs.h27
-rw-r--r--include/linux/can/dev.h2
-rw-r--r--include/linux/dccp.h8
-rw-r--r--include/linux/etherdevice.h13
-rw-r--r--include/linux/ethtool.h23
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/if_ppp.h174
-rw-r--r--include/linux/if_vlan.h7
-rw-r--r--include/linux/in.h1
-rw-r--r--include/linux/in6.h1
-rw-r--r--include/linux/inetdevice.h1
-rw-r--r--include/linux/ipv6.h8
-rw-r--r--include/linux/isdn.h2
-rw-r--r--include/linux/mdio.h10
-rw-r--r--include/linux/mlx4/device.h5
-rw-r--r--include/linux/mlx4/qp.h5
-rw-r--r--include/linux/net.h1
-rw-r--r--include/linux/netdev_features.h4
-rw-r--r--include/linux/netdevice.h117
-rw-r--r--include/linux/netfilter/Kbuild2
-rw-r--r--include/linux/netfilter/ipset/ip_set.h35
-rw-r--r--include/linux/netfilter/ipset/ip_set_ahash.h119
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h5
-rw-r--r--include/linux/netfilter/nfnetlink.h3
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h12
-rw-r--r--include/linux/netfilter/nfnetlink_cttimeout.h114
-rw-r--r--include/linux/netfilter/xt_CT.h12
-rw-r--r--include/linux/netfilter/xt_LOG.h19
-rw-r--r--include/linux/netfilter_ipv4/Kbuild2
-rw-r--r--include/linux/netfilter_ipv4/ipt_LOG.h2
-rw-r--r--include/linux/netfilter_ipv4/ipt_SAME.h20
-rw-r--r--include/linux/netfilter_ipv4/ipt_realm.h7
-rw-r--r--include/linux/netfilter_ipv6/ip6t_LOG.h2
-rw-r--r--include/linux/netlink.h30
-rw-r--r--include/linux/nfc.h8
-rw-r--r--include/linux/nl80211.h72
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/pkt_sched.h21
-rw-r--r--include/linux/platform_data/cpsw.h55
-rw-r--r--include/linux/ppp-comp.h38
-rw-r--r--include/linux/ppp-ioctl.h119
-rw-r--r--include/linux/ppp_defs.h38
-rw-r--r--include/linux/sh_eth.h1
-rw-r--r--include/linux/skbuff.h46
-rw-r--r--include/linux/snmp.h2
-rw-r--r--include/linux/socket.h4
-rw-r--r--include/linux/ssb/ssb.h108
-rw-r--r--include/linux/ssb/ssb_regs.h34
-rw-r--r--include/linux/tcp.h5
53 files changed, 1064 insertions, 445 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index c94e71781b79..a25555381097 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -238,6 +238,7 @@ header-y += magic.h
238header-y += major.h 238header-y += major.h
239header-y += map_to_7segment.h 239header-y += map_to_7segment.h
240header-y += matroxfb.h 240header-y += matroxfb.h
241header-y += mdio.h
241header-y += media.h 242header-y += media.h
242header-y += mempolicy.h 243header-y += mempolicy.h
243header-y += meye.h 244header-y += meye.h
@@ -304,6 +305,7 @@ header-y += poll.h
304header-y += posix_types.h 305header-y += posix_types.h
305header-y += ppdev.h 306header-y += ppdev.h
306header-y += ppp-comp.h 307header-y += ppp-comp.h
308header-y += ppp-ioctl.h
307header-y += ppp_defs.h 309header-y += ppp_defs.h
308header-y += pps.h 310header-y += pps.h
309header-y += prctl.h 311header-y += prctl.h
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 83c209f39493..5af9a075498f 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -136,6 +136,7 @@ struct bcma_device {
136 bool dev_registered; 136 bool dev_registered;
137 137
138 u8 core_index; 138 u8 core_index;
139 u8 core_unit;
139 140
140 u32 addr; 141 u32 addr;
141 u32 wrap; 142 u32 wrap;
@@ -175,6 +176,12 @@ int __bcma_driver_register(struct bcma_driver *drv, struct module *owner);
175 176
176extern void bcma_driver_unregister(struct bcma_driver *drv); 177extern void bcma_driver_unregister(struct bcma_driver *drv);
177 178
179/* Set a fallback SPROM.
180 * See kdoc at the function definition for complete documentation. */
181extern int bcma_arch_register_fallback_sprom(
182 int (*sprom_callback)(struct bcma_bus *bus,
183 struct ssb_sprom *out));
184
178struct bcma_bus { 185struct bcma_bus {
179 /* The MMIO area. */ 186 /* The MMIO area. */
180 void __iomem *mmio; 187 void __iomem *mmio;
@@ -195,6 +202,7 @@ struct bcma_bus {
195 struct list_head cores; 202 struct list_head cores;
196 u8 nr_cores; 203 u8 nr_cores;
197 u8 init_done:1; 204 u8 init_done:1;
205 u8 num;
198 206
199 struct bcma_drv_cc drv_cc; 207 struct bcma_drv_cc drv_cc;
200 struct bcma_drv_pci drv_pci; 208 struct bcma_drv_pci drv_pci;
@@ -282,6 +290,7 @@ static inline void bcma_maskset16(struct bcma_device *cc,
282 bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set); 290 bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set);
283} 291}
284 292
293extern struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid);
285extern bool bcma_core_is_enabled(struct bcma_device *core); 294extern bool bcma_core_is_enabled(struct bcma_device *core);
286extern void bcma_core_disable(struct bcma_device *core, u32 flags); 295extern void bcma_core_disable(struct bcma_device *core, u32 flags);
287extern int bcma_core_enable(struct bcma_device *core, u32 flags); 296extern int bcma_core_enable(struct bcma_device *core, u32 flags);
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index a33086a7530b..8bbfe31fbac8 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -56,6 +56,9 @@
56#define BCMA_CC_OTPS_HW_PROTECT 0x00000001 56#define BCMA_CC_OTPS_HW_PROTECT 0x00000001
57#define BCMA_CC_OTPS_SW_PROTECT 0x00000002 57#define BCMA_CC_OTPS_SW_PROTECT 0x00000002
58#define BCMA_CC_OTPS_CID_PROTECT 0x00000004 58#define BCMA_CC_OTPS_CID_PROTECT 0x00000004
59#define BCMA_CC_OTPS_GU_PROG_IND 0x00000F00 /* General Use programmed indication */
60#define BCMA_CC_OTPS_GU_PROG_IND_SHIFT 8
61#define BCMA_CC_OTPS_GU_PROG_HW 0x00000100 /* HW region programmed */
59#define BCMA_CC_OTPC 0x0014 /* OTP control */ 62#define BCMA_CC_OTPC 0x0014 /* OTP control */
60#define BCMA_CC_OTPC_RECWAIT 0xFF000000 63#define BCMA_CC_OTPC_RECWAIT 0xFF000000
61#define BCMA_CC_OTPC_PROGWAIT 0x00FFFF00 64#define BCMA_CC_OTPC_PROGWAIT 0x00FFFF00
@@ -72,6 +75,8 @@
72#define BCMA_CC_OTPP_READ 0x40000000 75#define BCMA_CC_OTPP_READ 0x40000000
73#define BCMA_CC_OTPP_START 0x80000000 76#define BCMA_CC_OTPP_START 0x80000000
74#define BCMA_CC_OTPP_BUSY 0x80000000 77#define BCMA_CC_OTPP_BUSY 0x80000000
78#define BCMA_CC_OTPL 0x001C /* OTP layout */
79#define BCMA_CC_OTPL_GURGN_OFFSET 0x00000FFF /* offset of general use region */
75#define BCMA_CC_IRQSTAT 0x0020 80#define BCMA_CC_IRQSTAT 0x0020
76#define BCMA_CC_IRQMASK 0x0024 81#define BCMA_CC_IRQMASK 0x0024
77#define BCMA_CC_IRQ_GPIO 0x00000001 /* gpio intr */ 82#define BCMA_CC_IRQ_GPIO 0x00000001 /* gpio intr */
@@ -79,6 +84,10 @@
79#define BCMA_CC_IRQ_WDRESET 0x80000000 /* watchdog reset occurred */ 84#define BCMA_CC_IRQ_WDRESET 0x80000000 /* watchdog reset occurred */
80#define BCMA_CC_CHIPCTL 0x0028 /* Rev >= 11 only */ 85#define BCMA_CC_CHIPCTL 0x0028 /* Rev >= 11 only */
81#define BCMA_CC_CHIPSTAT 0x002C /* Rev >= 11 only */ 86#define BCMA_CC_CHIPSTAT 0x002C /* Rev >= 11 only */
87#define BCMA_CC_CHIPST_4313_SPROM_PRESENT 1
88#define BCMA_CC_CHIPST_4313_OTP_PRESENT 2
89#define BCMA_CC_CHIPST_4331_SPROM_PRESENT 2
90#define BCMA_CC_CHIPST_4331_OTP_PRESENT 4
82#define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */ 91#define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */
83#define BCMA_CC_JCMD_START 0x80000000 92#define BCMA_CC_JCMD_START 0x80000000
84#define BCMA_CC_JCMD_BUSY 0x80000000 93#define BCMA_CC_JCMD_BUSY 0x80000000
@@ -181,6 +190,22 @@
181#define BCMA_CC_FLASH_CFG 0x0128 190#define BCMA_CC_FLASH_CFG 0x0128
182#define BCMA_CC_FLASH_CFG_DS 0x0010 /* Data size, 0=8bit, 1=16bit */ 191#define BCMA_CC_FLASH_CFG_DS 0x0010 /* Data size, 0=8bit, 1=16bit */
183#define BCMA_CC_FLASH_WAITCNT 0x012C 192#define BCMA_CC_FLASH_WAITCNT 0x012C
193#define BCMA_CC_SROM_CONTROL 0x0190
194#define BCMA_CC_SROM_CONTROL_START 0x80000000
195#define BCMA_CC_SROM_CONTROL_BUSY 0x80000000
196#define BCMA_CC_SROM_CONTROL_OPCODE 0x60000000
197#define BCMA_CC_SROM_CONTROL_OP_READ 0x00000000
198#define BCMA_CC_SROM_CONTROL_OP_WRITE 0x20000000
199#define BCMA_CC_SROM_CONTROL_OP_WRDIS 0x40000000
200#define BCMA_CC_SROM_CONTROL_OP_WREN 0x60000000
201#define BCMA_CC_SROM_CONTROL_OTPSEL 0x00000010
202#define BCMA_CC_SROM_CONTROL_LOCK 0x00000008
203#define BCMA_CC_SROM_CONTROL_SIZE_MASK 0x00000006
204#define BCMA_CC_SROM_CONTROL_SIZE_1K 0x00000000
205#define BCMA_CC_SROM_CONTROL_SIZE_4K 0x00000002
206#define BCMA_CC_SROM_CONTROL_SIZE_16K 0x00000004
207#define BCMA_CC_SROM_CONTROL_SIZE_SHIFT 1
208#define BCMA_CC_SROM_CONTROL_PRESENT 0x00000001
184/* 0x1E0 is defined as shared BCMA_CLKCTLST */ 209/* 0x1E0 is defined as shared BCMA_CLKCTLST */
185#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ 210#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */
186#define BCMA_CC_UART0_DATA 0x0300 211#define BCMA_CC_UART0_DATA 0x0300
@@ -240,7 +265,6 @@
240#define BCMA_CC_PLLCTL_ADDR 0x0660 265#define BCMA_CC_PLLCTL_ADDR 0x0660
241#define BCMA_CC_PLLCTL_DATA 0x0664 266#define BCMA_CC_PLLCTL_DATA 0x0664
242#define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ 267#define BCMA_CC_SPROM 0x0800 /* SPROM beginning */
243#define BCMA_CC_SPROM_PCIE6 0x0830 /* SPROM beginning on PCIe rev >= 6 */
244 268
245/* Divider allocation in 4716/47162/5356 */ 269/* Divider allocation in 4716/47162/5356 */
246#define BCMA_CC_PMU5_MAINPLL_CPU 1 270#define BCMA_CC_PMU5_MAINPLL_CPU 1
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index 3871b668caf9..46c71e27d31f 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -53,6 +53,35 @@ struct pci_dev;
53#define BCMA_CORE_PCI_SBTOPCI1_MASK 0xFC000000 53#define BCMA_CORE_PCI_SBTOPCI1_MASK 0xFC000000
54#define BCMA_CORE_PCI_SBTOPCI2 0x0108 /* Backplane to PCI translation 2 (sbtopci2) */ 54#define BCMA_CORE_PCI_SBTOPCI2 0x0108 /* Backplane to PCI translation 2 (sbtopci2) */
55#define BCMA_CORE_PCI_SBTOPCI2_MASK 0xC0000000 55#define BCMA_CORE_PCI_SBTOPCI2_MASK 0xC0000000
56#define BCMA_CORE_PCI_CONFIG_ADDR 0x0120 /* pcie config space access */
57#define BCMA_CORE_PCI_CONFIG_DATA 0x0124 /* pcie config space access */
58#define BCMA_CORE_PCI_MDIO_CONTROL 0x0128 /* controls the mdio access */
59#define BCMA_CORE_PCI_MDIOCTL_DIVISOR_MASK 0x7f /* clock to be used on MDIO */
60#define BCMA_CORE_PCI_MDIOCTL_DIVISOR_VAL 0x2
61#define BCMA_CORE_PCI_MDIOCTL_PREAM_EN 0x80 /* Enable preamble sequnce */
62#define BCMA_CORE_PCI_MDIOCTL_ACCESS_DONE 0x100 /* Tranaction complete */
63#define BCMA_CORE_PCI_MDIO_DATA 0x012c /* Data to the mdio access */
64#define BCMA_CORE_PCI_MDIODATA_MASK 0x0000ffff /* data 2 bytes */
65#define BCMA_CORE_PCI_MDIODATA_TA 0x00020000 /* Turnaround */
66#define BCMA_CORE_PCI_MDIODATA_REGADDR_SHF_OLD 18 /* Regaddr shift (rev < 10) */
67#define BCMA_CORE_PCI_MDIODATA_REGADDR_MASK_OLD 0x003c0000 /* Regaddr Mask (rev < 10) */
68#define BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF_OLD 22 /* Physmedia devaddr shift (rev < 10) */
69#define BCMA_CORE_PCI_MDIODATA_DEVADDR_MASK_OLD 0x0fc00000 /* Physmedia devaddr Mask (rev < 10) */
70#define BCMA_CORE_PCI_MDIODATA_REGADDR_SHF 18 /* Regaddr shift */
71#define BCMA_CORE_PCI_MDIODATA_REGADDR_MASK 0x007c0000 /* Regaddr Mask */
72#define BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF 23 /* Physmedia devaddr shift */
73#define BCMA_CORE_PCI_MDIODATA_DEVADDR_MASK 0x0f800000 /* Physmedia devaddr Mask */
74#define BCMA_CORE_PCI_MDIODATA_WRITE 0x10000000 /* write Transaction */
75#define BCMA_CORE_PCI_MDIODATA_READ 0x20000000 /* Read Transaction */
76#define BCMA_CORE_PCI_MDIODATA_START 0x40000000 /* start of Transaction */
77#define BCMA_CORE_PCI_MDIODATA_DEV_ADDR 0x0 /* dev address for serdes */
78#define BCMA_CORE_PCI_MDIODATA_BLK_ADDR 0x1F /* blk address for serdes */
79#define BCMA_CORE_PCI_MDIODATA_DEV_PLL 0x1d /* SERDES PLL Dev */
80#define BCMA_CORE_PCI_MDIODATA_DEV_TX 0x1e /* SERDES TX Dev */
81#define BCMA_CORE_PCI_MDIODATA_DEV_RX 0x1f /* SERDES RX Dev */
82#define BCMA_CORE_PCI_PCIEIND_ADDR 0x0130 /* indirect access to the internal register */
83#define BCMA_CORE_PCI_PCIEIND_DATA 0x0134 /* Data to/from the internal regsiter */
84#define BCMA_CORE_PCI_CLKREQENCTRL 0x0138 /* >= rev 6, Clkreq rdma control */
56#define BCMA_CORE_PCI_PCICFG0 0x0400 /* PCI config space 0 (rev >= 8) */ 85#define BCMA_CORE_PCI_PCICFG0 0x0400 /* PCI config space 0 (rev >= 8) */
57#define BCMA_CORE_PCI_PCICFG1 0x0500 /* PCI config space 1 (rev >= 8) */ 86#define BCMA_CORE_PCI_PCICFG1 0x0500 /* PCI config space 1 (rev >= 8) */
58#define BCMA_CORE_PCI_PCICFG2 0x0600 /* PCI config space 2 (rev >= 8) */ 87#define BCMA_CORE_PCI_PCICFG2 0x0600 /* PCI config space 2 (rev >= 8) */
@@ -72,20 +101,114 @@ struct pci_dev;
72#define BCMA_CORE_PCI_SBTOPCI_RC_READL 0x00000010 /* Memory read line */ 101#define BCMA_CORE_PCI_SBTOPCI_RC_READL 0x00000010 /* Memory read line */
73#define BCMA_CORE_PCI_SBTOPCI_RC_READM 0x00000020 /* Memory read multiple */ 102#define BCMA_CORE_PCI_SBTOPCI_RC_READM 0x00000020 /* Memory read multiple */
74 103
104/* PCIE protocol PHY diagnostic registers */
105#define BCMA_CORE_PCI_PLP_MODEREG 0x200 /* Mode */
106#define BCMA_CORE_PCI_PLP_STATUSREG 0x204 /* Status */
107#define BCMA_CORE_PCI_PLP_POLARITYINV_STAT 0x10 /* Status reg PCIE_PLP_STATUSREG */
108#define BCMA_CORE_PCI_PLP_LTSSMCTRLREG 0x208 /* LTSSM control */
109#define BCMA_CORE_PCI_PLP_LTLINKNUMREG 0x20c /* Link Training Link number */
110#define BCMA_CORE_PCI_PLP_LTLANENUMREG 0x210 /* Link Training Lane number */
111#define BCMA_CORE_PCI_PLP_LTNFTSREG 0x214 /* Link Training N_FTS */
112#define BCMA_CORE_PCI_PLP_ATTNREG 0x218 /* Attention */
113#define BCMA_CORE_PCI_PLP_ATTNMASKREG 0x21C /* Attention Mask */
114#define BCMA_CORE_PCI_PLP_RXERRCTR 0x220 /* Rx Error */
115#define BCMA_CORE_PCI_PLP_RXFRMERRCTR 0x224 /* Rx Framing Error */
116#define BCMA_CORE_PCI_PLP_RXERRTHRESHREG 0x228 /* Rx Error threshold */
117#define BCMA_CORE_PCI_PLP_TESTCTRLREG 0x22C /* Test Control reg */
118#define BCMA_CORE_PCI_PLP_SERDESCTRLOVRDREG 0x230 /* SERDES Control Override */
119#define BCMA_CORE_PCI_PLP_TIMINGOVRDREG 0x234 /* Timing param override */
120#define BCMA_CORE_PCI_PLP_RXTXSMDIAGREG 0x238 /* RXTX State Machine Diag */
121#define BCMA_CORE_PCI_PLP_LTSSMDIAGREG 0x23C /* LTSSM State Machine Diag */
122
123/* PCIE protocol DLLP diagnostic registers */
124#define BCMA_CORE_PCI_DLLP_LCREG 0x100 /* Link Control */
125#define BCMA_CORE_PCI_DLLP_LSREG 0x104 /* Link Status */
126#define BCMA_CORE_PCI_DLLP_LAREG 0x108 /* Link Attention */
127#define BCMA_CORE_PCI_DLLP_LSREG_LINKUP (1 << 16)
128#define BCMA_CORE_PCI_DLLP_LAMASKREG 0x10C /* Link Attention Mask */
129#define BCMA_CORE_PCI_DLLP_NEXTTXSEQNUMREG 0x110 /* Next Tx Seq Num */
130#define BCMA_CORE_PCI_DLLP_ACKEDTXSEQNUMREG 0x114 /* Acked Tx Seq Num */
131#define BCMA_CORE_PCI_DLLP_PURGEDTXSEQNUMREG 0x118 /* Purged Tx Seq Num */
132#define BCMA_CORE_PCI_DLLP_RXSEQNUMREG 0x11C /* Rx Sequence Number */
133#define BCMA_CORE_PCI_DLLP_LRREG 0x120 /* Link Replay */
134#define BCMA_CORE_PCI_DLLP_LACKTOREG 0x124 /* Link Ack Timeout */
135#define BCMA_CORE_PCI_DLLP_PMTHRESHREG 0x128 /* Power Management Threshold */
136#define BCMA_CORE_PCI_DLLP_RTRYWPREG 0x12C /* Retry buffer write ptr */
137#define BCMA_CORE_PCI_DLLP_RTRYRPREG 0x130 /* Retry buffer Read ptr */
138#define BCMA_CORE_PCI_DLLP_RTRYPPREG 0x134 /* Retry buffer Purged ptr */
139#define BCMA_CORE_PCI_DLLP_RTRRWREG 0x138 /* Retry buffer Read/Write */
140#define BCMA_CORE_PCI_DLLP_ECTHRESHREG 0x13C /* Error Count Threshold */
141#define BCMA_CORE_PCI_DLLP_TLPERRCTRREG 0x140 /* TLP Error Counter */
142#define BCMA_CORE_PCI_DLLP_ERRCTRREG 0x144 /* Error Counter */
143#define BCMA_CORE_PCI_DLLP_NAKRXCTRREG 0x148 /* NAK Received Counter */
144#define BCMA_CORE_PCI_DLLP_TESTREG 0x14C /* Test */
145#define BCMA_CORE_PCI_DLLP_PKTBIST 0x150 /* Packet BIST */
146#define BCMA_CORE_PCI_DLLP_PCIE11 0x154 /* DLLP PCIE 1.1 reg */
147
148/* SERDES RX registers */
149#define BCMA_CORE_PCI_SERDES_RX_CTRL 1 /* Rx cntrl */
150#define BCMA_CORE_PCI_SERDES_RX_CTRL_FORCE 0x80 /* rxpolarity_force */
151#define BCMA_CORE_PCI_SERDES_RX_CTRL_POLARITY 0x40 /* rxpolarity_value */
152#define BCMA_CORE_PCI_SERDES_RX_TIMER1 2 /* Rx Timer1 */
153#define BCMA_CORE_PCI_SERDES_RX_CDR 6 /* CDR */
154#define BCMA_CORE_PCI_SERDES_RX_CDRBW 7 /* CDR BW */
155
156/* SERDES PLL registers */
157#define BCMA_CORE_PCI_SERDES_PLL_CTRL 1 /* PLL control reg */
158#define BCMA_CORE_PCI_PLL_CTRL_FREQDET_EN 0x4000 /* bit 14 is FREQDET on */
159
75/* PCIcore specific boardflags */ 160/* PCIcore specific boardflags */
76#define BCMA_CORE_PCI_BFL_NOPCI 0x00000400 /* Board leaves PCI floating */ 161#define BCMA_CORE_PCI_BFL_NOPCI 0x00000400 /* Board leaves PCI floating */
77 162
163/* PCIE Config space accessing MACROS */
164#define BCMA_CORE_PCI_CFG_BUS_SHIFT 24 /* Bus shift */
165#define BCMA_CORE_PCI_CFG_SLOT_SHIFT 19 /* Slot/Device shift */
166#define BCMA_CORE_PCI_CFG_FUN_SHIFT 16 /* Function shift */
167#define BCMA_CORE_PCI_CFG_OFF_SHIFT 0 /* Register shift */
168
169#define BCMA_CORE_PCI_CFG_BUS_MASK 0xff /* Bus mask */
170#define BCMA_CORE_PCI_CFG_SLOT_MASK 0x1f /* Slot/Device mask */
171#define BCMA_CORE_PCI_CFG_FUN_MASK 7 /* Function mask */
172#define BCMA_CORE_PCI_CFG_OFF_MASK 0xfff /* Register mask */
173
174/* PCIE Root Capability Register bits (Host mode only) */
175#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001
176
177struct bcma_drv_pci;
178
179#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
180struct bcma_drv_pci_host {
181 struct bcma_drv_pci *pdev;
182
183 u32 host_cfg_addr;
184 spinlock_t cfgspace_lock;
185
186 struct pci_controller pci_controller;
187 struct pci_ops pci_ops;
188 struct resource mem_resource;
189 struct resource io_resource;
190};
191#endif
192
78struct bcma_drv_pci { 193struct bcma_drv_pci {
79 struct bcma_device *core; 194 struct bcma_device *core;
80 u8 setup_done:1; 195 u8 setup_done:1;
196 u8 hostmode:1;
197
198#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
199 struct bcma_drv_pci_host *host_controller;
200#endif
81}; 201};
82 202
83/* Register access */ 203/* Register access */
84#define pcicore_read32(pc, offset) bcma_read32((pc)->core, offset) 204#define pcicore_read32(pc, offset) bcma_read32((pc)->core, offset)
85#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) 205#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val)
86 206
87extern void bcma_core_pci_init(struct bcma_drv_pci *pc); 207extern void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc);
88extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, 208extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
89 struct bcma_device *core, bool enable); 209 struct bcma_device *core, bool enable);
90 210
211extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
212extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);
213
91#endif /* LINUX_BCMA_DRIVER_PCI_H_ */ 214#endif /* LINUX_BCMA_DRIVER_PCI_H_ */
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h
index 9faae2ae02e8..5a71d5719640 100644
--- a/include/linux/bcma/bcma_regs.h
+++ b/include/linux/bcma/bcma_regs.h
@@ -56,4 +56,31 @@
56#define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ 56#define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */
57#define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ 57#define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */
58 58
59/* SiliconBackplane Address Map.
60 * All regions may not exist on all chips.
61 */
62#define BCMA_SOC_SDRAM_BASE 0x00000000U /* Physical SDRAM */
63#define BCMA_SOC_PCI_MEM 0x08000000U /* Host Mode sb2pcitranslation0 (64 MB) */
64#define BCMA_SOC_PCI_MEM_SZ (64 * 1024 * 1024)
65#define BCMA_SOC_PCI_CFG 0x0c000000U /* Host Mode sb2pcitranslation1 (64 MB) */
66#define BCMA_SOC_SDRAM_SWAPPED 0x10000000U /* Byteswapped Physical SDRAM */
67#define BCMA_SOC_SDRAM_R2 0x80000000U /* Region 2 for sdram (512 MB) */
68
69
70#define BCMA_SOC_PCI_DMA 0x40000000U /* Client Mode sb2pcitranslation2 (1 GB) */
71#define BCMA_SOC_PCI_DMA2 0x80000000U /* Client Mode sb2pcitranslation2 (1 GB) */
72#define BCMA_SOC_PCI_DMA_SZ 0x40000000U /* Client Mode sb2pcitranslation2 size in bytes */
73#define BCMA_SOC_PCIE_DMA_L32 0x00000000U /* PCIE Client Mode sb2pcitranslation2
74 * (2 ZettaBytes), low 32 bits
75 */
76#define BCMA_SOC_PCIE_DMA_H32 0x80000000U /* PCIE Client Mode sb2pcitranslation2
77 * (2 ZettaBytes), high 32 bits
78 */
79
80#define BCMA_SOC_PCI1_MEM 0x40000000U /* Host Mode sb2pcitranslation0 (64 MB) */
81#define BCMA_SOC_PCI1_CFG 0x44000000U /* Host Mode sb2pcitranslation1 (64 MB) */
82#define BCMA_SOC_PCIE1_DMA_H32 0xc0000000U /* PCIE Client Mode sb2pcitranslation2
83 * (2 ZettaBytes), high 32 bits
84 */
85
59#endif /* LINUX_BCMA_REGS_H_ */ 86#endif /* LINUX_BCMA_REGS_H_ */
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index a0969fcb72b9..5d2efe7e3f1b 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -92,7 +92,7 @@ void can_bus_off(struct net_device *dev);
92 92
93void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, 93void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
94 unsigned int idx); 94 unsigned int idx);
95void can_get_echo_skb(struct net_device *dev, unsigned int idx); 95unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx);
96void can_free_echo_skb(struct net_device *dev, unsigned int idx); 96void can_free_echo_skb(struct net_device *dev, unsigned int idx);
97 97
98struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf); 98struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf);
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 710c04302a15..eaf95a023af4 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -376,8 +376,10 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
376/** 376/**
377 * struct dccp_request_sock - represent DCCP-specific connection request 377 * struct dccp_request_sock - represent DCCP-specific connection request
378 * @dreq_inet_rsk: structure inherited from 378 * @dreq_inet_rsk: structure inherited from
379 * @dreq_iss: initial sequence number sent on the Response (RFC 4340, 7.1) 379 * @dreq_iss: initial sequence number, sent on the first Response (RFC 4340, 7.1)
380 * @dreq_isr: initial sequence number received on the Request 380 * @dreq_gss: greatest sequence number sent (for retransmitted Responses)
381 * @dreq_isr: initial sequence number received in the first Request
382 * @dreq_gsr: greatest sequence number received (for retransmitted Request(s))
381 * @dreq_service: service code present on the Request (there is just one) 383 * @dreq_service: service code present on the Request (there is just one)
382 * @dreq_featneg: feature negotiation options for this connection 384 * @dreq_featneg: feature negotiation options for this connection
383 * The following two fields are analogous to the ones in dccp_sock: 385 * The following two fields are analogous to the ones in dccp_sock:
@@ -387,7 +389,9 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
387struct dccp_request_sock { 389struct dccp_request_sock {
388 struct inet_request_sock dreq_inet_rsk; 390 struct inet_request_sock dreq_inet_rsk;
389 __u64 dreq_iss; 391 __u64 dreq_iss;
392 __u64 dreq_gss;
390 __u64 dreq_isr; 393 __u64 dreq_isr;
394 __u64 dreq_gsr;
391 __be32 dreq_service; 395 __be32 dreq_service;
392 struct list_head dreq_featneg; 396 struct list_head dreq_featneg;
393 __u32 dreq_timestamp_echo; 397 __u32 dreq_timestamp_echo;
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 05955cf09937..8a1835855faa 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -140,17 +140,18 @@ static inline void random_ether_addr(u8 *addr)
140} 140}
141 141
142/** 142/**
143 * dev_hw_addr_random - Create random MAC and set device flag 143 * eth_hw_addr_random - Generate software assigned random Ethernet and
144 * set device flag
144 * @dev: pointer to net_device structure 145 * @dev: pointer to net_device structure
145 * @hwaddr: Pointer to a six-byte array containing the Ethernet address
146 * 146 *
147 * Generate random MAC to be used by a device and set addr_assign_type 147 * Generate a random Ethernet address (MAC) to be used by a net device
148 * so the state can be read by sysfs and be used by udev. 148 * and set addr_assign_type so the state can be read by sysfs and be
149 * used by userspace.
149 */ 150 */
150static inline void dev_hw_addr_random(struct net_device *dev, u8 *hwaddr) 151static inline void eth_hw_addr_random(struct net_device *dev)
151{ 152{
152 dev->addr_assign_type |= NET_ADDR_RANDOM; 153 dev->addr_assign_type |= NET_ADDR_RANDOM;
153 random_ether_addr(hwaddr); 154 random_ether_addr(dev->dev_addr);
154} 155}
155 156
156/** 157/**
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index da5b2de99ae4..e1d9e0ede309 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -30,10 +30,15 @@ struct ethtool_cmd {
30 * access it */ 30 * access it */
31 __u8 duplex; /* Duplex, half or full */ 31 __u8 duplex; /* Duplex, half or full */
32 __u8 port; /* Which connector port */ 32 __u8 port; /* Which connector port */
33 __u8 phy_address; 33 __u8 phy_address; /* MDIO PHY address (PRTAD for clause 45).
34 * May be read-only or read-write
35 * depending on the driver.
36 */
34 __u8 transceiver; /* Which transceiver to use */ 37 __u8 transceiver; /* Which transceiver to use */
35 __u8 autoneg; /* Enable or disable autonegotiation */ 38 __u8 autoneg; /* Enable or disable autonegotiation */
36 __u8 mdio_support; 39 __u8 mdio_support; /* MDIO protocols supported. Read-only.
40 * Not set by all drivers.
41 */
37 __u32 maxtxpkt; /* Tx pkts before generating tx int */ 42 __u32 maxtxpkt; /* Tx pkts before generating tx int */
38 __u32 maxrxpkt; /* Rx pkts before generating rx int */ 43 __u32 maxrxpkt; /* Rx pkts before generating rx int */
39 __u16 speed_hi; /* The forced speed (upper 44 __u16 speed_hi; /* The forced speed (upper
@@ -59,6 +64,20 @@ static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
59 return (ep->speed_hi << 16) | ep->speed; 64 return (ep->speed_hi << 16) | ep->speed;
60} 65}
61 66
67/* Device supports clause 22 register access to PHY or peripherals
68 * using the interface defined in <linux/mii.h>. This should not be
69 * set if there are known to be no such peripherals present or if
70 * the driver only emulates clause 22 registers for compatibility.
71 */
72#define ETH_MDIO_SUPPORTS_C22 1
73
74/* Device supports clause 45 register access to PHY or peripherals
75 * using the interface defined in <linux/mii.h> and <linux/mdio.h>.
76 * This should not be set if there are known to be no such peripherals
77 * present.
78 */
79#define ETH_MDIO_SUPPORTS_C45 2
80
62#define ETHTOOL_FWVERS_LEN 32 81#define ETHTOOL_FWVERS_LEN 32
63#define ETHTOOL_BUSINFO_LEN 32 82#define ETHTOOL_BUSINFO_LEN 32
64/* these strings are set to whatever the driver author decides... */ 83/* these strings are set to whatever the driver author decides... */
diff --git a/include/linux/if.h b/include/linux/if.h
index 06b6ef60c821..f995c663c493 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -80,6 +80,8 @@
80 * skbs on transmit */ 80 * skbs on transmit */
81#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */ 81#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */
82#define IFF_TEAM_PORT 0x40000 /* device used as team port */ 82#define IFF_TEAM_PORT 0x40000 /* device used as team port */
83#define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */
84
83 85
84#define IF_GET_IFACE 0x0001 /* for querying only */ 86#define IF_GET_IFACE 0x0001 /* for querying only */
85#define IF_GET_PROTO 0x0002 87#define IF_GET_PROTO 0x0002
diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
index c9ad38322576..9048fabb7a4e 100644
--- a/include/linux/if_ppp.h
+++ b/include/linux/if_ppp.h
@@ -1,173 +1 @@
1/* #include <linux/ppp-ioctl.h>
2 * if_ppp.h - Point-to-Point Protocol definitions.
3 *
4 * Copyright (c) 1989 Carnegie Mellon University.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms are permitted
8 * provided that the above copyright notice and this paragraph are
9 * duplicated in all such forms and that any documentation,
10 * advertising materials, and other materials related to such
11 * distribution and use acknowledge that the software was developed
12 * by Carnegie Mellon University. The name of the
13 * University may not be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 *
19 */
20
21/*
22 * ==FILEVERSION 20050812==
23 *
24 * NOTE TO MAINTAINERS:
25 * If you modify this file at all, please set the above date.
26 * if_ppp.h is shipped with a PPP distribution as well as with the kernel;
27 * if everyone increases the FILEVERSION number above, then scripts
28 * can do the right thing when deciding whether to install a new if_ppp.h
29 * file. Don't change the format of that line otherwise, so the
30 * installation script can recognize it.
31 */
32
33#ifndef _IF_PPP_H_
34#define _IF_PPP_H_
35
36#include <linux/types.h>
37#include <linux/compiler.h>
38
39/*
40 * Packet sizes
41 */
42
43#define PPP_MTU 1500 /* Default MTU (size of Info field) */
44#define PPP_MAXMRU 65000 /* Largest MRU we allow */
45#define PROTO_IPX 0x002b /* protocol numbers */
46#define PROTO_DNA_RT 0x0027 /* DNA Routing */
47
48
49/*
50 * Bit definitions for flags.
51 */
52
53#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
54#define SC_COMP_AC 0x00000002 /* header compression (output) */
55#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
56#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
57#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
58#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
59#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
60#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
61#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
62#define SC_LOOP_TRAFFIC 0x00000200 /* send traffic to pppd */
63#define SC_MULTILINK 0x00000400 /* do multilink encapsulation */
64#define SC_MP_SHORTSEQ 0x00000800 /* use short MP sequence numbers */
65#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
66#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
67#define SC_MP_XSHORTSEQ 0x00004000 /* transmit short MP seq numbers */
68#define SC_DEBUG 0x00010000 /* enable debug messages */
69#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
70#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
71#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
72#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
73#define SC_SYNC 0x00200000 /* synchronous serial mode */
74#define SC_MUST_COMP 0x00400000 /* no uncompressed packets may be sent or received */
75#define SC_MASK 0x0f600fff /* bits that user can change */
76
77/* state bits */
78#define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */
79#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
80#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
81#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
82#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
83#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
84#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
85
86/*
87 * Ioctl definitions.
88 */
89
90struct npioctl {
91 int protocol; /* PPP protocol, e.g. PPP_IP */
92 enum NPmode mode;
93};
94
95/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
96struct ppp_option_data {
97 __u8 __user *ptr;
98 __u32 length;
99 int transmit;
100};
101
102struct ifpppstatsreq {
103 struct ifreq b;
104 struct ppp_stats stats; /* statistic information */
105};
106
107struct ifpppcstatsreq {
108 struct ifreq b;
109 struct ppp_comp_stats stats;
110};
111
112/* For PPPIOCGL2TPSTATS */
113struct pppol2tp_ioc_stats {
114 __u16 tunnel_id; /* redundant */
115 __u16 session_id; /* if zero, get tunnel stats */
116 __u32 using_ipsec:1; /* valid only for session_id == 0 */
117 __aligned_u64 tx_packets;
118 __aligned_u64 tx_bytes;
119 __aligned_u64 tx_errors;
120 __aligned_u64 rx_packets;
121 __aligned_u64 rx_bytes;
122 __aligned_u64 rx_seq_discards;
123 __aligned_u64 rx_oos_packets;
124 __aligned_u64 rx_errors;
125};
126
127#define ifr__name b.ifr_ifrn.ifrn_name
128#define stats_ptr b.ifr_ifru.ifru_data
129
130/*
131 * Ioctl definitions.
132 */
133
134#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
135#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
136#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
137#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
138#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
139#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
140#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
141#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
142#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
143#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
144#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
145#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
146#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
147#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
148#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
149#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
150#define PPPIOCSPASS _IOW('t', 71, struct sock_fprog) /* set pass filter */
151#define PPPIOCSACTIVE _IOW('t', 70, struct sock_fprog) /* set active filt */
152#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
153#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
154#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
155#define PPPIOCNEWUNIT _IOWR('t', 62, int) /* create new ppp unit */
156#define PPPIOCATTACH _IOW('t', 61, int) /* attach to ppp unit */
157#define PPPIOCDETACH _IOW('t', 60, int) /* detach from ppp unit/chan */
158#define PPPIOCSMRRU _IOW('t', 59, int) /* set multilink MRU */
159#define PPPIOCCONNECT _IOW('t', 58, int) /* connect channel to unit */
160#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */
161#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */
162#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */
163#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
164
165#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
166#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
167#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
168
169#if !defined(ifr_mtu)
170#define ifr_mtu ifr_ifru.ifru_metric
171#endif
172
173#endif /* _IF_PPP_H_ */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 13aff1e2183b..33a6e1951d4d 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -18,10 +18,9 @@
18#include <linux/etherdevice.h> 18#include <linux/etherdevice.h>
19#include <linux/rtnetlink.h> 19#include <linux/rtnetlink.h>
20 20
21#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header) 21#define VLAN_HLEN 4 /* The additional bytes required by VLAN
22 * that VLAN requires. 22 * (in addition to the Ethernet header)
23 */ 23 */
24#define VLAN_ETH_ALEN 6 /* Octets in one ethernet addr */
25#define VLAN_ETH_HLEN 18 /* Total octets in header. */ 24#define VLAN_ETH_HLEN 18 /* Total octets in header. */
26#define VLAN_ETH_ZLEN 64 /* Min. octets in frame sans FCS */ 25#define VLAN_ETH_ZLEN 64 /* Min. octets in frame sans FCS */
27 26
@@ -177,7 +176,7 @@ static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci)
177 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); 176 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN);
178 177
179 /* Move the mac addresses to the beginning of the new header. */ 178 /* Move the mac addresses to the beginning of the new header. */
180 memmove(skb->data, skb->data + VLAN_HLEN, 2 * VLAN_ETH_ALEN); 179 memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN);
181 skb->mac_header -= VLAN_HLEN; 180 skb->mac_header -= VLAN_HLEN;
182 181
183 /* first, the ethernet type */ 182 /* first, the ethernet type */
diff --git a/include/linux/in.h b/include/linux/in.h
index 01129c0ea87c..e0337f11d92e 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -111,6 +111,7 @@ struct in_addr {
111#define MCAST_LEAVE_SOURCE_GROUP 47 111#define MCAST_LEAVE_SOURCE_GROUP 47
112#define MCAST_MSFILTER 48 112#define MCAST_MSFILTER 48
113#define IP_MULTICAST_ALL 49 113#define IP_MULTICAST_ALL 49
114#define IP_UNICAST_IF 50
114 115
115#define MCAST_EXCLUDE 0 116#define MCAST_EXCLUDE 0
116#define MCAST_INCLUDE 1 117#define MCAST_INCLUDE 1
diff --git a/include/linux/in6.h b/include/linux/in6.h
index 097a34b55560..5c83d9e3eb8f 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -271,6 +271,7 @@ struct in6_flowlabel_req {
271#define IPV6_ORIGDSTADDR 74 271#define IPV6_ORIGDSTADDR 74
272#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR 272#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
273#define IPV6_TRANSPARENT 75 273#define IPV6_TRANSPARENT 75
274#define IPV6_UNICAST_IF 76
274 275
275/* 276/*
276 * Multicast Routing: 277 * Multicast Routing:
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 5f8146695b7f..597f4a9f3240 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -139,6 +139,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
139 IN_DEV_ORCONF((in_dev), ACCEPT_REDIRECTS))) 139 IN_DEV_ORCONF((in_dev), ACCEPT_REDIRECTS)))
140 140
141#define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER) 141#define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER)
142#define IN_DEV_ARP_ACCEPT(in_dev) IN_DEV_ORCONF((in_dev), ARP_ACCEPT)
142#define IN_DEV_ARP_ANNOUNCE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_ANNOUNCE) 143#define IN_DEV_ARP_ANNOUNCE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_ANNOUNCE)
143#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE) 144#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE)
144#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY) 145#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY)
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 6318268dcaf5..8260ef779762 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -233,6 +233,11 @@ static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb)
233 return (struct ipv6hdr *)skb_transport_header(skb); 233 return (struct ipv6hdr *)skb_transport_header(skb);
234} 234}
235 235
236static inline __u8 ipv6_tclass(const struct ipv6hdr *iph)
237{
238 return (ntohl(*(__be32 *)iph) >> 20) & 0xff;
239}
240
236/* 241/*
237 This structure contains results of exthdrs parsing 242 This structure contains results of exthdrs parsing
238 as offsets from skb->nh. 243 as offsets from skb->nh.
@@ -324,6 +329,7 @@ struct ipv6_pinfo {
324 __unused_2:6; 329 __unused_2:6;
325 __s16 mcast_hops:9; 330 __s16 mcast_hops:9;
326#endif 331#endif
332 int ucast_oif;
327 int mcast_oif; 333 int mcast_oif;
328 334
329 /* pktoption flags */ 335 /* pktoption flags */
@@ -360,7 +366,7 @@ struct ipv6_pinfo {
360 dontfrag:1; 366 dontfrag:1;
361 __u8 min_hopcount; 367 __u8 min_hopcount;
362 __u8 tclass; 368 __u8 tclass;
363 __u8 padding; 369 __u8 rcv_tclass;
364 370
365 __u32 dst_cookie; 371 __u32 dst_cookie;
366 372
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 4ccf95d681b4..292f27a793d4 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -187,7 +187,7 @@ typedef struct {
187#endif 187#endif
188 188
189#include <linux/ppp_defs.h> 189#include <linux/ppp_defs.h>
190#include <linux/if_ppp.h> 190#include <linux/ppp-ioctl.h>
191 191
192#include <linux/isdn_ppp.h> 192#include <linux/isdn_ppp.h>
193#endif 193#endif
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index b1494aced217..dfb947959ec9 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -10,6 +10,7 @@
10#ifndef __LINUX_MDIO_H__ 10#ifndef __LINUX_MDIO_H__
11#define __LINUX_MDIO_H__ 11#define __LINUX_MDIO_H__
12 12
13#include <linux/types.h>
13#include <linux/mii.h> 14#include <linux/mii.h>
14 15
15/* MDIO Manageable Devices (MMDs). */ 16/* MDIO Manageable Devices (MMDs). */
@@ -273,6 +274,8 @@ static inline __u16 mdio_phy_id_c45(int prtad, int devad)
273 return MDIO_PHY_ID_C45 | (prtad << 5) | devad; 274 return MDIO_PHY_ID_C45 | (prtad << 5) | devad;
274} 275}
275 276
277#ifdef __KERNEL__
278
276static inline bool mdio_phy_id_is_c45(int phy_id) 279static inline bool mdio_phy_id_is_c45(int phy_id)
277{ 280{
278 return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK); 281 return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK);
@@ -288,11 +291,6 @@ static inline __u16 mdio_phy_id_devad(int phy_id)
288 return phy_id & MDIO_PHY_ID_DEVAD; 291 return phy_id & MDIO_PHY_ID_DEVAD;
289} 292}
290 293
291#define MDIO_SUPPORTS_C22 1
292#define MDIO_SUPPORTS_C45 2
293
294#ifdef __KERNEL__
295
296/** 294/**
297 * struct mdio_if_info - Ethernet controller MDIO interface 295 * struct mdio_if_info - Ethernet controller MDIO interface
298 * @prtad: PRTAD of the PHY (%MDIO_PRTAD_NONE if not present/unknown) 296 * @prtad: PRTAD of the PHY (%MDIO_PRTAD_NONE if not present/unknown)
@@ -321,6 +319,8 @@ struct mdio_if_info {
321 319
322#define MDIO_PRTAD_NONE (-1) 320#define MDIO_PRTAD_NONE (-1)
323#define MDIO_DEVAD_NONE (-1) 321#define MDIO_DEVAD_NONE (-1)
322#define MDIO_SUPPORTS_C22 1
323#define MDIO_SUPPORTS_C45 2
324#define MDIO_EMULATE_C22 4 324#define MDIO_EMULATE_C22 4
325 325
326struct ethtool_cmd; 326struct ethtool_cmd;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index aea61905499b..44d8144e9ae8 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -622,7 +622,10 @@ int mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac);
622int mlx4_get_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn); 622int mlx4_get_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn);
623void mlx4_put_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int qpn); 623void mlx4_put_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int qpn);
624void mlx4_set_stats_bitmap(struct mlx4_dev *dev, u64 *stats_bitmap); 624void mlx4_set_stats_bitmap(struct mlx4_dev *dev, u64 *stats_bitmap);
625 625int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
626 u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx);
627int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
628 u8 promisc);
626int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); 629int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
627int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 630int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
628void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index); 631void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index);
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index bee8fa231276..091f9e7dc8b9 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -212,7 +212,10 @@ struct mlx4_wqe_ctrl_seg {
212 * [1] SE (solicited event) 212 * [1] SE (solicited event)
213 * [0] FL (force loopback) 213 * [0] FL (force loopback)
214 */ 214 */
215 __be32 srcrb_flags; 215 union {
216 __be32 srcrb_flags;
217 __be16 srcrb_flags16[2];
218 };
216 /* 219 /*
217 * imm is immediate data for send/RDMA write w/ immediate; 220 * imm is immediate data for send/RDMA write w/ immediate;
218 * also invalidation key for send with invalidate; input 221 * also invalidation key for send with invalidate; input
diff --git a/include/linux/net.h b/include/linux/net.h
index b29923006b11..be60c7f5e145 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -206,6 +206,7 @@ struct proto_ops {
206 int offset, size_t size, int flags); 206 int offset, size_t size, int flags);
207 ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, 207 ssize_t (*splice_read)(struct socket *sock, loff_t *ppos,
208 struct pipe_inode_info *pipe, size_t len, unsigned int flags); 208 struct pipe_inode_info *pipe, size_t len, unsigned int flags);
209 void (*set_peek_off)(struct sock *sk, int val);
209}; 210};
210 211
211#define DECLARE_SOCKADDR(type, dst, src) \ 212#define DECLARE_SOCKADDR(type, dst, src) \
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 77f5202977ce..5ac32123035a 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -54,6 +54,8 @@ enum {
54 NETIF_F_RXCSUM_BIT, /* Receive checksumming offload */ 54 NETIF_F_RXCSUM_BIT, /* Receive checksumming offload */
55 NETIF_F_NOCACHE_COPY_BIT, /* Use no-cache copyfromuser */ 55 NETIF_F_NOCACHE_COPY_BIT, /* Use no-cache copyfromuser */
56 NETIF_F_LOOPBACK_BIT, /* Enable loopback */ 56 NETIF_F_LOOPBACK_BIT, /* Enable loopback */
57 NETIF_F_RXFCS_BIT, /* Append FCS to skb pkt data */
58 NETIF_F_RXALL_BIT, /* Receive errored frames too */
57 59
58 /* 60 /*
59 * Add your fresh new feature above and remember to update 61 * Add your fresh new feature above and remember to update
@@ -98,6 +100,8 @@ enum {
98#define NETIF_F_TSO __NETIF_F(TSO) 100#define NETIF_F_TSO __NETIF_F(TSO)
99#define NETIF_F_UFO __NETIF_F(UFO) 101#define NETIF_F_UFO __NETIF_F(UFO)
100#define NETIF_F_VLAN_CHALLENGED __NETIF_F(VLAN_CHALLENGED) 102#define NETIF_F_VLAN_CHALLENGED __NETIF_F(VLAN_CHALLENGED)
103#define NETIF_F_RXFCS __NETIF_F(RXFCS)
104#define NETIF_F_RXALL __NETIF_F(RXALL)
101 105
102/* Features valid for ethtool to change */ 106/* Features valid for ethtool to change */
103/* = all defined minus driver/device-class-related */ 107/* = all defined minus driver/device-class-related */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3e5cb2546e4f..8debe299676d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -417,7 +417,7 @@ typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb);
417 417
418extern void __napi_schedule(struct napi_struct *n); 418extern void __napi_schedule(struct napi_struct *n);
419 419
420static inline int napi_disable_pending(struct napi_struct *n) 420static inline bool napi_disable_pending(struct napi_struct *n)
421{ 421{
422 return test_bit(NAPI_STATE_DISABLE, &n->state); 422 return test_bit(NAPI_STATE_DISABLE, &n->state);
423} 423}
@@ -431,7 +431,7 @@ static inline int napi_disable_pending(struct napi_struct *n)
431 * insure only one NAPI poll instance runs. We also make 431 * insure only one NAPI poll instance runs. We also make
432 * sure there is no pending NAPI disable. 432 * sure there is no pending NAPI disable.
433 */ 433 */
434static inline int napi_schedule_prep(struct napi_struct *n) 434static inline bool napi_schedule_prep(struct napi_struct *n)
435{ 435{
436 return !napi_disable_pending(n) && 436 return !napi_disable_pending(n) &&
437 !test_and_set_bit(NAPI_STATE_SCHED, &n->state); 437 !test_and_set_bit(NAPI_STATE_SCHED, &n->state);
@@ -451,13 +451,13 @@ static inline void napi_schedule(struct napi_struct *n)
451} 451}
452 452
453/* Try to reschedule poll. Called by dev->poll() after napi_complete(). */ 453/* Try to reschedule poll. Called by dev->poll() after napi_complete(). */
454static inline int napi_reschedule(struct napi_struct *napi) 454static inline bool napi_reschedule(struct napi_struct *napi)
455{ 455{
456 if (napi_schedule_prep(napi)) { 456 if (napi_schedule_prep(napi)) {
457 __napi_schedule(napi); 457 __napi_schedule(napi);
458 return 1; 458 return true;
459 } 459 }
460 return 0; 460 return false;
461} 461}
462 462
463/** 463/**
@@ -1082,7 +1082,8 @@ struct net_device {
1082 const struct header_ops *header_ops; 1082 const struct header_ops *header_ops;
1083 1083
1084 unsigned int flags; /* interface flags (a la BSD) */ 1084 unsigned int flags; /* interface flags (a la BSD) */
1085 unsigned int priv_flags; /* Like 'flags' but invisible to userspace. */ 1085 unsigned int priv_flags; /* Like 'flags' but invisible to userspace.
1086 * See if.h for definitions. */
1086 unsigned short gflags; 1087 unsigned short gflags;
1087 unsigned short padded; /* How much padding added by alloc_netdev() */ 1088 unsigned short padded; /* How much padding added by alloc_netdev() */
1088 1089
@@ -1867,7 +1868,7 @@ static inline void netif_tx_stop_all_queues(struct net_device *dev)
1867 } 1868 }
1868} 1869}
1869 1870
1870static inline int netif_tx_queue_stopped(const struct netdev_queue *dev_queue) 1871static inline bool netif_tx_queue_stopped(const struct netdev_queue *dev_queue)
1871{ 1872{
1872 return test_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state); 1873 return test_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state);
1873} 1874}
@@ -1878,17 +1879,17 @@ static inline int netif_tx_queue_stopped(const struct netdev_queue *dev_queue)
1878 * 1879 *
1879 * Test if transmit queue on device is currently unable to send. 1880 * Test if transmit queue on device is currently unable to send.
1880 */ 1881 */
1881static inline int netif_queue_stopped(const struct net_device *dev) 1882static inline bool netif_queue_stopped(const struct net_device *dev)
1882{ 1883{
1883 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); 1884 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0));
1884} 1885}
1885 1886
1886static inline int netif_xmit_stopped(const struct netdev_queue *dev_queue) 1887static inline bool netif_xmit_stopped(const struct netdev_queue *dev_queue)
1887{ 1888{
1888 return dev_queue->state & QUEUE_STATE_ANY_XOFF; 1889 return dev_queue->state & QUEUE_STATE_ANY_XOFF;
1889} 1890}
1890 1891
1891static inline int netif_xmit_frozen_or_stopped(const struct netdev_queue *dev_queue) 1892static inline bool netif_xmit_frozen_or_stopped(const struct netdev_queue *dev_queue)
1892{ 1893{
1893 return dev_queue->state & QUEUE_STATE_ANY_XOFF_OR_FROZEN; 1894 return dev_queue->state & QUEUE_STATE_ANY_XOFF_OR_FROZEN;
1894} 1895}
@@ -1898,12 +1899,22 @@ static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue,
1898{ 1899{
1899#ifdef CONFIG_BQL 1900#ifdef CONFIG_BQL
1900 dql_queued(&dev_queue->dql, bytes); 1901 dql_queued(&dev_queue->dql, bytes);
1901 if (unlikely(dql_avail(&dev_queue->dql) < 0)) { 1902
1902 set_bit(__QUEUE_STATE_STACK_XOFF, &dev_queue->state); 1903 if (likely(dql_avail(&dev_queue->dql) >= 0))
1903 if (unlikely(dql_avail(&dev_queue->dql) >= 0)) 1904 return;
1904 clear_bit(__QUEUE_STATE_STACK_XOFF, 1905
1905 &dev_queue->state); 1906 set_bit(__QUEUE_STATE_STACK_XOFF, &dev_queue->state);
1906 } 1907
1908 /*
1909 * The XOFF flag must be set before checking the dql_avail below,
1910 * because in netdev_tx_completed_queue we update the dql_completed
1911 * before checking the XOFF flag.
1912 */
1913 smp_mb();
1914
1915 /* check again in case another CPU has just made room avail */
1916 if (unlikely(dql_avail(&dev_queue->dql) >= 0))
1917 clear_bit(__QUEUE_STATE_STACK_XOFF, &dev_queue->state);
1907#endif 1918#endif
1908} 1919}
1909 1920
@@ -1916,16 +1927,23 @@ static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue,
1916 unsigned pkts, unsigned bytes) 1927 unsigned pkts, unsigned bytes)
1917{ 1928{
1918#ifdef CONFIG_BQL 1929#ifdef CONFIG_BQL
1919 if (likely(bytes)) { 1930 if (unlikely(!bytes))
1920 dql_completed(&dev_queue->dql, bytes); 1931 return;
1921 if (unlikely(test_bit(__QUEUE_STATE_STACK_XOFF, 1932
1922 &dev_queue->state) && 1933 dql_completed(&dev_queue->dql, bytes);
1923 dql_avail(&dev_queue->dql) >= 0)) { 1934
1924 if (test_and_clear_bit(__QUEUE_STATE_STACK_XOFF, 1935 /*
1925 &dev_queue->state)) 1936 * Without the memory barrier there is a small possiblity that
1926 netif_schedule_queue(dev_queue); 1937 * netdev_tx_sent_queue will miss the update and cause the queue to
1927 } 1938 * be stopped forever
1928 } 1939 */
1940 smp_mb();
1941
1942 if (dql_avail(&dev_queue->dql) < 0)
1943 return;
1944
1945 if (test_and_clear_bit(__QUEUE_STATE_STACK_XOFF, &dev_queue->state))
1946 netif_schedule_queue(dev_queue);
1929#endif 1947#endif
1930} 1948}
1931 1949
@@ -1938,6 +1956,7 @@ static inline void netdev_completed_queue(struct net_device *dev,
1938static inline void netdev_tx_reset_queue(struct netdev_queue *q) 1956static inline void netdev_tx_reset_queue(struct netdev_queue *q)
1939{ 1957{
1940#ifdef CONFIG_BQL 1958#ifdef CONFIG_BQL
1959 clear_bit(__QUEUE_STATE_STACK_XOFF, &q->state);
1941 dql_reset(&q->dql); 1960 dql_reset(&q->dql);
1942#endif 1961#endif
1943} 1962}
@@ -1953,7 +1972,7 @@ static inline void netdev_reset_queue(struct net_device *dev_queue)
1953 * 1972 *
1954 * Test if the device has been brought up. 1973 * Test if the device has been brought up.
1955 */ 1974 */
1956static inline int netif_running(const struct net_device *dev) 1975static inline bool netif_running(const struct net_device *dev)
1957{ 1976{
1958 return test_bit(__LINK_STATE_START, &dev->state); 1977 return test_bit(__LINK_STATE_START, &dev->state);
1959} 1978}
@@ -2003,16 +2022,16 @@ static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
2003 * 2022 *
2004 * Check individual transmit queue of a device with multiple transmit queues. 2023 * Check individual transmit queue of a device with multiple transmit queues.
2005 */ 2024 */
2006static inline int __netif_subqueue_stopped(const struct net_device *dev, 2025static inline bool __netif_subqueue_stopped(const struct net_device *dev,
2007 u16 queue_index) 2026 u16 queue_index)
2008{ 2027{
2009 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); 2028 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
2010 2029
2011 return netif_tx_queue_stopped(txq); 2030 return netif_tx_queue_stopped(txq);
2012} 2031}
2013 2032
2014static inline int netif_subqueue_stopped(const struct net_device *dev, 2033static inline bool netif_subqueue_stopped(const struct net_device *dev,
2015 struct sk_buff *skb) 2034 struct sk_buff *skb)
2016{ 2035{
2017 return __netif_subqueue_stopped(dev, skb_get_queue_mapping(skb)); 2036 return __netif_subqueue_stopped(dev, skb_get_queue_mapping(skb));
2018} 2037}
@@ -2051,7 +2070,7 @@ static inline u16 skb_tx_hash(const struct net_device *dev,
2051 * 2070 *
2052 * Check if device has multiple transmit queues 2071 * Check if device has multiple transmit queues
2053 */ 2072 */
2054static inline int netif_is_multiqueue(const struct net_device *dev) 2073static inline bool netif_is_multiqueue(const struct net_device *dev)
2055{ 2074{
2056 return dev->num_tx_queues > 1; 2075 return dev->num_tx_queues > 1;
2057} 2076}
@@ -2121,7 +2140,7 @@ extern int netdev_rx_handler_register(struct net_device *dev,
2121 void *rx_handler_data); 2140 void *rx_handler_data);
2122extern void netdev_rx_handler_unregister(struct net_device *dev); 2141extern void netdev_rx_handler_unregister(struct net_device *dev);
2123 2142
2124extern int dev_valid_name(const char *name); 2143extern bool dev_valid_name(const char *name);
2125extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); 2144extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
2126extern int dev_ethtool(struct net *net, struct ifreq *); 2145extern int dev_ethtool(struct net *net, struct ifreq *);
2127extern unsigned dev_get_flags(const struct net_device *); 2146extern unsigned dev_get_flags(const struct net_device *);
@@ -2187,7 +2206,7 @@ extern void linkwatch_forget_dev(struct net_device *dev);
2187 * 2206 *
2188 * Check if carrier is present on device 2207 * Check if carrier is present on device
2189 */ 2208 */
2190static inline int netif_carrier_ok(const struct net_device *dev) 2209static inline bool netif_carrier_ok(const struct net_device *dev)
2191{ 2210{
2192 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state); 2211 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state);
2193} 2212}
@@ -2239,7 +2258,7 @@ static inline void netif_dormant_off(struct net_device *dev)
2239 * 2258 *
2240 * Check if carrier is present on device 2259 * Check if carrier is present on device
2241 */ 2260 */
2242static inline int netif_dormant(const struct net_device *dev) 2261static inline bool netif_dormant(const struct net_device *dev)
2243{ 2262{
2244 return test_bit(__LINK_STATE_DORMANT, &dev->state); 2263 return test_bit(__LINK_STATE_DORMANT, &dev->state);
2245} 2264}
@@ -2251,7 +2270,7 @@ static inline int netif_dormant(const struct net_device *dev)
2251 * 2270 *
2252 * Check if carrier is operational 2271 * Check if carrier is operational
2253 */ 2272 */
2254static inline int netif_oper_up(const struct net_device *dev) 2273static inline bool netif_oper_up(const struct net_device *dev)
2255{ 2274{
2256 return (dev->operstate == IF_OPER_UP || 2275 return (dev->operstate == IF_OPER_UP ||
2257 dev->operstate == IF_OPER_UNKNOWN /* backward compat */); 2276 dev->operstate == IF_OPER_UNKNOWN /* backward compat */);
@@ -2263,7 +2282,7 @@ static inline int netif_oper_up(const struct net_device *dev)
2263 * 2282 *
2264 * Check if device has not been removed from system. 2283 * Check if device has not been removed from system.
2265 */ 2284 */
2266static inline int netif_device_present(struct net_device *dev) 2285static inline bool netif_device_present(struct net_device *dev)
2267{ 2286{
2268 return test_bit(__LINK_STATE_PRESENT, &dev->state); 2287 return test_bit(__LINK_STATE_PRESENT, &dev->state);
2269} 2288}
@@ -2333,9 +2352,9 @@ static inline void __netif_tx_lock_bh(struct netdev_queue *txq)
2333 txq->xmit_lock_owner = smp_processor_id(); 2352 txq->xmit_lock_owner = smp_processor_id();
2334} 2353}
2335 2354
2336static inline int __netif_tx_trylock(struct netdev_queue *txq) 2355static inline bool __netif_tx_trylock(struct netdev_queue *txq)
2337{ 2356{
2338 int ok = spin_trylock(&txq->_xmit_lock); 2357 bool ok = spin_trylock(&txq->_xmit_lock);
2339 if (likely(ok)) 2358 if (likely(ok))
2340 txq->xmit_lock_owner = smp_processor_id(); 2359 txq->xmit_lock_owner = smp_processor_id();
2341 return ok; 2360 return ok;
@@ -2556,6 +2575,8 @@ extern void dev_load(struct net *net, const char *name);
2556extern void dev_mcast_init(void); 2575extern void dev_mcast_init(void);
2557extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, 2576extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
2558 struct rtnl_link_stats64 *storage); 2577 struct rtnl_link_stats64 *storage);
2578extern void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
2579 const struct net_device_stats *netdev_stats);
2559 2580
2560extern int netdev_max_backlog; 2581extern int netdev_max_backlog;
2561extern int netdev_tstamp_prequeue; 2582extern int netdev_tstamp_prequeue;
@@ -2611,7 +2632,7 @@ void netif_stacked_transfer_operstate(const struct net_device *rootdev,
2611 2632
2612netdev_features_t netif_skb_features(struct sk_buff *skb); 2633netdev_features_t netif_skb_features(struct sk_buff *skb);
2613 2634
2614static inline int net_gso_ok(netdev_features_t features, int gso_type) 2635static inline bool net_gso_ok(netdev_features_t features, int gso_type)
2615{ 2636{
2616 netdev_features_t feature = gso_type << NETIF_F_GSO_SHIFT; 2637 netdev_features_t feature = gso_type << NETIF_F_GSO_SHIFT;
2617 2638
@@ -2626,17 +2647,18 @@ static inline int net_gso_ok(netdev_features_t features, int gso_type)
2626 return (features & feature) == feature; 2647 return (features & feature) == feature;
2627} 2648}
2628 2649
2629static inline int skb_gso_ok(struct sk_buff *skb, netdev_features_t features) 2650static inline bool skb_gso_ok(struct sk_buff *skb, netdev_features_t features)
2630{ 2651{
2631 return net_gso_ok(features, skb_shinfo(skb)->gso_type) && 2652 return net_gso_ok(features, skb_shinfo(skb)->gso_type) &&
2632 (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST)); 2653 (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST));
2633} 2654}
2634 2655
2635static inline int netif_needs_gso(struct sk_buff *skb, 2656static inline bool netif_needs_gso(struct sk_buff *skb,
2636 netdev_features_t features) 2657 netdev_features_t features)
2637{ 2658{
2638 return skb_is_gso(skb) && (!skb_gso_ok(skb, features) || 2659 return skb_is_gso(skb) && (!skb_gso_ok(skb, features) ||
2639 unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); 2660 unlikely((skb->ip_summed != CHECKSUM_PARTIAL) &&
2661 (skb->ip_summed != CHECKSUM_UNNECESSARY)));
2640} 2662}
2641 2663
2642static inline void netif_set_gso_max_size(struct net_device *dev, 2664static inline void netif_set_gso_max_size(struct net_device *dev,
@@ -2645,11 +2667,16 @@ static inline void netif_set_gso_max_size(struct net_device *dev,
2645 dev->gso_max_size = size; 2667 dev->gso_max_size = size;
2646} 2668}
2647 2669
2648static inline int netif_is_bond_slave(struct net_device *dev) 2670static inline bool netif_is_bond_slave(struct net_device *dev)
2649{ 2671{
2650 return dev->flags & IFF_SLAVE && dev->priv_flags & IFF_BONDING; 2672 return dev->flags & IFF_SLAVE && dev->priv_flags & IFF_BONDING;
2651} 2673}
2652 2674
2675static inline bool netif_supports_nofcs(struct net_device *dev)
2676{
2677 return dev->priv_flags & IFF_SUPP_NOFCS;
2678}
2679
2653extern struct pernet_operations __net_initdata loopback_net_ops; 2680extern struct pernet_operations __net_initdata loopback_net_ops;
2654 2681
2655/* Logging, debugging and troubleshooting/diagnostic helpers. */ 2682/* Logging, debugging and troubleshooting/diagnostic helpers. */
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index e144f54185c0..1697036336b6 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -10,6 +10,7 @@ header-y += nfnetlink.h
10header-y += nfnetlink_acct.h 10header-y += nfnetlink_acct.h
11header-y += nfnetlink_compat.h 11header-y += nfnetlink_compat.h
12header-y += nfnetlink_conntrack.h 12header-y += nfnetlink_conntrack.h
13header-y += nfnetlink_cttimeout.h
13header-y += nfnetlink_log.h 14header-y += nfnetlink_log.h
14header-y += nfnetlink_queue.h 15header-y += nfnetlink_queue.h
15header-y += x_tables.h 16header-y += x_tables.h
@@ -22,6 +23,7 @@ header-y += xt_CT.h
22header-y += xt_DSCP.h 23header-y += xt_DSCP.h
23header-y += xt_IDLETIMER.h 24header-y += xt_IDLETIMER.h
24header-y += xt_LED.h 25header-y += xt_LED.h
26header-y += xt_LOG.h
25header-y += xt_MARK.h 27header-y += xt_MARK.h
26header-y += xt_nfacct.h 28header-y += xt_nfacct.h
27header-y += xt_NFLOG.h 29header-y += xt_NFLOG.h
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index 3540c6e262f7..2f8e18a23227 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -11,6 +11,8 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13 13
14#include <linux/types.h>
15
14/* The protocol version */ 16/* The protocol version */
15#define IPSET_PROTOCOL 6 17#define IPSET_PROTOCOL 6
16 18
@@ -148,6 +150,7 @@ enum ipset_cmd_flags {
148 IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME), 150 IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
149 IPSET_FLAG_BIT_LIST_HEADER = 2, 151 IPSET_FLAG_BIT_LIST_HEADER = 2,
150 IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER), 152 IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
153 IPSET_FLAG_CMD_MAX = 15, /* Lower half */
151}; 154};
152 155
153/* Flags at CADT attribute level */ 156/* Flags at CADT attribute level */
@@ -156,6 +159,9 @@ enum ipset_cadt_flags {
156 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE), 159 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
157 IPSET_FLAG_BIT_PHYSDEV = 1, 160 IPSET_FLAG_BIT_PHYSDEV = 1,
158 IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV), 161 IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
162 IPSET_FLAG_BIT_NOMATCH = 2,
163 IPSET_FLAG_NOMATCH = (1 << IPSET_FLAG_BIT_NOMATCH),
164 IPSET_FLAG_CADT_MAX = 15, /* Upper half */
159}; 165};
160 166
161/* Commands with settype-specific attributes */ 167/* Commands with settype-specific attributes */
@@ -168,19 +174,10 @@ enum ipset_adt {
168 IPSET_CADT_MAX, 174 IPSET_CADT_MAX,
169}; 175};
170 176
171#ifdef __KERNEL__
172#include <linux/ip.h>
173#include <linux/ipv6.h>
174#include <linux/netlink.h>
175#include <linux/netfilter.h>
176#include <linux/netfilter/x_tables.h>
177#include <linux/vmalloc.h>
178#include <net/netlink.h>
179
180/* Sets are identified by an index in kernel space. Tweak with ip_set_id_t 177/* Sets are identified by an index in kernel space. Tweak with ip_set_id_t
181 * and IPSET_INVALID_ID if you want to increase the max number of sets. 178 * and IPSET_INVALID_ID if you want to increase the max number of sets.
182 */ 179 */
183typedef u16 ip_set_id_t; 180typedef __u16 ip_set_id_t;
184 181
185#define IPSET_INVALID_ID 65535 182#define IPSET_INVALID_ID 65535
186 183
@@ -203,6 +200,15 @@ enum ip_set_kopt {
203 IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE), 200 IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE),
204}; 201};
205 202
203#ifdef __KERNEL__
204#include <linux/ip.h>
205#include <linux/ipv6.h>
206#include <linux/netlink.h>
207#include <linux/netfilter.h>
208#include <linux/netfilter/x_tables.h>
209#include <linux/vmalloc.h>
210#include <net/netlink.h>
211
206/* Set features */ 212/* Set features */
207enum ip_set_feature { 213enum ip_set_feature {
208 IPSET_TYPE_IP_FLAG = 0, 214 IPSET_TYPE_IP_FLAG = 0,
@@ -288,7 +294,10 @@ struct ip_set_type {
288 u8 features; 294 u8 features;
289 /* Set type dimension */ 295 /* Set type dimension */
290 u8 dimension; 296 u8 dimension;
291 /* Supported family: may be AF_UNSPEC for both AF_INET/AF_INET6 */ 297 /*
298 * Supported family: may be NFPROTO_UNSPEC for both
299 * NFPROTO_IPV4/NFPROTO_IPV6.
300 */
292 u8 family; 301 u8 family;
293 /* Type revisions */ 302 /* Type revisions */
294 u8 revision_min, revision_max; 303 u8 revision_min, revision_max;
@@ -450,6 +459,8 @@ bitmap_bytes(u32 a, u32 b)
450 return 4 * ((((b - a + 8) / 8) + 3) / 4); 459 return 4 * ((((b - a + 8) / 8) + 3) / 4);
451} 460}
452 461
462#endif /* __KERNEL__ */
463
453/* Interface to iptables/ip6tables */ 464/* Interface to iptables/ip6tables */
454 465
455#define SO_IP_SET 83 466#define SO_IP_SET 83
@@ -475,6 +486,4 @@ struct ip_set_req_version {
475 unsigned version; 486 unsigned version;
476}; 487};
477 488
478#endif /* __KERNEL__ */
479
480#endif /*_IP_SET_H */ 489#endif /*_IP_SET_H */
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h
index b89fb79cb44f..05a5d72680be 100644
--- a/include/linux/netfilter/ipset/ip_set_ahash.h
+++ b/include/linux/netfilter/ipset/ip_set_ahash.h
@@ -113,6 +113,12 @@ htable_bits(u32 hashsize)
113} 113}
114 114
115#ifdef IP_SET_HASH_WITH_NETS 115#ifdef IP_SET_HASH_WITH_NETS
116#ifdef IP_SET_HASH_WITH_NETS_PACKED
117/* When cidr is packed with nomatch, cidr - 1 is stored in the entry */
118#define CIDR(cidr) (cidr + 1)
119#else
120#define CIDR(cidr) (cidr)
121#endif
116 122
117#define SET_HOST_MASK(family) (family == AF_INET ? 32 : 128) 123#define SET_HOST_MASK(family) (family == AF_INET ? 32 : 128)
118 124
@@ -262,6 +268,12 @@ ip_set_hash_destroy(struct ip_set *set)
262#define type_pf_data_list TOKEN(TYPE, PF, _data_list) 268#define type_pf_data_list TOKEN(TYPE, PF, _data_list)
263#define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist) 269#define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist)
264#define type_pf_data_next TOKEN(TYPE, PF, _data_next) 270#define type_pf_data_next TOKEN(TYPE, PF, _data_next)
271#define type_pf_data_flags TOKEN(TYPE, PF, _data_flags)
272#ifdef IP_SET_HASH_WITH_NETS
273#define type_pf_data_match TOKEN(TYPE, PF, _data_match)
274#else
275#define type_pf_data_match(d) 1
276#endif
265 277
266#define type_pf_elem TOKEN(TYPE, PF, _elem) 278#define type_pf_elem TOKEN(TYPE, PF, _elem)
267#define type_pf_telem TOKEN(TYPE, PF, _telem) 279#define type_pf_telem TOKEN(TYPE, PF, _telem)
@@ -308,8 +320,10 @@ ip_set_hash_destroy(struct ip_set *set)
308 * we spare the maintenance of the internal counters. */ 320 * we spare the maintenance of the internal counters. */
309static int 321static int
310type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value, 322type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value,
311 u8 ahash_max) 323 u8 ahash_max, u32 cadt_flags)
312{ 324{
325 struct type_pf_elem *data;
326
313 if (n->pos >= n->size) { 327 if (n->pos >= n->size) {
314 void *tmp; 328 void *tmp;
315 329
@@ -330,7 +344,13 @@ type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value,
330 n->value = tmp; 344 n->value = tmp;
331 n->size += AHASH_INIT_SIZE; 345 n->size += AHASH_INIT_SIZE;
332 } 346 }
333 type_pf_data_copy(ahash_data(n, n->pos++), value); 347 data = ahash_data(n, n->pos++);
348 type_pf_data_copy(data, value);
349#ifdef IP_SET_HASH_WITH_NETS
350 /* Resizing won't overwrite stored flags */
351 if (cadt_flags)
352 type_pf_data_flags(data, cadt_flags);
353#endif
334 return 0; 354 return 0;
335} 355}
336 356
@@ -353,9 +373,12 @@ retry:
353 htable_bits++; 373 htable_bits++;
354 pr_debug("attempt to resize set %s from %u to %u, t %p\n", 374 pr_debug("attempt to resize set %s from %u to %u, t %p\n",
355 set->name, orig->htable_bits, htable_bits, orig); 375 set->name, orig->htable_bits, htable_bits, orig);
356 if (!htable_bits) 376 if (!htable_bits) {
357 /* In case we have plenty of memory :-) */ 377 /* In case we have plenty of memory :-) */
378 pr_warning("Cannot increase the hashsize of set %s further\n",
379 set->name);
358 return -IPSET_ERR_HASH_FULL; 380 return -IPSET_ERR_HASH_FULL;
381 }
359 t = ip_set_alloc(sizeof(*t) 382 t = ip_set_alloc(sizeof(*t)
360 + jhash_size(htable_bits) * sizeof(struct hbucket)); 383 + jhash_size(htable_bits) * sizeof(struct hbucket));
361 if (!t) 384 if (!t)
@@ -368,7 +391,7 @@ retry:
368 for (j = 0; j < n->pos; j++) { 391 for (j = 0; j < n->pos; j++) {
369 data = ahash_data(n, j); 392 data = ahash_data(n, j);
370 m = hbucket(t, HKEY(data, h->initval, htable_bits)); 393 m = hbucket(t, HKEY(data, h->initval, htable_bits));
371 ret = type_pf_elem_add(m, data, AHASH_MAX(h)); 394 ret = type_pf_elem_add(m, data, AHASH_MAX(h), 0);
372 if (ret < 0) { 395 if (ret < 0) {
373 read_unlock_bh(&set->lock); 396 read_unlock_bh(&set->lock);
374 ahash_destroy(t); 397 ahash_destroy(t);
@@ -406,9 +429,14 @@ type_pf_add(struct ip_set *set, void *value, u32 timeout, u32 flags)
406 struct hbucket *n; 429 struct hbucket *n;
407 int i, ret = 0; 430 int i, ret = 0;
408 u32 key, multi = 0; 431 u32 key, multi = 0;
432 u32 cadt_flags = flags >> 16;
409 433
410 if (h->elements >= h->maxelem) 434 if (h->elements >= h->maxelem) {
435 if (net_ratelimit())
436 pr_warning("Set %s is full, maxelem %u reached\n",
437 set->name, h->maxelem);
411 return -IPSET_ERR_HASH_FULL; 438 return -IPSET_ERR_HASH_FULL;
439 }
412 440
413 rcu_read_lock_bh(); 441 rcu_read_lock_bh();
414 t = rcu_dereference_bh(h->table); 442 t = rcu_dereference_bh(h->table);
@@ -416,11 +444,17 @@ type_pf_add(struct ip_set *set, void *value, u32 timeout, u32 flags)
416 n = hbucket(t, key); 444 n = hbucket(t, key);
417 for (i = 0; i < n->pos; i++) 445 for (i = 0; i < n->pos; i++)
418 if (type_pf_data_equal(ahash_data(n, i), d, &multi)) { 446 if (type_pf_data_equal(ahash_data(n, i), d, &multi)) {
447#ifdef IP_SET_HASH_WITH_NETS
448 if (flags & IPSET_FLAG_EXIST)
449 /* Support overwriting just the flags */
450 type_pf_data_flags(ahash_data(n, i),
451 cadt_flags);
452#endif
419 ret = -IPSET_ERR_EXIST; 453 ret = -IPSET_ERR_EXIST;
420 goto out; 454 goto out;
421 } 455 }
422 TUNE_AHASH_MAX(h, multi); 456 TUNE_AHASH_MAX(h, multi);
423 ret = type_pf_elem_add(n, value, AHASH_MAX(h)); 457 ret = type_pf_elem_add(n, value, AHASH_MAX(h), cadt_flags);
424 if (ret != 0) { 458 if (ret != 0) {
425 if (ret == -EAGAIN) 459 if (ret == -EAGAIN)
426 type_pf_data_next(h, d); 460 type_pf_data_next(h, d);
@@ -428,7 +462,7 @@ type_pf_add(struct ip_set *set, void *value, u32 timeout, u32 flags)
428 } 462 }
429 463
430#ifdef IP_SET_HASH_WITH_NETS 464#ifdef IP_SET_HASH_WITH_NETS
431 add_cidr(h, d->cidr, HOST_MASK); 465 add_cidr(h, CIDR(d->cidr), HOST_MASK);
432#endif 466#endif
433 h->elements++; 467 h->elements++;
434out: 468out:
@@ -463,7 +497,7 @@ type_pf_del(struct ip_set *set, void *value, u32 timeout, u32 flags)
463 n->pos--; 497 n->pos--;
464 h->elements--; 498 h->elements--;
465#ifdef IP_SET_HASH_WITH_NETS 499#ifdef IP_SET_HASH_WITH_NETS
466 del_cidr(h, d->cidr, HOST_MASK); 500 del_cidr(h, CIDR(d->cidr), HOST_MASK);
467#endif 501#endif
468 if (n->pos + AHASH_INIT_SIZE < n->size) { 502 if (n->pos + AHASH_INIT_SIZE < n->size) {
469 void *tmp = kzalloc((n->size - AHASH_INIT_SIZE) 503 void *tmp = kzalloc((n->size - AHASH_INIT_SIZE)
@@ -506,7 +540,7 @@ type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
506 for (i = 0; i < n->pos; i++) { 540 for (i = 0; i < n->pos; i++) {
507 data = ahash_data(n, i); 541 data = ahash_data(n, i);
508 if (type_pf_data_equal(data, d, &multi)) 542 if (type_pf_data_equal(data, d, &multi))
509 return 1; 543 return type_pf_data_match(data);
510 } 544 }
511 } 545 }
512 return 0; 546 return 0;
@@ -528,7 +562,7 @@ type_pf_test(struct ip_set *set, void *value, u32 timeout, u32 flags)
528#ifdef IP_SET_HASH_WITH_NETS 562#ifdef IP_SET_HASH_WITH_NETS
529 /* If we test an IP address and not a network address, 563 /* If we test an IP address and not a network address,
530 * try all possible network sizes */ 564 * try all possible network sizes */
531 if (d->cidr == SET_HOST_MASK(set->family)) 565 if (CIDR(d->cidr) == SET_HOST_MASK(set->family))
532 return type_pf_test_cidrs(set, d, timeout); 566 return type_pf_test_cidrs(set, d, timeout);
533#endif 567#endif
534 568
@@ -537,7 +571,7 @@ type_pf_test(struct ip_set *set, void *value, u32 timeout, u32 flags)
537 for (i = 0; i < n->pos; i++) { 571 for (i = 0; i < n->pos; i++) {
538 data = ahash_data(n, i); 572 data = ahash_data(n, i);
539 if (type_pf_data_equal(data, d, &multi)) 573 if (type_pf_data_equal(data, d, &multi))
540 return 1; 574 return type_pf_data_match(data);
541 } 575 }
542 return 0; 576 return 0;
543} 577}
@@ -693,7 +727,7 @@ type_pf_data_timeout_set(struct type_pf_elem *data, u32 timeout)
693 727
694static int 728static int
695type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value, 729type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value,
696 u8 ahash_max, u32 timeout) 730 u8 ahash_max, u32 cadt_flags, u32 timeout)
697{ 731{
698 struct type_pf_elem *data; 732 struct type_pf_elem *data;
699 733
@@ -720,6 +754,11 @@ type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value,
720 data = ahash_tdata(n, n->pos++); 754 data = ahash_tdata(n, n->pos++);
721 type_pf_data_copy(data, value); 755 type_pf_data_copy(data, value);
722 type_pf_data_timeout_set(data, timeout); 756 type_pf_data_timeout_set(data, timeout);
757#ifdef IP_SET_HASH_WITH_NETS
758 /* Resizing won't overwrite stored flags */
759 if (cadt_flags)
760 type_pf_data_flags(data, cadt_flags);
761#endif
723 return 0; 762 return 0;
724} 763}
725 764
@@ -740,7 +779,7 @@ type_pf_expire(struct ip_set_hash *h)
740 if (type_pf_data_expired(data)) { 779 if (type_pf_data_expired(data)) {
741 pr_debug("expired %u/%u\n", i, j); 780 pr_debug("expired %u/%u\n", i, j);
742#ifdef IP_SET_HASH_WITH_NETS 781#ifdef IP_SET_HASH_WITH_NETS
743 del_cidr(h, data->cidr, HOST_MASK); 782 del_cidr(h, CIDR(data->cidr), HOST_MASK);
744#endif 783#endif
745 if (j != n->pos - 1) 784 if (j != n->pos - 1)
746 /* Not last one */ 785 /* Not last one */
@@ -790,9 +829,12 @@ type_pf_tresize(struct ip_set *set, bool retried)
790retry: 829retry:
791 ret = 0; 830 ret = 0;
792 htable_bits++; 831 htable_bits++;
793 if (!htable_bits) 832 if (!htable_bits) {
794 /* In case we have plenty of memory :-) */ 833 /* In case we have plenty of memory :-) */
834 pr_warning("Cannot increase the hashsize of set %s further\n",
835 set->name);
795 return -IPSET_ERR_HASH_FULL; 836 return -IPSET_ERR_HASH_FULL;
837 }
796 t = ip_set_alloc(sizeof(*t) 838 t = ip_set_alloc(sizeof(*t)
797 + jhash_size(htable_bits) * sizeof(struct hbucket)); 839 + jhash_size(htable_bits) * sizeof(struct hbucket));
798 if (!t) 840 if (!t)
@@ -805,7 +847,7 @@ retry:
805 for (j = 0; j < n->pos; j++) { 847 for (j = 0; j < n->pos; j++) {
806 data = ahash_tdata(n, j); 848 data = ahash_tdata(n, j);
807 m = hbucket(t, HKEY(data, h->initval, htable_bits)); 849 m = hbucket(t, HKEY(data, h->initval, htable_bits));
808 ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), 850 ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), 0,
809 type_pf_data_timeout(data)); 851 type_pf_data_timeout(data));
810 if (ret < 0) { 852 if (ret < 0) {
811 read_unlock_bh(&set->lock); 853 read_unlock_bh(&set->lock);
@@ -839,12 +881,17 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
839 int ret = 0, i, j = AHASH_MAX(h) + 1; 881 int ret = 0, i, j = AHASH_MAX(h) + 1;
840 bool flag_exist = flags & IPSET_FLAG_EXIST; 882 bool flag_exist = flags & IPSET_FLAG_EXIST;
841 u32 key, multi = 0; 883 u32 key, multi = 0;
884 u32 cadt_flags = flags >> 16;
842 885
843 if (h->elements >= h->maxelem) 886 if (h->elements >= h->maxelem)
844 /* FIXME: when set is full, we slow down here */ 887 /* FIXME: when set is full, we slow down here */
845 type_pf_expire(h); 888 type_pf_expire(h);
846 if (h->elements >= h->maxelem) 889 if (h->elements >= h->maxelem) {
890 if (net_ratelimit())
891 pr_warning("Set %s is full, maxelem %u reached\n",
892 set->name, h->maxelem);
847 return -IPSET_ERR_HASH_FULL; 893 return -IPSET_ERR_HASH_FULL;
894 }
848 895
849 rcu_read_lock_bh(); 896 rcu_read_lock_bh();
850 t = rcu_dereference_bh(h->table); 897 t = rcu_dereference_bh(h->table);
@@ -854,6 +901,7 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
854 data = ahash_tdata(n, i); 901 data = ahash_tdata(n, i);
855 if (type_pf_data_equal(data, d, &multi)) { 902 if (type_pf_data_equal(data, d, &multi)) {
856 if (type_pf_data_expired(data) || flag_exist) 903 if (type_pf_data_expired(data) || flag_exist)
904 /* Just timeout value may be updated */
857 j = i; 905 j = i;
858 else { 906 else {
859 ret = -IPSET_ERR_EXIST; 907 ret = -IPSET_ERR_EXIST;
@@ -866,15 +914,18 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
866 if (j != AHASH_MAX(h) + 1) { 914 if (j != AHASH_MAX(h) + 1) {
867 data = ahash_tdata(n, j); 915 data = ahash_tdata(n, j);
868#ifdef IP_SET_HASH_WITH_NETS 916#ifdef IP_SET_HASH_WITH_NETS
869 del_cidr(h, data->cidr, HOST_MASK); 917 del_cidr(h, CIDR(data->cidr), HOST_MASK);
870 add_cidr(h, d->cidr, HOST_MASK); 918 add_cidr(h, CIDR(d->cidr), HOST_MASK);
871#endif 919#endif
872 type_pf_data_copy(data, d); 920 type_pf_data_copy(data, d);
873 type_pf_data_timeout_set(data, timeout); 921 type_pf_data_timeout_set(data, timeout);
922#ifdef IP_SET_HASH_WITH_NETS
923 type_pf_data_flags(data, cadt_flags);
924#endif
874 goto out; 925 goto out;
875 } 926 }
876 TUNE_AHASH_MAX(h, multi); 927 TUNE_AHASH_MAX(h, multi);
877 ret = type_pf_elem_tadd(n, d, AHASH_MAX(h), timeout); 928 ret = type_pf_elem_tadd(n, d, AHASH_MAX(h), cadt_flags, timeout);
878 if (ret != 0) { 929 if (ret != 0) {
879 if (ret == -EAGAIN) 930 if (ret == -EAGAIN)
880 type_pf_data_next(h, d); 931 type_pf_data_next(h, d);
@@ -882,7 +933,7 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
882 } 933 }
883 934
884#ifdef IP_SET_HASH_WITH_NETS 935#ifdef IP_SET_HASH_WITH_NETS
885 add_cidr(h, d->cidr, HOST_MASK); 936 add_cidr(h, CIDR(d->cidr), HOST_MASK);
886#endif 937#endif
887 h->elements++; 938 h->elements++;
888out: 939out:
@@ -916,7 +967,7 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout, u32 flags)
916 n->pos--; 967 n->pos--;
917 h->elements--; 968 h->elements--;
918#ifdef IP_SET_HASH_WITH_NETS 969#ifdef IP_SET_HASH_WITH_NETS
919 del_cidr(h, d->cidr, HOST_MASK); 970 del_cidr(h, CIDR(d->cidr), HOST_MASK);
920#endif 971#endif
921 if (n->pos + AHASH_INIT_SIZE < n->size) { 972 if (n->pos + AHASH_INIT_SIZE < n->size) {
922 void *tmp = kzalloc((n->size - AHASH_INIT_SIZE) 973 void *tmp = kzalloc((n->size - AHASH_INIT_SIZE)
@@ -954,8 +1005,17 @@ type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
954 n = hbucket(t, key); 1005 n = hbucket(t, key);
955 for (i = 0; i < n->pos; i++) { 1006 for (i = 0; i < n->pos; i++) {
956 data = ahash_tdata(n, i); 1007 data = ahash_tdata(n, i);
957 if (type_pf_data_equal(data, d, &multi)) 1008#ifdef IP_SET_HASH_WITH_MULTI
958 return !type_pf_data_expired(data); 1009 if (type_pf_data_equal(data, d, &multi)) {
1010 if (!type_pf_data_expired(data))
1011 return type_pf_data_match(data);
1012 multi = 0;
1013 }
1014#else
1015 if (type_pf_data_equal(data, d, &multi) &&
1016 !type_pf_data_expired(data))
1017 return type_pf_data_match(data);
1018#endif
959 } 1019 }
960 } 1020 }
961 return 0; 1021 return 0;
@@ -973,15 +1033,16 @@ type_pf_ttest(struct ip_set *set, void *value, u32 timeout, u32 flags)
973 u32 key, multi = 0; 1033 u32 key, multi = 0;
974 1034
975#ifdef IP_SET_HASH_WITH_NETS 1035#ifdef IP_SET_HASH_WITH_NETS
976 if (d->cidr == SET_HOST_MASK(set->family)) 1036 if (CIDR(d->cidr) == SET_HOST_MASK(set->family))
977 return type_pf_ttest_cidrs(set, d, timeout); 1037 return type_pf_ttest_cidrs(set, d, timeout);
978#endif 1038#endif
979 key = HKEY(d, h->initval, t->htable_bits); 1039 key = HKEY(d, h->initval, t->htable_bits);
980 n = hbucket(t, key); 1040 n = hbucket(t, key);
981 for (i = 0; i < n->pos; i++) { 1041 for (i = 0; i < n->pos; i++) {
982 data = ahash_tdata(n, i); 1042 data = ahash_tdata(n, i);
983 if (type_pf_data_equal(data, d, &multi)) 1043 if (type_pf_data_equal(data, d, &multi) &&
984 return !type_pf_data_expired(data); 1044 !type_pf_data_expired(data))
1045 return type_pf_data_match(data);
985 } 1046 }
986 return 0; 1047 return 0;
987} 1048}
@@ -1094,14 +1155,17 @@ type_pf_gc_init(struct ip_set *set)
1094#undef type_pf_data_isnull 1155#undef type_pf_data_isnull
1095#undef type_pf_data_copy 1156#undef type_pf_data_copy
1096#undef type_pf_data_zero_out 1157#undef type_pf_data_zero_out
1158#undef type_pf_data_netmask
1097#undef type_pf_data_list 1159#undef type_pf_data_list
1098#undef type_pf_data_tlist 1160#undef type_pf_data_tlist
1161#undef type_pf_data_next
1162#undef type_pf_data_flags
1163#undef type_pf_data_match
1099 1164
1100#undef type_pf_elem 1165#undef type_pf_elem
1101#undef type_pf_telem 1166#undef type_pf_telem
1102#undef type_pf_data_timeout 1167#undef type_pf_data_timeout
1103#undef type_pf_data_expired 1168#undef type_pf_data_expired
1104#undef type_pf_data_netmask
1105#undef type_pf_data_timeout_set 1169#undef type_pf_data_timeout_set
1106 1170
1107#undef type_pf_elem_add 1171#undef type_pf_elem_add
@@ -1111,6 +1175,7 @@ type_pf_gc_init(struct ip_set *set)
1111#undef type_pf_test 1175#undef type_pf_test
1112 1176
1113#undef type_pf_elem_tadd 1177#undef type_pf_elem_tadd
1178#undef type_pf_del_telem
1114#undef type_pf_expire 1179#undef type_pf_expire
1115#undef type_pf_tadd 1180#undef type_pf_tadd
1116#undef type_pf_tdel 1181#undef type_pf_tdel
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
index 6e135f97e59a..e59868ae12d4 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -18,7 +18,10 @@ enum tcp_conntrack {
18 TCP_CONNTRACK_LISTEN, /* obsolete */ 18 TCP_CONNTRACK_LISTEN, /* obsolete */
19#define TCP_CONNTRACK_SYN_SENT2 TCP_CONNTRACK_LISTEN 19#define TCP_CONNTRACK_SYN_SENT2 TCP_CONNTRACK_LISTEN
20 TCP_CONNTRACK_MAX, 20 TCP_CONNTRACK_MAX,
21 TCP_CONNTRACK_IGNORE 21 TCP_CONNTRACK_IGNORE,
22 TCP_CONNTRACK_RETRANS,
23 TCP_CONNTRACK_UNACK,
24 TCP_CONNTRACK_TIMEOUT_MAX
22}; 25};
23 26
24/* Window scaling is advertised by the sender */ 27/* Window scaling is advertised by the sender */
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index b64454c2f79f..6fd1f0d07e64 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -49,7 +49,8 @@ struct nfgenmsg {
49#define NFNL_SUBSYS_OSF 5 49#define NFNL_SUBSYS_OSF 5
50#define NFNL_SUBSYS_IPSET 6 50#define NFNL_SUBSYS_IPSET 6
51#define NFNL_SUBSYS_ACCT 7 51#define NFNL_SUBSYS_ACCT 7
52#define NFNL_SUBSYS_COUNT 8 52#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8
53#define NFNL_SUBSYS_COUNT 9
53 54
54#ifdef __KERNEL__ 55#ifdef __KERNEL__
55 56
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index debf1aefd753..e58e4b93c108 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -43,6 +43,7 @@ enum ctattr_type {
43 CTA_ZONE, 43 CTA_ZONE,
44 CTA_SECCTX, 44 CTA_SECCTX,
45 CTA_TIMESTAMP, 45 CTA_TIMESTAMP,
46 CTA_MARK_MASK,
46 __CTA_MAX 47 __CTA_MAX
47}; 48};
48#define CTA_MAX (__CTA_MAX - 1) 49#define CTA_MAX (__CTA_MAX - 1)
@@ -172,10 +173,21 @@ enum ctattr_expect {
172 CTA_EXPECT_HELP_NAME, 173 CTA_EXPECT_HELP_NAME,
173 CTA_EXPECT_ZONE, 174 CTA_EXPECT_ZONE,
174 CTA_EXPECT_FLAGS, 175 CTA_EXPECT_FLAGS,
176 CTA_EXPECT_CLASS,
177 CTA_EXPECT_NAT,
178 CTA_EXPECT_FN,
175 __CTA_EXPECT_MAX 179 __CTA_EXPECT_MAX
176}; 180};
177#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) 181#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1)
178 182
183enum ctattr_expect_nat {
184 CTA_EXPECT_NAT_UNSPEC,
185 CTA_EXPECT_NAT_DIR,
186 CTA_EXPECT_NAT_TUPLE,
187 __CTA_EXPECT_NAT_MAX
188};
189#define CTA_EXPECT_NAT_MAX (__CTA_EXPECT_NAT_MAX - 1)
190
179enum ctattr_help { 191enum ctattr_help {
180 CTA_HELP_UNSPEC, 192 CTA_HELP_UNSPEC,
181 CTA_HELP_NAME, 193 CTA_HELP_NAME,
diff --git a/include/linux/netfilter/nfnetlink_cttimeout.h b/include/linux/netfilter/nfnetlink_cttimeout.h
new file mode 100644
index 000000000000..a2810a7c5e30
--- /dev/null
+++ b/include/linux/netfilter/nfnetlink_cttimeout.h
@@ -0,0 +1,114 @@
1#ifndef _CTTIMEOUT_NETLINK_H
2#define _CTTIMEOUT_NETLINK_H
3#include <linux/netfilter/nfnetlink.h>
4
5enum ctnl_timeout_msg_types {
6 IPCTNL_MSG_TIMEOUT_NEW,
7 IPCTNL_MSG_TIMEOUT_GET,
8 IPCTNL_MSG_TIMEOUT_DELETE,
9
10 IPCTNL_MSG_TIMEOUT_MAX
11};
12
13enum ctattr_timeout {
14 CTA_TIMEOUT_UNSPEC,
15 CTA_TIMEOUT_NAME,
16 CTA_TIMEOUT_L3PROTO,
17 CTA_TIMEOUT_L4PROTO,
18 CTA_TIMEOUT_DATA,
19 CTA_TIMEOUT_USE,
20 __CTA_TIMEOUT_MAX
21};
22#define CTA_TIMEOUT_MAX (__CTA_TIMEOUT_MAX - 1)
23
24enum ctattr_timeout_generic {
25 CTA_TIMEOUT_GENERIC_UNSPEC,
26 CTA_TIMEOUT_GENERIC_TIMEOUT,
27 __CTA_TIMEOUT_GENERIC_MAX
28};
29#define CTA_TIMEOUT_GENERIC_MAX (__CTA_TIMEOUT_GENERIC_MAX - 1)
30
31enum ctattr_timeout_tcp {
32 CTA_TIMEOUT_TCP_UNSPEC,
33 CTA_TIMEOUT_TCP_SYN_SENT,
34 CTA_TIMEOUT_TCP_SYN_RECV,
35 CTA_TIMEOUT_TCP_ESTABLISHED,
36 CTA_TIMEOUT_TCP_FIN_WAIT,
37 CTA_TIMEOUT_TCP_CLOSE_WAIT,
38 CTA_TIMEOUT_TCP_LAST_ACK,
39 CTA_TIMEOUT_TCP_TIME_WAIT,
40 CTA_TIMEOUT_TCP_CLOSE,
41 CTA_TIMEOUT_TCP_SYN_SENT2,
42 CTA_TIMEOUT_TCP_RETRANS,
43 CTA_TIMEOUT_TCP_UNACK,
44 __CTA_TIMEOUT_TCP_MAX
45};
46#define CTA_TIMEOUT_TCP_MAX (__CTA_TIMEOUT_TCP_MAX - 1)
47
48enum ctattr_timeout_udp {
49 CTA_TIMEOUT_UDP_UNSPEC,
50 CTA_TIMEOUT_UDP_UNREPLIED,
51 CTA_TIMEOUT_UDP_REPLIED,
52 __CTA_TIMEOUT_UDP_MAX
53};
54#define CTA_TIMEOUT_UDP_MAX (__CTA_TIMEOUT_UDP_MAX - 1)
55
56enum ctattr_timeout_udplite {
57 CTA_TIMEOUT_UDPLITE_UNSPEC,
58 CTA_TIMEOUT_UDPLITE_UNREPLIED,
59 CTA_TIMEOUT_UDPLITE_REPLIED,
60 __CTA_TIMEOUT_UDPLITE_MAX
61};
62#define CTA_TIMEOUT_UDPLITE_MAX (__CTA_TIMEOUT_UDPLITE_MAX - 1)
63
64enum ctattr_timeout_icmp {
65 CTA_TIMEOUT_ICMP_UNSPEC,
66 CTA_TIMEOUT_ICMP_TIMEOUT,
67 __CTA_TIMEOUT_ICMP_MAX
68};
69#define CTA_TIMEOUT_ICMP_MAX (__CTA_TIMEOUT_ICMP_MAX - 1)
70
71enum ctattr_timeout_dccp {
72 CTA_TIMEOUT_DCCP_UNSPEC,
73 CTA_TIMEOUT_DCCP_REQUEST,
74 CTA_TIMEOUT_DCCP_RESPOND,
75 CTA_TIMEOUT_DCCP_PARTOPEN,
76 CTA_TIMEOUT_DCCP_OPEN,
77 CTA_TIMEOUT_DCCP_CLOSEREQ,
78 CTA_TIMEOUT_DCCP_CLOSING,
79 CTA_TIMEOUT_DCCP_TIMEWAIT,
80 __CTA_TIMEOUT_DCCP_MAX
81};
82#define CTA_TIMEOUT_DCCP_MAX (__CTA_TIMEOUT_DCCP_MAX - 1)
83
84enum ctattr_timeout_sctp {
85 CTA_TIMEOUT_SCTP_UNSPEC,
86 CTA_TIMEOUT_SCTP_CLOSED,
87 CTA_TIMEOUT_SCTP_COOKIE_WAIT,
88 CTA_TIMEOUT_SCTP_COOKIE_ECHOED,
89 CTA_TIMEOUT_SCTP_ESTABLISHED,
90 CTA_TIMEOUT_SCTP_SHUTDOWN_SENT,
91 CTA_TIMEOUT_SCTP_SHUTDOWN_RECD,
92 CTA_TIMEOUT_SCTP_SHUTDOWN_ACK_SENT,
93 __CTA_TIMEOUT_SCTP_MAX
94};
95#define CTA_TIMEOUT_SCTP_MAX (__CTA_TIMEOUT_SCTP_MAX - 1)
96
97enum ctattr_timeout_icmpv6 {
98 CTA_TIMEOUT_ICMPV6_UNSPEC,
99 CTA_TIMEOUT_ICMPV6_TIMEOUT,
100 __CTA_TIMEOUT_ICMPV6_MAX
101};
102#define CTA_TIMEOUT_ICMPV6_MAX (__CTA_TIMEOUT_ICMPV6_MAX - 1)
103
104enum ctattr_timeout_gre {
105 CTA_TIMEOUT_GRE_UNSPEC,
106 CTA_TIMEOUT_GRE_UNREPLIED,
107 CTA_TIMEOUT_GRE_REPLIED,
108 __CTA_TIMEOUT_GRE_MAX
109};
110#define CTA_TIMEOUT_GRE_MAX (__CTA_TIMEOUT_GRE_MAX - 1)
111
112#define CTNL_TIMEOUT_NAME_MAX 32
113
114#endif
diff --git a/include/linux/netfilter/xt_CT.h b/include/linux/netfilter/xt_CT.h
index b56e76811c04..a064b8af360c 100644
--- a/include/linux/netfilter/xt_CT.h
+++ b/include/linux/netfilter/xt_CT.h
@@ -16,4 +16,16 @@ struct xt_ct_target_info {
16 struct nf_conn *ct __attribute__((aligned(8))); 16 struct nf_conn *ct __attribute__((aligned(8)));
17}; 17};
18 18
19struct xt_ct_target_info_v1 {
20 __u16 flags;
21 __u16 zone;
22 __u32 ct_events;
23 __u32 exp_events;
24 char helper[16];
25 char timeout[32];
26
27 /* Used internally by the kernel */
28 struct nf_conn *ct __attribute__((aligned(8)));
29};
30
19#endif /* _XT_CT_H */ 31#endif /* _XT_CT_H */
diff --git a/include/linux/netfilter/xt_LOG.h b/include/linux/netfilter/xt_LOG.h
new file mode 100644
index 000000000000..cac079095305
--- /dev/null
+++ b/include/linux/netfilter/xt_LOG.h
@@ -0,0 +1,19 @@
1#ifndef _XT_LOG_H
2#define _XT_LOG_H
3
4/* make sure not to change this without changing nf_log.h:NF_LOG_* (!) */
5#define XT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
6#define XT_LOG_TCPOPT 0x02 /* Log TCP options */
7#define XT_LOG_IPOPT 0x04 /* Log IP options */
8#define XT_LOG_UID 0x08 /* Log UID owning local socket */
9#define XT_LOG_NFLOG 0x10 /* Unsupported, don't reuse */
10#define XT_LOG_MACDECODE 0x20 /* Decode MAC header */
11#define XT_LOG_MASK 0x2f
12
13struct xt_log_info {
14 unsigned char level;
15 unsigned char logflags;
16 char prefix[30];
17};
18
19#endif /* _XT_LOG_H */
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
index f9930c87fff3..31f8bec95650 100644
--- a/include/linux/netfilter_ipv4/Kbuild
+++ b/include/linux/netfilter_ipv4/Kbuild
@@ -4,11 +4,9 @@ header-y += ipt_CLUSTERIP.h
4header-y += ipt_ECN.h 4header-y += ipt_ECN.h
5header-y += ipt_LOG.h 5header-y += ipt_LOG.h
6header-y += ipt_REJECT.h 6header-y += ipt_REJECT.h
7header-y += ipt_SAME.h
8header-y += ipt_TTL.h 7header-y += ipt_TTL.h
9header-y += ipt_ULOG.h 8header-y += ipt_ULOG.h
10header-y += ipt_addrtype.h 9header-y += ipt_addrtype.h
11header-y += ipt_ah.h 10header-y += ipt_ah.h
12header-y += ipt_ecn.h 11header-y += ipt_ecn.h
13header-y += ipt_realm.h
14header-y += ipt_ttl.h 12header-y += ipt_ttl.h
diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/linux/netfilter_ipv4/ipt_LOG.h
index dcdbadf9fd4a..5d8152077d71 100644
--- a/include/linux/netfilter_ipv4/ipt_LOG.h
+++ b/include/linux/netfilter_ipv4/ipt_LOG.h
@@ -1,6 +1,8 @@
1#ifndef _IPT_LOG_H 1#ifndef _IPT_LOG_H
2#define _IPT_LOG_H 2#define _IPT_LOG_H
3 3
4#warning "Please update iptables, this file will be removed soon!"
5
4/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */ 6/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
5#define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ 7#define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
6#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */ 8#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */
diff --git a/include/linux/netfilter_ipv4/ipt_SAME.h b/include/linux/netfilter_ipv4/ipt_SAME.h
deleted file mode 100644
index 5bca78267afd..000000000000
--- a/include/linux/netfilter_ipv4/ipt_SAME.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef _IPT_SAME_H
2#define _IPT_SAME_H
3
4#include <linux/types.h>
5
6#define IPT_SAME_MAX_RANGE 10
7
8#define IPT_SAME_NODST 0x01
9
10struct ipt_same_info {
11 unsigned char info;
12 __u32 rangesize;
13 __u32 ipnum;
14 __u32 *iparray;
15
16 /* hangs off end. */
17 struct nf_nat_range range[IPT_SAME_MAX_RANGE];
18};
19
20#endif /*_IPT_SAME_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_realm.h b/include/linux/netfilter_ipv4/ipt_realm.h
deleted file mode 100644
index b3996eaa0188..000000000000
--- a/include/linux/netfilter_ipv4/ipt_realm.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _IPT_REALM_H
2#define _IPT_REALM_H
3
4#include <linux/netfilter/xt_realm.h>
5#define ipt_realm_info xt_realm_info
6
7#endif /* _IPT_REALM_H */
diff --git a/include/linux/netfilter_ipv6/ip6t_LOG.h b/include/linux/netfilter_ipv6/ip6t_LOG.h
index 9dd5579e02ec..3dd0bc4e0735 100644
--- a/include/linux/netfilter_ipv6/ip6t_LOG.h
+++ b/include/linux/netfilter_ipv6/ip6t_LOG.h
@@ -1,6 +1,8 @@
1#ifndef _IP6T_LOG_H 1#ifndef _IP6T_LOG_H
2#define _IP6T_LOG_H 2#define _IP6T_LOG_H
3 3
4#warning "Please update iptables, this file will be removed soon!"
5
4/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */ 6/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
5#define IP6T_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ 7#define IP6T_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
6#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */ 8#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 52e48959cfa1..a2092f582a78 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -225,6 +225,7 @@ struct netlink_callback {
225 int (*dump)(struct sk_buff * skb, 225 int (*dump)(struct sk_buff * skb,
226 struct netlink_callback *cb); 226 struct netlink_callback *cb);
227 int (*done)(struct netlink_callback *cb); 227 int (*done)(struct netlink_callback *cb);
228 void *data;
228 u16 family; 229 u16 family;
229 u16 min_dump_alloc; 230 u16 min_dump_alloc;
230 unsigned int prev_seq, seq; 231 unsigned int prev_seq, seq;
@@ -237,22 +238,8 @@ struct netlink_notify {
237 int protocol; 238 int protocol;
238}; 239};
239 240
240static __inline__ struct nlmsghdr * 241struct nlmsghdr *
241__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) 242__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags);
242{
243 struct nlmsghdr *nlh;
244 int size = NLMSG_LENGTH(len);
245
246 nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size));
247 nlh->nlmsg_type = type;
248 nlh->nlmsg_len = size;
249 nlh->nlmsg_flags = flags;
250 nlh->nlmsg_pid = pid;
251 nlh->nlmsg_seq = seq;
252 if (!__builtin_constant_p(size) || NLMSG_ALIGN(size) - size != 0)
253 memset(NLMSG_DATA(nlh) + len, 0, NLMSG_ALIGN(size) - size);
254 return nlh;
255}
256 243
257#define NLMSG_NEW(skb, pid, seq, type, len, flags) \ 244#define NLMSG_NEW(skb, pid, seq, type, len, flags) \
258({ if (unlikely(skb_tailroom(skb) < (int)NLMSG_SPACE(len))) \ 245({ if (unlikely(skb_tailroom(skb) < (int)NLMSG_SPACE(len))) \
@@ -262,11 +249,16 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
262#define NLMSG_PUT(skb, pid, seq, type, len) \ 249#define NLMSG_PUT(skb, pid, seq, type, len) \
263 NLMSG_NEW(skb, pid, seq, type, len, 0) 250 NLMSG_NEW(skb, pid, seq, type, len, 0)
264 251
252struct netlink_dump_control {
253 int (*dump)(struct sk_buff *skb, struct netlink_callback *);
254 int (*done)(struct netlink_callback*);
255 void *data;
256 u16 min_dump_alloc;
257};
258
265extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, 259extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
266 const struct nlmsghdr *nlh, 260 const struct nlmsghdr *nlh,
267 int (*dump)(struct sk_buff *skb, struct netlink_callback*), 261 struct netlink_dump_control *control);
268 int (*done)(struct netlink_callback*),
269 u16 min_dump_alloc);
270 262
271 263
272#define NL_NONROOT_RECV 0x1 264#define NL_NONROOT_RECV 0x1
diff --git a/include/linux/nfc.h b/include/linux/nfc.h
index 01d4e5d60325..39c1fcf089c0 100644
--- a/include/linux/nfc.h
+++ b/include/linux/nfc.h
@@ -89,6 +89,8 @@ enum nfc_commands {
89 * @NFC_ATTR_TARGET_SEL_RES: NFC-A targets extra information (useful if the 89 * @NFC_ATTR_TARGET_SEL_RES: NFC-A targets extra information (useful if the
90 * target is not NFC-Forum compliant) 90 * target is not NFC-Forum compliant)
91 * @NFC_ATTR_TARGET_NFCID1: NFC-A targets identifier, max 10 bytes 91 * @NFC_ATTR_TARGET_NFCID1: NFC-A targets identifier, max 10 bytes
92 * @NFC_ATTR_TARGET_SENSB_RES: NFC-B targets extra information, max 12 bytes
93 * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes
92 * @NFC_ATTR_COMM_MODE: Passive or active mode 94 * @NFC_ATTR_COMM_MODE: Passive or active mode
93 * @NFC_ATTR_RF_MODE: Initiator or target 95 * @NFC_ATTR_RF_MODE: Initiator or target
94 */ 96 */
@@ -101,14 +103,20 @@ enum nfc_attrs {
101 NFC_ATTR_TARGET_SENS_RES, 103 NFC_ATTR_TARGET_SENS_RES,
102 NFC_ATTR_TARGET_SEL_RES, 104 NFC_ATTR_TARGET_SEL_RES,
103 NFC_ATTR_TARGET_NFCID1, 105 NFC_ATTR_TARGET_NFCID1,
106 NFC_ATTR_TARGET_SENSB_RES,
107 NFC_ATTR_TARGET_SENSF_RES,
104 NFC_ATTR_COMM_MODE, 108 NFC_ATTR_COMM_MODE,
105 NFC_ATTR_RF_MODE, 109 NFC_ATTR_RF_MODE,
110 NFC_ATTR_DEVICE_POWERED,
106/* private: internal use only */ 111/* private: internal use only */
107 __NFC_ATTR_AFTER_LAST 112 __NFC_ATTR_AFTER_LAST
108}; 113};
109#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1) 114#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1)
110 115
111#define NFC_DEVICE_NAME_MAXSIZE 8 116#define NFC_DEVICE_NAME_MAXSIZE 8
117#define NFC_NFCID1_MAXSIZE 10
118#define NFC_SENSB_RES_MAXSIZE 12
119#define NFC_SENSF_RES_MAXSIZE 18
112 120
113/* NFC protocols */ 121/* NFC protocols */
114#define NFC_PROTO_JEWEL 1 122#define NFC_PROTO_JEWEL 1
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 0f5ff3739820..e474f6e780cc 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -156,21 +156,23 @@
156 * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX 156 * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
157 * or %NL80211_ATTR_MAC. 157 * or %NL80211_ATTR_MAC.
158 * 158 *
159 * @NL80211_CMD_GET_BEACON: retrieve beacon information (returned in a 159 * @NL80211_CMD_GET_BEACON: (not used)
160 * %NL80222_CMD_NEW_BEACON message) 160 * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface
161 * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface 161 * using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL
162 * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD, 162 * attributes. For drivers that generate the beacon and probe responses
163 * %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes. 163 * internally, the following attributes must be provided: %NL80211_ATTR_IE,
164 * Following attributes are provided for drivers that generate full Beacon 164 * %NL80211_ATTR_IE_PROBE_RESP and %NL80211_ATTR_IE_ASSOC_RESP.
165 * and Probe Response frames internally: %NL80211_ATTR_SSID, 165 * @NL80211_CMD_START_AP: Start AP operation on an AP interface, parameters
166 * are like for %NL80211_CMD_SET_BEACON, and additionally parameters that
167 * do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL,
168 * %NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID,
166 * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, 169 * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE,
167 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, 170 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
168 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, 171 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
169 * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_IE, %NL80211_ATTR_IE_PROBE_RESP, 172 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.
170 * %NL80211_ATTR_IE_ASSOC_RESP. 173 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
171 * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface, 174 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
172 * parameters are like for %NL80211_CMD_SET_BEACON. 175 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
173 * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it
174 * 176 *
175 * @NL80211_CMD_GET_STATION: Get station attributes for station identified by 177 * @NL80211_CMD_GET_STATION: Get station attributes for station identified by
176 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX. 178 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
@@ -367,6 +369,11 @@
367 * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, 369 * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
368 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and 370 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
369 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT. 371 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
372 * Background scan period can optionally be
373 * specified in %NL80211_ATTR_BG_SCAN_PERIOD,
374 * if not specified default background scan configuration
375 * in driver is used and if period value is 0, bg scan will be disabled.
376 * This attribute is ignored if driver does not support roam scan.
370 * It is also sent as an event, with the BSSID and response IEs when the 377 * It is also sent as an event, with the BSSID and response IEs when the
371 * connection is established or failed to be established. This can be 378 * connection is established or failed to be established. This can be
372 * determined by the STATUS_CODE attribute. 379 * determined by the STATUS_CODE attribute.
@@ -565,8 +572,10 @@ enum nl80211_commands {
565 572
566 NL80211_CMD_GET_BEACON, 573 NL80211_CMD_GET_BEACON,
567 NL80211_CMD_SET_BEACON, 574 NL80211_CMD_SET_BEACON,
568 NL80211_CMD_NEW_BEACON, 575 NL80211_CMD_START_AP,
569 NL80211_CMD_DEL_BEACON, 576 NL80211_CMD_NEW_BEACON = NL80211_CMD_START_AP,
577 NL80211_CMD_STOP_AP,
578 NL80211_CMD_DEL_BEACON = NL80211_CMD_STOP_AP,
570 579
571 NL80211_CMD_GET_STATION, 580 NL80211_CMD_GET_STATION,
572 NL80211_CMD_SET_STATION, 581 NL80211_CMD_SET_STATION,
@@ -1193,6 +1202,19 @@ enum nl80211_commands {
1193 * @NL80211_ATTR_NOACK_MAP: This u16 bitmap contains the No Ack Policy of 1202 * @NL80211_ATTR_NOACK_MAP: This u16 bitmap contains the No Ack Policy of
1194 * up to 16 TIDs. 1203 * up to 16 TIDs.
1195 * 1204 *
1205 * @NL80211_ATTR_INACTIVITY_TIMEOUT: timeout value in seconds, this can be
1206 * used by the drivers which has MLME in firmware and does not have support
1207 * to report per station tx/rx activity to free up the staion entry from
1208 * the list. This needs to be used when the driver advertises the
1209 * capability to timeout the stations.
1210 *
1211 * @NL80211_ATTR_RX_SIGNAL_DBM: signal strength in dBm (as a 32-bit int);
1212 * this attribute is (depending on the driver capabilities) added to
1213 * received frames indicated with %NL80211_CMD_FRAME.
1214 *
1215 * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds
1216 * or 0 to disable background scan.
1217 *
1196 * @NL80211_ATTR_MAX: highest attribute number currently defined 1218 * @NL80211_ATTR_MAX: highest attribute number currently defined
1197 * @__NL80211_ATTR_AFTER_LAST: internal use 1219 * @__NL80211_ATTR_AFTER_LAST: internal use
1198 */ 1220 */
@@ -1438,6 +1460,12 @@ enum nl80211_attrs {
1438 1460
1439 NL80211_ATTR_NOACK_MAP, 1461 NL80211_ATTR_NOACK_MAP,
1440 1462
1463 NL80211_ATTR_INACTIVITY_TIMEOUT,
1464
1465 NL80211_ATTR_RX_SIGNAL_DBM,
1466
1467 NL80211_ATTR_BG_SCAN_PERIOD,
1468
1441 /* add attributes here, update the policy in nl80211.c */ 1469 /* add attributes here, update the policy in nl80211.c */
1442 1470
1443 __NL80211_ATTR_AFTER_LAST, 1471 __NL80211_ATTR_AFTER_LAST,
@@ -1475,6 +1503,7 @@ enum nl80211_attrs {
1475#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS 1503#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
1476 1504
1477#define NL80211_MAX_SUPP_RATES 32 1505#define NL80211_MAX_SUPP_RATES 32
1506#define NL80211_MAX_SUPP_HT_RATES 77
1478#define NL80211_MAX_SUPP_REG_RULES 32 1507#define NL80211_MAX_SUPP_REG_RULES 32
1479#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 1508#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
1480#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 1509#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
@@ -2104,6 +2133,13 @@ enum nl80211_mntr_flags {
2104 * TUs) during which a mesh STA can send only one Action frame containing a 2133 * TUs) during which a mesh STA can send only one Action frame containing a
2105 * PERR element. 2134 * PERR element.
2106 * 2135 *
2136 * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding
2137 * or forwarding entity (default is TRUE - forwarding entity)
2138 *
2139 * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the
2140 * threshold for average signal strength of candidate station to establish
2141 * a peer link.
2142 *
2107 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute 2143 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
2108 * 2144 *
2109 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 2145 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
@@ -2128,6 +2164,8 @@ enum nl80211_meshconf_params {
2128 NL80211_MESHCONF_HWMP_RANN_INTERVAL, 2164 NL80211_MESHCONF_HWMP_RANN_INTERVAL,
2129 NL80211_MESHCONF_GATE_ANNOUNCEMENTS, 2165 NL80211_MESHCONF_GATE_ANNOUNCEMENTS,
2130 NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL, 2166 NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL,
2167 NL80211_MESHCONF_FORWARDING,
2168 NL80211_MESHCONF_RSSI_THRESHOLD,
2131 2169
2132 /* keep last */ 2170 /* keep last */
2133 __NL80211_MESHCONF_ATTR_AFTER_LAST, 2171 __NL80211_MESHCONF_ATTR_AFTER_LAST,
@@ -2401,12 +2439,15 @@ enum nl80211_key_attributes {
2401 * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with 2439 * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
2402 * 1 = 500 kbps) but without the IE length restriction (at most 2440 * 1 = 500 kbps) but without the IE length restriction (at most
2403 * %NL80211_MAX_SUPP_RATES in a single array). 2441 * %NL80211_MAX_SUPP_RATES in a single array).
2442 * @NL80211_TXRATE_MCS: HT (MCS) rates allowed for TX rate selection
2443 * in an array of MCS numbers.
2404 * @__NL80211_TXRATE_AFTER_LAST: internal 2444 * @__NL80211_TXRATE_AFTER_LAST: internal
2405 * @NL80211_TXRATE_MAX: highest TX rate attribute 2445 * @NL80211_TXRATE_MAX: highest TX rate attribute
2406 */ 2446 */
2407enum nl80211_tx_rate_attributes { 2447enum nl80211_tx_rate_attributes {
2408 __NL80211_TXRATE_INVALID, 2448 __NL80211_TXRATE_INVALID,
2409 NL80211_TXRATE_LEGACY, 2449 NL80211_TXRATE_LEGACY,
2450 NL80211_TXRATE_MCS,
2410 2451
2411 /* keep last */ 2452 /* keep last */
2412 __NL80211_TXRATE_AFTER_LAST, 2453 __NL80211_TXRATE_AFTER_LAST,
@@ -2792,10 +2833,13 @@ enum nl80211_ap_sme_features {
2792 * TX status to the socket error queue when requested with the 2833 * TX status to the socket error queue when requested with the
2793 * socket option. 2834 * socket option.
2794 * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates. 2835 * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates.
2836 * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
2837 * the connected inactive stations in AP mode.
2795 */ 2838 */
2796enum nl80211_feature_flags { 2839enum nl80211_feature_flags {
2797 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 2840 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
2798 NL80211_FEATURE_HT_IBSS = 1 << 1, 2841 NL80211_FEATURE_HT_IBSS = 1 << 1,
2842 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
2799}; 2843};
2800 2844
2801/** 2845/**
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 31d77af2ef42..3329965ed63f 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2105,6 +2105,7 @@
2105#define PCI_DEVICE_ID_NX2_57711E 0x1650 2105#define PCI_DEVICE_ID_NX2_57711E 0x1650
2106#define PCI_DEVICE_ID_TIGON3_5705 0x1653 2106#define PCI_DEVICE_ID_TIGON3_5705 0x1653
2107#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 2107#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654
2108#define PCI_DEVICE_ID_TIGON3_5719 0x1657
2108#define PCI_DEVICE_ID_TIGON3_5721 0x1659 2109#define PCI_DEVICE_ID_TIGON3_5721 0x1659
2109#define PCI_DEVICE_ID_TIGON3_5722 0x165a 2110#define PCI_DEVICE_ID_TIGON3_5722 0x165a
2110#define PCI_DEVICE_ID_TIGON3_5723 0x165b 2111#define PCI_DEVICE_ID_TIGON3_5723 0x165b
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index 0d5b79365d03..410b33d014d2 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -127,6 +127,27 @@ struct tc_multiq_qopt {
127 __u16 max_bands; /* Maximum number of queues */ 127 __u16 max_bands; /* Maximum number of queues */
128}; 128};
129 129
130/* PLUG section */
131
132#define TCQ_PLUG_BUFFER 0
133#define TCQ_PLUG_RELEASE_ONE 1
134#define TCQ_PLUG_RELEASE_INDEFINITE 2
135#define TCQ_PLUG_LIMIT 3
136
137struct tc_plug_qopt {
138 /* TCQ_PLUG_BUFFER: Inset a plug into the queue and
139 * buffer any incoming packets
140 * TCQ_PLUG_RELEASE_ONE: Dequeue packets from queue head
141 * to beginning of the next plug.
142 * TCQ_PLUG_RELEASE_INDEFINITE: Dequeue all packets from queue.
143 * Stop buffering packets until the next TCQ_PLUG_BUFFER
144 * command is received (just act as a pass-thru queue).
145 * TCQ_PLUG_LIMIT: Increase/decrease queue size
146 */
147 int action;
148 __u32 limit;
149};
150
130/* TBF section */ 151/* TBF section */
131 152
132struct tc_tbf_qopt { 153struct tc_tbf_qopt {
diff --git a/include/linux/platform_data/cpsw.h b/include/linux/platform_data/cpsw.h
new file mode 100644
index 000000000000..c4e23d029498
--- /dev/null
+++ b/include/linux/platform_data/cpsw.h
@@ -0,0 +1,55 @@
1/*
2 * Texas Instruments Ethernet Switch Driver
3 *
4 * Copyright (C) 2012 Texas Instruments
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#ifndef __CPSW_H__
16#define __CPSW_H__
17
18#include <linux/if_ether.h>
19
20struct cpsw_slave_data {
21 u32 slave_reg_ofs;
22 u32 sliver_reg_ofs;
23 const char *phy_id;
24 int phy_if;
25 u8 mac_addr[ETH_ALEN];
26};
27
28struct cpsw_platform_data {
29 u32 ss_reg_ofs; /* Subsystem control register offset */
30 u32 channels; /* number of cpdma channels (symmetric) */
31 u32 cpdma_reg_ofs; /* cpdma register offset */
32 u32 cpdma_sram_ofs; /* cpdma sram offset */
33
34 u32 slaves; /* number of slave cpgmac ports */
35 struct cpsw_slave_data *slave_data;
36
37 u32 ale_reg_ofs; /* address lookup engine reg offset */
38 u32 ale_entries; /* ale table size */
39
40 u32 host_port_reg_ofs; /* cpsw cpdma host port registers */
41 u32 host_port_num; /* The port number for the host port */
42
43 u32 hw_stats_reg_ofs; /* cpsw hardware statistics counters */
44
45 u32 bd_ram_ofs; /* embedded buffer descriptor RAM offset*/
46 u32 bd_ram_size; /*buffer descriptor ram size */
47 u32 hw_ram_addr; /*if the HW address for BD RAM is different */
48 bool no_bd_ram; /* no embedded BD ram*/
49
50 u32 rx_descs; /* Number of Rx Descriptios */
51
52 u32 mac_control; /* Mac control register */
53};
54
55#endif /* __CPSW_H__ */
diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h
index b8d4ddd22736..e53ff65935dd 100644
--- a/include/linux/ppp-comp.h
+++ b/include/linux/ppp-comp.h
@@ -1,42 +1,12 @@
1/* 1/*
2 * ppp-comp.h - Definitions for doing PPP packet compression. 2 * ppp-comp.h - Definitions for doing PPP packet compression.
3 * 3 *
4 * Copyright (c) 1994 The Australian National University. 4 * Copyright 1994-1998 Paul Mackerras.
5 * All rights reserved.
6 * 5 *
7 * Permission to use, copy, modify, and distribute this software and its 6 * This program is free software; you can redistribute it and/or
8 * documentation is hereby granted, provided that the above copyright 7 * modify it under the terms of the GNU General Public License
9 * notice appears in all copies. This software is provided without any 8 * version 2 as published by the Free Software Foundation.
10 * warranty, express or implied. The Australian National University
11 * makes no representations about the suitability of this software for
12 * any purpose.
13 *
14 * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
15 * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
16 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
17 * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
18 * OF SUCH DAMAGE.
19 *
20 * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
21 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
23 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
24 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
25 * OR MODIFICATIONS.
26 */ 9 */
27
28/*
29 * ==FILEVERSION 980319==
30 *
31 * NOTE TO MAINTAINERS:
32 * If you modify this file at all, please set the above date.
33 * ppp-comp.h is shipped with a PPP distribution as well as with the kernel;
34 * if everyone increases the FILEVERSION number above, then scripts
35 * can do the right thing when deciding whether to install a new ppp-comp.h
36 * file. Don't change the format of that line otherwise, so the
37 * installation script can recognize it.
38 */
39
40#ifndef _NET_PPP_COMP_H 10#ifndef _NET_PPP_COMP_H
41#define _NET_PPP_COMP_H 11#define _NET_PPP_COMP_H
42 12
diff --git a/include/linux/ppp-ioctl.h b/include/linux/ppp-ioctl.h
new file mode 100644
index 000000000000..2d9a8859550a
--- /dev/null
+++ b/include/linux/ppp-ioctl.h
@@ -0,0 +1,119 @@
1/*
2 * ppp-ioctl.h - PPP ioctl definitions.
3 *
4 * Copyright 1999-2002 Paul Mackerras.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 */
10#ifndef _PPP_IOCTL_H
11#define _PPP_IOCTL_H
12
13#include <linux/types.h>
14#include <linux/compiler.h>
15
16/*
17 * Bit definitions for flags argument to PPPIOCGFLAGS/PPPIOCSFLAGS.
18 */
19#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
20#define SC_COMP_AC 0x00000002 /* header compression (output) */
21#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
22#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
23#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
24#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
25#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
26#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
27#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
28#define SC_LOOP_TRAFFIC 0x00000200 /* send traffic to pppd */
29#define SC_MULTILINK 0x00000400 /* do multilink encapsulation */
30#define SC_MP_SHORTSEQ 0x00000800 /* use short MP sequence numbers */
31#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
32#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
33#define SC_MP_XSHORTSEQ 0x00004000 /* transmit short MP seq numbers */
34#define SC_DEBUG 0x00010000 /* enable debug messages */
35#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
36#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
37#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
38#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
39#define SC_SYNC 0x00200000 /* synchronous serial mode */
40#define SC_MUST_COMP 0x00400000 /* no uncompressed packets may be sent or received */
41#define SC_MASK 0x0f600fff /* bits that user can change */
42
43/* state bits */
44#define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */
45#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
46#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
47#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
48#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
49#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
50#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
51
52/* Used with PPPIOCGNPMODE/PPPIOCSNPMODE */
53struct npioctl {
54 int protocol; /* PPP protocol, e.g. PPP_IP */
55 enum NPmode mode;
56};
57
58/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
59struct ppp_option_data {
60 __u8 __user *ptr;
61 __u32 length;
62 int transmit;
63};
64
65/* For PPPIOCGL2TPSTATS */
66struct pppol2tp_ioc_stats {
67 __u16 tunnel_id; /* redundant */
68 __u16 session_id; /* if zero, get tunnel stats */
69 __u32 using_ipsec:1; /* valid only for session_id == 0 */
70 __aligned_u64 tx_packets;
71 __aligned_u64 tx_bytes;
72 __aligned_u64 tx_errors;
73 __aligned_u64 rx_packets;
74 __aligned_u64 rx_bytes;
75 __aligned_u64 rx_seq_discards;
76 __aligned_u64 rx_oos_packets;
77 __aligned_u64 rx_errors;
78};
79
80/*
81 * Ioctl definitions.
82 */
83
84#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
85#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
86#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
87#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
88#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
89#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
90#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
91#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
92#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
93#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
94#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
95#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
96#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
97#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
98#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
99#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
100#define PPPIOCSPASS _IOW('t', 71, struct sock_fprog) /* set pass filter */
101#define PPPIOCSACTIVE _IOW('t', 70, struct sock_fprog) /* set active filt */
102#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
103#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
104#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
105#define PPPIOCNEWUNIT _IOWR('t', 62, int) /* create new ppp unit */
106#define PPPIOCATTACH _IOW('t', 61, int) /* attach to ppp unit */
107#define PPPIOCDETACH _IOW('t', 60, int) /* detach from ppp unit/chan */
108#define PPPIOCSMRRU _IOW('t', 59, int) /* set multilink MRU */
109#define PPPIOCCONNECT _IOW('t', 58, int) /* connect channel to unit */
110#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */
111#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */
112#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */
113#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
114
115#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
116#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
117#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
118
119#endif /* _PPP_IOCTL_H */
diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h
index 0f93ed6b4a88..ba416f67eb62 100644
--- a/include/linux/ppp_defs.h
+++ b/include/linux/ppp_defs.h
@@ -1,44 +1,14 @@
1/* 1/*
2 * ppp_defs.h - PPP definitions. 2 * ppp_defs.h - PPP definitions.
3 * 3 *
4 * Copyright (c) 1994 The Australian National University. 4 * Copyright 1994-2000 Paul Mackerras.
5 * All rights reserved.
6 * 5 *
7 * Permission to use, copy, modify, and distribute this software and its 6 * This program is free software; you can redistribute it and/or
8 * documentation is hereby granted, provided that the above copyright 7 * modify it under the terms of the GNU General Public License
9 * notice appears in all copies. This software is provided without any 8 * version 2 as published by the Free Software Foundation.
10 * warranty, express or implied. The Australian National University
11 * makes no representations about the suitability of this software for
12 * any purpose.
13 *
14 * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
15 * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
16 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
17 * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
18 * OF SUCH DAMAGE.
19 *
20 * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
21 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
23 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
24 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
25 * OR MODIFICATIONS.
26 */ 9 */
27
28#include <linux/types.h> 10#include <linux/types.h>
29 11
30/*
31 * ==FILEVERSION 20000114==
32 *
33 * NOTE TO MAINTAINERS:
34 * If you modify this file at all, please set the above date.
35 * ppp_defs.h is shipped with a PPP distribution as well as with the kernel;
36 * if everyone increases the FILEVERSION number above, then scripts
37 * can do the right thing when deciding whether to install a new ppp_defs.h
38 * file. Don't change the format of that line otherwise, so the
39 * installation script can recognize it.
40 */
41
42#ifndef _PPP_DEFS_H_ 12#ifndef _PPP_DEFS_H_
43#define _PPP_DEFS_H_ 13#define _PPP_DEFS_H_
44 14
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
index 2076acf8294d..b17d765ded84 100644
--- a/include/linux/sh_eth.h
+++ b/include/linux/sh_eth.h
@@ -20,6 +20,7 @@ struct sh_eth_plat_data {
20 unsigned char mac_addr[6]; 20 unsigned char mac_addr[6];
21 unsigned no_ether_link:1; 21 unsigned no_ether_link:1;
22 unsigned ether_link_active_low:1; 22 unsigned ether_link_active_low:1;
23 unsigned needs_init:1;
23}; 24};
24 25
25#endif 26#endif
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ae86adee3746..a2b9953b582d 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -94,6 +94,13 @@
94 * about CHECKSUM_UNNECESSARY. 8) 94 * about CHECKSUM_UNNECESSARY. 8)
95 * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead. 95 * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead.
96 * 96 *
97 * UNNECESSARY: device will do per protocol specific csum. Protocol drivers
98 * that do not want net to perform the checksum calculation should use
99 * this flag in their outgoing skbs.
100 * NETIF_F_FCOE_CRC this indicates the device can do FCoE FC CRC
101 * offload. Correspondingly, the FCoE protocol driver
102 * stack should use CHECKSUM_UNNECESSARY.
103 *
97 * Any questions? No questions, good. --ANK 104 * Any questions? No questions, good. --ANK
98 */ 105 */
99 106
@@ -361,6 +368,7 @@ typedef unsigned char *sk_buff_data_t;
361 * ports. 368 * ports.
362 * @wifi_acked_valid: wifi_acked was set 369 * @wifi_acked_valid: wifi_acked was set
363 * @wifi_acked: whether frame was acked on wifi or not 370 * @wifi_acked: whether frame was acked on wifi or not
371 * @no_fcs: Request NIC to treat last 4 bytes as Ethernet FCS
364 * @dma_cookie: a cookie to one of several possible DMA operations 372 * @dma_cookie: a cookie to one of several possible DMA operations
365 * done by skb DMA functions 373 * done by skb DMA functions
366 * @secmark: security marking 374 * @secmark: security marking
@@ -438,6 +446,11 @@ struct sk_buff {
438#endif 446#endif
439 447
440 int skb_iif; 448 int skb_iif;
449
450 __u32 rxhash;
451
452 __u16 vlan_tci;
453
441#ifdef CONFIG_NET_SCHED 454#ifdef CONFIG_NET_SCHED
442 __u16 tc_index; /* traffic control index */ 455 __u16 tc_index; /* traffic control index */
443#ifdef CONFIG_NET_CLS_ACT 456#ifdef CONFIG_NET_CLS_ACT
@@ -445,8 +458,6 @@ struct sk_buff {
445#endif 458#endif
446#endif 459#endif
447 460
448 __u32 rxhash;
449
450 __u16 queue_mapping; 461 __u16 queue_mapping;
451 kmemcheck_bitfield_begin(flags2); 462 kmemcheck_bitfield_begin(flags2);
452#ifdef CONFIG_IPV6_NDISC_NODETYPE 463#ifdef CONFIG_IPV6_NDISC_NODETYPE
@@ -456,7 +467,8 @@ struct sk_buff {
456 __u8 l4_rxhash:1; 467 __u8 l4_rxhash:1;
457 __u8 wifi_acked_valid:1; 468 __u8 wifi_acked_valid:1;
458 __u8 wifi_acked:1; 469 __u8 wifi_acked:1;
459 /* 10/12 bit hole (depending on ndisc_nodetype presence) */ 470 __u8 no_fcs:1;
471 /* 9/11 bit hole (depending on ndisc_nodetype presence) */
460 kmemcheck_bitfield_end(flags2); 472 kmemcheck_bitfield_end(flags2);
461 473
462#ifdef CONFIG_NET_DMA 474#ifdef CONFIG_NET_DMA
@@ -470,8 +482,6 @@ struct sk_buff {
470 __u32 dropcount; 482 __u32 dropcount;
471 }; 483 };
472 484
473 __u16 vlan_tci;
474
475 sk_buff_data_t transport_header; 485 sk_buff_data_t transport_header;
476 sk_buff_data_t network_header; 486 sk_buff_data_t network_header;
477 sk_buff_data_t mac_header; 487 sk_buff_data_t mac_header;
@@ -876,6 +886,24 @@ static inline struct sk_buff *skb_peek(const struct sk_buff_head *list_)
876} 886}
877 887
878/** 888/**
889 * skb_peek_next - peek skb following the given one from a queue
890 * @skb: skb to start from
891 * @list_: list to peek at
892 *
893 * Returns %NULL when the end of the list is met or a pointer to the
894 * next element. The reference count is not incremented and the
895 * reference is therefore volatile. Use with caution.
896 */
897static inline struct sk_buff *skb_peek_next(struct sk_buff *skb,
898 const struct sk_buff_head *list_)
899{
900 struct sk_buff *next = skb->next;
901 if (next == (struct sk_buff *)list_)
902 next = NULL;
903 return next;
904}
905
906/**
879 * skb_peek_tail - peek at the tail of an &sk_buff_head 907 * skb_peek_tail - peek at the tail of an &sk_buff_head
880 * @list_: list to peek at 908 * @list_: list to peek at
881 * 909 *
@@ -1152,7 +1180,7 @@ static inline struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list)
1152} 1180}
1153 1181
1154 1182
1155static inline int skb_is_nonlinear(const struct sk_buff *skb) 1183static inline bool skb_is_nonlinear(const struct sk_buff *skb)
1156{ 1184{
1157 return skb->data_len; 1185 return skb->data_len;
1158} 1186}
@@ -2055,7 +2083,7 @@ static inline void skb_frag_add_head(struct sk_buff *skb, struct sk_buff *frag)
2055 for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next) 2083 for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next)
2056 2084
2057extern struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, 2085extern struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags,
2058 int *peeked, int *err); 2086 int *peeked, int *off, int *err);
2059extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, 2087extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags,
2060 int noblock, int *err); 2088 int noblock, int *err);
2061extern unsigned int datagram_poll(struct file *file, struct socket *sock, 2089extern unsigned int datagram_poll(struct file *file, struct socket *sock,
@@ -2448,12 +2476,12 @@ static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
2448} 2476}
2449#endif 2477#endif
2450 2478
2451static inline int skb_is_gso(const struct sk_buff *skb) 2479static inline bool skb_is_gso(const struct sk_buff *skb)
2452{ 2480{
2453 return skb_shinfo(skb)->gso_size; 2481 return skb_shinfo(skb)->gso_size;
2454} 2482}
2455 2483
2456static inline int skb_is_gso_v6(const struct sk_buff *skb) 2484static inline bool skb_is_gso_v6(const struct sk_buff *skb)
2457{ 2485{
2458 return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; 2486 return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6;
2459} 2487}
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index c1241c428179..2e68f5ba0389 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -232,6 +232,8 @@ enum
232 LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */ 232 LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */
233 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */ 233 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */
234 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */ 234 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */
235 LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */
236 LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */
235 __LINUX_MIB_MAX 237 __LINUX_MIB_MAX
236}; 238};
237 239
diff --git a/include/linux/socket.h b/include/linux/socket.h
index d0e77f607a79..da2d3e2543f3 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -326,11 +326,11 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
326 int offset, 326 int offset,
327 unsigned int len, __wsum *csump); 327 unsigned int len, __wsum *csump);
328 328
329extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); 329extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *address, int mode);
330extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); 330extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
331extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, 331extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,
332 int offset, int len); 332 int offset, int len);
333extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); 333extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr);
334extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); 334extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
335 335
336struct timespec; 336struct timespec;
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index dcf35b0f303a..d27683180025 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -16,6 +16,12 @@ struct pcmcia_device;
16struct ssb_bus; 16struct ssb_bus;
17struct ssb_driver; 17struct ssb_driver;
18 18
19struct ssb_sprom_core_pwr_info {
20 u8 itssi_2g, itssi_5g;
21 u8 maxpwr_2g, maxpwr_5gl, maxpwr_5g, maxpwr_5gh;
22 u16 pa_2g[4], pa_5gl[4], pa_5g[4], pa_5gh[4];
23};
24
19struct ssb_sprom { 25struct ssb_sprom {
20 u8 revision; 26 u8 revision;
21 u8 il0mac[6]; /* MAC address for 802.11b/g */ 27 u8 il0mac[6]; /* MAC address for 802.11b/g */
@@ -26,9 +32,12 @@ struct ssb_sprom {
26 u8 et0mdcport; /* MDIO for enet0 */ 32 u8 et0mdcport; /* MDIO for enet0 */
27 u8 et1mdcport; /* MDIO for enet1 */ 33 u8 et1mdcport; /* MDIO for enet1 */
28 u16 board_rev; /* Board revision number from SPROM. */ 34 u16 board_rev; /* Board revision number from SPROM. */
35 u16 board_num; /* Board number from SPROM. */
36 u16 board_type; /* Board type from SPROM. */
29 u8 country_code; /* Country Code */ 37 u8 country_code; /* Country Code */
30 u16 leddc_on_time; /* LED Powersave Duty Cycle On Count */ 38 char alpha2[2]; /* Country Code as two chars like EU or US */
31 u16 leddc_off_time; /* LED Powersave Duty Cycle Off Count */ 39 u8 leddc_on_time; /* LED Powersave Duty Cycle On Count */
40 u8 leddc_off_time; /* LED Powersave Duty Cycle Off Count */
32 u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */ 41 u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */
33 u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */ 42 u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */
34 u16 pa0b0; 43 u16 pa0b0;
@@ -47,10 +56,10 @@ struct ssb_sprom {
47 u8 gpio1; /* GPIO pin 1 */ 56 u8 gpio1; /* GPIO pin 1 */
48 u8 gpio2; /* GPIO pin 2 */ 57 u8 gpio2; /* GPIO pin 2 */
49 u8 gpio3; /* GPIO pin 3 */ 58 u8 gpio3; /* GPIO pin 3 */
50 u16 maxpwr_bg; /* 2.4GHz Amplifier Max Power (in dBm Q5.2) */ 59 u8 maxpwr_bg; /* 2.4GHz Amplifier Max Power (in dBm Q5.2) */
51 u16 maxpwr_al; /* 5.2GHz Amplifier Max Power (in dBm Q5.2) */ 60 u8 maxpwr_al; /* 5.2GHz Amplifier Max Power (in dBm Q5.2) */
52 u16 maxpwr_a; /* 5.3GHz Amplifier Max Power (in dBm Q5.2) */ 61 u8 maxpwr_a; /* 5.3GHz Amplifier Max Power (in dBm Q5.2) */
53 u16 maxpwr_ah; /* 5.8GHz Amplifier Max Power (in dBm Q5.2) */ 62 u8 maxpwr_ah; /* 5.8GHz Amplifier Max Power (in dBm Q5.2) */
54 u8 itssi_a; /* Idle TSSI Target for A-PHY */ 63 u8 itssi_a; /* Idle TSSI Target for A-PHY */
55 u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */ 64 u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */
56 u8 tri2g; /* 2.4GHz TX isolation */ 65 u8 tri2g; /* 2.4GHz TX isolation */
@@ -61,8 +70,8 @@ struct ssb_sprom {
61 u8 txpid5gl[4]; /* 4.9 - 5.1GHz TX power index */ 70 u8 txpid5gl[4]; /* 4.9 - 5.1GHz TX power index */
62 u8 txpid5g[4]; /* 5.1 - 5.5GHz TX power index */ 71 u8 txpid5g[4]; /* 5.1 - 5.5GHz TX power index */
63 u8 txpid5gh[4]; /* 5.5 - ...GHz TX power index */ 72 u8 txpid5gh[4]; /* 5.5 - ...GHz TX power index */
64 u8 rxpo2g; /* 2GHz RX power offset */ 73 s8 rxpo2g; /* 2GHz RX power offset */
65 u8 rxpo5g; /* 5GHz RX power offset */ 74 s8 rxpo5g; /* 5GHz RX power offset */
66 u8 rssisav2g; /* 2GHz RSSI params */ 75 u8 rssisav2g; /* 2GHz RSSI params */
67 u8 rssismc2g; 76 u8 rssismc2g;
68 u8 rssismf2g; 77 u8 rssismf2g;
@@ -82,16 +91,13 @@ struct ssb_sprom {
82 u16 boardflags2_hi; /* Board flags (bits 48-63) */ 91 u16 boardflags2_hi; /* Board flags (bits 48-63) */
83 /* TODO store board flags in a single u64 */ 92 /* TODO store board flags in a single u64 */
84 93
94 struct ssb_sprom_core_pwr_info core_pwr_info[4];
95
85 /* Antenna gain values for up to 4 antennas 96 /* Antenna gain values for up to 4 antennas
86 * on each band. Values in dBm/4 (Q5.2). Negative gain means the 97 * on each band. Values in dBm/4 (Q5.2). Negative gain means the
87 * loss in the connectors is bigger than the gain. */ 98 * loss in the connectors is bigger than the gain. */
88 struct { 99 struct {
89 struct { 100 s8 a0, a1, a2, a3;
90 s8 a0, a1, a2, a3;
91 } ghz24; /* 2.4GHz band */
92 struct {
93 s8 a0, a1, a2, a3;
94 } ghz5; /* 5GHz band */
95 } antenna_gain; 101 } antenna_gain;
96 102
97 struct { 103 struct {
@@ -103,7 +109,79 @@ struct ssb_sprom {
103 } ghz5; 109 } ghz5;
104 } fem; 110 } fem;
105 111
106 /* TODO - add any parameters needed from rev 2, 3, 4, 5 or 8 SPROMs */ 112 u16 mcs2gpo[8];
113 u16 mcs5gpo[8];
114 u16 mcs5glpo[8];
115 u16 mcs5ghpo[8];
116 u8 opo;
117
118 u8 rxgainerr2ga[3];
119 u8 rxgainerr5gla[3];
120 u8 rxgainerr5gma[3];
121 u8 rxgainerr5gha[3];
122 u8 rxgainerr5gua[3];
123
124 u8 noiselvl2ga[3];
125 u8 noiselvl5gla[3];
126 u8 noiselvl5gma[3];
127 u8 noiselvl5gha[3];
128 u8 noiselvl5gua[3];
129
130 u8 regrev;
131 u8 txchain;
132 u8 rxchain;
133 u8 antswitch;
134 u16 cddpo;
135 u16 stbcpo;
136 u16 bw40po;
137 u16 bwduppo;
138
139 u8 tempthresh;
140 u8 tempoffset;
141 u16 rawtempsense;
142 u8 measpower;
143 u8 tempsense_slope;
144 u8 tempcorrx;
145 u8 tempsense_option;
146 u8 freqoffset_corr;
147 u8 iqcal_swp_dis;
148 u8 hw_iqcal_en;
149 u8 elna2g;
150 u8 elna5g;
151 u8 phycal_tempdelta;
152 u8 temps_period;
153 u8 temps_hysteresis;
154 u8 measpower1;
155 u8 measpower2;
156 u8 pcieingress_war;
157
158 /* power per rate from sromrev 9 */
159 u16 cckbw202gpo;
160 u16 cckbw20ul2gpo;
161 u32 legofdmbw202gpo;
162 u32 legofdmbw20ul2gpo;
163 u32 legofdmbw205glpo;
164 u32 legofdmbw20ul5glpo;
165 u32 legofdmbw205gmpo;
166 u32 legofdmbw20ul5gmpo;
167 u32 legofdmbw205ghpo;
168 u32 legofdmbw20ul5ghpo;
169 u32 mcsbw202gpo;
170 u32 mcsbw20ul2gpo;
171 u32 mcsbw402gpo;
172 u32 mcsbw205glpo;
173 u32 mcsbw20ul5glpo;
174 u32 mcsbw405glpo;
175 u32 mcsbw205gmpo;
176 u32 mcsbw20ul5gmpo;
177 u32 mcsbw405gmpo;
178 u32 mcsbw205ghpo;
179 u32 mcsbw20ul5ghpo;
180 u32 mcsbw405ghpo;
181 u16 mcs32po;
182 u16 legofdm40duppo;
183 u8 sar2g;
184 u8 sar5g;
107}; 185};
108 186
109/* Information about the PCB the circuitry is soldered on. */ 187/* Information about the PCB the circuitry is soldered on. */
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index c814ae6eeb22..40b1ef8595ee 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -449,6 +449,39 @@
449#define SSB_SPROM8_TS_SLP_OPT_CORRX 0x00B6 449#define SSB_SPROM8_TS_SLP_OPT_CORRX 0x00B6
450#define SSB_SPROM8_FOC_HWIQ_IQSWP 0x00B8 450#define SSB_SPROM8_FOC_HWIQ_IQSWP 0x00B8
451#define SSB_SPROM8_PHYCAL_TEMPDELTA 0x00BA 451#define SSB_SPROM8_PHYCAL_TEMPDELTA 0x00BA
452
453/* There are 4 blocks with power info sharing the same layout */
454#define SSB_SROM8_PWR_INFO_CORE0 0x00C0
455#define SSB_SROM8_PWR_INFO_CORE1 0x00E0
456#define SSB_SROM8_PWR_INFO_CORE2 0x0100
457#define SSB_SROM8_PWR_INFO_CORE3 0x0120
458
459#define SSB_SROM8_2G_MAXP_ITSSI 0x00
460#define SSB_SPROM8_2G_MAXP 0x00FF
461#define SSB_SPROM8_2G_ITSSI 0xFF00
462#define SSB_SPROM8_2G_ITSSI_SHIFT 8
463#define SSB_SROM8_2G_PA_0 0x02 /* 2GHz power amp settings */
464#define SSB_SROM8_2G_PA_1 0x04
465#define SSB_SROM8_2G_PA_2 0x06
466#define SSB_SROM8_5G_MAXP_ITSSI 0x08 /* 5GHz ITSSI and 5.3GHz Max Power */
467#define SSB_SPROM8_5G_MAXP 0x00FF
468#define SSB_SPROM8_5G_ITSSI 0xFF00
469#define SSB_SPROM8_5G_ITSSI_SHIFT 8
470#define SSB_SPROM8_5GHL_MAXP 0x0A /* 5.2GHz and 5.8GHz Max Power */
471#define SSB_SPROM8_5GH_MAXP 0x00FF
472#define SSB_SPROM8_5GL_MAXP 0xFF00
473#define SSB_SPROM8_5GL_MAXP_SHIFT 8
474#define SSB_SROM8_5G_PA_0 0x0C /* 5.3GHz power amp settings */
475#define SSB_SROM8_5G_PA_1 0x0E
476#define SSB_SROM8_5G_PA_2 0x10
477#define SSB_SROM8_5GL_PA_0 0x12 /* 5.2GHz power amp settings */
478#define SSB_SROM8_5GL_PA_1 0x14
479#define SSB_SROM8_5GL_PA_2 0x16
480#define SSB_SROM8_5GH_PA_0 0x18 /* 5.8GHz power amp settings */
481#define SSB_SROM8_5GH_PA_1 0x1A
482#define SSB_SROM8_5GH_PA_2 0x1C
483
484/* TODO: Make it deprecated */
452#define SSB_SPROM8_MAXP_BG 0x00C0 /* Max Power 2GHz in path 1 */ 485#define SSB_SPROM8_MAXP_BG 0x00C0 /* Max Power 2GHz in path 1 */
453#define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */ 486#define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */
454#define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ 487#define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */
@@ -473,6 +506,7 @@
473#define SSB_SPROM8_PA1HIB0 0x00D8 /* 5.8GHz power amp settings */ 506#define SSB_SPROM8_PA1HIB0 0x00D8 /* 5.8GHz power amp settings */
474#define SSB_SPROM8_PA1HIB1 0x00DA 507#define SSB_SPROM8_PA1HIB1 0x00DA
475#define SSB_SPROM8_PA1HIB2 0x00DC 508#define SSB_SPROM8_PA1HIB2 0x00DC
509
476#define SSB_SPROM8_CCK2GPO 0x0140 /* CCK power offset */ 510#define SSB_SPROM8_CCK2GPO 0x0140 /* CCK power offset */
477#define SSB_SPROM8_OFDM2GPO 0x0142 /* 2.4GHz OFDM power offset */ 511#define SSB_SPROM8_OFDM2GPO 0x0142 /* 2.4GHz OFDM power offset */
478#define SSB_SPROM8_OFDM5GPO 0x0146 /* 5.3GHz OFDM power offset */ 512#define SSB_SPROM8_OFDM5GPO 0x0146 /* 5.3GHz OFDM power offset */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 3c7ffdb40dc6..b6c62d294380 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -464,7 +464,7 @@ struct tcp_sock {
464 const struct tcp_sock_af_ops *af_specific; 464 const struct tcp_sock_af_ops *af_specific;
465 465
466/* TCP MD5 Signature Option information */ 466/* TCP MD5 Signature Option information */
467 struct tcp_md5sig_info *md5sig_info; 467 struct tcp_md5sig_info __rcu *md5sig_info;
468#endif 468#endif
469 469
470 /* When the cookie options are generated and exchanged, then this 470 /* When the cookie options are generated and exchanged, then this
@@ -487,8 +487,7 @@ struct tcp_timewait_sock {
487 u32 tw_ts_recent; 487 u32 tw_ts_recent;
488 long tw_ts_recent_stamp; 488 long tw_ts_recent_stamp;
489#ifdef CONFIG_TCP_MD5SIG 489#ifdef CONFIG_TCP_MD5SIG
490 u16 tw_md5_keylen; 490 struct tcp_md5sig_key *tw_md5_key;
491 u8 tw_md5_key[TCP_MD5SIG_MAXKEYLEN];
492#endif 491#endif
493 /* Few sockets in timewait have cookies; in that case, then this 492 /* Few sockets in timewait have cookies; in that case, then this
494 * object holds a reference to them (tw_cookie_values->kref). 493 * object holds a reference to them (tw_cookie_values->kref).