aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/amba/serial.h3
-rw-r--r--include/linux/amd-iommu.h35
-rw-r--r--include/linux/arcdevice.h1
-rw-r--r--include/linux/ath9k_platform.h2
-rw-r--r--include/linux/audit.h7
-rw-r--r--include/linux/bcma/bcma.h26
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h1
-rw-r--r--include/linux/bcma/bcma_driver_pci.h2
-rw-r--r--include/linux/cn_proc.h13
-rw-r--r--include/linux/connector.h2
-rw-r--r--include/linux/cordic.h48
-rw-r--r--include/linux/crc8.h101
-rw-r--r--include/linux/dcbnl.h25
-rw-r--r--include/linux/dccp.h1
-rw-r--r--include/linux/device.h4
-rw-r--r--include/linux/dma-direction.h13
-rw-r--r--include/linux/dma-mapping.h10
-rw-r--r--include/linux/dmaengine.h4
-rw-r--r--include/linux/drbd_limits.h4
-rw-r--r--include/linux/etherdevice.h2
-rw-r--r--include/linux/ethtool.h35
-rw-r--r--include/linux/firewire-cdev.h78
-rw-r--r--include/linux/fscache.h21
-rw-r--r--include/linux/fsl-diu-fb.h6
-rw-r--r--include/linux/hid.h3
-rw-r--r--include/linux/ieee80211.h18
-rw-r--r--include/linux/if_ether.h5
-rw-r--r--include/linux/if_packet.h6
-rw-r--r--include/linux/if_vlan.h91
-rw-r--r--include/linux/inet_lro.h19
-rw-r--r--include/linux/iommu.h2
-rw-r--r--include/linux/irq.h3
-rw-r--r--include/linux/lguest.h2
-rw-r--r--include/linux/memory.h2
-rw-r--r--include/linux/mfd/ds1wm.h7
-rw-r--r--include/linux/mfd/tmio.h8
-rw-r--r--include/linux/mii.h2
-rw-r--r--include/linux/mlx4/cmd.h3
-rw-r--r--include/linux/mlx4/device.h60
-rw-r--r--include/linux/mlx4/qp.h8
-rw-r--r--include/linux/mmc/boot.h6
-rw-r--r--include/linux/mmc/card.h15
-rw-r--r--include/linux/mmc/core.h9
-rw-r--r--include/linux/mmc/dw_mmc.h28
-rw-r--r--include/linux/mmc/host.h26
-rw-r--r--include/linux/mmc/ioctl.h2
-rw-r--r--include/linux/mmc/mmc.h17
-rw-r--r--include/linux/mmc/pm.h2
-rw-r--r--include/linux/mmc/sd.h7
-rw-r--r--include/linux/mmc/sdhci-pltfm.h35
-rw-r--r--include/linux/mmc/sdhci-spear.h6
-rw-r--r--include/linux/mmc/sdhci.h6
-rw-r--r--include/linux/mmc/sdio.h7
-rw-r--r--include/linux/mmc/sdio_func.h7
-rw-r--r--include/linux/mmc/sdio_ids.h6
-rw-r--r--include/linux/mmc/sh_mmcif.h6
-rw-r--r--include/linux/mmc/sh_mobile_sdhi.h6
-rw-r--r--include/linux/mmc/tmio.h8
-rw-r--r--include/linux/mtd/ubi.h14
-rw-r--r--include/linux/mutex.h2
-rw-r--r--include/linux/netdevice.h61
-rw-r--r--include/linux/netfilter/ipset/ip_set.h50
-rw-r--r--include/linux/netfilter/ipset/ip_set_ahash.h154
-rw-r--r--include/linux/netfilter/ipset/ip_set_hash.h4
-rw-r--r--include/linux/netfilter/ipset/ip_set_timeout.h5
-rw-r--r--include/linux/netfilter/ipset/pfxlen.h11
-rw-r--r--include/linux/netfilter/nfnetlink.h3
-rw-r--r--include/linux/netfilter/nfnetlink_queue.h1
-rw-r--r--include/linux/netfilter/xt_set.h15
-rw-r--r--include/linux/netlink.h8
-rw-r--r--include/linux/netpoll.h2
-rw-r--r--include/linux/nfc.h126
-rw-r--r--include/linux/nl80211.h42
-rw-r--r--include/linux/of.h29
-rw-r--r--include/linux/of_address.h5
-rw-r--r--include/linux/of_gpio.h42
-rw-r--r--include/linux/of_pci.h5
-rw-r--r--include/linux/of_platform.h40
-rw-r--r--include/linux/opp.h8
-rw-r--r--include/linux/pci.h39
-rw-r--r--include/linux/pci_ids.h9
-rw-r--r--include/linux/platform_data/pxa_sdhci.h60
-rw-r--r--include/linux/plist.h55
-rw-r--r--include/linux/pm.h10
-rw-r--r--include/linux/pm_domain.h108
-rw-r--r--include/linux/pm_runtime.h38
-rw-r--r--include/linux/ptrace.h104
-rw-r--r--include/linux/random.h1
-rw-r--r--include/linux/rculist.h2
-rw-r--r--include/linux/rtmutex.h4
-rw-r--r--include/linux/rtnetlink.h2
-rw-r--r--include/linux/sched.h71
-rw-r--r--include/linux/sdla.h6
-rw-r--r--include/linux/skbuff.h73
-rw-r--r--include/linux/slab.h20
-rw-r--r--include/linux/slab_def.h52
-rw-r--r--include/linux/slob_def.h10
-rw-r--r--include/linux/slub_def.h23
-rw-r--r--include/linux/socket.h4
-rw-r--r--include/linux/spi/74x164.h2
-rw-r--r--include/linux/spi/mcp23s08.h9
-rw-r--r--include/linux/ssb/ssb.h2
-rw-r--r--include/linux/stmmac.h25
-rw-r--r--include/linux/suspend.h8
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h2
-rw-r--r--include/linux/tcp.h1
-rw-r--r--include/linux/tracehook.h385
-rw-r--r--include/linux/virtio_net.h1
-rw-r--r--include/linux/workqueue.h18
109 files changed, 1566 insertions, 1087 deletions
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h
index 5479fdc849e9..514ed45c462e 100644
--- a/include/linux/amba/serial.h
+++ b/include/linux/amba/serial.h
@@ -201,6 +201,9 @@ struct amba_pl011_data {
201 bool (*dma_filter)(struct dma_chan *chan, void *filter_param); 201 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
202 void *dma_rx_param; 202 void *dma_rx_param;
203 void *dma_tx_param; 203 void *dma_tx_param;
204 void (*init) (void);
205 void (*exit) (void);
206 void (*reset) (void);
204}; 207};
205#endif 208#endif
206 209
diff --git a/include/linux/amd-iommu.h b/include/linux/amd-iommu.h
new file mode 100644
index 000000000000..a6863a2dec1f
--- /dev/null
+++ b/include/linux/amd-iommu.h
@@ -0,0 +1,35 @@
1/*
2 * Copyright (C) 2007-2010 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 * Leo Duran <leo.duran@amd.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef _ASM_X86_AMD_IOMMU_H
21#define _ASM_X86_AMD_IOMMU_H
22
23#include <linux/irqreturn.h>
24
25#ifdef CONFIG_AMD_IOMMU
26
27extern int amd_iommu_detect(void);
28
29#else
30
31static inline int amd_iommu_detect(void) { return -ENODEV; }
32
33#endif
34
35#endif /* _ASM_X86_AMD_IOMMU_H */
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index 7d650a0e3d8f..7216b0daf544 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -20,6 +20,7 @@
20#include <linux/if_arcnet.h> 20#include <linux/if_arcnet.h>
21 21
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23#include <linux/irqreturn.h>
23 24
24#ifndef bool 25#ifndef bool
25#define bool int 26#define bool int
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
index 60a7c49dcb49..6e3f54f37844 100644
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -30,6 +30,8 @@ struct ath9k_platform_data {
30 u32 gpio_val; 30 u32 gpio_val;
31 31
32 bool is_clk_25mhz; 32 bool is_clk_25mhz;
33 int (*get_mac_revision)(void);
34 int (*external_reset)(void);
33}; 35};
34 36
35#endif /* _LINUX_ATH9K_PLATFORM_H */ 37#endif /* _LINUX_ATH9K_PLATFORM_H */
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 9d339eb27881..0c8006129fb2 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -613,6 +613,12 @@ extern void audit_log_d_path(struct audit_buffer *ab,
613extern void audit_log_key(struct audit_buffer *ab, 613extern void audit_log_key(struct audit_buffer *ab,
614 char *key); 614 char *key);
615extern void audit_log_lost(const char *message); 615extern void audit_log_lost(const char *message);
616#ifdef CONFIG_SECURITY
617extern void audit_log_secctx(struct audit_buffer *ab, u32 secid);
618#else
619#define audit_log_secctx(b,s) do { ; } while (0)
620#endif
621
616extern int audit_update_lsm_rules(void); 622extern int audit_update_lsm_rules(void);
617 623
618 /* Private API (for audit.c only) */ 624 /* Private API (for audit.c only) */
@@ -635,6 +641,7 @@ extern int audit_enabled;
635#define audit_log_untrustedstring(a,s) do { ; } while (0) 641#define audit_log_untrustedstring(a,s) do { ; } while (0)
636#define audit_log_d_path(b, p, d) do { ; } while (0) 642#define audit_log_d_path(b, p, d) do { ; } while (0)
637#define audit_log_key(b, k) do { ; } while (0) 643#define audit_log_key(b, k) do { ; } while (0)
644#define audit_log_secctx(b,s) do { ; } while (0)
638#define audit_enabled 0 645#define audit_enabled 0
639#endif 646#endif
640#endif 647#endif
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 08763e4e848f..3895aeb494a3 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -6,6 +6,7 @@
6 6
7#include <linux/bcma/bcma_driver_chipcommon.h> 7#include <linux/bcma/bcma_driver_chipcommon.h>
8#include <linux/bcma/bcma_driver_pci.h> 8#include <linux/bcma/bcma_driver_pci.h>
9#include <linux/ssb/ssb.h> /* SPROM sharing */
9 10
10#include "bcma_regs.h" 11#include "bcma_regs.h"
11 12
@@ -31,6 +32,12 @@ struct bcma_host_ops {
31 void (*write8)(struct bcma_device *core, u16 offset, u8 value); 32 void (*write8)(struct bcma_device *core, u16 offset, u8 value);
32 void (*write16)(struct bcma_device *core, u16 offset, u16 value); 33 void (*write16)(struct bcma_device *core, u16 offset, u16 value);
33 void (*write32)(struct bcma_device *core, u16 offset, u32 value); 34 void (*write32)(struct bcma_device *core, u16 offset, u32 value);
35#ifdef CONFIG_BCMA_BLOCKIO
36 void (*block_read)(struct bcma_device *core, void *buffer,
37 size_t count, u16 offset, u8 reg_width);
38 void (*block_write)(struct bcma_device *core, const void *buffer,
39 size_t count, u16 offset, u8 reg_width);
40#endif
34 /* Agent ops */ 41 /* Agent ops */
35 u32 (*aread32)(struct bcma_device *core, u16 offset); 42 u32 (*aread32)(struct bcma_device *core, u16 offset);
36 void (*awrite32)(struct bcma_device *core, u16 offset, u32 value); 43 void (*awrite32)(struct bcma_device *core, u16 offset, u32 value);
@@ -117,6 +124,8 @@ struct bcma_device {
117 struct bcma_device_id id; 124 struct bcma_device_id id;
118 125
119 struct device dev; 126 struct device dev;
127 struct device *dma_dev;
128 unsigned int irq;
120 bool dev_registered; 129 bool dev_registered;
121 130
122 u8 core_index; 131 u8 core_index;
@@ -179,6 +188,10 @@ struct bcma_bus {
179 188
180 struct bcma_drv_cc drv_cc; 189 struct bcma_drv_cc drv_cc;
181 struct bcma_drv_pci drv_pci; 190 struct bcma_drv_pci drv_pci;
191
192 /* We decided to share SPROM struct with SSB as long as we do not need
193 * any hacks for BCMA. This simplifies drivers code. */
194 struct ssb_sprom sprom;
182}; 195};
183 196
184extern inline u32 bcma_read8(struct bcma_device *core, u16 offset) 197extern inline u32 bcma_read8(struct bcma_device *core, u16 offset)
@@ -208,6 +221,18 @@ void bcma_write32(struct bcma_device *core, u16 offset, u32 value)
208{ 221{
209 core->bus->ops->write32(core, offset, value); 222 core->bus->ops->write32(core, offset, value);
210} 223}
224#ifdef CONFIG_BCMA_BLOCKIO
225extern inline void bcma_block_read(struct bcma_device *core, void *buffer,
226 size_t count, u16 offset, u8 reg_width)
227{
228 core->bus->ops->block_read(core, buffer, count, offset, reg_width);
229}
230extern inline void bcma_block_write(struct bcma_device *core, const void *buffer,
231 size_t count, u16 offset, u8 reg_width)
232{
233 core->bus->ops->block_write(core, buffer, count, offset, reg_width);
234}
235#endif
211extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset) 236extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset)
212{ 237{
213 return core->bus->ops->aread32(core, offset); 238 return core->bus->ops->aread32(core, offset);
@@ -219,6 +244,7 @@ void bcma_awrite32(struct bcma_device *core, u16 offset, u32 value)
219} 244}
220 245
221extern bool bcma_core_is_enabled(struct bcma_device *core); 246extern bool bcma_core_is_enabled(struct bcma_device *core);
247extern void bcma_core_disable(struct bcma_device *core, u32 flags);
222extern int bcma_core_enable(struct bcma_device *core, u32 flags); 248extern int bcma_core_enable(struct bcma_device *core, u32 flags);
223 249
224#endif /* LINUX_BCMA_H_ */ 250#endif /* LINUX_BCMA_H_ */
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 083c3b6cd5ce..9c5b69fc985a 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -244,6 +244,7 @@
244#define BCMA_CC_REGCTL_DATA 0x065C 244#define BCMA_CC_REGCTL_DATA 0x065C
245#define BCMA_CC_PLLCTL_ADDR 0x0660 245#define BCMA_CC_PLLCTL_ADDR 0x0660
246#define BCMA_CC_PLLCTL_DATA 0x0664 246#define BCMA_CC_PLLCTL_DATA 0x0664
247#define BCMA_CC_SPROM 0x0830 /* SPROM beginning */
247 248
248/* Data for the PMU, if available. 249/* Data for the PMU, if available.
249 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) 250 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index b7e191cf00ec..3871b668caf9 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -85,5 +85,7 @@ struct bcma_drv_pci {
85#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) 85#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val)
86 86
87extern void bcma_core_pci_init(struct bcma_drv_pci *pc); 87extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
88extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
89 struct bcma_device *core, bool enable);
88 90
89#endif /* LINUX_BCMA_DRIVER_PCI_H_ */ 91#endif /* LINUX_BCMA_DRIVER_PCI_H_ */
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
index 47dac5ea8d3a..12c517b51ca2 100644
--- a/include/linux/cn_proc.h
+++ b/include/linux/cn_proc.h
@@ -53,6 +53,7 @@ struct proc_event {
53 PROC_EVENT_UID = 0x00000004, 53 PROC_EVENT_UID = 0x00000004,
54 PROC_EVENT_GID = 0x00000040, 54 PROC_EVENT_GID = 0x00000040,
55 PROC_EVENT_SID = 0x00000080, 55 PROC_EVENT_SID = 0x00000080,
56 PROC_EVENT_PTRACE = 0x00000100,
56 /* "next" should be 0x00000400 */ 57 /* "next" should be 0x00000400 */
57 /* "last" is the last process event: exit */ 58 /* "last" is the last process event: exit */
58 PROC_EVENT_EXIT = 0x80000000 59 PROC_EVENT_EXIT = 0x80000000
@@ -95,6 +96,13 @@ struct proc_event {
95 __kernel_pid_t process_tgid; 96 __kernel_pid_t process_tgid;
96 } sid; 97 } sid;
97 98
99 struct ptrace_proc_event {
100 __kernel_pid_t process_pid;
101 __kernel_pid_t process_tgid;
102 __kernel_pid_t tracer_pid;
103 __kernel_pid_t tracer_tgid;
104 } ptrace;
105
98 struct exit_proc_event { 106 struct exit_proc_event {
99 __kernel_pid_t process_pid; 107 __kernel_pid_t process_pid;
100 __kernel_pid_t process_tgid; 108 __kernel_pid_t process_tgid;
@@ -109,6 +117,7 @@ void proc_fork_connector(struct task_struct *task);
109void proc_exec_connector(struct task_struct *task); 117void proc_exec_connector(struct task_struct *task);
110void proc_id_connector(struct task_struct *task, int which_id); 118void proc_id_connector(struct task_struct *task, int which_id);
111void proc_sid_connector(struct task_struct *task); 119void proc_sid_connector(struct task_struct *task);
120void proc_ptrace_connector(struct task_struct *task, int which_id);
112void proc_exit_connector(struct task_struct *task); 121void proc_exit_connector(struct task_struct *task);
113#else 122#else
114static inline void proc_fork_connector(struct task_struct *task) 123static inline void proc_fork_connector(struct task_struct *task)
@@ -124,6 +133,10 @@ static inline void proc_id_connector(struct task_struct *task,
124static inline void proc_sid_connector(struct task_struct *task) 133static inline void proc_sid_connector(struct task_struct *task)
125{} 134{}
126 135
136static inline void proc_ptrace_connector(struct task_struct *task,
137 int ptrace_id)
138{}
139
127static inline void proc_exit_connector(struct task_struct *task) 140static inline void proc_exit_connector(struct task_struct *task)
128{} 141{}
129#endif /* CONFIG_PROC_EVENTS */ 142#endif /* CONFIG_PROC_EVENTS */
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 7c60d0942adb..f696bccd48cb 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -44,7 +44,7 @@
44#define CN_VAL_DRBD 0x1 44#define CN_VAL_DRBD 0x1
45#define CN_KVP_IDX 0x9 /* HyperV KVP */ 45#define CN_KVP_IDX 0x9 /* HyperV KVP */
46 46
47#define CN_NETLINK_USERS 9 47#define CN_NETLINK_USERS 10 /* Highest index + 1 */
48 48
49/* 49/*
50 * Maximum connector's message size. 50 * Maximum connector's message size.
diff --git a/include/linux/cordic.h b/include/linux/cordic.h
new file mode 100644
index 000000000000..f932093e20c2
--- /dev/null
+++ b/include/linux/cordic.h
@@ -0,0 +1,48 @@
1/*
2 * Copyright (c) 2011 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16#ifndef __CORDIC_H_
17#define __CORDIC_H_
18
19#include <linux/types.h>
20
21/**
22 * struct cordic_iq - i/q coordinate.
23 *
24 * @i: real part of coordinate (in phase).
25 * @q: imaginary part of coordinate (quadrature).
26 */
27struct cordic_iq {
28 s32 i;
29 s32 q;
30};
31
32/**
33 * cordic_calc_iq() - calculates the i/q coordinate for given angle.
34 *
35 * @theta: angle in degrees for which i/q coordinate is to be calculated.
36 * @coord: function output parameter holding the i/q coordinate.
37 *
38 * The function calculates the i/q coordinate for a given angle using
39 * cordic algorithm. The coordinate consists of a real (i) and an
40 * imaginary (q) part. The real part is essentially the cosine of the
41 * angle and the imaginary part is the sine of the angle. The returned
42 * values are scaled by 2^16 for precision. The range for theta is
43 * for -180 degrees to +180 degrees. Passed values outside this range are
44 * converted before doing the actual calculation.
45 */
46struct cordic_iq cordic_calc_iq(s32 theta);
47
48#endif /* __CORDIC_H_ */
diff --git a/include/linux/crc8.h b/include/linux/crc8.h
new file mode 100644
index 000000000000..13c8dabb0441
--- /dev/null
+++ b/include/linux/crc8.h
@@ -0,0 +1,101 @@
1/*
2 * Copyright (c) 2011 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16#ifndef __CRC8_H_
17#define __CRC8_H_
18
19#include <linux/types.h>
20
21/* see usage of this value in crc8() description */
22#define CRC8_INIT_VALUE 0xFF
23
24/*
25 * Return value of crc8() indicating valid message+crc. This is true
26 * if a CRC is inverted before transmission. The CRC computed over the
27 * whole received bitstream is _table[x], where x is the bit pattern
28 * of the modification (almost always 0xff).
29 */
30#define CRC8_GOOD_VALUE(_table) (_table[0xFF])
31
32/* required table size for crc8 algorithm */
33#define CRC8_TABLE_SIZE 256
34
35/* helper macro assuring right table size is used */
36#define DECLARE_CRC8_TABLE(_table) \
37 static u8 _table[CRC8_TABLE_SIZE]
38
39/**
40 * crc8_populate_lsb - fill crc table for given polynomial in regular bit order.
41 *
42 * @table: table to be filled.
43 * @polynomial: polynomial for which table is to be filled.
44 *
45 * This function fills the provided table according the polynomial provided for
46 * regular bit order (lsb first). Polynomials in CRC algorithms are typically
47 * represented as shown below.
48 *
49 * poly = x^8 + x^7 + x^6 + x^4 + x^2 + 1
50 *
51 * For lsb first direction x^7 maps to the lsb. So the polynomial is as below.
52 *
53 * - lsb first: poly = 10101011(1) = 0xAB
54 */
55void crc8_populate_lsb(u8 table[CRC8_TABLE_SIZE], u8 polynomial);
56
57/**
58 * crc8_populate_msb - fill crc table for given polynomial in reverse bit order.
59 *
60 * @table: table to be filled.
61 * @polynomial: polynomial for which table is to be filled.
62 *
63 * This function fills the provided table according the polynomial provided for
64 * reverse bit order (msb first). Polynomials in CRC algorithms are typically
65 * represented as shown below.
66 *
67 * poly = x^8 + x^7 + x^6 + x^4 + x^2 + 1
68 *
69 * For msb first direction x^7 maps to the msb. So the polynomial is as below.
70 *
71 * - msb first: poly = (1)11010101 = 0xD5
72 */
73void crc8_populate_msb(u8 table[CRC8_TABLE_SIZE], u8 polynomial);
74
75/**
76 * crc8() - calculate a crc8 over the given input data.
77 *
78 * @table: crc table used for calculation.
79 * @pdata: pointer to data buffer.
80 * @nbytes: number of bytes in data buffer.
81 * @crc: previous returned crc8 value.
82 *
83 * The CRC8 is calculated using the polynomial given in crc8_populate_msb()
84 * or crc8_populate_lsb().
85 *
86 * The caller provides the initial value (either %CRC8_INIT_VALUE
87 * or the previous returned value) to allow for processing of
88 * discontiguous blocks of data. When generating the CRC the
89 * caller is responsible for complementing the final return value
90 * and inserting it into the byte stream. When validating a byte
91 * stream (including CRC8), a final return value of %CRC8_GOOD_VALUE
92 * indicates the byte stream data can be considered valid.
93 *
94 * Reference:
95 * "A Painless Guide to CRC Error Detection Algorithms", ver 3, Aug 1993
96 * Williams, Ross N., ross<at>ross.net
97 * (see URL http://www.ross.net/crc/download/crc_v3.txt).
98 */
99u8 crc8(const u8 table[CRC8_TABLE_SIZE], u8 *pdata, size_t nbytes, u8 crc);
100
101#endif /* __CRC8_H_ */
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index c52280047e2c..65a2562f66b4 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -203,6 +203,7 @@ struct dcbmsg {
203 * @DCB_CMD_GFEATCFG: get DCBX features flags 203 * @DCB_CMD_GFEATCFG: get DCBX features flags
204 * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags 204 * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
205 * @DCB_CMD_CEE_GET: get CEE aggregated configuration 205 * @DCB_CMD_CEE_GET: get CEE aggregated configuration
206 * @DCB_CMD_IEEE_DEL: delete IEEE 802.1Qaz configuration
206 */ 207 */
207enum dcbnl_commands { 208enum dcbnl_commands {
208 DCB_CMD_UNDEFINED, 209 DCB_CMD_UNDEFINED,
@@ -246,6 +247,7 @@ enum dcbnl_commands {
246 DCB_CMD_SFEATCFG, 247 DCB_CMD_SFEATCFG,
247 248
248 DCB_CMD_CEE_GET, 249 DCB_CMD_CEE_GET,
250 DCB_CMD_IEEE_DEL,
249 251
250 __DCB_CMD_ENUM_MAX, 252 __DCB_CMD_ENUM_MAX,
251 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, 253 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
@@ -331,18 +333,30 @@ enum ieee_attrs_app {
331#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1) 333#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
332 334
333/** 335/**
334 * enum cee_attrs - CEE DCBX get attributes 336 * enum cee_attrs - CEE DCBX get attributes.
335 * 337 *
336 * @DCB_ATTR_CEE_UNSPEC: unspecified 338 * @DCB_ATTR_CEE_UNSPEC: unspecified
337 * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only 339 * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
338 * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only 340 * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
339 * @DCB_ATTR_CEE_PEER_APP: peer APP tlv - get only 341 * @DCB_ATTR_CEE_PEER_APP_TABLE: peer APP tlv - get only
342 * @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG)
343 * @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG)
344 * @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG)
345 * @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP)
346 * @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG)
347 *
348 * An aggregated collection of the cee std negotiated parameters.
340 */ 349 */
341enum cee_attrs { 350enum cee_attrs {
342 DCB_ATTR_CEE_UNSPEC, 351 DCB_ATTR_CEE_UNSPEC,
343 DCB_ATTR_CEE_PEER_PG, 352 DCB_ATTR_CEE_PEER_PG,
344 DCB_ATTR_CEE_PEER_PFC, 353 DCB_ATTR_CEE_PEER_PFC,
345 DCB_ATTR_CEE_PEER_APP_TABLE, 354 DCB_ATTR_CEE_PEER_APP_TABLE,
355 DCB_ATTR_CEE_TX_PG,
356 DCB_ATTR_CEE_RX_PG,
357 DCB_ATTR_CEE_PFC,
358 DCB_ATTR_CEE_APP_TABLE,
359 DCB_ATTR_CEE_FEAT,
346 __DCB_ATTR_CEE_MAX 360 __DCB_ATTR_CEE_MAX
347}; 361};
348#define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1) 362#define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
@@ -355,6 +369,13 @@ enum peer_app_attr {
355}; 369};
356#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1) 370#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
357 371
372enum cee_attrs_app {
373 DCB_ATTR_CEE_APP_UNSPEC,
374 DCB_ATTR_CEE_APP,
375 __DCB_ATTR_CEE_APP_MAX
376};
377#define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1)
378
358/** 379/**
359 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs 380 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
360 * 381 *
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index d638e85dc501..710c04302a15 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -236,6 +236,7 @@ enum dccp_packet_dequeueing_policy {
236#ifdef __KERNEL__ 236#ifdef __KERNEL__
237 237
238#include <linux/in.h> 238#include <linux/in.h>
239#include <linux/interrupt.h>
239#include <linux/ktime.h> 240#include <linux/ktime.h>
240#include <linux/list.h> 241#include <linux/list.h>
241#include <linux/uio.h> 242#include <linux/uio.h>
diff --git a/include/linux/device.h b/include/linux/device.h
index e4f62d8896b7..160d4ddb2499 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -516,7 +516,7 @@ struct device_dma_parameters {
516 * minimizes board-specific #ifdefs in drivers. 516 * minimizes board-specific #ifdefs in drivers.
517 * @power: For device power management. 517 * @power: For device power management.
518 * See Documentation/power/devices.txt for details. 518 * See Documentation/power/devices.txt for details.
519 * @pwr_domain: Provide callbacks that are executed during system suspend, 519 * @pm_domain: Provide callbacks that are executed during system suspend,
520 * hibernation, system resume and during runtime PM transitions 520 * hibernation, system resume and during runtime PM transitions
521 * along with subsystem-level and driver-level callbacks. 521 * along with subsystem-level and driver-level callbacks.
522 * @numa_node: NUMA node this device is close to. 522 * @numa_node: NUMA node this device is close to.
@@ -567,7 +567,7 @@ struct device {
567 void *platform_data; /* Platform specific data, device 567 void *platform_data; /* Platform specific data, device
568 core doesn't touch it */ 568 core doesn't touch it */
569 struct dev_pm_info power; 569 struct dev_pm_info power;
570 struct dev_power_domain *pwr_domain; 570 struct dev_pm_domain *pm_domain;
571 571
572#ifdef CONFIG_NUMA 572#ifdef CONFIG_NUMA
573 int numa_node; /* NUMA node this device is close to */ 573 int numa_node; /* NUMA node this device is close to */
diff --git a/include/linux/dma-direction.h b/include/linux/dma-direction.h
new file mode 100644
index 000000000000..95b6a82f5951
--- /dev/null
+++ b/include/linux/dma-direction.h
@@ -0,0 +1,13 @@
1#ifndef _LINUX_DMA_DIRECTION_H
2#define _LINUX_DMA_DIRECTION_H
3/*
4 * These definitions mirror those in pci.h, so they can be used
5 * interchangeably with their PCI_ counterparts.
6 */
7enum dma_data_direction {
8 DMA_BIDIRECTIONAL = 0,
9 DMA_TO_DEVICE = 1,
10 DMA_FROM_DEVICE = 2,
11 DMA_NONE = 3,
12};
13#endif
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ba8319ae5fcc..1a167c48d84d 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -4,17 +4,9 @@
4#include <linux/device.h> 4#include <linux/device.h>
5#include <linux/err.h> 5#include <linux/err.h>
6#include <linux/dma-attrs.h> 6#include <linux/dma-attrs.h>
7#include <linux/dma-direction.h>
7#include <linux/scatterlist.h> 8#include <linux/scatterlist.h>
8 9
9/* These definitions mirror those in pci.h, so they can be used
10 * interchangeably with their PCI_ counterparts */
11enum dma_data_direction {
12 DMA_BIDIRECTIONAL = 0,
13 DMA_TO_DEVICE = 1,
14 DMA_FROM_DEVICE = 2,
15 DMA_NONE = 3,
16};
17
18struct dma_map_ops { 10struct dma_map_ops {
19 void* (*alloc_coherent)(struct device *dev, size_t size, 11 void* (*alloc_coherent)(struct device *dev, size_t size,
20 dma_addr_t *dma_handle, gfp_t gfp); 12 dma_addr_t *dma_handle, gfp_t gfp);
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index eee7addec282..8fbf40e0713c 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -23,7 +23,9 @@
23 23
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/uio.h> 25#include <linux/uio.h>
26#include <linux/dma-mapping.h> 26#include <linux/dma-direction.h>
27
28struct scatterlist;
27 29
28/** 30/**
29 * typedef dma_cookie_t - an opaque DMA cookie 31 * typedef dma_cookie_t - an opaque DMA cookie
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h
index 246f576c981d..447c36752385 100644
--- a/include/linux/drbd_limits.h
+++ b/include/linux/drbd_limits.h
@@ -117,10 +117,10 @@
117/* drbdsetup XY resize -d Z 117/* drbdsetup XY resize -d Z
118 * you are free to reduce the device size to nothing, if you want to. 118 * you are free to reduce the device size to nothing, if you want to.
119 * the upper limit with 64bit kernel, enough ram and flexible meta data 119 * the upper limit with 64bit kernel, enough ram and flexible meta data
120 * is 16 TB, currently. */ 120 * is 1 PiB, currently. */
121/* DRBD_MAX_SECTORS */ 121/* DRBD_MAX_SECTORS */
122#define DRBD_DISK_SIZE_SECT_MIN 0 122#define DRBD_DISK_SIZE_SECT_MIN 0
123#define DRBD_DISK_SIZE_SECT_MAX (16 * (2LLU << 30)) 123#define DRBD_DISK_SIZE_SECT_MAX (1 * (2LLU << 40))
124#define DRBD_DISK_SIZE_SECT_DEF 0 /* = disabled = no user size... */ 124#define DRBD_DISK_SIZE_SECT_DEF 0 /* = disabled = no user size... */
125 125
126#define DRBD_ON_IO_ERROR_DEF EP_PASS_ON 126#define DRBD_ON_IO_ERROR_DEF EP_PASS_ON
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index ab68f785fd19..05955cf09937 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -38,7 +38,7 @@ extern int eth_header(struct sk_buff *skb, struct net_device *dev,
38 const void *daddr, const void *saddr, unsigned len); 38 const void *daddr, const void *saddr, unsigned len);
39extern int eth_rebuild_header(struct sk_buff *skb); 39extern int eth_rebuild_header(struct sk_buff *skb);
40extern int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); 40extern int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
41extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh); 41extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type);
42extern void eth_header_cache_update(struct hh_cache *hh, 42extern void eth_header_cache_update(struct hh_cache *hh,
43 const struct net_device *dev, 43 const struct net_device *dev,
44 const unsigned char *haddr); 44 const unsigned char *haddr);
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 439b173c5882..c6e427ab65fe 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -287,7 +287,7 @@ enum ethtool_stringset {
287 ETH_SS_TEST = 0, 287 ETH_SS_TEST = 0,
288 ETH_SS_STATS, 288 ETH_SS_STATS,
289 ETH_SS_PRIV_FLAGS, 289 ETH_SS_PRIV_FLAGS,
290 ETH_SS_NTUPLE_FILTERS, 290 ETH_SS_NTUPLE_FILTERS, /* Do not use, GRXNTUPLE is now deprecated */
291 ETH_SS_FEATURES, 291 ETH_SS_FEATURES,
292}; 292};
293 293
@@ -310,9 +310,21 @@ struct ethtool_sset_info {
310 __u32's, etc. */ 310 __u32's, etc. */
311}; 311};
312 312
313/**
314 * enum ethtool_test_flags - flags definition of ethtool_test
315 * @ETH_TEST_FL_OFFLINE: if set perform online and offline tests, otherwise
316 * only online tests.
317 * @ETH_TEST_FL_FAILED: Driver set this flag if test fails.
318 * @ETH_TEST_FL_EXTERNAL_LB: Application request to perform external loopback
319 * test.
320 * @ETH_TEST_FL_EXTERNAL_LB_DONE: Driver performed the external loopback test
321 */
322
313enum ethtool_test_flags { 323enum ethtool_test_flags {
314 ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */ 324 ETH_TEST_FL_OFFLINE = (1 << 0),
315 ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */ 325 ETH_TEST_FL_FAILED = (1 << 1),
326 ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
327 ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
316}; 328};
317 329
318/* for requesting NIC test and getting results*/ 330/* for requesting NIC test and getting results*/
@@ -714,18 +726,6 @@ enum ethtool_sfeatures_retval_bits {
714/* needed by dev_disable_lro() */ 726/* needed by dev_disable_lro() */
715extern int __ethtool_set_flags(struct net_device *dev, u32 flags); 727extern int __ethtool_set_flags(struct net_device *dev, u32 flags);
716 728
717struct ethtool_rx_ntuple_flow_spec_container {
718 struct ethtool_rx_ntuple_flow_spec fs;
719 struct list_head list;
720};
721
722struct ethtool_rx_ntuple_list {
723#define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024
724#define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14
725 struct list_head list;
726 unsigned int count;
727};
728
729/** 729/**
730 * enum ethtool_phys_id_state - indicator state for physical identification 730 * enum ethtool_phys_id_state - indicator state for physical identification
731 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated 731 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated
@@ -758,7 +758,6 @@ u32 ethtool_op_get_ufo(struct net_device *dev);
758int ethtool_op_set_ufo(struct net_device *dev, u32 data); 758int ethtool_op_set_ufo(struct net_device *dev, u32 data);
759u32 ethtool_op_get_flags(struct net_device *dev); 759u32 ethtool_op_get_flags(struct net_device *dev);
760int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported); 760int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported);
761void ethtool_ntuple_flush(struct net_device *dev);
762bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported); 761bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
763 762
764/** 763/**
@@ -865,7 +864,6 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
865 * error code or zero. 864 * error code or zero.
866 * @set_rx_ntuple: Set an RX n-tuple rule. Returns a negative error code 865 * @set_rx_ntuple: Set an RX n-tuple rule. Returns a negative error code
867 * or zero. 866 * or zero.
868 * @get_rx_ntuple: Deprecated.
869 * @get_rxfh_indir: Get the contents of the RX flow hash indirection table. 867 * @get_rxfh_indir: Get the contents of the RX flow hash indirection table.
870 * Returns a negative error code or zero. 868 * Returns a negative error code or zero.
871 * @set_rxfh_indir: Set the contents of the RX flow hash indirection table. 869 * @set_rxfh_indir: Set the contents of the RX flow hash indirection table.
@@ -944,7 +942,6 @@ struct ethtool_ops {
944 int (*reset)(struct net_device *, u32 *); 942 int (*reset)(struct net_device *, u32 *);
945 int (*set_rx_ntuple)(struct net_device *, 943 int (*set_rx_ntuple)(struct net_device *,
946 struct ethtool_rx_ntuple *); 944 struct ethtool_rx_ntuple *);
947 int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *);
948 int (*get_rxfh_indir)(struct net_device *, 945 int (*get_rxfh_indir)(struct net_device *,
949 struct ethtool_rxfh_indir *); 946 struct ethtool_rxfh_indir *);
950 int (*set_rxfh_indir)(struct net_device *, 947 int (*set_rxfh_indir)(struct net_device *,
@@ -1017,7 +1014,7 @@ struct ethtool_ops {
1017#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ 1014#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
1018#define ETHTOOL_RESET 0x00000034 /* Reset hardware */ 1015#define ETHTOOL_RESET 0x00000034 /* Reset hardware */
1019#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ 1016#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
1020#define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ 1017#define ETHTOOL_GRXNTUPLE 0x00000036 /* deprecated */
1021#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ 1018#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
1022#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */ 1019#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
1023#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */ 1020#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index 4ff09889c5c0..357dbfc2829e 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -30,10 +30,13 @@
30#include <linux/types.h> 30#include <linux/types.h>
31#include <linux/firewire-constants.h> 31#include <linux/firewire-constants.h>
32 32
33/* available since kernel version 2.6.22 */
33#define FW_CDEV_EVENT_BUS_RESET 0x00 34#define FW_CDEV_EVENT_BUS_RESET 0x00
34#define FW_CDEV_EVENT_RESPONSE 0x01 35#define FW_CDEV_EVENT_RESPONSE 0x01
35#define FW_CDEV_EVENT_REQUEST 0x02 36#define FW_CDEV_EVENT_REQUEST 0x02
36#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 37#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03
38
39/* available since kernel version 2.6.30 */
37#define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04 40#define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04
38#define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05 41#define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05
39 42
@@ -120,24 +123,11 @@ struct fw_cdev_event_response {
120 123
121/** 124/**
122 * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2 125 * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2
123 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl
124 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST 126 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST
125 * @tcode: See &fw_cdev_event_request2
126 * @offset: See &fw_cdev_event_request2
127 * @handle: See &fw_cdev_event_request2
128 * @length: See &fw_cdev_event_request2
129 * @data: See &fw_cdev_event_request2
130 * 127 *
131 * This event is sent instead of &fw_cdev_event_request2 if the kernel or 128 * This event is sent instead of &fw_cdev_event_request2 if the kernel or
132 * the client implements ABI version <= 3. 129 * the client implements ABI version <= 3. &fw_cdev_event_request lacks
133 * 130 * essential information; use &fw_cdev_event_request2 instead.
134 * Unlike &fw_cdev_event_request2, the sender identity cannot be established,
135 * broadcast write requests cannot be distinguished from unicast writes, and
136 * @tcode of lock requests is %TCODE_LOCK_REQUEST.
137 *
138 * Requests to the FCP_REQUEST or FCP_RESPONSE register are responded to as
139 * with &fw_cdev_event_request2, except in kernel 2.6.32 and older which send
140 * the response packet of the client's %FW_CDEV_IOC_SEND_RESPONSE ioctl.
141 */ 131 */
142struct fw_cdev_event_request { 132struct fw_cdev_event_request {
143 __u64 closure; 133 __u64 closure;
@@ -452,29 +442,31 @@ union fw_cdev_event {
452 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and 442 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and
453 * %FW_CDEV_IOC_SET_ISO_CHANNELS 443 * %FW_CDEV_IOC_SET_ISO_CHANNELS
454 */ 444 */
455#define FW_CDEV_VERSION 3 /* Meaningless; don't use this macro. */
456 445
457/** 446/**
458 * struct fw_cdev_get_info - General purpose information ioctl 447 * struct fw_cdev_get_info - General purpose information ioctl
459 * @version: The version field is just a running serial number. Both an 448 * @version: The version field is just a running serial number. Both an
460 * input parameter (ABI version implemented by the client) and 449 * input parameter (ABI version implemented by the client) and
461 * output parameter (ABI version implemented by the kernel). 450 * output parameter (ABI version implemented by the kernel).
462 * A client must not fill in an %FW_CDEV_VERSION defined from an 451 * A client shall fill in the ABI @version for which the client
463 * included kernel header file but the actual version for which 452 * was implemented. This is necessary for forward compatibility.
464 * the client was implemented. This is necessary for forward 453 * @rom_length: If @rom is non-zero, up to @rom_length bytes of Configuration
465 * compatibility. We never break backwards compatibility, but
466 * may add more structs, events, and ioctls in later revisions.
467 * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration
468 * ROM will be copied into that user space address. In either 454 * ROM will be copied into that user space address. In either
469 * case, @rom_length is updated with the actual length of the 455 * case, @rom_length is updated with the actual length of the
470 * configuration ROM. 456 * Configuration ROM.
471 * @rom: If non-zero, address of a buffer to be filled by a copy of the 457 * @rom: If non-zero, address of a buffer to be filled by a copy of the
472 * device's configuration ROM 458 * device's Configuration ROM
473 * @bus_reset: If non-zero, address of a buffer to be filled by a 459 * @bus_reset: If non-zero, address of a buffer to be filled by a
474 * &struct fw_cdev_event_bus_reset with the current state 460 * &struct fw_cdev_event_bus_reset with the current state
475 * of the bus. This does not cause a bus reset to happen. 461 * of the bus. This does not cause a bus reset to happen.
476 * @bus_reset_closure: Value of &closure in this and subsequent bus reset events 462 * @bus_reset_closure: Value of &closure in this and subsequent bus reset events
477 * @card: The index of the card this device belongs to 463 * @card: The index of the card this device belongs to
464 *
465 * The %FW_CDEV_IOC_GET_INFO ioctl is usually the very first one which a client
466 * performs right after it opened a /dev/fw* file.
467 *
468 * As a side effect, reception of %FW_CDEV_EVENT_BUS_RESET events to be read(2)
469 * is started by this ioctl.
478 */ 470 */
479struct fw_cdev_get_info { 471struct fw_cdev_get_info {
480 __u32 version; 472 __u32 version;
@@ -612,7 +604,7 @@ struct fw_cdev_initiate_bus_reset {
612 * @handle: Handle to the descriptor, written by the kernel 604 * @handle: Handle to the descriptor, written by the kernel
613 * 605 *
614 * Add a descriptor block and optionally a preceding immediate key to the local 606 * Add a descriptor block and optionally a preceding immediate key to the local
615 * node's configuration ROM. 607 * node's Configuration ROM.
616 * 608 *
617 * The @key field specifies the upper 8 bits of the descriptor root directory 609 * The @key field specifies the upper 8 bits of the descriptor root directory
618 * pointer and the @data and @length fields specify the contents. The @key 610 * pointer and the @data and @length fields specify the contents. The @key
@@ -627,9 +619,9 @@ struct fw_cdev_initiate_bus_reset {
627 * If successful, the kernel adds the descriptor and writes back a @handle to 619 * If successful, the kernel adds the descriptor and writes back a @handle to
628 * the kernel-side object to be used for later removal of the descriptor block 620 * the kernel-side object to be used for later removal of the descriptor block
629 * and immediate key. The kernel will also generate a bus reset to signal the 621 * and immediate key. The kernel will also generate a bus reset to signal the
630 * change of the configuration ROM to other nodes. 622 * change of the Configuration ROM to other nodes.
631 * 623 *
632 * This ioctl affects the configuration ROMs of all local nodes. 624 * This ioctl affects the Configuration ROMs of all local nodes.
633 * The ioctl only succeeds on device files which represent a local node. 625 * The ioctl only succeeds on device files which represent a local node.
634 */ 626 */
635struct fw_cdev_add_descriptor { 627struct fw_cdev_add_descriptor {
@@ -641,13 +633,13 @@ struct fw_cdev_add_descriptor {
641}; 633};
642 634
643/** 635/**
644 * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM 636 * struct fw_cdev_remove_descriptor - Remove contents from the Configuration ROM
645 * @handle: Handle to the descriptor, as returned by the kernel when the 637 * @handle: Handle to the descriptor, as returned by the kernel when the
646 * descriptor was added 638 * descriptor was added
647 * 639 *
648 * Remove a descriptor block and accompanying immediate key from the local 640 * Remove a descriptor block and accompanying immediate key from the local
649 * nodes' configuration ROMs. The kernel will also generate a bus reset to 641 * nodes' Configuration ROMs. The kernel will also generate a bus reset to
650 * signal the change of the configuration ROM to other nodes. 642 * signal the change of the Configuration ROM to other nodes.
651 */ 643 */
652struct fw_cdev_remove_descriptor { 644struct fw_cdev_remove_descriptor {
653 __u32 handle; 645 __u32 handle;
@@ -863,13 +855,8 @@ struct fw_cdev_stop_iso {
863 * @local_time: system time, in microseconds since the Epoch 855 * @local_time: system time, in microseconds since the Epoch
864 * @cycle_timer: Cycle Time register contents 856 * @cycle_timer: Cycle Time register contents
865 * 857 *
866 * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer 858 * Same as %FW_CDEV_IOC_GET_CYCLE_TIMER2, but fixed to use %CLOCK_REALTIME
867 * and also the system clock (%CLOCK_REALTIME). This allows to express the 859 * and only with microseconds resolution.
868 * receive time of an isochronous packet as a system time.
869 *
870 * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and
871 * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register
872 * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394.
873 * 860 *
874 * In version 1 and 2 of the ABI, this ioctl returned unreliable (non- 861 * In version 1 and 2 of the ABI, this ioctl returned unreliable (non-
875 * monotonic) @cycle_timer values on certain controllers. 862 * monotonic) @cycle_timer values on certain controllers.
@@ -886,10 +873,17 @@ struct fw_cdev_get_cycle_timer {
886 * @clk_id: input parameter, clock from which to get the system time 873 * @clk_id: input parameter, clock from which to get the system time
887 * @cycle_timer: Cycle Time register contents 874 * @cycle_timer: Cycle Time register contents
888 * 875 *
889 * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 works like 876 * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 ioctl reads the isochronous cycle timer
890 * %FW_CDEV_IOC_GET_CYCLE_TIMER but lets you choose a clock like with POSIX' 877 * and also the system clock. This allows to correlate reception time of
891 * clock_gettime function. Supported @clk_id values are POSIX' %CLOCK_REALTIME 878 * isochronous packets with system time.
892 * and %CLOCK_MONOTONIC and Linux' %CLOCK_MONOTONIC_RAW. 879 *
880 * @clk_id lets you choose a clock like with POSIX' clock_gettime function.
881 * Supported @clk_id values are POSIX' %CLOCK_REALTIME and %CLOCK_MONOTONIC
882 * and Linux' %CLOCK_MONOTONIC_RAW.
883 *
884 * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and
885 * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register
886 * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394.
893 */ 887 */
894struct fw_cdev_get_cycle_timer2 { 888struct fw_cdev_get_cycle_timer2 {
895 __s64 tv_sec; 889 __s64 tv_sec;
@@ -1011,4 +1005,6 @@ struct fw_cdev_receive_phy_packets {
1011 __u64 closure; 1005 __u64 closure;
1012}; 1006};
1013 1007
1008#define FW_CDEV_VERSION 3 /* Meaningless legacy macro; don't use it. */
1009
1014#endif /* _LINUX_FIREWIRE_CDEV_H */ 1010#endif /* _LINUX_FIREWIRE_CDEV_H */
diff --git a/include/linux/fscache.h b/include/linux/fscache.h
index 7c4d72f5581f..9ec20dec3353 100644
--- a/include/linux/fscache.h
+++ b/include/linux/fscache.h
@@ -204,6 +204,8 @@ extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *);
204extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); 204extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *);
205extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *, 205extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *,
206 gfp_t); 206 gfp_t);
207extern void __fscache_uncache_all_inode_pages(struct fscache_cookie *,
208 struct inode *);
207 209
208/** 210/**
209 * fscache_register_netfs - Register a filesystem as desiring caching services 211 * fscache_register_netfs - Register a filesystem as desiring caching services
@@ -643,4 +645,23 @@ bool fscache_maybe_release_page(struct fscache_cookie *cookie,
643 return false; 645 return false;
644} 646}
645 647
648/**
649 * fscache_uncache_all_inode_pages - Uncache all an inode's pages
650 * @cookie: The cookie representing the inode's cache object.
651 * @inode: The inode to uncache pages from.
652 *
653 * Uncache all the pages in an inode that are marked PG_fscache, assuming them
654 * to be associated with the given cookie.
655 *
656 * This function may sleep. It will wait for pages that are being written out
657 * and will wait whilst the PG_fscache mark is removed by the cache.
658 */
659static inline
660void fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
661 struct inode *inode)
662{
663 if (fscache_cookie_valid(cookie))
664 __fscache_uncache_all_inode_pages(cookie, inode);
665}
666
646#endif /* _LINUX_FSCACHE_H */ 667#endif /* _LINUX_FSCACHE_H */
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
index 781d4671415f..daa9952d2174 100644
--- a/include/linux/fsl-diu-fb.h
+++ b/include/linux/fsl-diu-fb.h
@@ -24,12 +24,6 @@
24 * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory() 24 * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory()
25 */ 25 */
26#define MEM_ALLOC_THRESHOLD (1024*768*4+32) 26#define MEM_ALLOC_THRESHOLD (1024*768*4+32)
27/* Minimum value that the pixel clock can be set to in pico seconds
28 * This is determined by platform clock/3 where the minimum platform
29 * clock is 533MHz. This gives 5629 pico seconds.
30 */
31#define MIN_PIX_CLK 5629
32#define MAX_PIX_CLK 96096
33 27
34#include <linux/types.h> 28#include <linux/types.h>
35 29
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 42f7e2fb501f..9cf8e7ae7450 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -453,7 +453,8 @@ struct hid_input {
453 453
454enum hid_type { 454enum hid_type {
455 HID_TYPE_OTHER = 0, 455 HID_TYPE_OTHER = 0,
456 HID_TYPE_USBMOUSE 456 HID_TYPE_USBMOUSE,
457 HID_TYPE_USBNONE
457}; 458};
458 459
459struct hid_driver; 460struct hid_driver;
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index bf56b6f78270..a26108e4d924 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -117,8 +117,19 @@
117#define IEEE80211_MAX_MESH_ID_LEN 32 117#define IEEE80211_MAX_MESH_ID_LEN 32
118 118
119#define IEEE80211_QOS_CTL_LEN 2 119#define IEEE80211_QOS_CTL_LEN 2
120#define IEEE80211_QOS_CTL_TID_MASK 0x000F 120/* 1d tag mask */
121#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 121#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007
122/* TID mask */
123#define IEEE80211_QOS_CTL_TID_MASK 0x000f
124/* EOSP */
125#define IEEE80211_QOS_CTL_EOSP 0x0010
126/* ACK policy */
127#define IEEE80211_QOS_CTL_ACK_POLICY_NORMAL 0x0000
128#define IEEE80211_QOS_CTL_ACK_POLICY_NOACK 0x0020
129#define IEEE80211_QOS_CTL_ACK_POLICY_NO_EXPL 0x0040
130#define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK 0x0060
131/* A-MSDU 802.11n */
132#define IEEE80211_QOS_CTL_A_MSDU_PRESENT 0x0080
122 133
123/* U-APSD queue for WMM IEs sent by AP */ 134/* U-APSD queue for WMM IEs sent by AP */
124#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) 135#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7)
@@ -1423,9 +1434,6 @@ enum ieee80211_sa_query_action {
1423}; 1434};
1424 1435
1425 1436
1426/* A-MSDU 802.11n */
1427#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080
1428
1429/* cipher suite selectors */ 1437/* cipher suite selectors */
1430#define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00 1438#define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00
1431#define WLAN_CIPHER_SUITE_WEP40 0x000FAC01 1439#define WLAN_CIPHER_SUITE_WEP40 0x000FAC01
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 0065ffd3226b..a3d99ff6e3b5 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -78,10 +78,15 @@
78 */ 78 */
79#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ 79#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
80#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ 80#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
81#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
81#define ETH_P_TIPC 0x88CA /* TIPC */ 82#define ETH_P_TIPC 0x88CA /* TIPC */
83#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
82#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ 84#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
83#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ 85#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
84#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ 86#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
87#define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
88#define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
89#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
85#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ 90#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
86 91
87/* 92/*
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index 7b318630139f..c1486060f5ed 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -49,6 +49,12 @@ struct sockaddr_ll {
49#define PACKET_VNET_HDR 15 49#define PACKET_VNET_HDR 15
50#define PACKET_TX_TIMESTAMP 16 50#define PACKET_TX_TIMESTAMP 16
51#define PACKET_TIMESTAMP 17 51#define PACKET_TIMESTAMP 17
52#define PACKET_FANOUT 18
53
54#define PACKET_FANOUT_HASH 0
55#define PACKET_FANOUT_LB 1
56#define PACKET_FANOUT_CPU 2
57#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
52 58
53struct tpacket_stats { 59struct tpacket_stats {
54 unsigned int tp_packets; 60 unsigned int tp_packets;
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index affa27380b72..44da4822bcab 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -91,25 +91,6 @@ struct vlan_group {
91 struct rcu_head rcu; 91 struct rcu_head rcu;
92}; 92};
93 93
94static inline struct net_device *vlan_group_get_device(struct vlan_group *vg,
95 u16 vlan_id)
96{
97 struct net_device **array;
98 array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN];
99 return array ? array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] : NULL;
100}
101
102static inline void vlan_group_set_device(struct vlan_group *vg,
103 u16 vlan_id,
104 struct net_device *dev)
105{
106 struct net_device **array;
107 if (!vg)
108 return;
109 array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN];
110 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev;
111}
112
113static inline int is_vlan_dev(struct net_device *dev) 94static inline int is_vlan_dev(struct net_device *dev)
114{ 95{
115 return dev->priv_flags & IFF_802_1Q_VLAN; 96 return dev->priv_flags & IFF_802_1Q_VLAN;
@@ -119,35 +100,18 @@ static inline int is_vlan_dev(struct net_device *dev)
119#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) 100#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
120 101
121#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 102#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
122/* Must be invoked with rcu_read_lock or with RTNL. */
123static inline struct net_device *vlan_find_dev(struct net_device *real_dev,
124 u16 vlan_id)
125{
126 struct vlan_group *grp = rcu_dereference_rtnl(real_dev->vlgrp);
127
128 if (grp)
129 return vlan_group_get_device(grp, vlan_id);
130
131 return NULL;
132}
133 103
104extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
105 u16 vlan_id);
134extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); 106extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
135extern u16 vlan_dev_vlan_id(const struct net_device *dev); 107extern u16 vlan_dev_vlan_id(const struct net_device *dev);
136 108
137extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
138 u16 vlan_tci, int polling);
139extern bool vlan_do_receive(struct sk_buff **skb); 109extern bool vlan_do_receive(struct sk_buff **skb);
140extern struct sk_buff *vlan_untag(struct sk_buff *skb); 110extern struct sk_buff *vlan_untag(struct sk_buff *skb);
141extern gro_result_t
142vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
143 unsigned int vlan_tci, struct sk_buff *skb);
144extern gro_result_t
145vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
146 unsigned int vlan_tci);
147 111
148#else 112#else
149static inline struct net_device *vlan_find_dev(struct net_device *real_dev, 113static inline struct net_device *
150 u16 vlan_id) 114__vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id)
151{ 115{
152 return NULL; 116 return NULL;
153} 117}
@@ -164,13 +128,6 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
164 return 0; 128 return 0;
165} 129}
166 130
167static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
168 u16 vlan_tci, int polling)
169{
170 BUG();
171 return NET_XMIT_SUCCESS;
172}
173
174static inline bool vlan_do_receive(struct sk_buff **skb) 131static inline bool vlan_do_receive(struct sk_buff **skb)
175{ 132{
176 if ((*skb)->vlan_tci & VLAN_VID_MASK) 133 if ((*skb)->vlan_tci & VLAN_VID_MASK)
@@ -182,49 +139,9 @@ static inline struct sk_buff *vlan_untag(struct sk_buff *skb)
182{ 139{
183 return skb; 140 return skb;
184} 141}
185
186static inline gro_result_t
187vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
188 unsigned int vlan_tci, struct sk_buff *skb)
189{
190 return GRO_DROP;
191}
192
193static inline gro_result_t
194vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
195 unsigned int vlan_tci)
196{
197 return GRO_DROP;
198}
199#endif 142#endif
200 143
201/** 144/**
202 * vlan_hwaccel_rx - netif_rx wrapper for VLAN RX acceleration
203 * @skb: buffer
204 * @grp: vlan group
205 * @vlan_tci: VLAN TCI as received from the card
206 */
207static inline int vlan_hwaccel_rx(struct sk_buff *skb,
208 struct vlan_group *grp,
209 u16 vlan_tci)
210{
211 return __vlan_hwaccel_rx(skb, grp, vlan_tci, 0);
212}
213
214/**
215 * vlan_hwaccel_receive_skb - netif_receive_skb wrapper for VLAN RX acceleration
216 * @skb: buffer
217 * @grp: vlan group
218 * @vlan_tci: VLAN TCI as received from the card
219 */
220static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb,
221 struct vlan_group *grp,
222 u16 vlan_tci)
223{
224 return __vlan_hwaccel_rx(skb, grp, vlan_tci, 1);
225}
226
227/**
228 * vlan_insert_tag - regular VLAN tag inserting 145 * vlan_insert_tag - regular VLAN tag inserting
229 * @skb: skbuff to tag 146 * @skb: skbuff to tag
230 * @vlan_tci: VLAN TCI to insert 147 * @vlan_tci: VLAN TCI to insert
diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h
index c4335faebb63..2cf55afbcd4e 100644
--- a/include/linux/inet_lro.h
+++ b/include/linux/inet_lro.h
@@ -50,7 +50,6 @@ struct net_lro_desc {
50 struct skb_frag_struct *next_frag; 50 struct skb_frag_struct *next_frag;
51 struct iphdr *iph; 51 struct iphdr *iph;
52 struct tcphdr *tcph; 52 struct tcphdr *tcph;
53 struct vlan_group *vgrp;
54 __wsum data_csum; 53 __wsum data_csum;
55 __be32 tcp_rcv_tsecr; 54 __be32 tcp_rcv_tsecr;
56 __be32 tcp_rcv_tsval; 55 __be32 tcp_rcv_tsval;
@@ -60,7 +59,6 @@ struct net_lro_desc {
60 u16 ip_tot_len; 59 u16 ip_tot_len;
61 u16 tcp_saw_tstamp; /* timestamps enabled */ 60 u16 tcp_saw_tstamp; /* timestamps enabled */
62 __be16 tcp_window; 61 __be16 tcp_window;
63 u16 vlan_tag;
64 int pkt_aggr_cnt; /* counts aggregated packets */ 62 int pkt_aggr_cnt; /* counts aggregated packets */
65 int vlan_packet; 63 int vlan_packet;
66 int mss; 64 int mss;
@@ -137,16 +135,6 @@ void lro_receive_skb(struct net_lro_mgr *lro_mgr,
137 void *priv); 135 void *priv);
138 136
139/* 137/*
140 * Processes a SKB with VLAN HW acceleration support
141 */
142
143void lro_vlan_hwaccel_receive_skb(struct net_lro_mgr *lro_mgr,
144 struct sk_buff *skb,
145 struct vlan_group *vgrp,
146 u16 vlan_tag,
147 void *priv);
148
149/*
150 * Processes a fragment list 138 * Processes a fragment list
151 * 139 *
152 * This functions aggregate fragments and generate SKBs do pass 140 * This functions aggregate fragments and generate SKBs do pass
@@ -165,13 +153,6 @@ void lro_receive_frags(struct net_lro_mgr *lro_mgr,
165 struct skb_frag_struct *frags, 153 struct skb_frag_struct *frags,
166 int len, int true_size, void *priv, __wsum sum); 154 int len, int true_size, void *priv, __wsum sum);
167 155
168void lro_vlan_hwaccel_receive_frags(struct net_lro_mgr *lro_mgr,
169 struct skb_frag_struct *frags,
170 int len, int true_size,
171 struct vlan_group *vgrp,
172 u16 vlan_tag,
173 void *priv, __wsum sum);
174
175/* 156/*
176 * Forward all aggregated SKBs held by lro_mgr to network stack 157 * Forward all aggregated SKBs held by lro_mgr to network stack
177 */ 158 */
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 0a2ba4098996..9940319d6f9d 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -19,6 +19,8 @@
19#ifndef __LINUX_IOMMU_H 19#ifndef __LINUX_IOMMU_H
20#define __LINUX_IOMMU_H 20#define __LINUX_IOMMU_H
21 21
22#include <linux/errno.h>
23
22#define IOMMU_READ (1) 24#define IOMMU_READ (1)
23#define IOMMU_WRITE (2) 25#define IOMMU_WRITE (2)
24#define IOMMU_CACHE (4) /* DMA cache coherency */ 26#define IOMMU_CACHE (4) /* DMA cache coherency */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 8b4538446636..baa397eb9c33 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -676,7 +676,8 @@ void irq_gc_mask_disable_reg(struct irq_data *d);
676void irq_gc_mask_set_bit(struct irq_data *d); 676void irq_gc_mask_set_bit(struct irq_data *d);
677void irq_gc_mask_clr_bit(struct irq_data *d); 677void irq_gc_mask_clr_bit(struct irq_data *d);
678void irq_gc_unmask_enable_reg(struct irq_data *d); 678void irq_gc_unmask_enable_reg(struct irq_data *d);
679void irq_gc_ack(struct irq_data *d); 679void irq_gc_ack_set_bit(struct irq_data *d);
680void irq_gc_ack_clr_bit(struct irq_data *d);
680void irq_gc_mask_disable_reg_and_ack(struct irq_data *d); 681void irq_gc_mask_disable_reg_and_ack(struct irq_data *d);
681void irq_gc_eoi(struct irq_data *d); 682void irq_gc_eoi(struct irq_data *d);
682int irq_gc_set_wake(struct irq_data *d, unsigned int on); 683int irq_gc_set_wake(struct irq_data *d, unsigned int on);
diff --git a/include/linux/lguest.h b/include/linux/lguest.h
index 2fb1dcbcb5aa..9962c6bb1311 100644
--- a/include/linux/lguest.h
+++ b/include/linux/lguest.h
@@ -59,8 +59,6 @@ struct lguest_data {
59 unsigned long reserve_mem; 59 unsigned long reserve_mem;
60 /* KHz for the TSC clock. */ 60 /* KHz for the TSC clock. */
61 u32 tsc_khz; 61 u32 tsc_khz;
62 /* Page where the top-level pagetable is */
63 unsigned long pgdir;
64 62
65/* Fields initialized by the Guest at boot: */ 63/* Fields initialized by the Guest at boot: */
66 /* Instruction range to suppress interrupts even if enabled */ 64 /* Instruction range to suppress interrupts even if enabled */
diff --git a/include/linux/memory.h b/include/linux/memory.h
index e1e3b2b84f85..935699b30b7c 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -20,6 +20,8 @@
20#include <linux/compiler.h> 20#include <linux/compiler.h>
21#include <linux/mutex.h> 21#include <linux/mutex.h>
22 22
23#define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS)
24
23struct memory_block { 25struct memory_block {
24 unsigned long start_section_nr; 26 unsigned long start_section_nr;
25 unsigned long end_section_nr; 27 unsigned long end_section_nr;
diff --git a/include/linux/mfd/ds1wm.h b/include/linux/mfd/ds1wm.h
index be469a357cbb..38a372a0e285 100644
--- a/include/linux/mfd/ds1wm.h
+++ b/include/linux/mfd/ds1wm.h
@@ -3,4 +3,11 @@
3struct ds1wm_driver_data { 3struct ds1wm_driver_data {
4 int active_high; 4 int active_high;
5 int clock_rate; 5 int clock_rate;
6 /* in milliseconds, the amount of time to */
7 /* sleep following a reset pulse. Zero */
8 /* should work if your bus devices recover*/
9 /* time respects the 1-wire spec since the*/
10 /* ds1wm implements the precise timings of*/
11 /* a reset pulse/presence detect sequence.*/
12 unsigned int reset_recover_delay;
6}; 13};
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 5a90266c3a5a..0dc98044d8b7 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -68,6 +68,11 @@
68 * controller and report the event to the driver. 68 * controller and report the event to the driver.
69 */ 69 */
70#define TMIO_MMC_HAS_COLD_CD (1 << 3) 70#define TMIO_MMC_HAS_COLD_CD (1 << 3)
71/*
72 * Some controllers require waiting for the SD bus to become
73 * idle before writing to some registers.
74 */
75#define TMIO_MMC_HAS_IDLE_WAIT (1 << 4)
71 76
72int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); 77int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
73int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); 78int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
@@ -80,6 +85,8 @@ struct tmio_mmc_dma {
80 int alignment_shift; 85 int alignment_shift;
81}; 86};
82 87
88struct tmio_mmc_host;
89
83/* 90/*
84 * data for the MMC controller 91 * data for the MMC controller
85 */ 92 */
@@ -94,6 +101,7 @@ struct tmio_mmc_data {
94 void (*set_pwr)(struct platform_device *host, int state); 101 void (*set_pwr)(struct platform_device *host, int state);
95 void (*set_clk_div)(struct platform_device *host, int state); 102 void (*set_clk_div)(struct platform_device *host, int state);
96 int (*get_cd)(struct platform_device *host); 103 int (*get_cd)(struct platform_device *host);
104 int (*write16_hook)(struct tmio_mmc_host *host, int addr);
97}; 105};
98 106
99static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata) 107static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata)
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 359fba880274..103113a2fd18 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -128,6 +128,8 @@
128/* 1000BASE-T Control register */ 128/* 1000BASE-T Control register */
129#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */ 129#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
130#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */ 130#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */
131#define CTL1000_AS_MASTER 0x0800
132#define CTL1000_ENABLE_MASTER 0x1000
131 133
132/* 1000BASE-T Status register */ 134/* 1000BASE-T Status register */
133#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */ 135#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 9a18667c13cc..b56e4587208d 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -123,6 +123,9 @@ enum {
123 /* debug commands */ 123 /* debug commands */
124 MLX4_CMD_QUERY_DEBUG_MSG = 0x2a, 124 MLX4_CMD_QUERY_DEBUG_MSG = 0x2a,
125 MLX4_CMD_SET_DEBUG_MSG = 0x2b, 125 MLX4_CMD_SET_DEBUG_MSG = 0x2b,
126
127 /* statistics commands */
128 MLX4_CMD_QUERY_IF_STAT = 0X54,
126}; 129};
127 130
128enum { 131enum {
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 8985768e2c0d..387329e02303 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -58,22 +58,28 @@ enum {
58}; 58};
59 59
60enum { 60enum {
61 MLX4_DEV_CAP_FLAG_RC = 1 << 0, 61 MLX4_DEV_CAP_FLAG_RC = 1LL << 0,
62 MLX4_DEV_CAP_FLAG_UC = 1 << 1, 62 MLX4_DEV_CAP_FLAG_UC = 1LL << 1,
63 MLX4_DEV_CAP_FLAG_UD = 1 << 2, 63 MLX4_DEV_CAP_FLAG_UD = 1LL << 2,
64 MLX4_DEV_CAP_FLAG_SRQ = 1 << 6, 64 MLX4_DEV_CAP_FLAG_SRQ = 1LL << 6,
65 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1 << 7, 65 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1LL << 7,
66 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8, 66 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8,
67 MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9, 67 MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1LL << 9,
68 MLX4_DEV_CAP_FLAG_DPDP = 1 << 12, 68 MLX4_DEV_CAP_FLAG_DPDP = 1LL << 12,
69 MLX4_DEV_CAP_FLAG_BLH = 1 << 15, 69 MLX4_DEV_CAP_FLAG_BLH = 1LL << 15,
70 MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16, 70 MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1LL << 16,
71 MLX4_DEV_CAP_FLAG_APM = 1 << 17, 71 MLX4_DEV_CAP_FLAG_APM = 1LL << 17,
72 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, 72 MLX4_DEV_CAP_FLAG_ATOMIC = 1LL << 18,
73 MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, 73 MLX4_DEV_CAP_FLAG_RAW_MCAST = 1LL << 19,
74 MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, 74 MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1LL << 20,
75 MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21, 75 MLX4_DEV_CAP_FLAG_UD_MCAST = 1LL << 21,
76 MLX4_DEV_CAP_FLAG_IBOE = 1 << 30 76 MLX4_DEV_CAP_FLAG_IBOE = 1LL << 30,
77 MLX4_DEV_CAP_FLAG_UC_LOOPBACK = 1LL << 32,
78 MLX4_DEV_CAP_FLAG_WOL = 1LL << 38,
79 MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40,
80 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41,
81 MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42,
82 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48
77}; 83};
78 84
79enum { 85enum {
@@ -253,15 +259,10 @@ struct mlx4_caps {
253 int mtt_entry_sz; 259 int mtt_entry_sz;
254 u32 max_msg_sz; 260 u32 max_msg_sz;
255 u32 page_size_cap; 261 u32 page_size_cap;
256 u32 flags; 262 u64 flags;
257 u32 bmme_flags; 263 u32 bmme_flags;
258 u32 reserved_lkey; 264 u32 reserved_lkey;
259 u16 stat_rate_support; 265 u16 stat_rate_support;
260 int udp_rss;
261 int loopback_support;
262 int vep_uc_steering;
263 int vep_mc_steering;
264 int wol;
265 u8 port_width_cap[MLX4_MAX_PORTS + 1]; 266 u8 port_width_cap[MLX4_MAX_PORTS + 1];
266 int max_gso_sz; 267 int max_gso_sz;
267 int reserved_qps_cnt[MLX4_NUM_QP_REGION]; 268 int reserved_qps_cnt[MLX4_NUM_QP_REGION];
@@ -274,6 +275,7 @@ struct mlx4_caps {
274 u8 supported_type[MLX4_MAX_PORTS + 1]; 275 u8 supported_type[MLX4_MAX_PORTS + 1];
275 u32 port_mask; 276 u32 port_mask;
276 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; 277 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1];
278 u32 max_counters;
277}; 279};
278 280
279struct mlx4_buf_list { 281struct mlx4_buf_list {
@@ -438,6 +440,17 @@ union mlx4_ext_av {
438 struct mlx4_eth_av eth; 440 struct mlx4_eth_av eth;
439}; 441};
440 442
443struct mlx4_counter {
444 u8 reserved1[3];
445 u8 counter_mode;
446 __be32 num_ifc;
447 u32 reserved2[2];
448 __be64 rx_frames;
449 __be64 rx_bytes;
450 __be64 tx_frames;
451 __be64 tx_bytes;
452};
453
441struct mlx4_dev { 454struct mlx4_dev {
442 struct pci_dev *pdev; 455 struct pci_dev *pdev;
443 unsigned long flags; 456 unsigned long flags;
@@ -568,4 +581,7 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec);
568int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); 581int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port);
569int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); 582int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port);
570 583
584int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx);
585void mlx4_counter_free(struct mlx4_dev *dev, u32 idx);
586
571#endif /* MLX4_DEVICE_H */ 587#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 9e9eb21056ca..4001c8249dbb 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -54,7 +54,8 @@ enum mlx4_qp_optpar {
54 MLX4_QP_OPTPAR_RETRY_COUNT = 1 << 12, 54 MLX4_QP_OPTPAR_RETRY_COUNT = 1 << 12,
55 MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13, 55 MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13,
56 MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14, 56 MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14,
57 MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16 57 MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16,
58 MLX4_QP_OPTPAR_COUNTER_INDEX = 1 << 20
58}; 59};
59 60
60enum mlx4_qp_state { 61enum mlx4_qp_state {
@@ -99,7 +100,7 @@ struct mlx4_qp_path {
99 u8 fl; 100 u8 fl;
100 u8 reserved1[2]; 101 u8 reserved1[2];
101 u8 pkey_index; 102 u8 pkey_index;
102 u8 reserved2; 103 u8 counter_index;
103 u8 grh_mylmc; 104 u8 grh_mylmc;
104 __be16 rlid; 105 __be16 rlid;
105 u8 ackto; 106 u8 ackto;
@@ -111,8 +112,7 @@ struct mlx4_qp_path {
111 u8 sched_queue; 112 u8 sched_queue;
112 u8 vlan_index; 113 u8 vlan_index;
113 u8 reserved3[2]; 114 u8 reserved3[2];
114 u8 counter_index; 115 u8 reserved4[2];
115 u8 reserved4;
116 u8 dmac[6]; 116 u8 dmac[6];
117}; 117};
118 118
diff --git a/include/linux/mmc/boot.h b/include/linux/mmc/boot.h
index 39d787c229cb..23acc3baa07d 100644
--- a/include/linux/mmc/boot.h
+++ b/include/linux/mmc/boot.h
@@ -1,7 +1,7 @@
1#ifndef MMC_BOOT_H 1#ifndef LINUX_MMC_BOOT_H
2#define MMC_BOOT_H 2#define LINUX_MMC_BOOT_H
3 3
4enum { MMC_PROGRESS_ENTER, MMC_PROGRESS_INIT, 4enum { MMC_PROGRESS_ENTER, MMC_PROGRESS_INIT,
5 MMC_PROGRESS_LOAD, MMC_PROGRESS_DONE }; 5 MMC_PROGRESS_LOAD, MMC_PROGRESS_DONE };
6 6
7#endif 7#endif /* LINUX_MMC_BOOT_H */
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index c6927a4d157f..b460fc2af8a1 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -64,6 +64,19 @@ struct mmc_ext_csd {
64 unsigned long long enhanced_area_offset; /* Units: Byte */ 64 unsigned long long enhanced_area_offset; /* Units: Byte */
65 unsigned int enhanced_area_size; /* Units: KB */ 65 unsigned int enhanced_area_size; /* Units: KB */
66 unsigned int boot_size; /* in bytes */ 66 unsigned int boot_size; /* in bytes */
67 u8 raw_partition_support; /* 160 */
68 u8 raw_erased_mem_count; /* 181 */
69 u8 raw_ext_csd_structure; /* 194 */
70 u8 raw_card_type; /* 196 */
71 u8 raw_s_a_timeout; /* 217 */
72 u8 raw_hc_erase_gap_size; /* 221 */
73 u8 raw_erase_timeout_mult; /* 223 */
74 u8 raw_hc_erase_grp_size; /* 224 */
75 u8 raw_sec_trim_mult; /* 229 */
76 u8 raw_sec_erase_mult; /* 230 */
77 u8 raw_sec_feature_support;/* 231 */
78 u8 raw_trim_mult; /* 232 */
79 u8 raw_sectors[4]; /* 212 - 4 bytes */
67}; 80};
68 81
69struct sd_scr { 82struct sd_scr {
@@ -390,4 +403,4 @@ extern void mmc_unregister_driver(struct mmc_driver *);
390extern void mmc_fixup_device(struct mmc_card *card, 403extern void mmc_fixup_device(struct mmc_card *card,
391 const struct mmc_fixup *table); 404 const struct mmc_fixup *table);
392 405
393#endif 406#endif /* LINUX_MMC_CARD_H */
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index b6718e549a51..b8b1b7a311f1 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -117,6 +117,7 @@ struct mmc_data {
117 117
118 unsigned int sg_len; /* size of scatter list */ 118 unsigned int sg_len; /* size of scatter list */
119 struct scatterlist *sg; /* I/O scatter list */ 119 struct scatterlist *sg; /* I/O scatter list */
120 s32 host_cookie; /* host private data */
120}; 121};
121 122
122struct mmc_request { 123struct mmc_request {
@@ -125,13 +126,16 @@ struct mmc_request {
125 struct mmc_data *data; 126 struct mmc_data *data;
126 struct mmc_command *stop; 127 struct mmc_command *stop;
127 128
128 void *done_data; /* completion data */ 129 struct completion completion;
129 void (*done)(struct mmc_request *);/* completion function */ 130 void (*done)(struct mmc_request *);/* completion function */
130}; 131};
131 132
132struct mmc_host; 133struct mmc_host;
133struct mmc_card; 134struct mmc_card;
135struct mmc_async_req;
134 136
137extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
138 struct mmc_async_req *, int *);
135extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); 139extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
136extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); 140extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
137extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); 141extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *);
@@ -155,6 +159,7 @@ extern int mmc_can_trim(struct mmc_card *card);
155extern int mmc_can_secure_erase_trim(struct mmc_card *card); 159extern int mmc_can_secure_erase_trim(struct mmc_card *card);
156extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, 160extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
157 unsigned int nr); 161 unsigned int nr);
162extern unsigned int mmc_calc_max_discard(struct mmc_card *card);
158 163
159extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); 164extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
160 165
@@ -179,4 +184,4 @@ static inline void mmc_claim_host(struct mmc_host *host)
179 184
180extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max); 185extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
181 186
182#endif 187#endif /* LINUX_MMC_CORE_H */
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index bdd7ceeb99e4..6b46819705d1 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -11,8 +11,8 @@
11 * (at your option) any later version. 11 * (at your option) any later version.
12 */ 12 */
13 13
14#ifndef _LINUX_MMC_DW_MMC_H_ 14#ifndef LINUX_MMC_DW_MMC_H
15#define _LINUX_MMC_DW_MMC_H_ 15#define LINUX_MMC_DW_MMC_H
16 16
17#define MAX_MCI_SLOTS 2 17#define MAX_MCI_SLOTS 2
18 18
@@ -48,6 +48,7 @@ struct mmc_data;
48 * @data: The data currently being transferred, or NULL if no data 48 * @data: The data currently being transferred, or NULL if no data
49 * transfer is in progress. 49 * transfer is in progress.
50 * @use_dma: Whether DMA channel is initialized or not. 50 * @use_dma: Whether DMA channel is initialized or not.
51 * @using_dma: Whether DMA is in use for the current transfer.
51 * @sg_dma: Bus address of DMA buffer. 52 * @sg_dma: Bus address of DMA buffer.
52 * @sg_cpu: Virtual address of DMA buffer. 53 * @sg_cpu: Virtual address of DMA buffer.
53 * @dma_ops: Pointer to platform-specific DMA callbacks. 54 * @dma_ops: Pointer to platform-specific DMA callbacks.
@@ -74,7 +75,11 @@ struct mmc_data;
74 * @pdev: Platform device associated with the MMC controller. 75 * @pdev: Platform device associated with the MMC controller.
75 * @pdata: Platform data associated with the MMC controller. 76 * @pdata: Platform data associated with the MMC controller.
76 * @slot: Slots sharing this MMC controller. 77 * @slot: Slots sharing this MMC controller.
78 * @fifo_depth: depth of FIFO.
77 * @data_shift: log2 of FIFO item size. 79 * @data_shift: log2 of FIFO item size.
80 * @part_buf_start: Start index in part_buf.
81 * @part_buf_count: Bytes of partial data in part_buf.
82 * @part_buf: Simple buffer for partial fifo reads/writes.
78 * @push_data: Pointer to FIFO push function. 83 * @push_data: Pointer to FIFO push function.
79 * @pull_data: Pointer to FIFO pull function. 84 * @pull_data: Pointer to FIFO pull function.
80 * @quirks: Set of quirks that apply to specific versions of the IP. 85 * @quirks: Set of quirks that apply to specific versions of the IP.
@@ -117,6 +122,7 @@ struct dw_mci {
117 122
118 /* DMA interface members*/ 123 /* DMA interface members*/
119 int use_dma; 124 int use_dma;
125 int using_dma;
120 126
121 dma_addr_t sg_dma; 127 dma_addr_t sg_dma;
122 void *sg_cpu; 128 void *sg_cpu;
@@ -131,7 +137,7 @@ struct dw_mci {
131 u32 stop_cmdr; 137 u32 stop_cmdr;
132 u32 dir_status; 138 u32 dir_status;
133 struct tasklet_struct tasklet; 139 struct tasklet_struct tasklet;
134 struct tasklet_struct card_tasklet; 140 struct work_struct card_work;
135 unsigned long pending_events; 141 unsigned long pending_events;
136 unsigned long completed_events; 142 unsigned long completed_events;
137 enum dw_mci_state state; 143 enum dw_mci_state state;
@@ -146,7 +152,15 @@ struct dw_mci {
146 struct dw_mci_slot *slot[MAX_MCI_SLOTS]; 152 struct dw_mci_slot *slot[MAX_MCI_SLOTS];
147 153
148 /* FIFO push and pull */ 154 /* FIFO push and pull */
155 int fifo_depth;
149 int data_shift; 156 int data_shift;
157 u8 part_buf_start;
158 u8 part_buf_count;
159 union {
160 u16 part_buf16;
161 u32 part_buf32;
162 u64 part_buf;
163 };
150 void (*push_data)(struct dw_mci *host, void *buf, int cnt); 164 void (*push_data)(struct dw_mci *host, void *buf, int cnt);
151 void (*pull_data)(struct dw_mci *host, void *buf, int cnt); 165 void (*pull_data)(struct dw_mci *host, void *buf, int cnt);
152 166
@@ -196,6 +210,12 @@ struct dw_mci_board {
196 unsigned int bus_hz; /* Bus speed */ 210 unsigned int bus_hz; /* Bus speed */
197 211
198 unsigned int caps; /* Capabilities */ 212 unsigned int caps; /* Capabilities */
213 /*
214 * Override fifo depth. If 0, autodetect it from the FIFOTH register,
215 * but note that this may not be reliable after a bootloader has used
216 * it.
217 */
218 unsigned int fifo_depth;
199 219
200 /* delay in mS before detecting cards after interrupt */ 220 /* delay in mS before detecting cards after interrupt */
201 u32 detect_delay_ms; 221 u32 detect_delay_ms;
@@ -219,4 +239,4 @@ struct dw_mci_board {
219 struct block_settings *blk_settings; 239 struct block_settings *blk_settings;
220}; 240};
221 241
222#endif /* _LINUX_MMC_DW_MMC_H_ */ 242#endif /* LINUX_MMC_DW_MMC_H */
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 1ee4424462eb..0f83858147a6 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -106,6 +106,15 @@ struct mmc_host_ops {
106 */ 106 */
107 int (*enable)(struct mmc_host *host); 107 int (*enable)(struct mmc_host *host);
108 int (*disable)(struct mmc_host *host, int lazy); 108 int (*disable)(struct mmc_host *host, int lazy);
109 /*
110 * It is optional for the host to implement pre_req and post_req in
111 * order to support double buffering of requests (prepare one
112 * request while another request is active).
113 */
114 void (*post_req)(struct mmc_host *host, struct mmc_request *req,
115 int err);
116 void (*pre_req)(struct mmc_host *host, struct mmc_request *req,
117 bool is_first_req);
109 void (*request)(struct mmc_host *host, struct mmc_request *req); 118 void (*request)(struct mmc_host *host, struct mmc_request *req);
110 /* 119 /*
111 * Avoid calling these three functions too often or in a "fast path", 120 * Avoid calling these three functions too often or in a "fast path",
@@ -139,11 +148,22 @@ struct mmc_host_ops {
139 int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); 148 int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios);
140 int (*execute_tuning)(struct mmc_host *host); 149 int (*execute_tuning)(struct mmc_host *host);
141 void (*enable_preset_value)(struct mmc_host *host, bool enable); 150 void (*enable_preset_value)(struct mmc_host *host, bool enable);
151 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
142}; 152};
143 153
144struct mmc_card; 154struct mmc_card;
145struct device; 155struct device;
146 156
157struct mmc_async_req {
158 /* active mmc request */
159 struct mmc_request *mrq;
160 /*
161 * Check error status of completed mmc request.
162 * Returns 0 if success otherwise non zero.
163 */
164 int (*err_check) (struct mmc_card *, struct mmc_async_req *);
165};
166
147struct mmc_host { 167struct mmc_host {
148 struct device *parent; 168 struct device *parent;
149 struct device class_dev; 169 struct device class_dev;
@@ -231,6 +251,7 @@ struct mmc_host {
231 unsigned int max_req_size; /* maximum number of bytes in one req */ 251 unsigned int max_req_size; /* maximum number of bytes in one req */
232 unsigned int max_blk_size; /* maximum size of one mmc block */ 252 unsigned int max_blk_size; /* maximum size of one mmc block */
233 unsigned int max_blk_count; /* maximum number of blocks in one req */ 253 unsigned int max_blk_count; /* maximum number of blocks in one req */
254 unsigned int max_discard_to; /* max. discard timeout in ms */
234 255
235 /* private data */ 256 /* private data */
236 spinlock_t lock; /* lock for claim and bus ops */ 257 spinlock_t lock; /* lock for claim and bus ops */
@@ -281,6 +302,8 @@ struct mmc_host {
281 302
282 struct dentry *debugfs_root; 303 struct dentry *debugfs_root;
283 304
305 struct mmc_async_req *areq; /* active async req */
306
284 unsigned long private[0] ____cacheline_aligned; 307 unsigned long private[0] ____cacheline_aligned;
285}; 308};
286 309
@@ -373,5 +396,4 @@ static inline int mmc_host_cmd23(struct mmc_host *host)
373{ 396{
374 return host->caps & MMC_CAP_CMD23; 397 return host->caps & MMC_CAP_CMD23;
375} 398}
376#endif 399#endif /* LINUX_MMC_HOST_H */
377
diff --git a/include/linux/mmc/ioctl.h b/include/linux/mmc/ioctl.h
index 5baf2983a12f..8fa5bc5f8059 100644
--- a/include/linux/mmc/ioctl.h
+++ b/include/linux/mmc/ioctl.h
@@ -51,4 +51,4 @@ struct mmc_ioc_cmd {
51 * block device operations. 51 * block device operations.
52 */ 52 */
53#define MMC_IOC_MAX_BYTES (512L * 256) 53#define MMC_IOC_MAX_BYTES (512L * 256)
54#endif /* LINUX_MMC_IOCTL_H */ 54#endif /* LINUX_MMC_IOCTL_H */
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index ac26a685cca8..5a794cb503ea 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -21,8 +21,8 @@
21 * 15 May 2002 21 * 15 May 2002
22 */ 22 */
23 23
24#ifndef MMC_MMC_H 24#ifndef LINUX_MMC_MMC_H
25#define MMC_MMC_H 25#define LINUX_MMC_MMC_H
26 26
27/* Standard MMC commands (4.1) type argument response */ 27/* Standard MMC commands (4.1) type argument response */
28 /* class 1 */ 28 /* class 1 */
@@ -140,6 +140,16 @@ static inline bool mmc_op_multi(u32 opcode)
140#define R1_SWITCH_ERROR (1 << 7) /* sx, c */ 140#define R1_SWITCH_ERROR (1 << 7) /* sx, c */
141#define R1_APP_CMD (1 << 5) /* sr, c */ 141#define R1_APP_CMD (1 << 5) /* sr, c */
142 142
143#define R1_STATE_IDLE 0
144#define R1_STATE_READY 1
145#define R1_STATE_IDENT 2
146#define R1_STATE_STBY 3
147#define R1_STATE_TRAN 4
148#define R1_STATE_DATA 5
149#define R1_STATE_RCV 6
150#define R1_STATE_PRG 7
151#define R1_STATE_DIS 8
152
143/* 153/*
144 * MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS 154 * MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS
145 * R1 is the low order byte; R2 is the next highest byte, when present. 155 * R1 is the low order byte; R2 is the next highest byte, when present.
@@ -327,5 +337,4 @@ struct _mmc_csd {
327#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */ 337#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */
328#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */ 338#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */
329 339
330#endif /* MMC_MMC_PROTOCOL_H */ 340#endif /* LINUX_MMC_MMC_H */
331
diff --git a/include/linux/mmc/pm.h b/include/linux/mmc/pm.h
index d37aac49cf9a..4a139204c20c 100644
--- a/include/linux/mmc/pm.h
+++ b/include/linux/mmc/pm.h
@@ -27,4 +27,4 @@ typedef unsigned int mmc_pm_flag_t;
27#define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */ 27#define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */
28#define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */ 28#define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */
29 29
30#endif 30#endif /* LINUX_MMC_PM_H */
diff --git a/include/linux/mmc/sd.h b/include/linux/mmc/sd.h
index 7d35d52c3df3..1ebcf9ba1256 100644
--- a/include/linux/mmc/sd.h
+++ b/include/linux/mmc/sd.h
@@ -9,8 +9,8 @@
9 * your option) any later version. 9 * your option) any later version.
10 */ 10 */
11 11
12#ifndef MMC_SD_H 12#ifndef LINUX_MMC_SD_H
13#define MMC_SD_H 13#define LINUX_MMC_SD_H
14 14
15/* SD commands type argument response */ 15/* SD commands type argument response */
16 /* class 0 */ 16 /* class 0 */
@@ -91,5 +91,4 @@
91#define SD_SWITCH_ACCESS_DEF 0 91#define SD_SWITCH_ACCESS_DEF 0
92#define SD_SWITCH_ACCESS_HS 1 92#define SD_SWITCH_ACCESS_HS 1
93 93
94#endif 94#endif /* LINUX_MMC_SD_H */
95
diff --git a/include/linux/mmc/sdhci-pltfm.h b/include/linux/mmc/sdhci-pltfm.h
deleted file mode 100644
index 548d59d404cb..000000000000
--- a/include/linux/mmc/sdhci-pltfm.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Platform data declarations for the sdhci-pltfm driver.
3 *
4 * Copyright (c) 2010 MontaVista Software, LLC.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at
11 * your option) any later version.
12 */
13
14#ifndef _SDHCI_PLTFM_H
15#define _SDHCI_PLTFM_H
16
17struct sdhci_ops;
18struct sdhci_host;
19
20/**
21 * struct sdhci_pltfm_data - SDHCI platform-specific information & hooks
22 * @ops: optional pointer to the platform-provided SDHCI ops
23 * @quirks: optional SDHCI quirks
24 * @init: optional hook that is called during device probe, before the
25 * driver tries to access any SDHCI registers
26 * @exit: optional hook that is called during device removal
27 */
28struct sdhci_pltfm_data {
29 struct sdhci_ops *ops;
30 unsigned int quirks;
31 int (*init)(struct sdhci_host *host, struct sdhci_pltfm_data *pdata);
32 void (*exit)(struct sdhci_host *host);
33};
34
35#endif /* _SDHCI_PLTFM_H */
diff --git a/include/linux/mmc/sdhci-spear.h b/include/linux/mmc/sdhci-spear.h
index 9188c973f3e1..5cdc96da9dd5 100644
--- a/include/linux/mmc/sdhci-spear.h
+++ b/include/linux/mmc/sdhci-spear.h
@@ -11,8 +11,8 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13 13
14#ifndef MMC_SDHCI_SPEAR_H 14#ifndef LINUX_MMC_SDHCI_SPEAR_H
15#define MMC_SDHCI_SPEAR_H 15#define LINUX_MMC_SDHCI_SPEAR_H
16 16
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18/* 18/*
@@ -39,4 +39,4 @@ sdhci_set_plat_data(struct platform_device *pdev, struct sdhci_plat_data *data)
39 pdev->dev.platform_data = data; 39 pdev->dev.platform_data = data;
40} 40}
41 41
42#endif /* MMC_SDHCI_SPEAR_H */ 42#endif /* LINUX_MMC_SDHCI_SPEAR_H */
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 6a68c4eb4e44..5666f3abfab7 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -8,8 +8,8 @@
8 * the Free Software Foundation; either version 2 of the License, or (at 8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version. 9 * your option) any later version.
10 */ 10 */
11#ifndef __SDHCI_H 11#ifndef LINUX_MMC_SDHCI_H
12#define __SDHCI_H 12#define LINUX_MMC_SDHCI_H
13 13
14#include <linux/scatterlist.h> 14#include <linux/scatterlist.h>
15#include <linux/compiler.h> 15#include <linux/compiler.h>
@@ -162,4 +162,4 @@ struct sdhci_host {
162 162
163 unsigned long private[0] ____cacheline_aligned; 163 unsigned long private[0] ____cacheline_aligned;
164}; 164};
165#endif /* __SDHCI_H */ 165#endif /* LINUX_MMC_SDHCI_H */
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h
index 245cdacee544..2a2e9905a247 100644
--- a/include/linux/mmc/sdio.h
+++ b/include/linux/mmc/sdio.h
@@ -9,8 +9,8 @@
9 * your option) any later version. 9 * your option) any later version.
10 */ 10 */
11 11
12#ifndef MMC_SDIO_H 12#ifndef LINUX_MMC_SDIO_H
13#define MMC_SDIO_H 13#define LINUX_MMC_SDIO_H
14 14
15/* SDIO commands type argument response */ 15/* SDIO commands type argument response */
16#define SD_IO_SEND_OP_COND 5 /* bcr [23:0] OCR R4 */ 16#define SD_IO_SEND_OP_COND 5 /* bcr [23:0] OCR R4 */
@@ -161,5 +161,4 @@
161 161
162#define SDIO_FBR_BLKSIZE 0x10 /* block size (2 bytes) */ 162#define SDIO_FBR_BLKSIZE 0x10 /* block size (2 bytes) */
163 163
164#endif 164#endif /* LINUX_MMC_SDIO_H */
165
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index 31baaf82f458..50f0bc952328 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -9,8 +9,8 @@
9 * your option) any later version. 9 * your option) any later version.
10 */ 10 */
11 11
12#ifndef MMC_SDIO_FUNC_H 12#ifndef LINUX_MMC_SDIO_FUNC_H
13#define MMC_SDIO_FUNC_H 13#define LINUX_MMC_SDIO_FUNC_H
14 14
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/mod_devicetable.h> 16#include <linux/mod_devicetable.h>
@@ -161,5 +161,4 @@ extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b,
161extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func); 161extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func);
162extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags); 162extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
163 163
164#endif 164#endif /* LINUX_MMC_SDIO_FUNC_H */
165
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index a36ab3bc7b03..9f03feedc8e7 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -2,8 +2,8 @@
2 * SDIO Classes, Interface Types, Manufacturer IDs, etc. 2 * SDIO Classes, Interface Types, Manufacturer IDs, etc.
3 */ 3 */
4 4
5#ifndef MMC_SDIO_IDS_H 5#ifndef LINUX_MMC_SDIO_IDS_H
6#define MMC_SDIO_IDS_H 6#define LINUX_MMC_SDIO_IDS_H
7 7
8/* 8/*
9 * Standard SDIO Function Interfaces 9 * Standard SDIO Function Interfaces
@@ -44,4 +44,4 @@
44#define SDIO_DEVICE_ID_SIANO_NOVA_A0 0x1100 44#define SDIO_DEVICE_ID_SIANO_NOVA_A0 0x1100
45#define SDIO_DEVICE_ID_SIANO_STELLAR 0x5347 45#define SDIO_DEVICE_ID_SIANO_STELLAR 0x5347
46 46
47#endif 47#endif /* LINUX_MMC_SDIO_IDS_H */
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index 9eb9b4b96f55..0222cd8ebe76 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -11,8 +11,8 @@
11 * 11 *
12 */ 12 */
13 13
14#ifndef __SH_MMCIF_H__ 14#ifndef LINUX_MMC_SH_MMCIF_H
15#define __SH_MMCIF_H__ 15#define LINUX_MMC_SH_MMCIF_H
16 16
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
@@ -220,4 +220,4 @@ static inline void sh_mmcif_boot_init(void __iomem *base)
220 sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); 220 sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000);
221} 221}
222 222
223#endif /* __SH_MMCIF_H__ */ 223#endif /* LINUX_MMC_SH_MMCIF_H */
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
index faf32b6ec185..bd50b365167f 100644
--- a/include/linux/mmc/sh_mobile_sdhi.h
+++ b/include/linux/mmc/sh_mobile_sdhi.h
@@ -1,5 +1,5 @@
1#ifndef __SH_MOBILE_SDHI_H__ 1#ifndef LINUX_MMC_SH_MOBILE_SDHI_H
2#define __SH_MOBILE_SDHI_H__ 2#define LINUX_MMC_SH_MOBILE_SDHI_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
@@ -17,4 +17,4 @@ struct sh_mobile_sdhi_info {
17 int (*get_cd)(struct platform_device *pdev); 17 int (*get_cd)(struct platform_device *pdev);
18}; 18};
19 19
20#endif /* __SH_MOBILE_SDHI_H__ */ 20#endif /* LINUX_MMC_SH_MOBILE_SDHI_H */
diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h
index 19490b942db0..a1c1f321e519 100644
--- a/include/linux/mmc/tmio.h
+++ b/include/linux/mmc/tmio.h
@@ -12,8 +12,8 @@
12 * 12 *
13 * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3 13 * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3
14 */ 14 */
15#ifndef _LINUX_MMC_TMIO_H_ 15#ifndef LINUX_MMC_TMIO_H
16#define _LINUX_MMC_TMIO_H_ 16#define LINUX_MMC_TMIO_H
17 17
18#define CTL_SD_CMD 0x00 18#define CTL_SD_CMD 0x00
19#define CTL_ARG_REG 0x04 19#define CTL_ARG_REG 0x04
@@ -21,6 +21,7 @@
21#define CTL_XFER_BLK_COUNT 0xa 21#define CTL_XFER_BLK_COUNT 0xa
22#define CTL_RESPONSE 0x0c 22#define CTL_RESPONSE 0x0c
23#define CTL_STATUS 0x1c 23#define CTL_STATUS 0x1c
24#define CTL_STATUS2 0x1e
24#define CTL_IRQ_MASK 0x20 25#define CTL_IRQ_MASK 0x20
25#define CTL_SD_CARD_CLK_CTL 0x24 26#define CTL_SD_CARD_CLK_CTL 0x24
26#define CTL_SD_XFER_LEN 0x26 27#define CTL_SD_XFER_LEN 0x26
@@ -30,6 +31,7 @@
30#define CTL_TRANSACTION_CTL 0x34 31#define CTL_TRANSACTION_CTL 0x34
31#define CTL_SDIO_STATUS 0x36 32#define CTL_SDIO_STATUS 0x36
32#define CTL_SDIO_IRQ_MASK 0x38 33#define CTL_SDIO_IRQ_MASK 0x38
34#define CTL_DMA_ENABLE 0xd8
33#define CTL_RESET_SD 0xe0 35#define CTL_RESET_SD 0xe0
34#define CTL_SDIO_REGS 0x100 36#define CTL_SDIO_REGS 0x100
35#define CTL_CLK_AND_WAIT_CTL 0x138 37#define CTL_CLK_AND_WAIT_CTL 0x138
@@ -60,4 +62,4 @@
60 62
61#define TMIO_BBS 512 /* Boot block size */ 63#define TMIO_BBS 512 /* Boot block size */
62 64
63#endif /* _LINUX_MMC_TMIO_H_ */ 65#endif /* LINUX_MMC_TMIO_H */
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h
index 15da0e99f48a..db4836bed514 100644
--- a/include/linux/mtd/ubi.h
+++ b/include/linux/mtd/ubi.h
@@ -155,12 +155,14 @@ struct ubi_device_info {
155}; 155};
156 156
157/* 157/*
158 * enum - volume notification types. 158 * Volume notification types.
159 * @UBI_VOLUME_ADDED: volume has been added 159 * @UBI_VOLUME_ADDED: a volume has been added (an UBI device was attached or a
160 * @UBI_VOLUME_REMOVED: start volume volume 160 * volume was created)
161 * @UBI_VOLUME_RESIZED: volume size has been re-sized 161 * @UBI_VOLUME_REMOVED: a volume has been removed (an UBI device was detached
162 * @UBI_VOLUME_RENAMED: volume name has been re-named 162 * or a volume was removed)
163 * @UBI_VOLUME_UPDATED: volume name has been updated 163 * @UBI_VOLUME_RESIZED: a volume has been re-sized
164 * @UBI_VOLUME_RENAMED: a volume has been re-named
165 * @UBI_VOLUME_UPDATED: data has been written to a volume
164 * 166 *
165 * These constants define which type of event has happened when a volume 167 * These constants define which type of event has happened when a volume
166 * notification function is invoked. 168 * notification function is invoked.
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index a940fe435aca..7f87217e9d1f 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -92,7 +92,7 @@ do { \
92 \ 92 \
93 __mutex_init((mutex), #mutex, &__key); \ 93 __mutex_init((mutex), #mutex, &__key); \
94} while (0) 94} while (0)
95# define mutex_destroy(mutex) do { } while (0) 95static inline void mutex_destroy(struct mutex *lock) {}
96#endif 96#endif
97 97
98#ifdef CONFIG_DEBUG_LOCK_ALLOC 98#ifdef CONFIG_DEBUG_LOCK_ALLOC
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 54b8b4d7b68f..34f3abc6457a 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -34,7 +34,6 @@
34#include <linux/pm_qos_params.h> 34#include <linux/pm_qos_params.h>
35#include <linux/timer.h> 35#include <linux/timer.h>
36#include <linux/delay.h> 36#include <linux/delay.h>
37#include <linux/mm.h>
38#include <asm/atomic.h> 37#include <asm/atomic.h>
39#include <asm/cache.h> 38#include <asm/cache.h>
40#include <asm/byteorder.h> 39#include <asm/byteorder.h>
@@ -61,11 +60,6 @@ struct wireless_dev;
61#define SET_ETHTOOL_OPS(netdev,ops) \ 60#define SET_ETHTOOL_OPS(netdev,ops) \
62 ( (netdev)->ethtool_ops = (ops) ) 61 ( (netdev)->ethtool_ops = (ops) )
63 62
64#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev
65 functions are available. */
66#define HAVE_FREE_NETDEV /* free_netdev() */
67#define HAVE_NETDEV_PRIV /* netdev_priv() */
68
69/* hardware address assignment types */ 63/* hardware address assignment types */
70#define NET_ADDR_PERM 0 /* address is permanent (default) */ 64#define NET_ADDR_PERM 0 /* address is permanent (default) */
71#define NET_ADDR_RANDOM 1 /* address is generated randomly */ 65#define NET_ADDR_RANDOM 1 /* address is generated randomly */
@@ -258,21 +252,8 @@ struct netdev_hw_addr_list {
258 netdev_hw_addr_list_for_each(ha, &(dev)->mc) 252 netdev_hw_addr_list_for_each(ha, &(dev)->mc)
259 253
260struct hh_cache { 254struct hh_cache {
261 struct hh_cache *hh_next; /* Next entry */ 255 u16 hh_len;
262 atomic_t hh_refcnt; /* number of users */ 256 u16 __pad;
263/*
264 * We want hh_output, hh_len, hh_lock and hh_data be a in a separate
265 * cache line on SMP.
266 * They are mostly read, but hh_refcnt may be changed quite frequently,
267 * incurring cache line ping pongs.
268 */
269 __be16 hh_type ____cacheline_aligned_in_smp;
270 /* protocol identifier, f.e ETH_P_IP
271 * NOTE: For VLANs, this will be the
272 * encapuslated type. --BLG
273 */
274 u16 hh_len; /* length of header */
275 int (*hh_output)(struct sk_buff *skb);
276 seqlock_t hh_lock; 257 seqlock_t hh_lock;
277 258
278 /* cached hardware header; allow for machine alignment needs. */ 259 /* cached hardware header; allow for machine alignment needs. */
@@ -284,12 +265,6 @@ struct hh_cache {
284 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; 265 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)];
285}; 266};
286 267
287static inline void hh_cache_put(struct hh_cache *hh)
288{
289 if (atomic_dec_and_test(&hh->hh_refcnt))
290 kfree(hh);
291}
292
293/* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much. 268/* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much.
294 * Alternative is: 269 * Alternative is:
295 * dev->hard_header_len ? (dev->hard_header_len + 270 * dev->hard_header_len ? (dev->hard_header_len +
@@ -314,8 +289,7 @@ struct header_ops {
314 const void *saddr, unsigned len); 289 const void *saddr, unsigned len);
315 int (*parse)(const struct sk_buff *skb, unsigned char *haddr); 290 int (*parse)(const struct sk_buff *skb, unsigned char *haddr);
316 int (*rebuild)(struct sk_buff *skb); 291 int (*rebuild)(struct sk_buff *skb);
317#define HAVE_HEADER_CACHE 292 int (*cache)(const struct neighbour *neigh, struct hh_cache *hh, __be16 type);
318 int (*cache)(const struct neighbour *neigh, struct hh_cache *hh);
319 void (*cache_update)(struct hh_cache *hh, 293 void (*cache_update)(struct hh_cache *hh,
320 const struct net_device *dev, 294 const struct net_device *dev,
321 const unsigned char *haddr); 295 const unsigned char *haddr);
@@ -556,7 +530,7 @@ struct netdev_queue {
556 struct Qdisc *qdisc; 530 struct Qdisc *qdisc;
557 unsigned long state; 531 unsigned long state;
558 struct Qdisc *qdisc_sleeping; 532 struct Qdisc *qdisc_sleeping;
559#ifdef CONFIG_RPS 533#if defined(CONFIG_RPS) || defined(CONFIG_XPS)
560 struct kobject kobj; 534 struct kobject kobj;
561#endif 535#endif
562#if defined(CONFIG_XPS) && defined(CONFIG_NUMA) 536#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
@@ -794,12 +768,6 @@ struct netdev_tc_txq {
794 * 3. Update dev->stats asynchronously and atomically, and define 768 * 3. Update dev->stats asynchronously and atomically, and define
795 * neither operation. 769 * neither operation.
796 * 770 *
797 * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp);
798 * If device support VLAN receive acceleration
799 * (ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called
800 * when vlan groups for the device changes. Note: grp is NULL
801 * if no vlan's groups are being used.
802 *
803 * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid); 771 * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid);
804 * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER) 772 * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER)
805 * this function is called when a VLAN id is registered. 773 * this function is called when a VLAN id is registered.
@@ -888,7 +856,6 @@ struct netdev_tc_txq {
888 * Must return >0 or -errno if it changed dev->features itself. 856 * Must return >0 or -errno if it changed dev->features itself.
889 * 857 *
890 */ 858 */
891#define HAVE_NET_DEVICE_OPS
892struct net_device_ops { 859struct net_device_ops {
893 int (*ndo_init)(struct net_device *dev); 860 int (*ndo_init)(struct net_device *dev);
894 void (*ndo_uninit)(struct net_device *dev); 861 void (*ndo_uninit)(struct net_device *dev);
@@ -919,8 +886,6 @@ struct net_device_ops {
919 struct rtnl_link_stats64 *storage); 886 struct rtnl_link_stats64 *storage);
920 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); 887 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
921 888
922 void (*ndo_vlan_rx_register)(struct net_device *dev,
923 struct vlan_group *grp);
924 void (*ndo_vlan_rx_add_vid)(struct net_device *dev, 889 void (*ndo_vlan_rx_add_vid)(struct net_device *dev,
925 unsigned short vid); 890 unsigned short vid);
926 void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, 891 void (*ndo_vlan_rx_kill_vid)(struct net_device *dev,
@@ -1097,12 +1062,6 @@ struct net_device {
1097#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ 1062#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \
1098 NETIF_F_FSO) 1063 NETIF_F_FSO)
1099 1064
1100#define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \
1101 NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
1102 NETIF_F_HIGHDMA | \
1103 NETIF_F_SCTP_CSUM | \
1104 NETIF_F_ALL_FCOE)
1105
1106 /* 1065 /*
1107 * If one device supports one of these features, then enable them 1066 * If one device supports one of these features, then enable them
1108 * for all in netdev_increment_features. 1067 * for all in netdev_increment_features.
@@ -1220,7 +1179,7 @@ struct net_device {
1220 1179
1221 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ 1180 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */
1222 1181
1223#ifdef CONFIG_RPS 1182#if defined(CONFIG_RPS) || defined(CONFIG_XPS)
1224 struct kset *queues_kset; 1183 struct kset *queues_kset;
1225 1184
1226 struct netdev_rx_queue *_rx; 1185 struct netdev_rx_queue *_rx;
@@ -1348,9 +1307,6 @@ struct net_device {
1348 /* max exchange id for FCoE LRO by ddp */ 1307 /* max exchange id for FCoE LRO by ddp */
1349 unsigned int fcoe_ddp_xid; 1308 unsigned int fcoe_ddp_xid;
1350#endif 1309#endif
1351 /* n-tuple filter list attached to this device */
1352 struct ethtool_rx_ntuple_list ethtool_ntuple_list;
1353
1354 /* phy device may attach itself for hardware timestamping */ 1310 /* phy device may attach itself for hardware timestamping */
1355 struct phy_device *phydev; 1311 struct phy_device *phydev;
1356 1312
@@ -1563,7 +1519,6 @@ struct packet_type {
1563 struct list_head list; 1519 struct list_head list;
1564}; 1520};
1565 1521
1566#include <linux/interrupt.h>
1567#include <linux/notifier.h> 1522#include <linux/notifier.h>
1568 1523
1569extern rwlock_t dev_base_lock; /* Device list lock */ 1524extern rwlock_t dev_base_lock; /* Device list lock */
@@ -1786,8 +1741,6 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd,
1786 1741
1787DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); 1742DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
1788 1743
1789#define HAVE_NETIF_QUEUE
1790
1791extern void __netif_schedule(struct Qdisc *q); 1744extern void __netif_schedule(struct Qdisc *q);
1792 1745
1793static inline void netif_schedule_queue(struct netdev_queue *txq) 1746static inline void netif_schedule_queue(struct netdev_queue *txq)
@@ -2063,10 +2016,8 @@ extern void dev_kfree_skb_irq(struct sk_buff *skb);
2063 */ 2016 */
2064extern void dev_kfree_skb_any(struct sk_buff *skb); 2017extern void dev_kfree_skb_any(struct sk_buff *skb);
2065 2018
2066#define HAVE_NETIF_RX 1
2067extern int netif_rx(struct sk_buff *skb); 2019extern int netif_rx(struct sk_buff *skb);
2068extern int netif_rx_ni(struct sk_buff *skb); 2020extern int netif_rx_ni(struct sk_buff *skb);
2069#define HAVE_NETIF_RECEIVE_SKB 1
2070extern int netif_receive_skb(struct sk_buff *skb); 2021extern int netif_receive_skb(struct sk_buff *skb);
2071extern gro_result_t dev_gro_receive(struct napi_struct *napi, 2022extern gro_result_t dev_gro_receive(struct napi_struct *napi,
2072 struct sk_buff *skb); 2023 struct sk_buff *skb);
@@ -2246,7 +2197,6 @@ extern void netif_device_attach(struct net_device *dev);
2246/* 2197/*
2247 * Network interface message level settings 2198 * Network interface message level settings
2248 */ 2199 */
2249#define HAVE_NETIF_MSG 1
2250 2200
2251enum { 2201enum {
2252 NETIF_MSG_DRV = 0x0001, 2202 NETIF_MSG_DRV = 0x0001,
@@ -2564,7 +2514,6 @@ static inline u32 netdev_get_wanted_features(struct net_device *dev)
2564 return (dev->features & ~dev->hw_features) | dev->wanted_features; 2514 return (dev->features & ~dev->hw_features) | dev->wanted_features;
2565} 2515}
2566u32 netdev_increment_features(u32 all, u32 one, u32 mask); 2516u32 netdev_increment_features(u32 all, u32 one, u32 mask);
2567u32 netdev_fix_features(struct net_device *dev, u32 features);
2568int __netdev_update_features(struct net_device *dev); 2517int __netdev_update_features(struct net_device *dev);
2569void netdev_update_features(struct net_device *dev); 2518void netdev_update_features(struct net_device *dev);
2570void netdev_change_features(struct net_device *dev); 2519void netdev_change_features(struct net_device *dev);
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index 5a262e3ae715..3540c6e262f7 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -104,6 +104,8 @@ enum {
104 IPSET_ATTR_NAMEREF, 104 IPSET_ATTR_NAMEREF,
105 IPSET_ATTR_IP2, 105 IPSET_ATTR_IP2,
106 IPSET_ATTR_CIDR2, 106 IPSET_ATTR_CIDR2,
107 IPSET_ATTR_IP2_TO,
108 IPSET_ATTR_IFACE,
107 __IPSET_ATTR_ADT_MAX, 109 __IPSET_ATTR_ADT_MAX,
108}; 110};
109#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1) 111#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
@@ -142,12 +144,18 @@ enum ipset_errno {
142enum ipset_cmd_flags { 144enum ipset_cmd_flags {
143 IPSET_FLAG_BIT_EXIST = 0, 145 IPSET_FLAG_BIT_EXIST = 0,
144 IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST), 146 IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST),
147 IPSET_FLAG_BIT_LIST_SETNAME = 1,
148 IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
149 IPSET_FLAG_BIT_LIST_HEADER = 2,
150 IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
145}; 151};
146 152
147/* Flags at CADT attribute level */ 153/* Flags at CADT attribute level */
148enum ipset_cadt_flags { 154enum ipset_cadt_flags {
149 IPSET_FLAG_BIT_BEFORE = 0, 155 IPSET_FLAG_BIT_BEFORE = 0,
150 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE), 156 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
157 IPSET_FLAG_BIT_PHYSDEV = 1,
158 IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
151}; 159};
152 160
153/* Commands with settype-specific attributes */ 161/* Commands with settype-specific attributes */
@@ -165,6 +173,7 @@ enum ipset_adt {
165#include <linux/ipv6.h> 173#include <linux/ipv6.h>
166#include <linux/netlink.h> 174#include <linux/netlink.h>
167#include <linux/netfilter.h> 175#include <linux/netfilter.h>
176#include <linux/netfilter/x_tables.h>
168#include <linux/vmalloc.h> 177#include <linux/vmalloc.h>
169#include <net/netlink.h> 178#include <net/netlink.h>
170 179
@@ -206,6 +215,8 @@ enum ip_set_feature {
206 IPSET_TYPE_IP2 = (1 << IPSET_TYPE_IP2_FLAG), 215 IPSET_TYPE_IP2 = (1 << IPSET_TYPE_IP2_FLAG),
207 IPSET_TYPE_NAME_FLAG = 4, 216 IPSET_TYPE_NAME_FLAG = 4,
208 IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG), 217 IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG),
218 IPSET_TYPE_IFACE_FLAG = 5,
219 IPSET_TYPE_IFACE = (1 << IPSET_TYPE_IFACE_FLAG),
209 /* Strictly speaking not a feature, but a flag for dumping: 220 /* Strictly speaking not a feature, but a flag for dumping:
210 * this settype must be dumped last */ 221 * this settype must be dumped last */
211 IPSET_DUMP_LAST_FLAG = 7, 222 IPSET_DUMP_LAST_FLAG = 7,
@@ -214,7 +225,17 @@ enum ip_set_feature {
214 225
215struct ip_set; 226struct ip_set;
216 227
217typedef int (*ipset_adtfn)(struct ip_set *set, void *value, u32 timeout); 228typedef int (*ipset_adtfn)(struct ip_set *set, void *value,
229 u32 timeout, u32 flags);
230
231/* Kernel API function options */
232struct ip_set_adt_opt {
233 u8 family; /* Actual protocol family */
234 u8 dim; /* Dimension of match/target */
235 u8 flags; /* Direction and negation flags */
236 u32 cmdflags; /* Command-like flags */
237 u32 timeout; /* Timeout value */
238};
218 239
219/* Set type, variant-specific part */ 240/* Set type, variant-specific part */
220struct ip_set_type_variant { 241struct ip_set_type_variant {
@@ -223,14 +244,15 @@ struct ip_set_type_variant {
223 * zero for no match/success to add/delete 244 * zero for no match/success to add/delete
224 * positive for matching element */ 245 * positive for matching element */
225 int (*kadt)(struct ip_set *set, const struct sk_buff * skb, 246 int (*kadt)(struct ip_set *set, const struct sk_buff * skb,
226 enum ipset_adt adt, u8 pf, u8 dim, u8 flags); 247 const struct xt_action_param *par,
248 enum ipset_adt adt, const struct ip_set_adt_opt *opt);
227 249
228 /* Userspace: test/add/del entries 250 /* Userspace: test/add/del entries
229 * returns negative error code, 251 * returns negative error code,
230 * zero for no match/success to add/delete 252 * zero for no match/success to add/delete
231 * positive for matching element */ 253 * positive for matching element */
232 int (*uadt)(struct ip_set *set, struct nlattr *tb[], 254 int (*uadt)(struct ip_set *set, struct nlattr *tb[],
233 enum ipset_adt adt, u32 *lineno, u32 flags); 255 enum ipset_adt adt, u32 *lineno, u32 flags, bool retried);
234 256
235 /* Low level add/del/test functions */ 257 /* Low level add/del/test functions */
236 ipset_adtfn adt[IPSET_ADT_MAX]; 258 ipset_adtfn adt[IPSET_ADT_MAX];
@@ -268,8 +290,8 @@ struct ip_set_type {
268 u8 dimension; 290 u8 dimension;
269 /* Supported family: may be AF_UNSPEC for both AF_INET/AF_INET6 */ 291 /* Supported family: may be AF_UNSPEC for both AF_INET/AF_INET6 */
270 u8 family; 292 u8 family;
271 /* Type revision */ 293 /* Type revisions */
272 u8 revision; 294 u8 revision_min, revision_max;
273 295
274 /* Create set */ 296 /* Create set */
275 int (*create)(struct ip_set *set, struct nlattr *tb[], u32 flags); 297 int (*create)(struct ip_set *set, struct nlattr *tb[], u32 flags);
@@ -300,6 +322,8 @@ struct ip_set {
300 const struct ip_set_type_variant *variant; 322 const struct ip_set_type_variant *variant;
301 /* The actual INET family of the set */ 323 /* The actual INET family of the set */
302 u8 family; 324 u8 family;
325 /* The type revision */
326 u8 revision;
303 /* The type specific data */ 327 /* The type specific data */
304 void *data; 328 void *data;
305}; 329};
@@ -307,21 +331,25 @@ struct ip_set {
307/* register and unregister set references */ 331/* register and unregister set references */
308extern ip_set_id_t ip_set_get_byname(const char *name, struct ip_set **set); 332extern ip_set_id_t ip_set_get_byname(const char *name, struct ip_set **set);
309extern void ip_set_put_byindex(ip_set_id_t index); 333extern void ip_set_put_byindex(ip_set_id_t index);
310extern const char * ip_set_name_byindex(ip_set_id_t index); 334extern const char *ip_set_name_byindex(ip_set_id_t index);
311extern ip_set_id_t ip_set_nfnl_get(const char *name); 335extern ip_set_id_t ip_set_nfnl_get(const char *name);
312extern ip_set_id_t ip_set_nfnl_get_byindex(ip_set_id_t index); 336extern ip_set_id_t ip_set_nfnl_get_byindex(ip_set_id_t index);
313extern void ip_set_nfnl_put(ip_set_id_t index); 337extern void ip_set_nfnl_put(ip_set_id_t index);
314 338
315/* API for iptables set match, and SET target */ 339/* API for iptables set match, and SET target */
340
316extern int ip_set_add(ip_set_id_t id, const struct sk_buff *skb, 341extern int ip_set_add(ip_set_id_t id, const struct sk_buff *skb,
317 u8 family, u8 dim, u8 flags); 342 const struct xt_action_param *par,
343 const struct ip_set_adt_opt *opt);
318extern int ip_set_del(ip_set_id_t id, const struct sk_buff *skb, 344extern int ip_set_del(ip_set_id_t id, const struct sk_buff *skb,
319 u8 family, u8 dim, u8 flags); 345 const struct xt_action_param *par,
346 const struct ip_set_adt_opt *opt);
320extern int ip_set_test(ip_set_id_t id, const struct sk_buff *skb, 347extern int ip_set_test(ip_set_id_t id, const struct sk_buff *skb,
321 u8 family, u8 dim, u8 flags); 348 const struct xt_action_param *par,
349 const struct ip_set_adt_opt *opt);
322 350
323/* Utility functions */ 351/* Utility functions */
324extern void * ip_set_alloc(size_t size); 352extern void *ip_set_alloc(size_t size);
325extern void ip_set_free(void *members); 353extern void ip_set_free(void *members);
326extern int ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr); 354extern int ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr);
327extern int ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr); 355extern int ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr);
@@ -331,7 +359,7 @@ ip_set_get_hostipaddr4(struct nlattr *nla, u32 *ipaddr)
331{ 359{
332 __be32 ip; 360 __be32 ip;
333 int ret = ip_set_get_ipaddr4(nla, &ip); 361 int ret = ip_set_get_ipaddr4(nla, &ip);
334 362
335 if (ret) 363 if (ret)
336 return ret; 364 return ret;
337 *ipaddr = ntohl(ip); 365 *ipaddr = ntohl(ip);
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h
index ac3c822eb39a..b89fb79cb44f 100644
--- a/include/linux/netfilter/ipset/ip_set_ahash.h
+++ b/include/linux/netfilter/ipset/ip_set_ahash.h
@@ -5,6 +5,11 @@
5#include <linux/jhash.h> 5#include <linux/jhash.h>
6#include <linux/netfilter/ipset/ip_set_timeout.h> 6#include <linux/netfilter/ipset/ip_set_timeout.h>
7 7
8#define CONCAT(a, b, c) a##b##c
9#define TOKEN(a, b, c) CONCAT(a, b, c)
10
11#define type_pf_next TOKEN(TYPE, PF, _elem)
12
8/* Hashing which uses arrays to resolve clashing. The hash table is resized 13/* Hashing which uses arrays to resolve clashing. The hash table is resized
9 * (doubled) when searching becomes too long. 14 * (doubled) when searching becomes too long.
10 * Internally jhash is used with the assumption that the size of the 15 * Internally jhash is used with the assumption that the size of the
@@ -23,7 +28,32 @@
23/* Number of elements to store in an initial array block */ 28/* Number of elements to store in an initial array block */
24#define AHASH_INIT_SIZE 4 29#define AHASH_INIT_SIZE 4
25/* Max number of elements to store in an array block */ 30/* Max number of elements to store in an array block */
26#define AHASH_MAX_SIZE (3*4) 31#define AHASH_MAX_SIZE (3*AHASH_INIT_SIZE)
32
33/* Max number of elements can be tuned */
34#ifdef IP_SET_HASH_WITH_MULTI
35#define AHASH_MAX(h) ((h)->ahash_max)
36
37static inline u8
38tune_ahash_max(u8 curr, u32 multi)
39{
40 u32 n;
41
42 if (multi < curr)
43 return curr;
44
45 n = curr + AHASH_INIT_SIZE;
46 /* Currently, at listing one hash bucket must fit into a message.
47 * Therefore we have a hard limit here.
48 */
49 return n > curr && n <= 64 ? n : curr;
50}
51#define TUNE_AHASH_MAX(h, multi) \
52 ((h)->ahash_max = tune_ahash_max((h)->ahash_max, multi))
53#else
54#define AHASH_MAX(h) AHASH_MAX_SIZE
55#define TUNE_AHASH_MAX(h, multi)
56#endif
27 57
28/* A hash bucket */ 58/* A hash bucket */
29struct hbucket { 59struct hbucket {
@@ -38,7 +68,7 @@ struct htable {
38 struct hbucket bucket[0]; /* hashtable buckets */ 68 struct hbucket bucket[0]; /* hashtable buckets */
39}; 69};
40 70
41#define hbucket(h, i) &((h)->bucket[i]) 71#define hbucket(h, i) (&((h)->bucket[i]))
42 72
43/* Book-keeping of the prefixes added to the set */ 73/* Book-keeping of the prefixes added to the set */
44struct ip_set_hash_nets { 74struct ip_set_hash_nets {
@@ -54,9 +84,16 @@ struct ip_set_hash {
54 u32 initval; /* random jhash init value */ 84 u32 initval; /* random jhash init value */
55 u32 timeout; /* timeout value, if enabled */ 85 u32 timeout; /* timeout value, if enabled */
56 struct timer_list gc; /* garbage collection when timeout enabled */ 86 struct timer_list gc; /* garbage collection when timeout enabled */
87 struct type_pf_next next; /* temporary storage for uadd */
88#ifdef IP_SET_HASH_WITH_MULTI
89 u8 ahash_max; /* max elements in an array block */
90#endif
57#ifdef IP_SET_HASH_WITH_NETMASK 91#ifdef IP_SET_HASH_WITH_NETMASK
58 u8 netmask; /* netmask value for subnets to store */ 92 u8 netmask; /* netmask value for subnets to store */
59#endif 93#endif
94#ifdef IP_SET_HASH_WITH_RBTREE
95 struct rb_root rbtree;
96#endif
60#ifdef IP_SET_HASH_WITH_NETS 97#ifdef IP_SET_HASH_WITH_NETS
61 struct ip_set_hash_nets nets[0]; /* book-keeping of prefixes */ 98 struct ip_set_hash_nets nets[0]; /* book-keeping of prefixes */
62#endif 99#endif
@@ -194,17 +231,24 @@ ip_set_hash_destroy(struct ip_set *set)
194 del_timer_sync(&h->gc); 231 del_timer_sync(&h->gc);
195 232
196 ahash_destroy(h->table); 233 ahash_destroy(h->table);
234#ifdef IP_SET_HASH_WITH_RBTREE
235 rbtree_destroy(&h->rbtree);
236#endif
197 kfree(h); 237 kfree(h);
198 238
199 set->data = NULL; 239 set->data = NULL;
200} 240}
201 241
202#define HKEY(data, initval, htable_bits) \
203(jhash2((u32 *)(data), sizeof(struct type_pf_elem)/sizeof(u32), initval) \
204 & jhash_mask(htable_bits))
205
206#endif /* _IP_SET_AHASH_H */ 242#endif /* _IP_SET_AHASH_H */
207 243
244#ifndef HKEY_DATALEN
245#define HKEY_DATALEN sizeof(struct type_pf_elem)
246#endif
247
248#define HKEY(data, initval, htable_bits) \
249(jhash2((u32 *)(data), HKEY_DATALEN/sizeof(u32), initval) \
250 & jhash_mask(htable_bits))
251
208#define CONCAT(a, b, c) a##b##c 252#define CONCAT(a, b, c) a##b##c
209#define TOKEN(a, b, c) CONCAT(a, b, c) 253#define TOKEN(a, b, c) CONCAT(a, b, c)
210 254
@@ -217,6 +261,7 @@ ip_set_hash_destroy(struct ip_set *set)
217#define type_pf_data_netmask TOKEN(TYPE, PF, _data_netmask) 261#define type_pf_data_netmask TOKEN(TYPE, PF, _data_netmask)
218#define type_pf_data_list TOKEN(TYPE, PF, _data_list) 262#define type_pf_data_list TOKEN(TYPE, PF, _data_list)
219#define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist) 263#define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist)
264#define type_pf_data_next TOKEN(TYPE, PF, _data_next)
220 265
221#define type_pf_elem TOKEN(TYPE, PF, _elem) 266#define type_pf_elem TOKEN(TYPE, PF, _elem)
222#define type_pf_telem TOKEN(TYPE, PF, _telem) 267#define type_pf_telem TOKEN(TYPE, PF, _telem)
@@ -262,12 +307,13 @@ ip_set_hash_destroy(struct ip_set *set)
262/* Add an element to the hash table when resizing the set: 307/* Add an element to the hash table when resizing the set:
263 * we spare the maintenance of the internal counters. */ 308 * we spare the maintenance of the internal counters. */
264static int 309static int
265type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value) 310type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value,
311 u8 ahash_max)
266{ 312{
267 if (n->pos >= n->size) { 313 if (n->pos >= n->size) {
268 void *tmp; 314 void *tmp;
269 315
270 if (n->size >= AHASH_MAX_SIZE) 316 if (n->size >= ahash_max)
271 /* Trigger rehashing */ 317 /* Trigger rehashing */
272 return -EAGAIN; 318 return -EAGAIN;
273 319
@@ -322,7 +368,7 @@ retry:
322 for (j = 0; j < n->pos; j++) { 368 for (j = 0; j < n->pos; j++) {
323 data = ahash_data(n, j); 369 data = ahash_data(n, j);
324 m = hbucket(t, HKEY(data, h->initval, htable_bits)); 370 m = hbucket(t, HKEY(data, h->initval, htable_bits));
325 ret = type_pf_elem_add(m, data); 371 ret = type_pf_elem_add(m, data, AHASH_MAX(h));
326 if (ret < 0) { 372 if (ret < 0) {
327 read_unlock_bh(&set->lock); 373 read_unlock_bh(&set->lock);
328 ahash_destroy(t); 374 ahash_destroy(t);
@@ -346,17 +392,20 @@ retry:
346 return 0; 392 return 0;
347} 393}
348 394
395static inline void
396type_pf_data_next(struct ip_set_hash *h, const struct type_pf_elem *d);
397
349/* Add an element to a hash and update the internal counters when succeeded, 398/* Add an element to a hash and update the internal counters when succeeded,
350 * otherwise report the proper error code. */ 399 * otherwise report the proper error code. */
351static int 400static int
352type_pf_add(struct ip_set *set, void *value, u32 timeout) 401type_pf_add(struct ip_set *set, void *value, u32 timeout, u32 flags)
353{ 402{
354 struct ip_set_hash *h = set->data; 403 struct ip_set_hash *h = set->data;
355 struct htable *t; 404 struct htable *t;
356 const struct type_pf_elem *d = value; 405 const struct type_pf_elem *d = value;
357 struct hbucket *n; 406 struct hbucket *n;
358 int i, ret = 0; 407 int i, ret = 0;
359 u32 key; 408 u32 key, multi = 0;
360 409
361 if (h->elements >= h->maxelem) 410 if (h->elements >= h->maxelem)
362 return -IPSET_ERR_HASH_FULL; 411 return -IPSET_ERR_HASH_FULL;
@@ -366,14 +415,17 @@ type_pf_add(struct ip_set *set, void *value, u32 timeout)
366 key = HKEY(value, h->initval, t->htable_bits); 415 key = HKEY(value, h->initval, t->htable_bits);
367 n = hbucket(t, key); 416 n = hbucket(t, key);
368 for (i = 0; i < n->pos; i++) 417 for (i = 0; i < n->pos; i++)
369 if (type_pf_data_equal(ahash_data(n, i), d)) { 418 if (type_pf_data_equal(ahash_data(n, i), d, &multi)) {
370 ret = -IPSET_ERR_EXIST; 419 ret = -IPSET_ERR_EXIST;
371 goto out; 420 goto out;
372 } 421 }
373 422 TUNE_AHASH_MAX(h, multi);
374 ret = type_pf_elem_add(n, value); 423 ret = type_pf_elem_add(n, value, AHASH_MAX(h));
375 if (ret != 0) 424 if (ret != 0) {
425 if (ret == -EAGAIN)
426 type_pf_data_next(h, d);
376 goto out; 427 goto out;
428 }
377 429
378#ifdef IP_SET_HASH_WITH_NETS 430#ifdef IP_SET_HASH_WITH_NETS
379 add_cidr(h, d->cidr, HOST_MASK); 431 add_cidr(h, d->cidr, HOST_MASK);
@@ -388,7 +440,7 @@ out:
388 * and free up space if possible. 440 * and free up space if possible.
389 */ 441 */
390static int 442static int
391type_pf_del(struct ip_set *set, void *value, u32 timeout) 443type_pf_del(struct ip_set *set, void *value, u32 timeout, u32 flags)
392{ 444{
393 struct ip_set_hash *h = set->data; 445 struct ip_set_hash *h = set->data;
394 struct htable *t = h->table; 446 struct htable *t = h->table;
@@ -396,13 +448,13 @@ type_pf_del(struct ip_set *set, void *value, u32 timeout)
396 struct hbucket *n; 448 struct hbucket *n;
397 int i; 449 int i;
398 struct type_pf_elem *data; 450 struct type_pf_elem *data;
399 u32 key; 451 u32 key, multi = 0;
400 452
401 key = HKEY(value, h->initval, t->htable_bits); 453 key = HKEY(value, h->initval, t->htable_bits);
402 n = hbucket(t, key); 454 n = hbucket(t, key);
403 for (i = 0; i < n->pos; i++) { 455 for (i = 0; i < n->pos; i++) {
404 data = ahash_data(n, i); 456 data = ahash_data(n, i);
405 if (!type_pf_data_equal(data, d)) 457 if (!type_pf_data_equal(data, d, &multi))
406 continue; 458 continue;
407 if (i != n->pos - 1) 459 if (i != n->pos - 1)
408 /* Not last one */ 460 /* Not last one */
@@ -443,17 +495,17 @@ type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
443 struct hbucket *n; 495 struct hbucket *n;
444 const struct type_pf_elem *data; 496 const struct type_pf_elem *data;
445 int i, j = 0; 497 int i, j = 0;
446 u32 key; 498 u32 key, multi = 0;
447 u8 host_mask = SET_HOST_MASK(set->family); 499 u8 host_mask = SET_HOST_MASK(set->family);
448 500
449 pr_debug("test by nets\n"); 501 pr_debug("test by nets\n");
450 for (; j < host_mask && h->nets[j].cidr; j++) { 502 for (; j < host_mask && h->nets[j].cidr && !multi; j++) {
451 type_pf_data_netmask(d, h->nets[j].cidr); 503 type_pf_data_netmask(d, h->nets[j].cidr);
452 key = HKEY(d, h->initval, t->htable_bits); 504 key = HKEY(d, h->initval, t->htable_bits);
453 n = hbucket(t, key); 505 n = hbucket(t, key);
454 for (i = 0; i < n->pos; i++) { 506 for (i = 0; i < n->pos; i++) {
455 data = ahash_data(n, i); 507 data = ahash_data(n, i);
456 if (type_pf_data_equal(data, d)) 508 if (type_pf_data_equal(data, d, &multi))
457 return 1; 509 return 1;
458 } 510 }
459 } 511 }
@@ -463,7 +515,7 @@ type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
463 515
464/* Test whether the element is added to the set */ 516/* Test whether the element is added to the set */
465static int 517static int
466type_pf_test(struct ip_set *set, void *value, u32 timeout) 518type_pf_test(struct ip_set *set, void *value, u32 timeout, u32 flags)
467{ 519{
468 struct ip_set_hash *h = set->data; 520 struct ip_set_hash *h = set->data;
469 struct htable *t = h->table; 521 struct htable *t = h->table;
@@ -471,7 +523,7 @@ type_pf_test(struct ip_set *set, void *value, u32 timeout)
471 struct hbucket *n; 523 struct hbucket *n;
472 const struct type_pf_elem *data; 524 const struct type_pf_elem *data;
473 int i; 525 int i;
474 u32 key; 526 u32 key, multi = 0;
475 527
476#ifdef IP_SET_HASH_WITH_NETS 528#ifdef IP_SET_HASH_WITH_NETS
477 /* If we test an IP address and not a network address, 529 /* If we test an IP address and not a network address,
@@ -484,7 +536,7 @@ type_pf_test(struct ip_set *set, void *value, u32 timeout)
484 n = hbucket(t, key); 536 n = hbucket(t, key);
485 for (i = 0; i < n->pos; i++) { 537 for (i = 0; i < n->pos; i++) {
486 data = ahash_data(n, i); 538 data = ahash_data(n, i);
487 if (type_pf_data_equal(data, d)) 539 if (type_pf_data_equal(data, d, &multi))
488 return 1; 540 return 1;
489 } 541 }
490 return 0; 542 return 0;
@@ -586,10 +638,11 @@ nla_put_failure:
586 638
587static int 639static int
588type_pf_kadt(struct ip_set *set, const struct sk_buff * skb, 640type_pf_kadt(struct ip_set *set, const struct sk_buff * skb,
589 enum ipset_adt adt, u8 pf, u8 dim, u8 flags); 641 const struct xt_action_param *par,
642 enum ipset_adt adt, const struct ip_set_adt_opt *opt);
590static int 643static int
591type_pf_uadt(struct ip_set *set, struct nlattr *tb[], 644type_pf_uadt(struct ip_set *set, struct nlattr *tb[],
592 enum ipset_adt adt, u32 *lineno, u32 flags); 645 enum ipset_adt adt, u32 *lineno, u32 flags, bool retried);
593 646
594static const struct ip_set_type_variant type_pf_variant = { 647static const struct ip_set_type_variant type_pf_variant = {
595 .kadt = type_pf_kadt, 648 .kadt = type_pf_kadt,
@@ -640,14 +693,14 @@ type_pf_data_timeout_set(struct type_pf_elem *data, u32 timeout)
640 693
641static int 694static int
642type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value, 695type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value,
643 u32 timeout) 696 u8 ahash_max, u32 timeout)
644{ 697{
645 struct type_pf_elem *data; 698 struct type_pf_elem *data;
646 699
647 if (n->pos >= n->size) { 700 if (n->pos >= n->size) {
648 void *tmp; 701 void *tmp;
649 702
650 if (n->size >= AHASH_MAX_SIZE) 703 if (n->size >= ahash_max)
651 /* Trigger rehashing */ 704 /* Trigger rehashing */
652 return -EAGAIN; 705 return -EAGAIN;
653 706
@@ -752,7 +805,7 @@ retry:
752 for (j = 0; j < n->pos; j++) { 805 for (j = 0; j < n->pos; j++) {
753 data = ahash_tdata(n, j); 806 data = ahash_tdata(n, j);
754 m = hbucket(t, HKEY(data, h->initval, htable_bits)); 807 m = hbucket(t, HKEY(data, h->initval, htable_bits));
755 ret = type_pf_elem_tadd(m, data, 808 ret = type_pf_elem_tadd(m, data, AHASH_MAX(h),
756 type_pf_data_timeout(data)); 809 type_pf_data_timeout(data));
757 if (ret < 0) { 810 if (ret < 0) {
758 read_unlock_bh(&set->lock); 811 read_unlock_bh(&set->lock);
@@ -776,15 +829,16 @@ retry:
776} 829}
777 830
778static int 831static int
779type_pf_tadd(struct ip_set *set, void *value, u32 timeout) 832type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
780{ 833{
781 struct ip_set_hash *h = set->data; 834 struct ip_set_hash *h = set->data;
782 struct htable *t = h->table; 835 struct htable *t = h->table;
783 const struct type_pf_elem *d = value; 836 const struct type_pf_elem *d = value;
784 struct hbucket *n; 837 struct hbucket *n;
785 struct type_pf_elem *data; 838 struct type_pf_elem *data;
786 int ret = 0, i, j = AHASH_MAX_SIZE + 1; 839 int ret = 0, i, j = AHASH_MAX(h) + 1;
787 u32 key; 840 bool flag_exist = flags & IPSET_FLAG_EXIST;
841 u32 key, multi = 0;
788 842
789 if (h->elements >= h->maxelem) 843 if (h->elements >= h->maxelem)
790 /* FIXME: when set is full, we slow down here */ 844 /* FIXME: when set is full, we slow down here */
@@ -798,18 +852,18 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout)
798 n = hbucket(t, key); 852 n = hbucket(t, key);
799 for (i = 0; i < n->pos; i++) { 853 for (i = 0; i < n->pos; i++) {
800 data = ahash_tdata(n, i); 854 data = ahash_tdata(n, i);
801 if (type_pf_data_equal(data, d)) { 855 if (type_pf_data_equal(data, d, &multi)) {
802 if (type_pf_data_expired(data)) 856 if (type_pf_data_expired(data) || flag_exist)
803 j = i; 857 j = i;
804 else { 858 else {
805 ret = -IPSET_ERR_EXIST; 859 ret = -IPSET_ERR_EXIST;
806 goto out; 860 goto out;
807 } 861 }
808 } else if (j == AHASH_MAX_SIZE + 1 && 862 } else if (j == AHASH_MAX(h) + 1 &&
809 type_pf_data_expired(data)) 863 type_pf_data_expired(data))
810 j = i; 864 j = i;
811 } 865 }
812 if (j != AHASH_MAX_SIZE + 1) { 866 if (j != AHASH_MAX(h) + 1) {
813 data = ahash_tdata(n, j); 867 data = ahash_tdata(n, j);
814#ifdef IP_SET_HASH_WITH_NETS 868#ifdef IP_SET_HASH_WITH_NETS
815 del_cidr(h, data->cidr, HOST_MASK); 869 del_cidr(h, data->cidr, HOST_MASK);
@@ -819,9 +873,13 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout)
819 type_pf_data_timeout_set(data, timeout); 873 type_pf_data_timeout_set(data, timeout);
820 goto out; 874 goto out;
821 } 875 }
822 ret = type_pf_elem_tadd(n, d, timeout); 876 TUNE_AHASH_MAX(h, multi);
823 if (ret != 0) 877 ret = type_pf_elem_tadd(n, d, AHASH_MAX(h), timeout);
878 if (ret != 0) {
879 if (ret == -EAGAIN)
880 type_pf_data_next(h, d);
824 goto out; 881 goto out;
882 }
825 883
826#ifdef IP_SET_HASH_WITH_NETS 884#ifdef IP_SET_HASH_WITH_NETS
827 add_cidr(h, d->cidr, HOST_MASK); 885 add_cidr(h, d->cidr, HOST_MASK);
@@ -833,7 +891,7 @@ out:
833} 891}
834 892
835static int 893static int
836type_pf_tdel(struct ip_set *set, void *value, u32 timeout) 894type_pf_tdel(struct ip_set *set, void *value, u32 timeout, u32 flags)
837{ 895{
838 struct ip_set_hash *h = set->data; 896 struct ip_set_hash *h = set->data;
839 struct htable *t = h->table; 897 struct htable *t = h->table;
@@ -841,13 +899,13 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout)
841 struct hbucket *n; 899 struct hbucket *n;
842 int i; 900 int i;
843 struct type_pf_elem *data; 901 struct type_pf_elem *data;
844 u32 key; 902 u32 key, multi = 0;
845 903
846 key = HKEY(value, h->initval, t->htable_bits); 904 key = HKEY(value, h->initval, t->htable_bits);
847 n = hbucket(t, key); 905 n = hbucket(t, key);
848 for (i = 0; i < n->pos; i++) { 906 for (i = 0; i < n->pos; i++) {
849 data = ahash_tdata(n, i); 907 data = ahash_tdata(n, i);
850 if (!type_pf_data_equal(data, d)) 908 if (!type_pf_data_equal(data, d, &multi))
851 continue; 909 continue;
852 if (type_pf_data_expired(data)) 910 if (type_pf_data_expired(data))
853 return -IPSET_ERR_EXIST; 911 return -IPSET_ERR_EXIST;
@@ -887,16 +945,16 @@ type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
887 struct type_pf_elem *data; 945 struct type_pf_elem *data;
888 struct hbucket *n; 946 struct hbucket *n;
889 int i, j = 0; 947 int i, j = 0;
890 u32 key; 948 u32 key, multi = 0;
891 u8 host_mask = SET_HOST_MASK(set->family); 949 u8 host_mask = SET_HOST_MASK(set->family);
892 950
893 for (; j < host_mask && h->nets[j].cidr; j++) { 951 for (; j < host_mask && h->nets[j].cidr && !multi; j++) {
894 type_pf_data_netmask(d, h->nets[j].cidr); 952 type_pf_data_netmask(d, h->nets[j].cidr);
895 key = HKEY(d, h->initval, t->htable_bits); 953 key = HKEY(d, h->initval, t->htable_bits);
896 n = hbucket(t, key); 954 n = hbucket(t, key);
897 for (i = 0; i < n->pos; i++) { 955 for (i = 0; i < n->pos; i++) {
898 data = ahash_tdata(n, i); 956 data = ahash_tdata(n, i);
899 if (type_pf_data_equal(data, d)) 957 if (type_pf_data_equal(data, d, &multi))
900 return !type_pf_data_expired(data); 958 return !type_pf_data_expired(data);
901 } 959 }
902 } 960 }
@@ -905,14 +963,14 @@ type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
905#endif 963#endif
906 964
907static int 965static int
908type_pf_ttest(struct ip_set *set, void *value, u32 timeout) 966type_pf_ttest(struct ip_set *set, void *value, u32 timeout, u32 flags)
909{ 967{
910 struct ip_set_hash *h = set->data; 968 struct ip_set_hash *h = set->data;
911 struct htable *t = h->table; 969 struct htable *t = h->table;
912 struct type_pf_elem *data, *d = value; 970 struct type_pf_elem *data, *d = value;
913 struct hbucket *n; 971 struct hbucket *n;
914 int i; 972 int i;
915 u32 key; 973 u32 key, multi = 0;
916 974
917#ifdef IP_SET_HASH_WITH_NETS 975#ifdef IP_SET_HASH_WITH_NETS
918 if (d->cidr == SET_HOST_MASK(set->family)) 976 if (d->cidr == SET_HOST_MASK(set->family))
@@ -922,7 +980,7 @@ type_pf_ttest(struct ip_set *set, void *value, u32 timeout)
922 n = hbucket(t, key); 980 n = hbucket(t, key);
923 for (i = 0; i < n->pos; i++) { 981 for (i = 0; i < n->pos; i++) {
924 data = ahash_tdata(n, i); 982 data = ahash_tdata(n, i);
925 if (type_pf_data_equal(data, d)) 983 if (type_pf_data_equal(data, d, &multi))
926 return !type_pf_data_expired(data); 984 return !type_pf_data_expired(data);
927 } 985 }
928 return 0; 986 return 0;
@@ -1030,6 +1088,8 @@ type_pf_gc_init(struct ip_set *set)
1030 IPSET_GC_PERIOD(h->timeout)); 1088 IPSET_GC_PERIOD(h->timeout));
1031} 1089}
1032 1090
1091#undef HKEY_DATALEN
1092#undef HKEY
1033#undef type_pf_data_equal 1093#undef type_pf_data_equal
1034#undef type_pf_data_isnull 1094#undef type_pf_data_isnull
1035#undef type_pf_data_copy 1095#undef type_pf_data_copy
diff --git a/include/linux/netfilter/ipset/ip_set_hash.h b/include/linux/netfilter/ipset/ip_set_hash.h
index b86f15c04524..e2a9fae767f6 100644
--- a/include/linux/netfilter/ipset/ip_set_hash.h
+++ b/include/linux/netfilter/ipset/ip_set_hash.h
@@ -11,6 +11,10 @@ enum {
11 IPSET_ERR_INVALID_PROTO, 11 IPSET_ERR_INVALID_PROTO,
12 /* Protocol missing but must be specified */ 12 /* Protocol missing but must be specified */
13 IPSET_ERR_MISSING_PROTO, 13 IPSET_ERR_MISSING_PROTO,
14 /* Range not supported */
15 IPSET_ERR_HASH_RANGE_UNSUPPORTED,
16 /* Invalid range */
17 IPSET_ERR_HASH_RANGE,
14}; 18};
15 19
16#ifdef __KERNEL__ 20#ifdef __KERNEL__
diff --git a/include/linux/netfilter/ipset/ip_set_timeout.h b/include/linux/netfilter/ipset/ip_set_timeout.h
index bcdd40ad39ed..47923205a4ad 100644
--- a/include/linux/netfilter/ipset/ip_set_timeout.h
+++ b/include/linux/netfilter/ipset/ip_set_timeout.h
@@ -22,6 +22,9 @@
22 22
23#define with_timeout(timeout) ((timeout) != IPSET_NO_TIMEOUT) 23#define with_timeout(timeout) ((timeout) != IPSET_NO_TIMEOUT)
24 24
25#define opt_timeout(opt, map) \
26 (with_timeout((opt)->timeout) ? (opt)->timeout : (map)->timeout)
27
25static inline unsigned int 28static inline unsigned int
26ip_set_timeout_uget(struct nlattr *tb) 29ip_set_timeout_uget(struct nlattr *tb)
27{ 30{
@@ -75,7 +78,7 @@ ip_set_timeout_set(u32 timeout)
75static inline u32 78static inline u32
76ip_set_timeout_get(unsigned long timeout) 79ip_set_timeout_get(unsigned long timeout)
77{ 80{
78 return timeout == IPSET_ELEM_PERMANENT ? 0 : 81 return timeout == IPSET_ELEM_PERMANENT ? 0 :
79 jiffies_to_msecs(timeout - jiffies)/1000; 82 jiffies_to_msecs(timeout - jiffies)/1000;
80} 83}
81 84
diff --git a/include/linux/netfilter/ipset/pfxlen.h b/include/linux/netfilter/ipset/pfxlen.h
index 0e1fb50da562..199fd11fedc0 100644
--- a/include/linux/netfilter/ipset/pfxlen.h
+++ b/include/linux/netfilter/ipset/pfxlen.h
@@ -2,7 +2,8 @@
2#define _PFXLEN_H 2#define _PFXLEN_H
3 3
4#include <asm/byteorder.h> 4#include <asm/byteorder.h>
5#include <linux/netfilter.h> 5#include <linux/netfilter.h>
6#include <net/tcp.h>
6 7
7/* Prefixlen maps, by Jan Engelhardt */ 8/* Prefixlen maps, by Jan Engelhardt */
8extern const union nf_inet_addr ip_set_netmask_map[]; 9extern const union nf_inet_addr ip_set_netmask_map[];
@@ -32,4 +33,12 @@ ip_set_hostmask6(u8 pfxlen)
32 return &ip_set_hostmask_map[pfxlen].ip6[0]; 33 return &ip_set_hostmask_map[pfxlen].ip6[0];
33} 34}
34 35
36extern u32 ip_set_range_to_cidr(u32 from, u32 to, u8 *cidr);
37
38#define ip_set_mask_from_to(from, to, cidr) \
39do { \
40 from &= ip_set_hostmask(cidr); \
41 to = from | ~ip_set_hostmask(cidr); \
42} while (0)
43
35#endif /*_PFXLEN_H */ 44#endif /*_PFXLEN_H */
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 2b11fc1a86be..74d33861473c 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -60,6 +60,9 @@ struct nfnl_callback {
60 int (*call)(struct sock *nl, struct sk_buff *skb, 60 int (*call)(struct sock *nl, struct sk_buff *skb,
61 const struct nlmsghdr *nlh, 61 const struct nlmsghdr *nlh,
62 const struct nlattr * const cda[]); 62 const struct nlattr * const cda[]);
63 int (*call_rcu)(struct sock *nl, struct sk_buff *skb,
64 const struct nlmsghdr *nlh,
65 const struct nlattr * const cda[]);
63 const struct nla_policy *policy; /* netlink attribute policy */ 66 const struct nla_policy *policy; /* netlink attribute policy */
64 const u_int16_t attr_count; /* number of nlattr's */ 67 const u_int16_t attr_count; /* number of nlattr's */
65}; 68};
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h
index af94e0014ebd..24b32e6c009e 100644
--- a/include/linux/netfilter/nfnetlink_queue.h
+++ b/include/linux/netfilter/nfnetlink_queue.h
@@ -8,6 +8,7 @@ enum nfqnl_msg_types {
8 NFQNL_MSG_PACKET, /* packet from kernel to userspace */ 8 NFQNL_MSG_PACKET, /* packet from kernel to userspace */
9 NFQNL_MSG_VERDICT, /* verdict from userspace to kernel */ 9 NFQNL_MSG_VERDICT, /* verdict from userspace to kernel */
10 NFQNL_MSG_CONFIG, /* connect to a particular queue */ 10 NFQNL_MSG_CONFIG, /* connect to a particular queue */
11 NFQNL_MSG_VERDICT_BATCH, /* batchv from userspace to kernel */
11 12
12 NFQNL_MSG_MAX 13 NFQNL_MSG_MAX
13}; 14};
diff --git a/include/linux/netfilter/xt_set.h b/include/linux/netfilter/xt_set.h
index 081f1ded2842..c0405ac92870 100644
--- a/include/linux/netfilter/xt_set.h
+++ b/include/linux/netfilter/xt_set.h
@@ -35,7 +35,7 @@ struct xt_set_info_target_v0 {
35 struct xt_set_info_v0 del_set; 35 struct xt_set_info_v0 del_set;
36}; 36};
37 37
38/* Revision 1: current interface to netfilter/iptables */ 38/* Revision 1 match and target */
39 39
40struct xt_set_info { 40struct xt_set_info {
41 ip_set_id_t index; 41 ip_set_id_t index;
@@ -44,13 +44,22 @@ struct xt_set_info {
44}; 44};
45 45
46/* match and target infos */ 46/* match and target infos */
47struct xt_set_info_match { 47struct xt_set_info_match_v1 {
48 struct xt_set_info match_set; 48 struct xt_set_info match_set;
49}; 49};
50 50
51struct xt_set_info_target { 51struct xt_set_info_target_v1 {
52 struct xt_set_info add_set; 52 struct xt_set_info add_set;
53 struct xt_set_info del_set; 53 struct xt_set_info del_set;
54}; 54};
55 55
56/* Revision 2 target */
57
58struct xt_set_info_target_v2 {
59 struct xt_set_info add_set;
60 struct xt_set_info del_set;
61 u32 flags;
62 u32 timeout;
63};
64
56#endif /*_XT_SET_H*/ 65#endif /*_XT_SET_H*/
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index a9dd89552f9c..2e17c5dbdcb8 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -49,6 +49,7 @@ struct nlmsghdr {
49#define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */ 49#define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */
50#define NLM_F_ACK 4 /* Reply with ack, with zero or error code */ 50#define NLM_F_ACK 4 /* Reply with ack, with zero or error code */
51#define NLM_F_ECHO 8 /* Echo this request */ 51#define NLM_F_ECHO 8 /* Echo this request */
52#define NLM_F_DUMP_INTR 16 /* Dump was inconsistent due to sequence change */
52 53
53/* Modifiers to GET request */ 54/* Modifiers to GET request */
54#define NLM_F_ROOT 0x100 /* specify tree root */ 55#define NLM_F_ROOT 0x100 /* specify tree root */
@@ -221,7 +222,9 @@ struct netlink_callback {
221 int (*dump)(struct sk_buff * skb, 222 int (*dump)(struct sk_buff * skb,
222 struct netlink_callback *cb); 223 struct netlink_callback *cb);
223 int (*done)(struct netlink_callback *cb); 224 int (*done)(struct netlink_callback *cb);
224 int family; 225 u16 family;
226 u16 min_dump_alloc;
227 unsigned int prev_seq, seq;
225 long args[6]; 228 long args[6];
226}; 229};
227 230
@@ -259,7 +262,8 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
259extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, 262extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
260 const struct nlmsghdr *nlh, 263 const struct nlmsghdr *nlh,
261 int (*dump)(struct sk_buff *skb, struct netlink_callback*), 264 int (*dump)(struct sk_buff *skb, struct netlink_callback*),
262 int (*done)(struct netlink_callback*)); 265 int (*done)(struct netlink_callback*),
266 u16 min_dump_alloc);
263 267
264 268
265#define NL_NONROOT_RECV 0x1 269#define NL_NONROOT_RECV 0x1
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 79358bb712c6..5dfa091c3347 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -40,8 +40,6 @@ struct netpoll_info {
40 struct netpoll *netpoll; 40 struct netpoll *netpoll;
41}; 41};
42 42
43void netpoll_poll_dev(struct net_device *dev);
44void netpoll_poll(struct netpoll *np);
45void netpoll_send_udp(struct netpoll *np, const char *msg, int len); 43void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
46void netpoll_print_options(struct netpoll *np); 44void netpoll_print_options(struct netpoll *np);
47int netpoll_parse_options(struct netpoll *np, char *opt); 45int netpoll_parse_options(struct netpoll *np, char *opt);
diff --git a/include/linux/nfc.h b/include/linux/nfc.h
new file mode 100644
index 000000000000..330a4c5db588
--- /dev/null
+++ b/include/linux/nfc.h
@@ -0,0 +1,126 @@
1/*
2 * Copyright (C) 2011 Instituto Nokia de Tecnologia
3 *
4 * Authors:
5 * Lauro Ramos Venancio <lauro.venancio@openbossa.org>
6 * Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef __LINUX_NFC_H
25#define __LINUX_NFC_H
26
27#include <linux/types.h>
28#include <linux/socket.h>
29
30#define NFC_GENL_NAME "nfc"
31#define NFC_GENL_VERSION 1
32
33#define NFC_GENL_MCAST_EVENT_NAME "events"
34
35/**
36 * enum nfc_commands - supported nfc commands
37 *
38 * @NFC_CMD_UNSPEC: unspecified command
39 *
40 * @NFC_CMD_GET_DEVICE: request information about a device (requires
41 * %NFC_ATTR_DEVICE_INDEX) or dump request to get a list of all nfc devices
42 * @NFC_CMD_START_POLL: start polling for targets using the given protocols
43 * (requires %NFC_ATTR_DEVICE_INDEX and %NFC_ATTR_PROTOCOLS)
44 * @NFC_CMD_STOP_POLL: stop polling for targets (requires
45 * %NFC_ATTR_DEVICE_INDEX)
46 * @NFC_CMD_GET_TARGET: dump all targets found by the previous poll (requires
47 * %NFC_ATTR_DEVICE_INDEX)
48 * @NFC_EVENT_TARGETS_FOUND: event emitted when a new target is found
49 * (it sends %NFC_ATTR_DEVICE_INDEX)
50 * @NFC_EVENT_DEVICE_ADDED: event emitted when a new device is registred
51 * (it sends %NFC_ATTR_DEVICE_NAME, %NFC_ATTR_DEVICE_INDEX and
52 * %NFC_ATTR_PROTOCOLS)
53 * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed
54 * (it sends %NFC_ATTR_DEVICE_INDEX)
55 */
56enum nfc_commands {
57 NFC_CMD_UNSPEC,
58 NFC_CMD_GET_DEVICE,
59 NFC_CMD_START_POLL,
60 NFC_CMD_STOP_POLL,
61 NFC_CMD_GET_TARGET,
62 NFC_EVENT_TARGETS_FOUND,
63 NFC_EVENT_DEVICE_ADDED,
64 NFC_EVENT_DEVICE_REMOVED,
65/* private: internal use only */
66 __NFC_CMD_AFTER_LAST
67};
68#define NFC_CMD_MAX (__NFC_CMD_AFTER_LAST - 1)
69
70/**
71 * enum nfc_attrs - supported nfc attributes
72 *
73 * @NFC_ATTR_UNSPEC: unspecified attribute
74 *
75 * @NFC_ATTR_DEVICE_INDEX: index of nfc device
76 * @NFC_ATTR_DEVICE_NAME: device name, max 8 chars
77 * @NFC_ATTR_PROTOCOLS: nfc protocols - bitwise or-ed combination from
78 * NFC_PROTO_*_MASK constants
79 * @NFC_ATTR_TARGET_INDEX: index of the nfc target
80 * @NFC_ATTR_TARGET_SENS_RES: NFC-A targets extra information such as NFCID
81 * @NFC_ATTR_TARGET_SEL_RES: NFC-A targets extra information (useful if the
82 * target is not NFC-Forum compliant)
83 */
84enum nfc_attrs {
85 NFC_ATTR_UNSPEC,
86 NFC_ATTR_DEVICE_INDEX,
87 NFC_ATTR_DEVICE_NAME,
88 NFC_ATTR_PROTOCOLS,
89 NFC_ATTR_TARGET_INDEX,
90 NFC_ATTR_TARGET_SENS_RES,
91 NFC_ATTR_TARGET_SEL_RES,
92/* private: internal use only */
93 __NFC_ATTR_AFTER_LAST
94};
95#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1)
96
97#define NFC_DEVICE_NAME_MAXSIZE 8
98
99/* NFC protocols */
100#define NFC_PROTO_JEWEL 1
101#define NFC_PROTO_MIFARE 2
102#define NFC_PROTO_FELICA 3
103#define NFC_PROTO_ISO14443 4
104#define NFC_PROTO_NFC_DEP 5
105
106#define NFC_PROTO_MAX 6
107
108/* NFC protocols masks used in bitsets */
109#define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL)
110#define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE)
111#define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA)
112#define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443)
113#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP)
114
115struct sockaddr_nfc {
116 sa_family_t sa_family;
117 __u32 dev_idx;
118 __u32 target_idx;
119 __u32 nfc_protocol;
120};
121
122/* NFC socket protocols */
123#define NFC_SOCKPROTO_RAW 0
124#define NFC_SOCKPROTO_MAX 1
125
126#endif /*__LINUX_NFC_H */
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index c7ccaae15af6..8cb025a00094 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -247,7 +247,8 @@
247 * passed, all channels allowed for the current regulatory domain 247 * passed, all channels allowed for the current regulatory domain
248 * are used. Extra IEs can also be passed from the userspace by 248 * are used. Extra IEs can also be passed from the userspace by
249 * using the %NL80211_ATTR_IE attribute. 249 * using the %NL80211_ATTR_IE attribute.
250 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan 250 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT
251 * if scheduled scan is not running.
251 * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan 252 * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
252 * results available. 253 * results available.
253 * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has 254 * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has
@@ -483,6 +484,14 @@
483 * more background information, see 484 * more background information, see
484 * http://wireless.kernel.org/en/users/Documentation/WoWLAN. 485 * http://wireless.kernel.org/en/users/Documentation/WoWLAN.
485 * 486 *
487 * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver
488 * the necessary information for supporting GTK rekey offload. This
489 * feature is typically used during WoWLAN. The configuration data
490 * is contained in %NL80211_ATTR_REKEY_DATA (which is nested and
491 * contains the data in sub-attributes). After rekeying happened,
492 * this command may also be sent by the driver as an MLME event to
493 * inform userspace of the new replay counter.
494 *
486 * @NL80211_CMD_MAX: highest used command number 495 * @NL80211_CMD_MAX: highest used command number
487 * @__NL80211_CMD_AFTER_LAST: internal use 496 * @__NL80211_CMD_AFTER_LAST: internal use
488 */ 497 */
@@ -605,6 +614,8 @@ enum nl80211_commands {
605 NL80211_CMD_SCHED_SCAN_RESULTS, 614 NL80211_CMD_SCHED_SCAN_RESULTS,
606 NL80211_CMD_SCHED_SCAN_STOPPED, 615 NL80211_CMD_SCHED_SCAN_STOPPED,
607 616
617 NL80211_CMD_SET_REKEY_OFFLOAD,
618
608 /* add new commands above here */ 619 /* add new commands above here */
609 620
610 /* used to define NL80211_CMD_MAX below */ 621 /* used to define NL80211_CMD_MAX below */
@@ -996,6 +1007,9 @@ enum nl80211_commands {
996 * are managed in software: interfaces of these types aren't subject to 1007 * are managed in software: interfaces of these types aren't subject to
997 * any restrictions in their number or combinations. 1008 * any restrictions in their number or combinations.
998 * 1009 *
1010 * @%NL80211_ATTR_REKEY_DATA: nested attribute containing the information
1011 * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data.
1012 *
999 * @NL80211_ATTR_MAX: highest attribute number currently defined 1013 * @NL80211_ATTR_MAX: highest attribute number currently defined
1000 * @__NL80211_ATTR_AFTER_LAST: internal use 1014 * @__NL80211_ATTR_AFTER_LAST: internal use
1001 */ 1015 */
@@ -1194,6 +1208,8 @@ enum nl80211_attrs {
1194 NL80211_ATTR_INTERFACE_COMBINATIONS, 1208 NL80211_ATTR_INTERFACE_COMBINATIONS,
1195 NL80211_ATTR_SOFTWARE_IFTYPES, 1209 NL80211_ATTR_SOFTWARE_IFTYPES,
1196 1210
1211 NL80211_ATTR_REKEY_DATA,
1212
1197 /* add attributes here, update the policy in nl80211.c */ 1213 /* add attributes here, update the policy in nl80211.c */
1198 1214
1199 __NL80211_ATTR_AFTER_LAST, 1215 __NL80211_ATTR_AFTER_LAST,
@@ -2361,4 +2377,28 @@ enum nl80211_plink_state {
2361 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 2377 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
2362}; 2378};
2363 2379
2380#define NL80211_KCK_LEN 16
2381#define NL80211_KEK_LEN 16
2382#define NL80211_REPLAY_CTR_LEN 8
2383
2384/**
2385 * enum nl80211_rekey_data - attributes for GTK rekey offload
2386 * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes
2387 * @NL80211_REKEY_DATA_KEK: key encryption key (binary)
2388 * @NL80211_REKEY_DATA_KCK: key confirmation key (binary)
2389 * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary)
2390 * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal)
2391 * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal)
2392 */
2393enum nl80211_rekey_data {
2394 __NL80211_REKEY_DATA_INVALID,
2395 NL80211_REKEY_DATA_KEK,
2396 NL80211_REKEY_DATA_KCK,
2397 NL80211_REKEY_DATA_REPLAY_CTR,
2398
2399 /* keep last */
2400 NUM_NL80211_REKEY_DATA,
2401 MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1
2402};
2403
2364#endif /* __LINUX_NL80211_H */ 2404#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/of.h b/include/linux/of.h
index bfc0ed1b0ced..bd716f8908de 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -195,6 +195,13 @@ extern struct device_node *of_find_node_with_property(
195extern struct property *of_find_property(const struct device_node *np, 195extern struct property *of_find_property(const struct device_node *np,
196 const char *name, 196 const char *name,
197 int *lenp); 197 int *lenp);
198extern int of_property_read_u32_array(const struct device_node *np,
199 char *propname,
200 u32 *out_values,
201 size_t sz);
202
203extern int of_property_read_string(struct device_node *np, char *propname,
204 const char **out_string);
198extern int of_device_is_compatible(const struct device_node *device, 205extern int of_device_is_compatible(const struct device_node *device,
199 const char *); 206 const char *);
200extern int of_device_is_available(const struct device_node *device); 207extern int of_device_is_available(const struct device_node *device);
@@ -227,12 +234,32 @@ extern void of_attach_node(struct device_node *);
227extern void of_detach_node(struct device_node *); 234extern void of_detach_node(struct device_node *);
228#endif 235#endif
229 236
230#else 237#else /* CONFIG_OF */
231 238
232static inline bool of_have_populated_dt(void) 239static inline bool of_have_populated_dt(void)
233{ 240{
234 return false; 241 return false;
235} 242}
236 243
244static inline int of_property_read_u32_array(const struct device_node *np,
245 char *propname, u32 *out_values, size_t sz)
246{
247 return -ENOSYS;
248}
249
250static inline int of_property_read_string(struct device_node *np,
251 char *propname, const char **out_string)
252{
253 return -ENOSYS;
254}
255
237#endif /* CONFIG_OF */ 256#endif /* CONFIG_OF */
257
258static inline int of_property_read_u32(const struct device_node *np,
259 char *propname,
260 u32 *out_value)
261{
262 return of_property_read_u32_array(np, propname, out_value, 1);
263}
264
238#endif /* _LINUX_OF_H */ 265#endif /* _LINUX_OF_H */
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index 2feda6ee6140..3118623c2c1f 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -1,11 +1,16 @@
1#ifndef __OF_ADDRESS_H 1#ifndef __OF_ADDRESS_H
2#define __OF_ADDRESS_H 2#define __OF_ADDRESS_H
3#include <linux/ioport.h> 3#include <linux/ioport.h>
4#include <linux/errno.h>
4#include <linux/of.h> 5#include <linux/of.h>
5 6
6extern u64 of_translate_address(struct device_node *np, const __be32 *addr); 7extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
7extern int of_address_to_resource(struct device_node *dev, int index, 8extern int of_address_to_resource(struct device_node *dev, int index,
8 struct resource *r); 9 struct resource *r);
10extern struct device_node *of_find_matching_node_by_address(
11 struct device_node *from,
12 const struct of_device_id *matches,
13 u64 base_address);
9extern void __iomem *of_iomap(struct device_node *device, int index); 14extern void __iomem *of_iomap(struct device_node *device, int index);
10 15
11/* Extract an address from a device, returns the region size and 16/* Extract an address from a device, returns the region size and
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index 6598c04dab01..aec8025c786a 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -46,8 +46,9 @@ static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc)
46 return container_of(gc, struct of_mm_gpio_chip, gc); 46 return container_of(gc, struct of_mm_gpio_chip, gc);
47} 47}
48 48
49extern int of_get_gpio_flags(struct device_node *np, int index, 49extern int of_get_named_gpio_flags(struct device_node *np,
50 enum of_gpio_flags *flags); 50 const char *list_name, int index, enum of_gpio_flags *flags);
51
51extern unsigned int of_gpio_count(struct device_node *np); 52extern unsigned int of_gpio_count(struct device_node *np);
52 53
53extern int of_mm_gpiochip_add(struct device_node *np, 54extern int of_mm_gpiochip_add(struct device_node *np,
@@ -60,8 +61,8 @@ extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np);
60#else /* CONFIG_OF_GPIO */ 61#else /* CONFIG_OF_GPIO */
61 62
62/* Drivers may not strictly depend on the GPIO support, so let them link. */ 63/* Drivers may not strictly depend on the GPIO support, so let them link. */
63static inline int of_get_gpio_flags(struct device_node *np, int index, 64static inline int of_get_named_gpio_flags(struct device_node *np,
64 enum of_gpio_flags *flags) 65 const char *list_name, int index, enum of_gpio_flags *flags)
65{ 66{
66 return -ENOSYS; 67 return -ENOSYS;
67} 68}
@@ -77,7 +78,38 @@ static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
77#endif /* CONFIG_OF_GPIO */ 78#endif /* CONFIG_OF_GPIO */
78 79
79/** 80/**
80 * of_get_gpio - Get a GPIO number to use with GPIO API 81 * of_get_gpio_flags() - Get a GPIO number and flags to use with GPIO API
82 * @np: device node to get GPIO from
83 * @index: index of the GPIO
84 * @flags: a flags pointer to fill in
85 *
86 * Returns GPIO number to use with Linux generic GPIO API, or one of the errno
87 * value on the error condition. If @flags is not NULL the function also fills
88 * in flags for the GPIO.
89 */
90static inline int of_get_gpio_flags(struct device_node *np, int index,
91 enum of_gpio_flags *flags)
92{
93 return of_get_named_gpio_flags(np, "gpios", index, flags);
94}
95
96/**
97 * of_get_named_gpio() - Get a GPIO number to use with GPIO API
98 * @np: device node to get GPIO from
99 * @propname: Name of property containing gpio specifier(s)
100 * @index: index of the GPIO
101 *
102 * Returns GPIO number to use with Linux generic GPIO API, or one of the errno
103 * value on the error condition.
104 */
105static inline int of_get_named_gpio(struct device_node *np,
106 const char *propname, int index)
107{
108 return of_get_named_gpio_flags(np, propname, index, NULL);
109}
110
111/**
112 * of_get_gpio() - Get a GPIO number to use with GPIO API
81 * @np: device node to get GPIO from 113 * @np: device node to get GPIO from
82 * @index: index of the GPIO 114 * @index: index of the GPIO
83 * 115 *
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h
index 85a27b650d76..f93e21700d3e 100644
--- a/include/linux/of_pci.h
+++ b/include/linux/of_pci.h
@@ -6,4 +6,9 @@
6struct pci_dev; 6struct pci_dev;
7struct of_irq; 7struct of_irq;
8int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); 8int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
9
10struct device_node;
11struct device_node *of_pci_find_child_device(struct device_node *parent,
12 unsigned int devfn);
13
9#endif 14#endif
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index fb51ae38cea7..5a6f458a4bb7 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -20,6 +20,40 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21 21
22/** 22/**
23 * struct of_dev_auxdata - lookup table entry for device names & platform_data
24 * @compatible: compatible value of node to match against node
25 * @phys_addr: Start address of registers to match against node
26 * @name: Name to assign for matching nodes
27 * @platform_data: platform_data to assign for matching nodes
28 *
29 * This lookup table allows the caller of of_platform_populate() to override
30 * the names of devices when creating devices from the device tree. The table
31 * should be terminated with an empty entry. It also allows the platform_data
32 * pointer to be set.
33 *
34 * The reason for this functionality is that some Linux infrastructure uses
35 * the device name to look up a specific device, but the Linux-specific names
36 * are not encoded into the device tree, so the kernel needs to provide specific
37 * values.
38 *
39 * Note: Using an auxdata lookup table should be considered a last resort when
40 * converting a platform to use the DT. Normally the automatically generated
41 * device name will not matter, and drivers should obtain data from the device
42 * node instead of from an anonymouns platform_data pointer.
43 */
44struct of_dev_auxdata {
45 char *compatible;
46 resource_size_t phys_addr;
47 char *name;
48 void *platform_data;
49};
50
51/* Macro to simplify populating a lookup table */
52#define OF_DEV_AUXDATA(_compat,_phys,_name,_pdata) \
53 { .compatible = _compat, .phys_addr = _phys, .name = _name, \
54 .platform_data = _pdata }
55
56/**
23 * of_platform_driver - Legacy of-aware driver for platform devices. 57 * of_platform_driver - Legacy of-aware driver for platform devices.
24 * 58 *
25 * An of_platform_driver driver is attached to a basic platform_device on 59 * An of_platform_driver driver is attached to a basic platform_device on
@@ -40,6 +74,8 @@ struct of_platform_driver
40#define to_of_platform_driver(drv) \ 74#define to_of_platform_driver(drv) \
41 container_of(drv,struct of_platform_driver, driver) 75 container_of(drv,struct of_platform_driver, driver)
42 76
77extern const struct of_device_id of_default_bus_match_table[];
78
43/* Platform drivers register/unregister */ 79/* Platform drivers register/unregister */
44extern struct platform_device *of_device_alloc(struct device_node *np, 80extern struct platform_device *of_device_alloc(struct device_node *np,
45 const char *bus_id, 81 const char *bus_id,
@@ -55,6 +91,10 @@ extern struct platform_device *of_platform_device_create(struct device_node *np,
55extern int of_platform_bus_probe(struct device_node *root, 91extern int of_platform_bus_probe(struct device_node *root,
56 const struct of_device_id *matches, 92 const struct of_device_id *matches,
57 struct device *parent); 93 struct device *parent);
94extern int of_platform_populate(struct device_node *root,
95 const struct of_device_id *matches,
96 const struct of_dev_auxdata *lookup,
97 struct device *parent);
58#endif /* !CONFIG_SPARC */ 98#endif /* !CONFIG_SPARC */
59 99
60#endif /* CONFIG_OF_DEVICE */ 100#endif /* CONFIG_OF_DEVICE */
diff --git a/include/linux/opp.h b/include/linux/opp.h
index 5449945d589f..7020e9736fc5 100644
--- a/include/linux/opp.h
+++ b/include/linux/opp.h
@@ -94,12 +94,20 @@ static inline int opp_disable(struct device *dev, unsigned long freq)
94#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) 94#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
95int opp_init_cpufreq_table(struct device *dev, 95int opp_init_cpufreq_table(struct device *dev,
96 struct cpufreq_frequency_table **table); 96 struct cpufreq_frequency_table **table);
97void opp_free_cpufreq_table(struct device *dev,
98 struct cpufreq_frequency_table **table);
97#else 99#else
98static inline int opp_init_cpufreq_table(struct device *dev, 100static inline int opp_init_cpufreq_table(struct device *dev,
99 struct cpufreq_frequency_table **table) 101 struct cpufreq_frequency_table **table)
100{ 102{
101 return -EINVAL; 103 return -EINVAL;
102} 104}
105
106static inline
107void opp_free_cpufreq_table(struct device *dev,
108 struct cpufreq_frequency_table **table)
109{
110}
103#endif /* CONFIG_CPU_FREQ */ 111#endif /* CONFIG_CPU_FREQ */
104 112
105#endif /* __LINUX_OPP_H__ */ 113#endif /* __LINUX_OPP_H__ */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c446b5ca2d38..4e4203a96312 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1589,5 +1589,44 @@ int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);
1589int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, 1589int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
1590 unsigned int len, const char *kw); 1590 unsigned int len, const char *kw);
1591 1591
1592/* PCI <-> OF binding helpers */
1593#ifdef CONFIG_OF
1594struct device_node;
1595extern void pci_set_of_node(struct pci_dev *dev);
1596extern void pci_release_of_node(struct pci_dev *dev);
1597extern void pci_set_bus_of_node(struct pci_bus *bus);
1598extern void pci_release_bus_of_node(struct pci_bus *bus);
1599
1600/* Arch may override this (weak) */
1601extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus);
1602
1603static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
1604{
1605 return pdev ? pdev->dev.of_node : NULL;
1606}
1607
1608static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
1609{
1610 return bus ? bus->dev.of_node : NULL;
1611}
1612
1613#else /* CONFIG_OF */
1614static inline void pci_set_of_node(struct pci_dev *dev) { }
1615static inline void pci_release_of_node(struct pci_dev *dev) { }
1616static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
1617static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
1618#endif /* CONFIG_OF */
1619
1620/**
1621 * pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device
1622 * @pdev: the PCI device
1623 *
1624 * if the device is PCIE, return NULL
1625 * if the device isn't connected to a PCIe bridge (that is its parent is a
1626 * legacy PCI bridge and the bridge is directly connected to bus 0), return its
1627 * parent
1628 */
1629struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev);
1630
1592#endif /* __KERNEL__ */ 1631#endif /* __KERNEL__ */
1593#endif /* LINUX_PCI_H */ 1632#endif /* LINUX_PCI_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index f8910e155566..057093043067 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2103,6 +2103,9 @@
2103#define PCI_DEVICE_ID_TIGON3_5761E 0x1680 2103#define PCI_DEVICE_ID_TIGON3_5761E 0x1680
2104#define PCI_DEVICE_ID_TIGON3_5761 0x1681 2104#define PCI_DEVICE_ID_TIGON3_5761 0x1681
2105#define PCI_DEVICE_ID_TIGON3_5764 0x1684 2105#define PCI_DEVICE_ID_TIGON3_5764 0x1684
2106#define PCI_DEVICE_ID_NX2_57800 0x168a
2107#define PCI_DEVICE_ID_NX2_57840 0x168d
2108#define PCI_DEVICE_ID_NX2_57810 0x168e
2106#define PCI_DEVICE_ID_TIGON3_5787M 0x1693 2109#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
2107#define PCI_DEVICE_ID_TIGON3_5782 0x1696 2110#define PCI_DEVICE_ID_TIGON3_5782 0x1696
2108#define PCI_DEVICE_ID_TIGON3_5784 0x1698 2111#define PCI_DEVICE_ID_TIGON3_5784 0x1698
@@ -2110,11 +2113,17 @@
2110#define PCI_DEVICE_ID_TIGON3_5787 0x169b 2113#define PCI_DEVICE_ID_TIGON3_5787 0x169b
2111#define PCI_DEVICE_ID_TIGON3_5788 0x169c 2114#define PCI_DEVICE_ID_TIGON3_5788 0x169c
2112#define PCI_DEVICE_ID_TIGON3_5789 0x169d 2115#define PCI_DEVICE_ID_TIGON3_5789 0x169d
2116#define PCI_DEVICE_ID_NX2_57800_MF 0x16a5
2113#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 2117#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6
2114#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 2118#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7
2115#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 2119#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8
2120#define PCI_DEVICE_ID_NX2_57800_VF 0x16a9
2116#define PCI_DEVICE_ID_NX2_5706S 0x16aa 2121#define PCI_DEVICE_ID_NX2_5706S 0x16aa
2122#define PCI_DEVICE_ID_NX2_57840_MF 0x16ab
2117#define PCI_DEVICE_ID_NX2_5708S 0x16ac 2123#define PCI_DEVICE_ID_NX2_5708S 0x16ac
2124#define PCI_DEVICE_ID_NX2_57840_VF 0x16ad
2125#define PCI_DEVICE_ID_NX2_57810_MF 0x16ae
2126#define PCI_DEVICE_ID_NX2_57810_VF 0x16af
2118#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 2127#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6
2119#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 2128#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7
2120#define PCI_DEVICE_ID_TIGON3_5781 0x16dd 2129#define PCI_DEVICE_ID_TIGON3_5781 0x16dd
diff --git a/include/linux/platform_data/pxa_sdhci.h b/include/linux/platform_data/pxa_sdhci.h
new file mode 100644
index 000000000000..51ad0995abac
--- /dev/null
+++ b/include/linux/platform_data/pxa_sdhci.h
@@ -0,0 +1,60 @@
1/*
2 * include/linux/platform_data/pxa_sdhci.h
3 *
4 * Copyright 2010 Marvell
5 * Zhangfei Gao <zhangfei.gao@marvell.com>
6 *
7 * PXA Platform - SDHCI platform data definitions
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef _PXA_SDHCI_H_
15#define _PXA_SDHCI_H_
16
17/* pxa specific flag */
18/* Require clock free running */
19#define PXA_FLAG_ENABLE_CLOCK_GATING (1<<0)
20/* card always wired to host, like on-chip emmc */
21#define PXA_FLAG_CARD_PERMANENT (1<<1)
22/* Board design supports 8-bit data on SD/SDIO BUS */
23#define PXA_FLAG_SD_8_BIT_CAPABLE_SLOT (1<<2)
24
25/*
26 * struct pxa_sdhci_platdata() - Platform device data for PXA SDHCI
27 * @flags: flags for platform requirement
28 * @clk_delay_cycles:
29 * mmp2: each step is roughly 100ps, 5bits width
30 * pxa910: each step is 1ns, 4bits width
31 * @clk_delay_sel: select clk_delay, used on pxa910
32 * 0: choose feedback clk
33 * 1: choose feedback clk + delay value
34 * 2: choose internal clk
35 * @clk_delay_enable: enable clk_delay or not, used on pxa910
36 * @ext_cd_gpio: gpio pin used for external CD line
37 * @ext_cd_gpio_invert: invert values for external CD gpio line
38 * @max_speed: the maximum speed supported
39 * @host_caps: Standard MMC host capabilities bit field.
40 * @quirks: quirks of platfrom
41 * @pm_caps: pm_caps of platfrom
42 */
43struct sdhci_pxa_platdata {
44 unsigned int flags;
45 unsigned int clk_delay_cycles;
46 unsigned int clk_delay_sel;
47 bool clk_delay_enable;
48 unsigned int ext_cd_gpio;
49 bool ext_cd_gpio_invert;
50 unsigned int max_speed;
51 unsigned int host_caps;
52 unsigned int quirks;
53 unsigned int pm_caps;
54};
55
56struct sdhci_pxa {
57 u8 clk_enable;
58 u8 power_mode;
59};
60#endif /* _PXA_SDHCI_H_ */
diff --git a/include/linux/plist.h b/include/linux/plist.h
index c9b9f322c8d8..aa0fb390bd29 100644
--- a/include/linux/plist.h
+++ b/include/linux/plist.h
@@ -77,14 +77,9 @@
77 77
78#include <linux/kernel.h> 78#include <linux/kernel.h>
79#include <linux/list.h> 79#include <linux/list.h>
80#include <linux/spinlock_types.h>
81 80
82struct plist_head { 81struct plist_head {
83 struct list_head node_list; 82 struct list_head node_list;
84#ifdef CONFIG_DEBUG_PI_LIST
85 raw_spinlock_t *rawlock;
86 spinlock_t *spinlock;
87#endif
88}; 83};
89 84
90struct plist_node { 85struct plist_node {
@@ -93,37 +88,13 @@ struct plist_node {
93 struct list_head node_list; 88 struct list_head node_list;
94}; 89};
95 90
96#ifdef CONFIG_DEBUG_PI_LIST
97# define PLIST_HEAD_LOCK_INIT(_lock) .spinlock = _lock
98# define PLIST_HEAD_LOCK_INIT_RAW(_lock) .rawlock = _lock
99#else
100# define PLIST_HEAD_LOCK_INIT(_lock)
101# define PLIST_HEAD_LOCK_INIT_RAW(_lock)
102#endif
103
104#define _PLIST_HEAD_INIT(head) \
105 .node_list = LIST_HEAD_INIT((head).node_list)
106
107/** 91/**
108 * PLIST_HEAD_INIT - static struct plist_head initializer 92 * PLIST_HEAD_INIT - static struct plist_head initializer
109 * @head: struct plist_head variable name 93 * @head: struct plist_head variable name
110 * @_lock: lock to initialize for this list
111 */
112#define PLIST_HEAD_INIT(head, _lock) \
113{ \
114 _PLIST_HEAD_INIT(head), \
115 PLIST_HEAD_LOCK_INIT(&(_lock)) \
116}
117
118/**
119 * PLIST_HEAD_INIT_RAW - static struct plist_head initializer
120 * @head: struct plist_head variable name
121 * @_lock: lock to initialize for this list
122 */ 94 */
123#define PLIST_HEAD_INIT_RAW(head, _lock) \ 95#define PLIST_HEAD_INIT(head) \
124{ \ 96{ \
125 _PLIST_HEAD_INIT(head), \ 97 .node_list = LIST_HEAD_INIT((head).node_list) \
126 PLIST_HEAD_LOCK_INIT_RAW(&(_lock)) \
127} 98}
128 99
129/** 100/**
@@ -141,31 +112,11 @@ struct plist_node {
141/** 112/**
142 * plist_head_init - dynamic struct plist_head initializer 113 * plist_head_init - dynamic struct plist_head initializer
143 * @head: &struct plist_head pointer 114 * @head: &struct plist_head pointer
144 * @lock: spinlock protecting the list (debugging)
145 */ 115 */
146static inline void 116static inline void
147plist_head_init(struct plist_head *head, spinlock_t *lock) 117plist_head_init(struct plist_head *head)
148{ 118{
149 INIT_LIST_HEAD(&head->node_list); 119 INIT_LIST_HEAD(&head->node_list);
150#ifdef CONFIG_DEBUG_PI_LIST
151 head->spinlock = lock;
152 head->rawlock = NULL;
153#endif
154}
155
156/**
157 * plist_head_init_raw - dynamic struct plist_head initializer
158 * @head: &struct plist_head pointer
159 * @lock: raw_spinlock protecting the list (debugging)
160 */
161static inline void
162plist_head_init_raw(struct plist_head *head, raw_spinlock_t *lock)
163{
164 INIT_LIST_HEAD(&head->node_list);
165#ifdef CONFIG_DEBUG_PI_LIST
166 head->rawlock = lock;
167 head->spinlock = NULL;
168#endif
169} 120}
170 121
171/** 122/**
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 411e4f4be52b..f7c84c9abd30 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -461,8 +461,8 @@ struct dev_pm_info {
461 unsigned long active_jiffies; 461 unsigned long active_jiffies;
462 unsigned long suspended_jiffies; 462 unsigned long suspended_jiffies;
463 unsigned long accounting_timestamp; 463 unsigned long accounting_timestamp;
464 void *subsys_data; /* Owned by the subsystem. */
465#endif 464#endif
465 void *subsys_data; /* Owned by the subsystem. */
466}; 466};
467 467
468extern void update_pm_runtime_accounting(struct device *dev); 468extern void update_pm_runtime_accounting(struct device *dev);
@@ -472,7 +472,7 @@ extern void update_pm_runtime_accounting(struct device *dev);
472 * hibernation, system resume and during runtime PM transitions along with 472 * hibernation, system resume and during runtime PM transitions along with
473 * subsystem-level and driver-level callbacks. 473 * subsystem-level and driver-level callbacks.
474 */ 474 */
475struct dev_power_domain { 475struct dev_pm_domain {
476 struct dev_pm_ops ops; 476 struct dev_pm_ops ops;
477}; 477};
478 478
@@ -553,11 +553,17 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
553extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); 553extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
554 554
555extern int pm_generic_prepare(struct device *dev); 555extern int pm_generic_prepare(struct device *dev);
556extern int pm_generic_suspend_noirq(struct device *dev);
556extern int pm_generic_suspend(struct device *dev); 557extern int pm_generic_suspend(struct device *dev);
558extern int pm_generic_resume_noirq(struct device *dev);
557extern int pm_generic_resume(struct device *dev); 559extern int pm_generic_resume(struct device *dev);
560extern int pm_generic_freeze_noirq(struct device *dev);
558extern int pm_generic_freeze(struct device *dev); 561extern int pm_generic_freeze(struct device *dev);
562extern int pm_generic_thaw_noirq(struct device *dev);
559extern int pm_generic_thaw(struct device *dev); 563extern int pm_generic_thaw(struct device *dev);
564extern int pm_generic_restore_noirq(struct device *dev);
560extern int pm_generic_restore(struct device *dev); 565extern int pm_generic_restore(struct device *dev);
566extern int pm_generic_poweroff_noirq(struct device *dev);
561extern int pm_generic_poweroff(struct device *dev); 567extern int pm_generic_poweroff(struct device *dev);
562extern void pm_generic_complete(struct device *dev); 568extern void pm_generic_complete(struct device *dev);
563 569
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
new file mode 100644
index 000000000000..21097cb086fe
--- /dev/null
+++ b/include/linux/pm_domain.h
@@ -0,0 +1,108 @@
1/*
2 * pm_domain.h - Definitions and headers related to device power domains.
3 *
4 * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp.
5 *
6 * This file is released under the GPLv2.
7 */
8
9#ifndef _LINUX_PM_DOMAIN_H
10#define _LINUX_PM_DOMAIN_H
11
12#include <linux/device.h>
13
14enum gpd_status {
15 GPD_STATE_ACTIVE = 0, /* PM domain is active */
16 GPD_STATE_BUSY, /* Something is happening to the PM domain */
17 GPD_STATE_REPEAT, /* Power off in progress, to be repeated */
18 GPD_STATE_POWER_OFF, /* PM domain is off */
19};
20
21struct dev_power_governor {
22 bool (*power_down_ok)(struct dev_pm_domain *domain);
23};
24
25struct generic_pm_domain {
26 struct dev_pm_domain domain; /* PM domain operations */
27 struct list_head gpd_list_node; /* Node in the global PM domains list */
28 struct list_head sd_node; /* Node in the parent's subdomain list */
29 struct generic_pm_domain *parent; /* Parent PM domain */
30 struct list_head sd_list; /* List of dubdomains */
31 struct list_head dev_list; /* List of devices */
32 struct mutex lock;
33 struct dev_power_governor *gov;
34 struct work_struct power_off_work;
35 unsigned int in_progress; /* Number of devices being suspended now */
36 unsigned int sd_count; /* Number of subdomains with power "on" */
37 enum gpd_status status; /* Current state of the domain */
38 wait_queue_head_t status_wait_queue;
39 struct task_struct *poweroff_task; /* Powering off task */
40 unsigned int resume_count; /* Number of devices being resumed */
41 unsigned int device_count; /* Number of devices */
42 unsigned int suspended_count; /* System suspend device counter */
43 unsigned int prepared_count; /* Suspend counter of prepared devices */
44 bool suspend_power_off; /* Power status before system suspend */
45 int (*power_off)(struct generic_pm_domain *domain);
46 int (*power_on)(struct generic_pm_domain *domain);
47 int (*start_device)(struct device *dev);
48 int (*stop_device)(struct device *dev);
49 bool (*active_wakeup)(struct device *dev);
50};
51
52static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
53{
54 return container_of(pd, struct generic_pm_domain, domain);
55}
56
57struct dev_list_entry {
58 struct list_head node;
59 struct device *dev;
60 bool need_restore;
61};
62
63#ifdef CONFIG_PM_GENERIC_DOMAINS
64extern int pm_genpd_add_device(struct generic_pm_domain *genpd,
65 struct device *dev);
66extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
67 struct device *dev);
68extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
69 struct generic_pm_domain *new_subdomain);
70extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
71 struct generic_pm_domain *target);
72extern void pm_genpd_init(struct generic_pm_domain *genpd,
73 struct dev_power_governor *gov, bool is_off);
74extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
75extern void pm_genpd_poweroff_unused(void);
76extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
77#else
78static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
79 struct device *dev)
80{
81 return -ENOSYS;
82}
83static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
84 struct device *dev)
85{
86 return -ENOSYS;
87}
88static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
89 struct generic_pm_domain *new_sd)
90{
91 return -ENOSYS;
92}
93static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
94 struct generic_pm_domain *target)
95{
96 return -ENOSYS;
97}
98static inline void pm_genpd_init(struct generic_pm_domain *genpd,
99 struct dev_power_governor *gov, bool is_off) {}
100static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
101{
102 return -ENOSYS;
103}
104static inline void pm_genpd_poweroff_unused(void) {}
105static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
106#endif
107
108#endif /* _LINUX_PM_DOMAIN_H */
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 878cf84baeb1..daac05d751b2 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -82,6 +82,11 @@ static inline bool pm_runtime_suspended(struct device *dev)
82 && !dev->power.disable_depth; 82 && !dev->power.disable_depth;
83} 83}
84 84
85static inline bool pm_runtime_status_suspended(struct device *dev)
86{
87 return dev->power.runtime_status == RPM_SUSPENDED;
88}
89
85static inline bool pm_runtime_enabled(struct device *dev) 90static inline bool pm_runtime_enabled(struct device *dev)
86{ 91{
87 return !dev->power.disable_depth; 92 return !dev->power.disable_depth;
@@ -130,6 +135,7 @@ static inline void pm_runtime_put_noidle(struct device *dev) {}
130static inline bool device_run_wake(struct device *dev) { return false; } 135static inline bool device_run_wake(struct device *dev) { return false; }
131static inline void device_set_run_wake(struct device *dev, bool enable) {} 136static inline void device_set_run_wake(struct device *dev, bool enable) {}
132static inline bool pm_runtime_suspended(struct device *dev) { return false; } 137static inline bool pm_runtime_suspended(struct device *dev) { return false; }
138static inline bool pm_runtime_status_suspended(struct device *dev) { return false; }
133static inline bool pm_runtime_enabled(struct device *dev) { return false; } 139static inline bool pm_runtime_enabled(struct device *dev) { return false; }
134 140
135static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } 141static inline int pm_generic_runtime_idle(struct device *dev) { return 0; }
@@ -247,41 +253,41 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
247 253
248struct pm_clk_notifier_block { 254struct pm_clk_notifier_block {
249 struct notifier_block nb; 255 struct notifier_block nb;
250 struct dev_power_domain *pwr_domain; 256 struct dev_pm_domain *pm_domain;
251 char *con_ids[]; 257 char *con_ids[];
252}; 258};
253 259
254#ifdef CONFIG_PM_RUNTIME_CLK 260#ifdef CONFIG_PM_CLK
255extern int pm_runtime_clk_init(struct device *dev); 261extern int pm_clk_init(struct device *dev);
256extern void pm_runtime_clk_destroy(struct device *dev); 262extern void pm_clk_destroy(struct device *dev);
257extern int pm_runtime_clk_add(struct device *dev, const char *con_id); 263extern int pm_clk_add(struct device *dev, const char *con_id);
258extern void pm_runtime_clk_remove(struct device *dev, const char *con_id); 264extern void pm_clk_remove(struct device *dev, const char *con_id);
259extern int pm_runtime_clk_suspend(struct device *dev); 265extern int pm_clk_suspend(struct device *dev);
260extern int pm_runtime_clk_resume(struct device *dev); 266extern int pm_clk_resume(struct device *dev);
261#else 267#else
262static inline int pm_runtime_clk_init(struct device *dev) 268static inline int pm_clk_init(struct device *dev)
263{ 269{
264 return -EINVAL; 270 return -EINVAL;
265} 271}
266static inline void pm_runtime_clk_destroy(struct device *dev) 272static inline void pm_clk_destroy(struct device *dev)
267{ 273{
268} 274}
269static inline int pm_runtime_clk_add(struct device *dev, const char *con_id) 275static inline int pm_clk_add(struct device *dev, const char *con_id)
270{ 276{
271 return -EINVAL; 277 return -EINVAL;
272} 278}
273static inline void pm_runtime_clk_remove(struct device *dev, const char *con_id) 279static inline void pm_clk_remove(struct device *dev, const char *con_id)
274{ 280{
275} 281}
276#define pm_runtime_clock_suspend NULL 282#define pm_clk_suspend NULL
277#define pm_runtime_clock_resume NULL 283#define pm_clk_resume NULL
278#endif 284#endif
279 285
280#ifdef CONFIG_HAVE_CLK 286#ifdef CONFIG_HAVE_CLK
281extern void pm_runtime_clk_add_notifier(struct bus_type *bus, 287extern void pm_clk_add_notifier(struct bus_type *bus,
282 struct pm_clk_notifier_block *clknb); 288 struct pm_clk_notifier_block *clknb);
283#else 289#else
284static inline void pm_runtime_clk_add_notifier(struct bus_type *bus, 290static inline void pm_clk_add_notifier(struct bus_type *bus,
285 struct pm_clk_notifier_block *clknb) 291 struct pm_clk_notifier_block *clknb)
286{ 292{
287} 293}
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 9178d5cc0b01..800f113bea66 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -47,6 +47,13 @@
47#define PTRACE_GETREGSET 0x4204 47#define PTRACE_GETREGSET 0x4204
48#define PTRACE_SETREGSET 0x4205 48#define PTRACE_SETREGSET 0x4205
49 49
50#define PTRACE_SEIZE 0x4206
51#define PTRACE_INTERRUPT 0x4207
52#define PTRACE_LISTEN 0x4208
53
54/* flags in @data for PTRACE_SEIZE */
55#define PTRACE_SEIZE_DEVEL 0x80000000 /* temp flag for development */
56
50/* options set using PTRACE_SETOPTIONS */ 57/* options set using PTRACE_SETOPTIONS */
51#define PTRACE_O_TRACESYSGOOD 0x00000001 58#define PTRACE_O_TRACESYSGOOD 0x00000001
52#define PTRACE_O_TRACEFORK 0x00000002 59#define PTRACE_O_TRACEFORK 0x00000002
@@ -65,6 +72,7 @@
65#define PTRACE_EVENT_EXEC 4 72#define PTRACE_EVENT_EXEC 4
66#define PTRACE_EVENT_VFORK_DONE 5 73#define PTRACE_EVENT_VFORK_DONE 5
67#define PTRACE_EVENT_EXIT 6 74#define PTRACE_EVENT_EXIT 6
75#define PTRACE_EVENT_STOP 7
68 76
69#include <asm/ptrace.h> 77#include <asm/ptrace.h>
70 78
@@ -77,16 +85,22 @@
77 * flags. When the a task is stopped the ptracer owns task->ptrace. 85 * flags. When the a task is stopped the ptracer owns task->ptrace.
78 */ 86 */
79 87
88#define PT_SEIZED 0x00010000 /* SEIZE used, enable new behavior */
80#define PT_PTRACED 0x00000001 89#define PT_PTRACED 0x00000001
81#define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */ 90#define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */
82#define PT_TRACESYSGOOD 0x00000004 91#define PT_TRACESYSGOOD 0x00000004
83#define PT_PTRACE_CAP 0x00000008 /* ptracer can follow suid-exec */ 92#define PT_PTRACE_CAP 0x00000008 /* ptracer can follow suid-exec */
84#define PT_TRACE_FORK 0x00000010 93
85#define PT_TRACE_VFORK 0x00000020 94/* PT_TRACE_* event enable flags */
86#define PT_TRACE_CLONE 0x00000040 95#define PT_EVENT_FLAG_SHIFT 4
87#define PT_TRACE_EXEC 0x00000080 96#define PT_EVENT_FLAG(event) (1 << (PT_EVENT_FLAG_SHIFT + (event) - 1))
88#define PT_TRACE_VFORK_DONE 0x00000100 97
89#define PT_TRACE_EXIT 0x00000200 98#define PT_TRACE_FORK PT_EVENT_FLAG(PTRACE_EVENT_FORK)
99#define PT_TRACE_VFORK PT_EVENT_FLAG(PTRACE_EVENT_VFORK)
100#define PT_TRACE_CLONE PT_EVENT_FLAG(PTRACE_EVENT_CLONE)
101#define PT_TRACE_EXEC PT_EVENT_FLAG(PTRACE_EVENT_EXEC)
102#define PT_TRACE_VFORK_DONE PT_EVENT_FLAG(PTRACE_EVENT_VFORK_DONE)
103#define PT_TRACE_EXIT PT_EVENT_FLAG(PTRACE_EVENT_EXIT)
90 104
91#define PT_TRACE_MASK 0x000003f4 105#define PT_TRACE_MASK 0x000003f4
92 106
@@ -105,7 +119,7 @@ extern long arch_ptrace(struct task_struct *child, long request,
105extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); 119extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
106extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); 120extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);
107extern void ptrace_disable(struct task_struct *); 121extern void ptrace_disable(struct task_struct *);
108extern int ptrace_check_attach(struct task_struct *task, int kill); 122extern int ptrace_check_attach(struct task_struct *task, bool ignore_state);
109extern int ptrace_request(struct task_struct *child, long request, 123extern int ptrace_request(struct task_struct *child, long request,
110 unsigned long addr, unsigned long data); 124 unsigned long addr, unsigned long data);
111extern void ptrace_notify(int exit_code); 125extern void ptrace_notify(int exit_code);
@@ -122,7 +136,7 @@ extern bool ptrace_may_access(struct task_struct *task, unsigned int mode);
122 136
123static inline int ptrace_reparented(struct task_struct *child) 137static inline int ptrace_reparented(struct task_struct *child)
124{ 138{
125 return child->real_parent != child->parent; 139 return !same_thread_group(child->real_parent, child->parent);
126} 140}
127 141
128static inline void ptrace_unlink(struct task_struct *child) 142static inline void ptrace_unlink(struct task_struct *child)
@@ -137,36 +151,56 @@ int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
137 unsigned long data); 151 unsigned long data);
138 152
139/** 153/**
140 * task_ptrace - return %PT_* flags that apply to a task 154 * ptrace_parent - return the task that is tracing the given task
141 * @task: pointer to &task_struct in question 155 * @task: task to consider
142 * 156 *
143 * Returns the %PT_* flags that apply to @task. 157 * Returns %NULL if no one is tracing @task, or the &struct task_struct
158 * pointer to its tracer.
159 *
160 * Must called under rcu_read_lock(). The pointer returned might be kept
161 * live only by RCU. During exec, this may be called with task_lock() held
162 * on @task, still held from when check_unsafe_exec() was called.
144 */ 163 */
145static inline int task_ptrace(struct task_struct *task) 164static inline struct task_struct *ptrace_parent(struct task_struct *task)
146{ 165{
147 return task->ptrace; 166 if (unlikely(task->ptrace))
167 return rcu_dereference(task->parent);
168 return NULL;
169}
170
171/**
172 * ptrace_event_enabled - test whether a ptrace event is enabled
173 * @task: ptracee of interest
174 * @event: %PTRACE_EVENT_* to test
175 *
176 * Test whether @event is enabled for ptracee @task.
177 *
178 * Returns %true if @event is enabled, %false otherwise.
179 */
180static inline bool ptrace_event_enabled(struct task_struct *task, int event)
181{
182 return task->ptrace & PT_EVENT_FLAG(event);
148} 183}
149 184
150/** 185/**
151 * ptrace_event - possibly stop for a ptrace event notification 186 * ptrace_event - possibly stop for a ptrace event notification
152 * @mask: %PT_* bit to check in @current->ptrace 187 * @event: %PTRACE_EVENT_* value to report
153 * @event: %PTRACE_EVENT_* value to report if @mask is set
154 * @message: value for %PTRACE_GETEVENTMSG to return 188 * @message: value for %PTRACE_GETEVENTMSG to return
155 * 189 *
156 * This checks the @mask bit to see if ptrace wants stops for this event. 190 * Check whether @event is enabled and, if so, report @event and @message
157 * If so we stop, reporting @event and @message to the ptrace parent. 191 * to the ptrace parent.
158 *
159 * Returns nonzero if we did a ptrace notification, zero if not.
160 * 192 *
161 * Called without locks. 193 * Called without locks.
162 */ 194 */
163static inline int ptrace_event(int mask, int event, unsigned long message) 195static inline void ptrace_event(int event, unsigned long message)
164{ 196{
165 if (mask && likely(!(current->ptrace & mask))) 197 if (unlikely(ptrace_event_enabled(current, event))) {
166 return 0; 198 current->ptrace_message = message;
167 current->ptrace_message = message; 199 ptrace_notify((event << 8) | SIGTRAP);
168 ptrace_notify((event << 8) | SIGTRAP); 200 } else if (event == PTRACE_EVENT_EXEC && unlikely(current->ptrace)) {
169 return 1; 201 /* legacy EXEC report via SIGTRAP */
202 send_sig(SIGTRAP, current, 0);
203 }
170} 204}
171 205
172/** 206/**
@@ -183,16 +217,24 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace)
183{ 217{
184 INIT_LIST_HEAD(&child->ptrace_entry); 218 INIT_LIST_HEAD(&child->ptrace_entry);
185 INIT_LIST_HEAD(&child->ptraced); 219 INIT_LIST_HEAD(&child->ptraced);
186 child->parent = child->real_parent; 220#ifdef CONFIG_HAVE_HW_BREAKPOINT
221 atomic_set(&child->ptrace_bp_refcnt, 1);
222#endif
223 child->jobctl = 0;
187 child->ptrace = 0; 224 child->ptrace = 0;
188 if (unlikely(ptrace) && (current->ptrace & PT_PTRACED)) { 225 child->parent = child->real_parent;
226
227 if (unlikely(ptrace) && current->ptrace) {
189 child->ptrace = current->ptrace; 228 child->ptrace = current->ptrace;
190 __ptrace_link(child, current->parent); 229 __ptrace_link(child, current->parent);
191 }
192 230
193#ifdef CONFIG_HAVE_HW_BREAKPOINT 231 if (child->ptrace & PT_SEIZED)
194 atomic_set(&child->ptrace_bp_refcnt, 1); 232 task_set_jobctl_pending(child, JOBCTL_TRAP_STOP);
195#endif 233 else
234 sigaddset(&child->pending.signal, SIGSTOP);
235
236 set_tsk_thread_flag(child, TIF_SIGPENDING);
237 }
196} 238}
197 239
198/** 240/**
diff --git a/include/linux/random.h b/include/linux/random.h
index fb7ab9de5f36..ce29a040c8dc 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -58,6 +58,7 @@ extern void get_random_bytes(void *buf, int nbytes);
58void generate_random_uuid(unsigned char uuid_out[16]); 58void generate_random_uuid(unsigned char uuid_out[16]);
59 59
60extern __u32 secure_ip_id(__be32 daddr); 60extern __u32 secure_ip_id(__be32 daddr);
61extern __u32 secure_ipv6_id(const __be32 daddr[4]);
61extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); 62extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
62extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, 63extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
63 __be16 dport); 64 __be16 dport);
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index e3beb315517a..d079290843a9 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -183,7 +183,7 @@ static inline void list_splice_init_rcu(struct list_head *list,
183 struct list_head *last = list->prev; 183 struct list_head *last = list->prev;
184 struct list_head *at = head->next; 184 struct list_head *at = head->next;
185 185
186 if (list_empty(head)) 186 if (list_empty(list))
187 return; 187 return;
188 188
189 /* "first" and "last" tracking list, so initialize it. */ 189 /* "first" and "last" tracking list, so initialize it. */
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
index 8d522ffeda33..de17134244f3 100644
--- a/include/linux/rtmutex.h
+++ b/include/linux/rtmutex.h
@@ -66,7 +66,7 @@ struct hrtimer_sleeper;
66 66
67#define __RT_MUTEX_INITIALIZER(mutexname) \ 67#define __RT_MUTEX_INITIALIZER(mutexname) \
68 { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ 68 { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \
69 , .wait_list = PLIST_HEAD_INIT_RAW(mutexname.wait_list, mutexname.wait_lock) \ 69 , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list) \
70 , .owner = NULL \ 70 , .owner = NULL \
71 __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} 71 __DEBUG_RT_MUTEX_INITIALIZER(mutexname)}
72 72
@@ -100,7 +100,7 @@ extern void rt_mutex_unlock(struct rt_mutex *lock);
100 100
101#ifdef CONFIG_RT_MUTEXES 101#ifdef CONFIG_RT_MUTEXES
102# define INIT_RT_MUTEXES(tsk) \ 102# define INIT_RT_MUTEXES(tsk) \
103 .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \ 103 .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters), \
104 INIT_RT_MUTEX_DEBUG(tsk) 104 INIT_RT_MUTEX_DEBUG(tsk)
105#else 105#else
106# define INIT_RT_MUTEXES(tsk) 106# define INIT_RT_MUTEXES(tsk)
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index bbad657a3725..c81226a9a35c 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -585,6 +585,8 @@ enum rtnetlink_groups {
585#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR 585#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
586 RTNLGRP_PHONET_ROUTE, 586 RTNLGRP_PHONET_ROUTE,
587#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE 587#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
588 RTNLGRP_DCB,
589#define RTNLGRP_DCB RTNLGRP_DCB
588 __RTNLGRP_MAX 590 __RTNLGRP_MAX
589}; 591};
590#define RTNLGRP_MAX (__RTNLGRP_MAX - 1) 592#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index a837b20ba190..f6ef727ee4fc 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -808,7 +808,7 @@ enum cpu_idle_type {
808 * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the 808 * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the
809 * increased costs. 809 * increased costs.
810 */ 810 */
811#if BITS_PER_LONG > 32 811#if 0 /* BITS_PER_LONG > 32 -- currently broken: it increases power usage under light load */
812# define SCHED_LOAD_RESOLUTION 10 812# define SCHED_LOAD_RESOLUTION 10
813# define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION) 813# define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION)
814# define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION) 814# define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION)
@@ -844,6 +844,7 @@ enum cpu_idle_type {
844#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ 844#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */
845#define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */ 845#define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */
846#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ 846#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */
847#define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */
847 848
848enum powersavings_balance_level { 849enum powersavings_balance_level {
849 POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */ 850 POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */
@@ -893,16 +894,21 @@ static inline int sd_power_saving_flags(void)
893 return 0; 894 return 0;
894} 895}
895 896
896struct sched_group { 897struct sched_group_power {
897 struct sched_group *next; /* Must be a circular list */
898 atomic_t ref; 898 atomic_t ref;
899
900 /* 899 /*
901 * CPU power of this group, SCHED_LOAD_SCALE being max power for a 900 * CPU power of this group, SCHED_LOAD_SCALE being max power for a
902 * single CPU. 901 * single CPU.
903 */ 902 */
904 unsigned int cpu_power, cpu_power_orig; 903 unsigned int power, power_orig;
904};
905
906struct sched_group {
907 struct sched_group *next; /* Must be a circular list */
908 atomic_t ref;
909
905 unsigned int group_weight; 910 unsigned int group_weight;
911 struct sched_group_power *sgp;
906 912
907 /* 913 /*
908 * The CPUs this group covers. 914 * The CPUs this group covers.
@@ -1254,6 +1260,9 @@ struct task_struct {
1254#ifdef CONFIG_PREEMPT_RCU 1260#ifdef CONFIG_PREEMPT_RCU
1255 int rcu_read_lock_nesting; 1261 int rcu_read_lock_nesting;
1256 char rcu_read_unlock_special; 1262 char rcu_read_unlock_special;
1263#if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU)
1264 int rcu_boosted;
1265#endif /* #if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU) */
1257 struct list_head rcu_node_entry; 1266 struct list_head rcu_node_entry;
1258#endif /* #ifdef CONFIG_PREEMPT_RCU */ 1267#endif /* #ifdef CONFIG_PREEMPT_RCU */
1259#ifdef CONFIG_TREE_PREEMPT_RCU 1268#ifdef CONFIG_TREE_PREEMPT_RCU
@@ -1283,7 +1292,7 @@ struct task_struct {
1283 int exit_state; 1292 int exit_state;
1284 int exit_code, exit_signal; 1293 int exit_code, exit_signal;
1285 int pdeath_signal; /* The signal sent when the parent dies */ 1294 int pdeath_signal; /* The signal sent when the parent dies */
1286 unsigned int group_stop; /* GROUP_STOP_*, siglock protected */ 1295 unsigned int jobctl; /* JOBCTL_*, siglock protected */
1287 /* ??? */ 1296 /* ??? */
1288 unsigned int personality; 1297 unsigned int personality;
1289 unsigned did_exec:1; 1298 unsigned did_exec:1;
@@ -1804,15 +1813,34 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1804#define used_math() tsk_used_math(current) 1813#define used_math() tsk_used_math(current)
1805 1814
1806/* 1815/*
1807 * task->group_stop flags 1816 * task->jobctl flags
1808 */ 1817 */
1809#define GROUP_STOP_SIGMASK 0xffff /* signr of the last group stop */ 1818#define JOBCTL_STOP_SIGMASK 0xffff /* signr of the last group stop */
1810#define GROUP_STOP_PENDING (1 << 16) /* task should stop for group stop */ 1819
1811#define GROUP_STOP_CONSUME (1 << 17) /* consume group stop count */ 1820#define JOBCTL_STOP_DEQUEUED_BIT 16 /* stop signal dequeued */
1812#define GROUP_STOP_TRAPPING (1 << 18) /* switching from STOPPED to TRACED */ 1821#define JOBCTL_STOP_PENDING_BIT 17 /* task should stop for group stop */
1813#define GROUP_STOP_DEQUEUED (1 << 19) /* stop signal dequeued */ 1822#define JOBCTL_STOP_CONSUME_BIT 18 /* consume group stop count */
1814 1823#define JOBCTL_TRAP_STOP_BIT 19 /* trap for STOP */
1815extern void task_clear_group_stop_pending(struct task_struct *task); 1824#define JOBCTL_TRAP_NOTIFY_BIT 20 /* trap for NOTIFY */
1825#define JOBCTL_TRAPPING_BIT 21 /* switching to TRACED */
1826#define JOBCTL_LISTENING_BIT 22 /* ptracer is listening for events */
1827
1828#define JOBCTL_STOP_DEQUEUED (1 << JOBCTL_STOP_DEQUEUED_BIT)
1829#define JOBCTL_STOP_PENDING (1 << JOBCTL_STOP_PENDING_BIT)
1830#define JOBCTL_STOP_CONSUME (1 << JOBCTL_STOP_CONSUME_BIT)
1831#define JOBCTL_TRAP_STOP (1 << JOBCTL_TRAP_STOP_BIT)
1832#define JOBCTL_TRAP_NOTIFY (1 << JOBCTL_TRAP_NOTIFY_BIT)
1833#define JOBCTL_TRAPPING (1 << JOBCTL_TRAPPING_BIT)
1834#define JOBCTL_LISTENING (1 << JOBCTL_LISTENING_BIT)
1835
1836#define JOBCTL_TRAP_MASK (JOBCTL_TRAP_STOP | JOBCTL_TRAP_NOTIFY)
1837#define JOBCTL_PENDING_MASK (JOBCTL_STOP_PENDING | JOBCTL_TRAP_MASK)
1838
1839extern bool task_set_jobctl_pending(struct task_struct *task,
1840 unsigned int mask);
1841extern void task_clear_jobctl_trapping(struct task_struct *task);
1842extern void task_clear_jobctl_pending(struct task_struct *task,
1843 unsigned int mask);
1816 1844
1817#ifdef CONFIG_PREEMPT_RCU 1845#ifdef CONFIG_PREEMPT_RCU
1818 1846
@@ -2127,7 +2155,7 @@ static inline int dequeue_signal_lock(struct task_struct *tsk, sigset_t *mask, s
2127 spin_unlock_irqrestore(&tsk->sighand->siglock, flags); 2155 spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
2128 2156
2129 return ret; 2157 return ret;
2130} 2158}
2131 2159
2132extern void block_all_signals(int (*notifier)(void *priv), void *priv, 2160extern void block_all_signals(int (*notifier)(void *priv), void *priv,
2133 sigset_t *mask); 2161 sigset_t *mask);
@@ -2142,7 +2170,7 @@ extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_
2142extern int kill_pgrp(struct pid *pid, int sig, int priv); 2170extern int kill_pgrp(struct pid *pid, int sig, int priv);
2143extern int kill_pid(struct pid *pid, int sig, int priv); 2171extern int kill_pid(struct pid *pid, int sig, int priv);
2144extern int kill_proc_info(int, struct siginfo *, pid_t); 2172extern int kill_proc_info(int, struct siginfo *, pid_t);
2145extern int do_notify_parent(struct task_struct *, int); 2173extern __must_check bool do_notify_parent(struct task_struct *, int);
2146extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); 2174extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
2147extern void force_sig(int, struct task_struct *); 2175extern void force_sig(int, struct task_struct *);
2148extern int send_sig(int, struct task_struct *, int); 2176extern int send_sig(int, struct task_struct *, int);
@@ -2266,8 +2294,10 @@ static inline int get_nr_threads(struct task_struct *tsk)
2266 return tsk->signal->nr_threads; 2294 return tsk->signal->nr_threads;
2267} 2295}
2268 2296
2269/* de_thread depends on thread_group_leader not being a pid based check */ 2297static inline bool thread_group_leader(struct task_struct *p)
2270#define thread_group_leader(p) (p == p->group_leader) 2298{
2299 return p->exit_signal >= 0;
2300}
2271 2301
2272/* Do to the insanities of de_thread it is possible for a process 2302/* Do to the insanities of de_thread it is possible for a process
2273 * to have the pid of the thread group leader without actually being 2303 * to have the pid of the thread group leader without actually being
@@ -2300,11 +2330,6 @@ static inline int thread_group_empty(struct task_struct *p)
2300#define delay_group_leader(p) \ 2330#define delay_group_leader(p) \
2301 (thread_group_leader(p) && !thread_group_empty(p)) 2331 (thread_group_leader(p) && !thread_group_empty(p))
2302 2332
2303static inline int task_detached(struct task_struct *p)
2304{
2305 return p->exit_signal == -1;
2306}
2307
2308/* 2333/*
2309 * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring 2334 * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
2310 * subscriptions and synchronises with wait4(). Also used in procfs. Also 2335 * subscriptions and synchronises with wait4(). Also used in procfs. Also
diff --git a/include/linux/sdla.h b/include/linux/sdla.h
index 564acd3a71c1..9995c7fc3f60 100644
--- a/include/linux/sdla.h
+++ b/include/linux/sdla.h
@@ -112,11 +112,7 @@ struct sdla_dlci_conf {
112 short Tb_max; 112 short Tb_max;
113}; 113};
114 114
115#ifndef __KERNEL__ 115#ifdef __KERNEL__
116
117void sdla(void *cfg_info, char *dev, struct frad_conf *conf, int quiet);
118
119#else
120 116
121/* important Z80 window addresses */ 117/* important Z80 window addresses */
122#define SDLA_CONTROL_WND 0xE000 118#define SDLA_CONTROL_WND 0xE000
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c0a4f3ab0cc0..a24218c9c84b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -187,6 +187,20 @@ enum {
187 187
188 /* ensure the originating sk reference is available on driver level */ 188 /* ensure the originating sk reference is available on driver level */
189 SKBTX_DRV_NEEDS_SK_REF = 1 << 3, 189 SKBTX_DRV_NEEDS_SK_REF = 1 << 3,
190
191 /* device driver supports TX zero-copy buffers */
192 SKBTX_DEV_ZEROCOPY = 1 << 4,
193};
194
195/*
196 * The callback notifies userspace to release buffers when skb DMA is done in
197 * lower device, the skb last reference should be 0 when calling this.
198 * The desc is used to track userspace buffer index.
199 */
200struct ubuf_info {
201 void (*callback)(void *);
202 void *arg;
203 unsigned long desc;
190}; 204};
191 205
192/* This data is invariant across clones and lives at 206/* This data is invariant across clones and lives at
@@ -211,6 +225,7 @@ struct skb_shared_info {
211 /* Intermediate layers must ensure that destructor_arg 225 /* Intermediate layers must ensure that destructor_arg
212 * remains valid until skb destructor */ 226 * remains valid until skb destructor */
213 void * destructor_arg; 227 void * destructor_arg;
228
214 /* must be last field, see pskb_expand_head() */ 229 /* must be last field, see pskb_expand_head() */
215 skb_frag_t frags[MAX_SKB_FRAGS]; 230 skb_frag_t frags[MAX_SKB_FRAGS];
216}; 231};
@@ -270,15 +285,12 @@ typedef unsigned char *sk_buff_data_t;
270 * struct sk_buff - socket buffer 285 * struct sk_buff - socket buffer
271 * @next: Next buffer in list 286 * @next: Next buffer in list
272 * @prev: Previous buffer in list 287 * @prev: Previous buffer in list
273 * @sk: Socket we are owned by
274 * @tstamp: Time we arrived 288 * @tstamp: Time we arrived
289 * @sk: Socket we are owned by
275 * @dev: Device we arrived on/are leaving by 290 * @dev: Device we arrived on/are leaving by
276 * @transport_header: Transport layer header 291 * @cb: Control buffer. Free for use by every layer. Put private vars here
277 * @network_header: Network layer header
278 * @mac_header: Link layer header
279 * @_skb_refdst: destination entry (with norefcount bit) 292 * @_skb_refdst: destination entry (with norefcount bit)
280 * @sp: the security path, used for xfrm 293 * @sp: the security path, used for xfrm
281 * @cb: Control buffer. Free for use by every layer. Put private vars here
282 * @len: Length of actual data 294 * @len: Length of actual data
283 * @data_len: Data length 295 * @data_len: Data length
284 * @mac_len: Length of link layer header 296 * @mac_len: Length of link layer header
@@ -286,40 +298,45 @@ typedef unsigned char *sk_buff_data_t;
286 * @csum: Checksum (must include start/offset pair) 298 * @csum: Checksum (must include start/offset pair)
287 * @csum_start: Offset from skb->head where checksumming should start 299 * @csum_start: Offset from skb->head where checksumming should start
288 * @csum_offset: Offset from csum_start where checksum should be stored 300 * @csum_offset: Offset from csum_start where checksum should be stored
301 * @priority: Packet queueing priority
289 * @local_df: allow local fragmentation 302 * @local_df: allow local fragmentation
290 * @cloned: Head may be cloned (check refcnt to be sure) 303 * @cloned: Head may be cloned (check refcnt to be sure)
304 * @ip_summed: Driver fed us an IP checksum
291 * @nohdr: Payload reference only, must not modify header 305 * @nohdr: Payload reference only, must not modify header
306 * @nfctinfo: Relationship of this skb to the connection
292 * @pkt_type: Packet class 307 * @pkt_type: Packet class
293 * @fclone: skbuff clone status 308 * @fclone: skbuff clone status
294 * @ip_summed: Driver fed us an IP checksum
295 * @priority: Packet queueing priority
296 * @users: User count - see {datagram,tcp}.c
297 * @protocol: Packet protocol from driver
298 * @truesize: Buffer size
299 * @head: Head of buffer
300 * @data: Data head pointer
301 * @tail: Tail pointer
302 * @end: End pointer
303 * @destructor: Destruct function
304 * @mark: Generic packet mark
305 * @nfct: Associated connection, if any
306 * @ipvs_property: skbuff is owned by ipvs 309 * @ipvs_property: skbuff is owned by ipvs
307 * @peeked: this packet has been seen already, so stats have been 310 * @peeked: this packet has been seen already, so stats have been
308 * done for it, don't do them again 311 * done for it, don't do them again
309 * @nf_trace: netfilter packet trace flag 312 * @nf_trace: netfilter packet trace flag
310 * @nfctinfo: Relationship of this skb to the connection 313 * @protocol: Packet protocol from driver
314 * @destructor: Destruct function
315 * @nfct: Associated connection, if any
311 * @nfct_reasm: netfilter conntrack re-assembly pointer 316 * @nfct_reasm: netfilter conntrack re-assembly pointer
312 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 317 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
313 * @skb_iif: ifindex of device we arrived on 318 * @skb_iif: ifindex of device we arrived on
314 * @rxhash: the packet hash computed on receive
315 * @queue_mapping: Queue mapping for multiqueue devices
316 * @tc_index: Traffic control index 319 * @tc_index: Traffic control index
317 * @tc_verd: traffic control verdict 320 * @tc_verd: traffic control verdict
321 * @rxhash: the packet hash computed on receive
322 * @queue_mapping: Queue mapping for multiqueue devices
318 * @ndisc_nodetype: router type (from link layer) 323 * @ndisc_nodetype: router type (from link layer)
324 * @ooo_okay: allow the mapping of a socket to a queue to be changed
319 * @dma_cookie: a cookie to one of several possible DMA operations 325 * @dma_cookie: a cookie to one of several possible DMA operations
320 * done by skb DMA functions 326 * done by skb DMA functions
321 * @secmark: security marking 327 * @secmark: security marking
328 * @mark: Generic packet mark
329 * @dropcount: total number of sk_receive_queue overflows
322 * @vlan_tci: vlan tag control information 330 * @vlan_tci: vlan tag control information
331 * @transport_header: Transport layer header
332 * @network_header: Network layer header
333 * @mac_header: Link layer header
334 * @tail: Tail pointer
335 * @end: End pointer
336 * @head: Head of buffer
337 * @data: Data head pointer
338 * @truesize: Buffer size
339 * @users: User count - see {datagram,tcp}.c
323 */ 340 */
324 341
325struct sk_buff { 342struct sk_buff {
@@ -1562,16 +1579,22 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
1562 return __netdev_alloc_skb(dev, length, GFP_ATOMIC); 1579 return __netdev_alloc_skb(dev, length, GFP_ATOMIC);
1563} 1580}
1564 1581
1565static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, 1582static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev,
1566 unsigned int length) 1583 unsigned int length, gfp_t gfp)
1567{ 1584{
1568 struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN); 1585 struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
1569 1586
1570 if (NET_IP_ALIGN && skb) 1587 if (NET_IP_ALIGN && skb)
1571 skb_reserve(skb, NET_IP_ALIGN); 1588 skb_reserve(skb, NET_IP_ALIGN);
1572 return skb; 1589 return skb;
1573} 1590}
1574 1591
1592static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
1593 unsigned int length)
1594{
1595 return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC);
1596}
1597
1575/** 1598/**
1576 * __netdev_alloc_page - allocate a page for ps-rx on a specific device 1599 * __netdev_alloc_page - allocate a page for ps-rx on a specific device
1577 * @dev: network device to receive on 1600 * @dev: network device to receive on
@@ -2028,8 +2051,7 @@ static inline void sw_tx_timestamp(struct sk_buff *skb)
2028 * skb_tx_timestamp() - Driver hook for transmit timestamping 2051 * skb_tx_timestamp() - Driver hook for transmit timestamping
2029 * 2052 *
2030 * Ethernet MAC Drivers should call this function in their hard_xmit() 2053 * Ethernet MAC Drivers should call this function in their hard_xmit()
2031 * function as soon as possible after giving the sk_buff to the MAC 2054 * function immediately before giving the sk_buff to the MAC hardware.
2032 * hardware, but before freeing the sk_buff.
2033 * 2055 *
2034 * @skb: A socket buffer. 2056 * @skb: A socket buffer.
2035 */ 2057 */
@@ -2266,5 +2288,6 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb)
2266} 2288}
2267 2289
2268bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2290bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2291
2269#endif /* __KERNEL__ */ 2292#endif /* __KERNEL__ */
2270#endif /* _LINUX_SKBUFF_H */ 2293#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/slab.h b/include/linux/slab.h
index ad4dd1c8d30a..573c809c33d9 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -134,6 +134,26 @@ unsigned int kmem_cache_size(struct kmem_cache *);
134#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT) 134#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT)
135 135
136/* 136/*
137 * Some archs want to perform DMA into kmalloc caches and need a guaranteed
138 * alignment larger than the alignment of a 64-bit integer.
139 * Setting ARCH_KMALLOC_MINALIGN in arch headers allows that.
140 */
141#ifdef ARCH_DMA_MINALIGN
142#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
143#else
144#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
145#endif
146
147/*
148 * Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment.
149 * Intended for arches that get misalignment faults even for 64 bit integer
150 * aligned buffers.
151 */
152#ifndef ARCH_SLAB_MINALIGN
153#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
154#endif
155
156/*
137 * Common kmalloc functions provided by all allocators 157 * Common kmalloc functions provided by all allocators
138 */ 158 */
139void * __must_check __krealloc(const void *, size_t, gfp_t); 159void * __must_check __krealloc(const void *, size_t, gfp_t);
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 83203ae9390b..d00e0bacda93 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -18,53 +18,25 @@
18#include <trace/events/kmem.h> 18#include <trace/events/kmem.h>
19 19
20/* 20/*
21 * Enforce a minimum alignment for the kmalloc caches.
22 * Usually, the kmalloc caches are cache_line_size() aligned, except when
23 * DEBUG and FORCED_DEBUG are enabled, then they are BYTES_PER_WORD aligned.
24 * Some archs want to perform DMA into kmalloc caches and need a guaranteed
25 * alignment larger than the alignment of a 64-bit integer.
26 * ARCH_KMALLOC_MINALIGN allows that.
27 * Note that increasing this value may disable some debug features.
28 */
29#ifdef ARCH_DMA_MINALIGN
30#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
31#else
32#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
33#endif
34
35#ifndef ARCH_SLAB_MINALIGN
36/*
37 * Enforce a minimum alignment for all caches.
38 * Intended for archs that get misalignment faults even for BYTES_PER_WORD
39 * aligned buffers. Includes ARCH_KMALLOC_MINALIGN.
40 * If possible: Do not enable this flag for CONFIG_DEBUG_SLAB, it disables
41 * some debug features.
42 */
43#define ARCH_SLAB_MINALIGN 0
44#endif
45
46/*
47 * struct kmem_cache 21 * struct kmem_cache
48 * 22 *
49 * manages a cache. 23 * manages a cache.
50 */ 24 */
51 25
52struct kmem_cache { 26struct kmem_cache {
53/* 1) per-cpu data, touched during every alloc/free */ 27/* 1) Cache tunables. Protected by cache_chain_mutex */
54 struct array_cache *array[NR_CPUS];
55/* 2) Cache tunables. Protected by cache_chain_mutex */
56 unsigned int batchcount; 28 unsigned int batchcount;
57 unsigned int limit; 29 unsigned int limit;
58 unsigned int shared; 30 unsigned int shared;
59 31
60 unsigned int buffer_size; 32 unsigned int buffer_size;
61 u32 reciprocal_buffer_size; 33 u32 reciprocal_buffer_size;
62/* 3) touched by every alloc & free from the backend */ 34/* 2) touched by every alloc & free from the backend */
63 35
64 unsigned int flags; /* constant flags */ 36 unsigned int flags; /* constant flags */
65 unsigned int num; /* # of objs per slab */ 37 unsigned int num; /* # of objs per slab */
66 38
67/* 4) cache_grow/shrink */ 39/* 3) cache_grow/shrink */
68 /* order of pgs per slab (2^n) */ 40 /* order of pgs per slab (2^n) */
69 unsigned int gfporder; 41 unsigned int gfporder;
70 42
@@ -80,11 +52,11 @@ struct kmem_cache {
80 /* constructor func */ 52 /* constructor func */
81 void (*ctor)(void *obj); 53 void (*ctor)(void *obj);
82 54
83/* 5) cache creation/removal */ 55/* 4) cache creation/removal */
84 const char *name; 56 const char *name;
85 struct list_head next; 57 struct list_head next;
86 58
87/* 6) statistics */ 59/* 5) statistics */
88#ifdef CONFIG_DEBUG_SLAB 60#ifdef CONFIG_DEBUG_SLAB
89 unsigned long num_active; 61 unsigned long num_active;
90 unsigned long num_allocations; 62 unsigned long num_allocations;
@@ -111,16 +83,18 @@ struct kmem_cache {
111 int obj_size; 83 int obj_size;
112#endif /* CONFIG_DEBUG_SLAB */ 84#endif /* CONFIG_DEBUG_SLAB */
113 85
86/* 6) per-cpu/per-node data, touched during every alloc/free */
114 /* 87 /*
115 * We put nodelists[] at the end of kmem_cache, because we want to size 88 * We put array[] at the end of kmem_cache, because we want to size
116 * this array to nr_node_ids slots instead of MAX_NUMNODES 89 * this array to nr_cpu_ids slots instead of NR_CPUS
117 * (see kmem_cache_init()) 90 * (see kmem_cache_init())
118 * We still use [MAX_NUMNODES] and not [1] or [0] because cache_cache 91 * We still use [NR_CPUS] and not [1] or [0] because cache_cache
119 * is statically defined, so we reserve the max number of nodes. 92 * is statically defined, so we reserve the max number of cpus.
120 */ 93 */
121 struct kmem_list3 *nodelists[MAX_NUMNODES]; 94 struct kmem_list3 **nodelists;
95 struct array_cache *array[NR_CPUS];
122 /* 96 /*
123 * Do not add fields after nodelists[] 97 * Do not add fields after array[]
124 */ 98 */
125}; 99};
126 100
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h
index 4382db09df4f..0ec00b39d006 100644
--- a/include/linux/slob_def.h
+++ b/include/linux/slob_def.h
@@ -1,16 +1,6 @@
1#ifndef __LINUX_SLOB_DEF_H 1#ifndef __LINUX_SLOB_DEF_H
2#define __LINUX_SLOB_DEF_H 2#define __LINUX_SLOB_DEF_H
3 3
4#ifdef ARCH_DMA_MINALIGN
5#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
6#else
7#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long)
8#endif
9
10#ifndef ARCH_SLAB_MINALIGN
11#define ARCH_SLAB_MINALIGN __alignof__(unsigned long)
12#endif
13
14void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 4void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
15 5
16static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, 6static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep,
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index c8668d161dd8..4b35c06dfbc5 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -113,16 +113,6 @@ struct kmem_cache {
113 113
114#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) 114#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE)
115 115
116#ifdef ARCH_DMA_MINALIGN
117#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
118#else
119#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
120#endif
121
122#ifndef ARCH_SLAB_MINALIGN
123#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
124#endif
125
126/* 116/*
127 * Maximum kmalloc object size handled by SLUB. Larger object allocations 117 * Maximum kmalloc object size handled by SLUB. Larger object allocations
128 * are passed through to the page allocator. The page allocator "fastpath" 118 * are passed through to the page allocator. The page allocator "fastpath"
@@ -228,6 +218,19 @@ kmalloc_order(size_t size, gfp_t flags, unsigned int order)
228 return ret; 218 return ret;
229} 219}
230 220
221/**
222 * Calling this on allocated memory will check that the memory
223 * is expected to be in use, and print warnings if not.
224 */
225#ifdef CONFIG_SLUB_DEBUG
226extern bool verify_mem_not_deleted(const void *x);
227#else
228static inline bool verify_mem_not_deleted(const void *x)
229{
230 return true;
231}
232#endif
233
231#ifdef CONFIG_TRACING 234#ifdef CONFIG_TRACING
232extern void * 235extern void *
233kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size); 236kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size);
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 4ef98e422fde..e17f82266639 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -192,7 +192,8 @@ struct ucred {
192#define AF_IEEE802154 36 /* IEEE802154 sockets */ 192#define AF_IEEE802154 36 /* IEEE802154 sockets */
193#define AF_CAIF 37 /* CAIF sockets */ 193#define AF_CAIF 37 /* CAIF sockets */
194#define AF_ALG 38 /* Algorithm sockets */ 194#define AF_ALG 38 /* Algorithm sockets */
195#define AF_MAX 39 /* For now.. */ 195#define AF_NFC 39 /* NFC sockets */
196#define AF_MAX 40 /* For now.. */
196 197
197/* Protocol families, same as address families. */ 198/* Protocol families, same as address families. */
198#define PF_UNSPEC AF_UNSPEC 199#define PF_UNSPEC AF_UNSPEC
@@ -234,6 +235,7 @@ struct ucred {
234#define PF_IEEE802154 AF_IEEE802154 235#define PF_IEEE802154 AF_IEEE802154
235#define PF_CAIF AF_CAIF 236#define PF_CAIF AF_CAIF
236#define PF_ALG AF_ALG 237#define PF_ALG AF_ALG
238#define PF_NFC AF_NFC
237#define PF_MAX AF_MAX 239#define PF_MAX AF_MAX
238 240
239/* Maximum queue length specifiable by listen. */ 241/* Maximum queue length specifiable by listen. */
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h
index d85c52f294a0..0aa6acc73317 100644
--- a/include/linux/spi/74x164.h
+++ b/include/linux/spi/74x164.h
@@ -1,8 +1,6 @@
1#ifndef LINUX_SPI_74X164_H 1#ifndef LINUX_SPI_74X164_H
2#define LINUX_SPI_74X164_H 2#define LINUX_SPI_74X164_H
3 3
4#define GEN_74X164_DRIVER_NAME "74x164"
5
6struct gen_74x164_chip_platform_data { 4struct gen_74x164_chip_platform_data {
7 /* number assigned to the first GPIO */ 5 /* number assigned to the first GPIO */
8 unsigned base; 6 unsigned base;
diff --git a/include/linux/spi/mcp23s08.h b/include/linux/spi/mcp23s08.h
index c42cff8ca191..2d676d5aaa89 100644
--- a/include/linux/spi/mcp23s08.h
+++ b/include/linux/spi/mcp23s08.h
@@ -22,13 +22,4 @@ struct mcp23s08_platform_data {
22 * base to base+15 (or base+31 for s17 variant). 22 * base to base+15 (or base+31 for s17 variant).
23 */ 23 */
24 unsigned base; 24 unsigned base;
25
26 void *context; /* param to setup/teardown */
27
28 int (*setup)(struct spi_device *spi,
29 int gpio, unsigned ngpio,
30 void *context);
31 int (*teardown)(struct spi_device *spi,
32 int gpio, unsigned ngpio,
33 void *context);
34}; 25};
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 252e44821787..b0928c10111b 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -99,7 +99,7 @@ struct ssb_sprom {
99struct ssb_boardinfo { 99struct ssb_boardinfo {
100 u16 vendor; 100 u16 vendor;
101 u16 type; 101 u16 type;
102 u16 rev; 102 u8 rev;
103}; 103};
104 104
105 105
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 9529e49b0385..0dddc9e42b6b 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -28,11 +28,21 @@
28 28
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30 30
31/* platform data for platform device structure's platform_data field */ 31/* Platfrom data for platform device structure's platform_data field */
32
33struct stmmac_mdio_bus_data {
34 int bus_id;
35 int (*phy_reset)(void *priv);
36 unsigned int phy_mask;
37 int *irqs;
38 int probed_phy_irq;
39};
32 40
33/* Private data for the STM on-board ethernet driver */
34struct plat_stmmacenet_data { 41struct plat_stmmacenet_data {
35 int bus_id; 42 int bus_id;
43 int phy_addr;
44 int interface;
45 struct stmmac_mdio_bus_data *mdio_bus_data;
36 int pbl; 46 int pbl;
37 int clk_csr; 47 int clk_csr;
38 int has_gmac; 48 int has_gmac;
@@ -40,6 +50,7 @@ struct plat_stmmacenet_data {
40 int tx_coe; 50 int tx_coe;
41 int bugged_jumbo; 51 int bugged_jumbo;
42 int pmt; 52 int pmt;
53 int force_sf_dma_mode;
43 void (*fix_mac_speed)(void *priv, unsigned int speed); 54 void (*fix_mac_speed)(void *priv, unsigned int speed);
44 void (*bus_setup)(void __iomem *ioaddr); 55 void (*bus_setup)(void __iomem *ioaddr);
45 int (*init)(struct platform_device *pdev); 56 int (*init)(struct platform_device *pdev);
@@ -47,14 +58,4 @@ struct plat_stmmacenet_data {
47 void *custom_cfg; 58 void *custom_cfg;
48 void *bsp_priv; 59 void *bsp_priv;
49}; 60};
50
51struct plat_stmmacphy_data {
52 int bus_id;
53 int phy_addr;
54 unsigned int phy_mask;
55 int interface;
56 int (*phy_reset)(void *priv);
57 void *priv;
58};
59#endif 61#endif
60
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 083ffea7ba18..e1e3742733be 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -92,6 +92,13 @@ typedef int __bitwise suspend_state_t;
92 * @enter() and @wake(), even if any of them fails. It is executed after 92 * @enter() and @wake(), even if any of them fails. It is executed after
93 * a failing @prepare. 93 * a failing @prepare.
94 * 94 *
95 * @suspend_again: Returns whether the system should suspend again (true) or
96 * not (false). If the platform wants to poll sensors or execute some
97 * code during suspended without invoking userspace and most of devices,
98 * suspend_again callback is the place assuming that periodic-wakeup or
99 * alarm-wakeup is already setup. This allows to execute some codes while
100 * being kept suspended in the view of userland and devices.
101 *
95 * @end: Called by the PM core right after resuming devices, to indicate to 102 * @end: Called by the PM core right after resuming devices, to indicate to
96 * the platform that the system has returned to the working state or 103 * the platform that the system has returned to the working state or
97 * the transition to the sleep state has been aborted. 104 * the transition to the sleep state has been aborted.
@@ -113,6 +120,7 @@ struct platform_suspend_ops {
113 int (*enter)(suspend_state_t state); 120 int (*enter)(suspend_state_t state);
114 void (*wake)(void); 121 void (*wake)(void);
115 void (*finish)(void); 122 void (*finish)(void);
123 bool (*suspend_again)(void);
116 void (*end)(void); 124 void (*end)(void);
117 void (*recover)(void); 125 void (*recover)(void);
118}; 126};
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index 7138962664f8..b11f8ce2d3c0 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -67,7 +67,7 @@ enum {
67 TCF_META_ID_SK_FORWARD_ALLOCS, 67 TCF_META_ID_SK_FORWARD_ALLOCS,
68 TCF_META_ID_SK_SNDBUF, 68 TCF_META_ID_SK_SNDBUF,
69 TCF_META_ID_SK_ALLOCS, 69 TCF_META_ID_SK_ALLOCS,
70 TCF_META_ID_SK_ROUTE_CAPS, 70 __TCF_META_ID_SK_ROUTE_CAPS, /* unimplemented but in ABI already */
71 TCF_META_ID_SK_HASH, 71 TCF_META_ID_SK_HASH,
72 TCF_META_ID_SK_LINGERTIME, 72 TCF_META_ID_SK_LINGERTIME,
73 TCF_META_ID_SK_ACK_BACKLOG, 73 TCF_META_ID_SK_ACK_BACKLOG,
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index e64f4c67d0ef..531ede8006d9 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -282,6 +282,7 @@ struct tcp_request_sock {
282#endif 282#endif
283 u32 rcv_isn; 283 u32 rcv_isn;
284 u32 snt_isn; 284 u32 snt_isn;
285 u32 snt_synack; /* synack sent time */
285}; 286};
286 287
287static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) 288static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index e95f5236611f..a71a2927a6a0 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -51,27 +51,12 @@
51#include <linux/security.h> 51#include <linux/security.h>
52struct linux_binprm; 52struct linux_binprm;
53 53
54/**
55 * tracehook_expect_breakpoints - guess if task memory might be touched
56 * @task: current task, making a new mapping
57 *
58 * Return nonzero if @task is expected to want breakpoint insertion in
59 * its memory at some point. A zero return is no guarantee it won't
60 * be done, but this is a hint that it's known to be likely.
61 *
62 * May be called with @task->mm->mmap_sem held for writing.
63 */
64static inline int tracehook_expect_breakpoints(struct task_struct *task)
65{
66 return (task_ptrace(task) & PT_PTRACED) != 0;
67}
68
69/* 54/*
70 * ptrace report for syscall entry and exit looks identical. 55 * ptrace report for syscall entry and exit looks identical.
71 */ 56 */
72static inline void ptrace_report_syscall(struct pt_regs *regs) 57static inline void ptrace_report_syscall(struct pt_regs *regs)
73{ 58{
74 int ptrace = task_ptrace(current); 59 int ptrace = current->ptrace;
75 60
76 if (!(ptrace & PT_PTRACED)) 61 if (!(ptrace & PT_PTRACED))
77 return; 62 return;
@@ -145,229 +130,6 @@ static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step)
145} 130}
146 131
147/** 132/**
148 * tracehook_unsafe_exec - check for exec declared unsafe due to tracing
149 * @task: current task doing exec
150 *
151 * Return %LSM_UNSAFE_* bits applied to an exec because of tracing.
152 *
153 * @task->signal->cred_guard_mutex is held by the caller through the do_execve().
154 */
155static inline int tracehook_unsafe_exec(struct task_struct *task)
156{
157 int unsafe = 0;
158 int ptrace = task_ptrace(task);
159 if (ptrace & PT_PTRACED) {
160 if (ptrace & PT_PTRACE_CAP)
161 unsafe |= LSM_UNSAFE_PTRACE_CAP;
162 else
163 unsafe |= LSM_UNSAFE_PTRACE;
164 }
165 return unsafe;
166}
167
168/**
169 * tracehook_tracer_task - return the task that is tracing the given task
170 * @tsk: task to consider
171 *
172 * Returns NULL if no one is tracing @task, or the &struct task_struct
173 * pointer to its tracer.
174 *
175 * Must called under rcu_read_lock(). The pointer returned might be kept
176 * live only by RCU. During exec, this may be called with task_lock()
177 * held on @task, still held from when tracehook_unsafe_exec() was called.
178 */
179static inline struct task_struct *tracehook_tracer_task(struct task_struct *tsk)
180{
181 if (task_ptrace(tsk) & PT_PTRACED)
182 return rcu_dereference(tsk->parent);
183 return NULL;
184}
185
186/**
187 * tracehook_report_exec - a successful exec was completed
188 * @fmt: &struct linux_binfmt that performed the exec
189 * @bprm: &struct linux_binprm containing exec details
190 * @regs: user-mode register state
191 *
192 * An exec just completed, we are shortly going to return to user mode.
193 * The freshly initialized register state can be seen and changed in @regs.
194 * The name, file and other pointers in @bprm are still on hand to be
195 * inspected, but will be freed as soon as this returns.
196 *
197 * Called with no locks, but with some kernel resources held live
198 * and a reference on @fmt->module.
199 */
200static inline void tracehook_report_exec(struct linux_binfmt *fmt,
201 struct linux_binprm *bprm,
202 struct pt_regs *regs)
203{
204 if (!ptrace_event(PT_TRACE_EXEC, PTRACE_EVENT_EXEC, 0) &&
205 unlikely(task_ptrace(current) & PT_PTRACED))
206 send_sig(SIGTRAP, current, 0);
207}
208
209/**
210 * tracehook_report_exit - task has begun to exit
211 * @exit_code: pointer to value destined for @current->exit_code
212 *
213 * @exit_code points to the value passed to do_exit(), which tracing
214 * might change here. This is almost the first thing in do_exit(),
215 * before freeing any resources or setting the %PF_EXITING flag.
216 *
217 * Called with no locks held.
218 */
219static inline void tracehook_report_exit(long *exit_code)
220{
221 ptrace_event(PT_TRACE_EXIT, PTRACE_EVENT_EXIT, *exit_code);
222}
223
224/**
225 * tracehook_prepare_clone - prepare for new child to be cloned
226 * @clone_flags: %CLONE_* flags from clone/fork/vfork system call
227 *
228 * This is called before a new user task is to be cloned.
229 * Its return value will be passed to tracehook_finish_clone().
230 *
231 * Called with no locks held.
232 */
233static inline int tracehook_prepare_clone(unsigned clone_flags)
234{
235 if (clone_flags & CLONE_UNTRACED)
236 return 0;
237
238 if (clone_flags & CLONE_VFORK) {
239 if (current->ptrace & PT_TRACE_VFORK)
240 return PTRACE_EVENT_VFORK;
241 } else if ((clone_flags & CSIGNAL) != SIGCHLD) {
242 if (current->ptrace & PT_TRACE_CLONE)
243 return PTRACE_EVENT_CLONE;
244 } else if (current->ptrace & PT_TRACE_FORK)
245 return PTRACE_EVENT_FORK;
246
247 return 0;
248}
249
250/**
251 * tracehook_finish_clone - new child created and being attached
252 * @child: new child task
253 * @clone_flags: %CLONE_* flags from clone/fork/vfork system call
254 * @trace: return value from tracehook_prepare_clone()
255 *
256 * This is called immediately after adding @child to its parent's children list.
257 * The @trace value is that returned by tracehook_prepare_clone().
258 *
259 * Called with current's siglock and write_lock_irq(&tasklist_lock) held.
260 */
261static inline void tracehook_finish_clone(struct task_struct *child,
262 unsigned long clone_flags, int trace)
263{
264 ptrace_init_task(child, (clone_flags & CLONE_PTRACE) || trace);
265}
266
267/**
268 * tracehook_report_clone - in parent, new child is about to start running
269 * @regs: parent's user register state
270 * @clone_flags: flags from parent's system call
271 * @pid: new child's PID in the parent's namespace
272 * @child: new child task
273 *
274 * Called after a child is set up, but before it has been started running.
275 * This is not a good place to block, because the child has not started
276 * yet. Suspend the child here if desired, and then block in
277 * tracehook_report_clone_complete(). This must prevent the child from
278 * self-reaping if tracehook_report_clone_complete() uses the @child
279 * pointer; otherwise it might have died and been released by the time
280 * tracehook_report_clone_complete() is called.
281 *
282 * Called with no locks held, but the child cannot run until this returns.
283 */
284static inline void tracehook_report_clone(struct pt_regs *regs,
285 unsigned long clone_flags,
286 pid_t pid, struct task_struct *child)
287{
288 if (unlikely(task_ptrace(child))) {
289 /*
290 * It doesn't matter who attached/attaching to this
291 * task, the pending SIGSTOP is right in any case.
292 */
293 sigaddset(&child->pending.signal, SIGSTOP);
294 set_tsk_thread_flag(child, TIF_SIGPENDING);
295 }
296}
297
298/**
299 * tracehook_report_clone_complete - new child is running
300 * @trace: return value from tracehook_prepare_clone()
301 * @regs: parent's user register state
302 * @clone_flags: flags from parent's system call
303 * @pid: new child's PID in the parent's namespace
304 * @child: child task, already running
305 *
306 * This is called just after the child has started running. This is
307 * just before the clone/fork syscall returns, or blocks for vfork
308 * child completion if @clone_flags has the %CLONE_VFORK bit set.
309 * The @child pointer may be invalid if a self-reaping child died and
310 * tracehook_report_clone() took no action to prevent it from self-reaping.
311 *
312 * Called with no locks held.
313 */
314static inline void tracehook_report_clone_complete(int trace,
315 struct pt_regs *regs,
316 unsigned long clone_flags,
317 pid_t pid,
318 struct task_struct *child)
319{
320 if (unlikely(trace))
321 ptrace_event(0, trace, pid);
322}
323
324/**
325 * tracehook_report_vfork_done - vfork parent's child has exited or exec'd
326 * @child: child task, already running
327 * @pid: new child's PID in the parent's namespace
328 *
329 * Called after a %CLONE_VFORK parent has waited for the child to complete.
330 * The clone/vfork system call will return immediately after this.
331 * The @child pointer may be invalid if a self-reaping child died and
332 * tracehook_report_clone() took no action to prevent it from self-reaping.
333 *
334 * Called with no locks held.
335 */
336static inline void tracehook_report_vfork_done(struct task_struct *child,
337 pid_t pid)
338{
339 ptrace_event(PT_TRACE_VFORK_DONE, PTRACE_EVENT_VFORK_DONE, pid);
340}
341
342/**
343 * tracehook_prepare_release_task - task is being reaped, clean up tracing
344 * @task: task in %EXIT_DEAD state
345 *
346 * This is called in release_task() just before @task gets finally reaped
347 * and freed. This would be the ideal place to remove and clean up any
348 * tracing-related state for @task.
349 *
350 * Called with no locks held.
351 */
352static inline void tracehook_prepare_release_task(struct task_struct *task)
353{
354}
355
356/**
357 * tracehook_finish_release_task - final tracing clean-up
358 * @task: task in %EXIT_DEAD state
359 *
360 * This is called in release_task() when @task is being in the middle of
361 * being reaped. After this, there must be no tracing entanglements.
362 *
363 * Called with write_lock_irq(&tasklist_lock) held.
364 */
365static inline void tracehook_finish_release_task(struct task_struct *task)
366{
367 ptrace_release_task(task);
368}
369
370/**
371 * tracehook_signal_handler - signal handler setup is complete 133 * tracehook_signal_handler - signal handler setup is complete
372 * @sig: number of signal being delivered 134 * @sig: number of signal being delivered
373 * @info: siginfo_t of signal being delivered 135 * @info: siginfo_t of signal being delivered
@@ -390,151 +152,6 @@ static inline void tracehook_signal_handler(int sig, siginfo_t *info,
390 ptrace_notify(SIGTRAP); 152 ptrace_notify(SIGTRAP);
391} 153}
392 154
393/**
394 * tracehook_consider_ignored_signal - suppress short-circuit of ignored signal
395 * @task: task receiving the signal
396 * @sig: signal number being sent
397 *
398 * Return zero iff tracing doesn't care to examine this ignored signal,
399 * so it can short-circuit normal delivery and never even get queued.
400 *
401 * Called with @task->sighand->siglock held.
402 */
403static inline int tracehook_consider_ignored_signal(struct task_struct *task,
404 int sig)
405{
406 return (task_ptrace(task) & PT_PTRACED) != 0;
407}
408
409/**
410 * tracehook_consider_fatal_signal - suppress special handling of fatal signal
411 * @task: task receiving the signal
412 * @sig: signal number being sent
413 *
414 * Return nonzero to prevent special handling of this termination signal.
415 * Normally handler for signal is %SIG_DFL. It can be %SIG_IGN if @sig is
416 * ignored, in which case force_sig() is about to reset it to %SIG_DFL.
417 * When this returns zero, this signal might cause a quick termination
418 * that does not give the debugger a chance to intercept the signal.
419 *
420 * Called with or without @task->sighand->siglock held.
421 */
422static inline int tracehook_consider_fatal_signal(struct task_struct *task,
423 int sig)
424{
425 return (task_ptrace(task) & PT_PTRACED) != 0;
426}
427
428/**
429 * tracehook_force_sigpending - let tracing force signal_pending(current) on
430 *
431 * Called when recomputing our signal_pending() flag. Return nonzero
432 * to force the signal_pending() flag on, so that tracehook_get_signal()
433 * will be called before the next return to user mode.
434 *
435 * Called with @current->sighand->siglock held.
436 */
437static inline int tracehook_force_sigpending(void)
438{
439 return 0;
440}
441
442/**
443 * tracehook_get_signal - deliver synthetic signal to traced task
444 * @task: @current
445 * @regs: task_pt_regs(@current)
446 * @info: details of synthetic signal
447 * @return_ka: sigaction for synthetic signal
448 *
449 * Return zero to check for a real pending signal normally.
450 * Return -1 after releasing the siglock to repeat the check.
451 * Return a signal number to induce an artificial signal delivery,
452 * setting *@info and *@return_ka to specify its details and behavior.
453 *
454 * The @return_ka->sa_handler value controls the disposition of the
455 * signal, no matter the signal number. For %SIG_DFL, the return value
456 * is a representative signal to indicate the behavior (e.g. %SIGTERM
457 * for death, %SIGQUIT for core dump, %SIGSTOP for job control stop,
458 * %SIGTSTP for stop unless in an orphaned pgrp), but the signal number
459 * reported will be @info->si_signo instead.
460 *
461 * Called with @task->sighand->siglock held, before dequeuing pending signals.
462 */
463static inline int tracehook_get_signal(struct task_struct *task,
464 struct pt_regs *regs,
465 siginfo_t *info,
466 struct k_sigaction *return_ka)
467{
468 return 0;
469}
470
471/**
472 * tracehook_finish_jctl - report about return from job control stop
473 *
474 * This is called by do_signal_stop() after wakeup.
475 */
476static inline void tracehook_finish_jctl(void)
477{
478}
479
480#define DEATH_REAP -1
481#define DEATH_DELAYED_GROUP_LEADER -2
482
483/**
484 * tracehook_notify_death - task is dead, ready to notify parent
485 * @task: @current task now exiting
486 * @death_cookie: value to pass to tracehook_report_death()
487 * @group_dead: nonzero if this was the last thread in the group to die
488 *
489 * A return value >= 0 means call do_notify_parent() with that signal
490 * number. Negative return value can be %DEATH_REAP to self-reap right
491 * now, or %DEATH_DELAYED_GROUP_LEADER to a zombie without notifying our
492 * parent. Note that a return value of 0 means a do_notify_parent() call
493 * that sends no signal, but still wakes up a parent blocked in wait*().
494 *
495 * Called with write_lock_irq(&tasklist_lock) held.
496 */
497static inline int tracehook_notify_death(struct task_struct *task,
498 void **death_cookie, int group_dead)
499{
500 if (task_detached(task))
501 return task->ptrace ? SIGCHLD : DEATH_REAP;
502
503 /*
504 * If something other than our normal parent is ptracing us, then
505 * send it a SIGCHLD instead of honoring exit_signal. exit_signal
506 * only has special meaning to our real parent.
507 */
508 if (thread_group_empty(task) && !ptrace_reparented(task))
509 return task->exit_signal;
510
511 return task->ptrace ? SIGCHLD : DEATH_DELAYED_GROUP_LEADER;
512}
513
514/**
515 * tracehook_report_death - task is dead and ready to be reaped
516 * @task: @current task now exiting
517 * @signal: return value from tracheook_notify_death()
518 * @death_cookie: value passed back from tracehook_notify_death()
519 * @group_dead: nonzero if this was the last thread in the group to die
520 *
521 * Thread has just become a zombie or is about to self-reap. If positive,
522 * @signal is the signal number just sent to the parent (usually %SIGCHLD).
523 * If @signal is %DEATH_REAP, this thread will self-reap. If @signal is
524 * %DEATH_DELAYED_GROUP_LEADER, this is a delayed_group_leader() zombie.
525 * The @death_cookie was passed back by tracehook_notify_death().
526 *
527 * If normal reaping is not inhibited, @task->exit_state might be changing
528 * in parallel.
529 *
530 * Called without locks.
531 */
532static inline void tracehook_report_death(struct task_struct *task,
533 int signal, void *death_cookie,
534 int group_dead)
535{
536}
537
538#ifdef TIF_NOTIFY_RESUME 155#ifdef TIF_NOTIFY_RESUME
539/** 156/**
540 * set_notify_resume - cause tracehook_notify_resume() to be called 157 * set_notify_resume - cause tracehook_notify_resume() to be called
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 136040bba3e3..970d5a2a9047 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -63,6 +63,7 @@ struct virtio_net_config {
63 * specify GSO or CSUM features, you can simply ignore the header. */ 63 * specify GSO or CSUM features, you can simply ignore the header. */
64struct virtio_net_hdr { 64struct virtio_net_hdr {
65#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset 65#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
66#define VIRTIO_NET_HDR_F_DATA_VALID 2 // Csum is valid
66 __u8 flags; 67 __u8 flags;
67#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame 68#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
68#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO) 69#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO)
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index f584aba78ca9..2be2887c6958 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -255,7 +255,7 @@ enum {
255 WQ_HIGHPRI = 1 << 4, /* high priority */ 255 WQ_HIGHPRI = 1 << 4, /* high priority */
256 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ 256 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */
257 257
258 WQ_DYING = 1 << 6, /* internal: workqueue is dying */ 258 WQ_DRAINING = 1 << 6, /* internal: workqueue is draining */
259 WQ_RESCUER = 1 << 7, /* internal: workqueue has rescuer */ 259 WQ_RESCUER = 1 << 7, /* internal: workqueue has rescuer */
260 260
261 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ 261 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */
@@ -355,6 +355,7 @@ extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
355 struct delayed_work *work, unsigned long delay); 355 struct delayed_work *work, unsigned long delay);
356 356
357extern void flush_workqueue(struct workqueue_struct *wq); 357extern void flush_workqueue(struct workqueue_struct *wq);
358extern void drain_workqueue(struct workqueue_struct *wq);
358extern void flush_scheduled_work(void); 359extern void flush_scheduled_work(void);
359 360
360extern int schedule_work(struct work_struct *work); 361extern int schedule_work(struct work_struct *work);
@@ -412,21 +413,6 @@ static inline bool __cancel_delayed_work(struct delayed_work *work)
412 return ret; 413 return ret;
413} 414}
414 415
415/* Obsolete. use cancel_delayed_work_sync() */
416static inline __deprecated
417void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq,
418 struct delayed_work *work)
419{
420 cancel_delayed_work_sync(work);
421}
422
423/* Obsolete. use cancel_delayed_work_sync() */
424static inline __deprecated
425void cancel_rearming_delayed_work(struct delayed_work *work)
426{
427 cancel_delayed_work_sync(work);
428}
429
430#ifndef CONFIG_SMP 416#ifndef CONFIG_SMP
431static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) 417static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg)
432{ 418{