aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-10-30 04:43:08 -0400
committerIngo Molnar <mingo@elte.hu>2010-10-30 04:43:08 -0400
commit169ed55bd30305b933f52bfab32a58671d44ab68 (patch)
tree32e280957474f458901abfce16fa2a1687ef7497 /include/linux
parent3d7851b3cdd43a734e5cc4c643fd886ab28ad4d5 (diff)
parent45f81b1c96d9793e47ce925d257ea693ce0b193e (diff)
Merge branch 'tip/perf/jump-label-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/acpi.h11
-rw-r--r--include/linux/altera_uart.h5
-rw-r--r--include/linux/amba/pl08x.h222
-rw-r--r--include/linux/atmdev.h2
-rw-r--r--include/linux/backing-dev.h3
-rw-r--r--include/linux/basic_mmio_gpio.h20
-rw-r--r--include/linux/bfin_mac.h29
-rw-r--r--include/linux/bio.h15
-rw-r--r--include/linux/bitops.h45
-rw-r--r--include/linux/blk_types.h11
-rw-r--r--include/linux/blkdev.h164
-rw-r--r--include/linux/buffer_head.h3
-rw-r--r--include/linux/can/platform/mcp251x.h4
-rw-r--r--include/linux/cgroup.h4
-rw-r--r--include/linux/coda_fs_i.h13
-rw-r--r--include/linux/coda_linux.h6
-rw-r--r--include/linux/coda_psdev.h4
-rw-r--r--include/linux/completion.h10
-rw-r--r--include/linux/connector.h8
-rw-r--r--include/linux/davinci_emac.h16
-rw-r--r--include/linux/dccp.h6
-rw-r--r--include/linux/device.h7
-rw-r--r--include/linux/dlm.h4
-rw-r--r--include/linux/dmaengine.h60
-rw-r--r--include/linux/drbd.h22
-rw-r--r--include/linux/drbd_limits.h29
-rw-r--r--include/linux/drbd_nl.h6
-rw-r--r--include/linux/dynamic_debug.h2
-rw-r--r--include/linux/etherdevice.h22
-rw-r--r--include/linux/ethtool.h190
-rw-r--r--include/linux/exportfs.h13
-rw-r--r--include/linux/fb.h6
-rw-r--r--include/linux/fdreg.h2
-rw-r--r--include/linux/fs.h102
-rw-r--r--include/linux/fsl_devices.h18
-rw-r--r--include/linux/gameport.h4
-rw-r--r--include/linux/genhd.h53
-rw-r--r--include/linux/gfp.h105
-rw-r--r--include/linux/gpio-fan.h36
-rw-r--r--include/linux/hid.h5
-rw-r--r--include/linux/hiddev.h4
-rw-r--r--include/linux/highmem.h74
-rw-r--r--include/linux/hugetlb.h17
-rw-r--r--include/linux/i2c.h12
-rw-r--r--include/linux/i2c/adp5588.h21
-rw-r--r--include/linux/i2c/apds990x.h79
-rw-r--r--include/linux/i2c/bh1770glc.h53
-rw-r--r--include/linux/i2c/twl.h6
-rw-r--r--include/linux/idr.h8
-rw-r--r--include/linux/ieee80211.h71
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/if_bonding.h3
-rw-r--r--include/linux/if_ether.h2
-rw-r--r--include/linux/if_infiniband.h2
-rw-r--r--include/linux/if_macvlan.h9
-rw-r--r--include/linux/if_pppox.h52
-rw-r--r--include/linux/if_vlan.h31
-rw-r--r--include/linux/in.h19
-rw-r--r--include/linux/in6.h4
-rw-r--r--include/linux/inetdevice.h21
-rw-r--r--include/linux/init.h13
-rw-r--r--include/linux/init_task.h4
-rw-r--r--include/linux/input.h57
-rw-r--r--include/linux/input/bu21013.h44
-rw-r--r--include/linux/intel_mid_dma.h16
-rw-r--r--include/linux/interrupt.h1
-rw-r--r--include/linux/io-mapping.h14
-rw-r--r--include/linux/ip_vs.h15
-rw-r--r--include/linux/ipv6.h4
-rw-r--r--include/linux/jhash.h2
-rw-r--r--include/linux/jump_label.h7
-rw-r--r--include/linux/kdb.h51
-rw-r--r--include/linux/kernel.h46
-rw-r--r--include/linux/kernel_stat.h18
-rw-r--r--include/linux/kfifo.h28
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/kvm.h12
-rw-r--r--include/linux/kvm_host.h22
-rw-r--r--include/linux/kvm_para.h7
-rw-r--r--include/linux/lis3lv02d.h55
-rw-r--r--include/linux/list.h6
-rw-r--r--include/linux/math64.h12
-rw-r--r--include/linux/memory.h4
-rw-r--r--include/linux/memory_hotplug.h4
-rw-r--r--include/linux/migrate.h16
-rw-r--r--include/linux/mlx4/cmd.h3
-rw-r--r--include/linux/mlx4/device.h42
-rw-r--r--include/linux/mlx4/driver.h9
-rw-r--r--include/linux/mlx4/qp.h9
-rw-r--r--include/linux/mm.h29
-rw-r--r--include/linux/mm_types.h2
-rw-r--r--include/linux/mmc/sdio_ids.h1
-rw-r--r--include/linux/mmzone.h10
-rw-r--r--include/linux/moduleparam.h4
-rw-r--r--include/linux/mroute.h1
-rw-r--r--include/linux/mtio.h1
-rw-r--r--include/linux/n_r3964.h1
-rw-r--r--include/linux/ncp_fs.h28
-rw-r--r--include/linux/ncp_fs_sb.h4
-rw-r--r--include/linux/net.h2
-rw-r--r--include/linux/netdevice.h136
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h6
-rw-r--r--include/linux/netfilter/nf_conntrack_sip.h1
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h1
-rw-r--r--include/linux/netfilter/x_tables.h5
-rw-r--r--include/linux/netfilter/xt_TPROXY.h13
-rw-r--r--include/linux/netfilter_arp/arp_tables.h68
-rw-r--r--include/linux/netfilter_bridge/Kbuild2
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h107
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h110
-rw-r--r--include/linux/netpoll.h9
-rw-r--r--include/linux/nfs4.h65
-rw-r--r--include/linux/nfs_fs.h19
-rw-r--r--include/linux/nfs_fs_sb.h4
-rw-r--r--include/linux/nfs_idmap.h31
-rw-r--r--include/linux/nfs_mount.h3
-rw-r--r--include/linux/nfs_xdr.h128
-rw-r--r--include/linux/nilfs2_fs.h18
-rw-r--r--include/linux/nl80211.h210
-rw-r--r--include/linux/of_device.h13
-rw-r--r--include/linux/of_fdt.h2
-rw-r--r--include/linux/of_irq.h4
-rw-r--r--include/linux/of_pdt.h45
-rw-r--r--include/linux/padata.h4
-rw-r--r--include/linux/page-flags.h2
-rw-r--r--include/linux/pageblock-flags.h5
-rw-r--r--include/linux/pagemap.h13
-rw-r--r--include/linux/pci_ids.h30
-rw-r--r--include/linux/percpu.h31
-rw-r--r--include/linux/phonet.h5
-rw-r--r--include/linux/phy.h16
-rw-r--r--include/linux/pkt_cls.h1
-rw-r--r--include/linux/platform_device.h3
-rw-r--r--include/linux/poll.h2
-rw-r--r--include/linux/power_supply.h6
-rw-r--r--include/linux/ptrace.h12
-rw-r--r--include/linux/ramoops.h15
-rw-r--r--include/linux/ratelimit.h2
-rw-r--r--include/linux/rds.h115
-rw-r--r--include/linux/reiserfs_fs.h2
-rw-r--r--include/linux/ring_buffer.h12
-rw-r--r--include/linux/rio.h17
-rw-r--r--include/linux/rio_ids.h2
-rw-r--r--include/linux/rio_regs.h18
-rw-r--r--include/linux/rmap.h30
-rw-r--r--include/linux/rtnetlink.h30
-rw-r--r--include/linux/sched.h20
-rw-r--r--include/linux/selection.h1
-rw-r--r--include/linux/serial_8250.h8
-rw-r--r--include/linux/serial_core.h13
-rw-r--r--include/linux/serio.h10
-rw-r--r--include/linux/sfi.h24
-rw-r--r--include/linux/sh_clk.h17
-rw-r--r--include/linux/sh_intc.h16
-rw-r--r--include/linux/sh_pfc.h1
-rw-r--r--include/linux/signalfd.h3
-rw-r--r--include/linux/skbuff.h117
-rw-r--r--include/linux/slub_def.h14
-rw-r--r--include/linux/smp.h19
-rw-r--r--include/linux/smp_lock.h7
-rw-r--r--include/linux/socket.h1
-rw-r--r--include/linux/spi/74x164.h11
-rw-r--r--include/linux/ssb/ssb_regs.h1
-rw-r--r--include/linux/stmmac.h6
-rw-r--r--include/linux/sunrpc/auth.h4
-rw-r--r--include/linux/sunrpc/cache.h37
-rw-r--r--include/linux/sunrpc/clnt.h2
-rw-r--r--include/linux/sunrpc/gss_spkm3.h55
-rw-r--r--include/linux/sunrpc/stats.h23
-rw-r--r--include/linux/sunrpc/svc_xprt.h32
-rw-r--r--include/linux/sunrpc/svcauth.h17
-rw-r--r--include/linux/sunrpc/xdr.h9
-rw-r--r--include/linux/sunrpc/xprt.h4
-rw-r--r--include/linux/swap.h10
-rw-r--r--include/linux/synclink.h5
-rw-r--r--include/linux/syscalls.h3
-rw-r--r--include/linux/tc_act/Kbuild1
-rw-r--r--include/linux/tc_act/tc_csum.h32
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h1
-rw-r--r--include/linux/tcp.h1
-rw-r--r--include/linux/tipc.h30
-rw-r--r--include/linux/tracehook.h2
-rw-r--r--include/linux/tty.h3
-rw-r--r--include/linux/tty_driver.h9
-rw-r--r--include/linux/types.h20
-rw-r--r--include/linux/uio_driver.h2
-rw-r--r--include/linux/usb/cdc.h79
-rw-r--r--include/linux/usb/ch9.h68
-rw-r--r--include/linux/usb/composite.h40
-rw-r--r--include/linux/usb/gadget.h20
-rw-r--r--include/linux/usb/hcd.h2
-rw-r--r--include/linux/usb/intel_mid_otg.h180
-rw-r--r--include/linux/usb/langwell_otg.h139
-rw-r--r--include/linux/usb/ncm.h114
-rw-r--r--include/linux/usb/otg.h11
-rw-r--r--include/linux/usb/serial.h2
-rw-r--r--include/linux/usb/storage.h48
-rw-r--r--include/linux/usb_usual.h43
-rw-r--r--include/linux/virtio_9p.h1
-rw-r--r--include/linux/vmalloc.h4
-rw-r--r--include/linux/wireless.h2
-rw-r--r--include/linux/wl12xx.h (renamed from include/linux/spi/wl12xx.h)23
-rw-r--r--include/linux/wlp.h736
-rw-r--r--include/linux/workqueue.h57
-rw-r--r--include/linux/writeback.h4
206 files changed, 3761 insertions, 2160 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 4e8ea8c8ec1e..831c4634162c 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -301,6 +301,7 @@ header-y += quota.h
301header-y += radeonfb.h 301header-y += radeonfb.h
302header-y += random.h 302header-y += random.h
303header-y += raw.h 303header-y += raw.h
304header-y += rds.h
304header-y += reboot.h 305header-y += reboot.h
305header-y += reiserfs_fs.h 306header-y += reiserfs_fs.h
306header-y += reiserfs_xattr.h 307header-y += reiserfs_xattr.h
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index c227757feb06..050a7bccb836 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -245,8 +245,6 @@ int acpi_check_resource_conflict(const struct resource *res);
245 245
246int acpi_check_region(resource_size_t start, resource_size_t n, 246int acpi_check_region(resource_size_t start, resource_size_t n,
247 const char *name); 247 const char *name);
248int acpi_check_mem_region(resource_size_t start, resource_size_t n,
249 const char *name);
250 248
251int acpi_resources_are_enforced(void); 249int acpi_resources_are_enforced(void);
252 250
@@ -308,6 +306,9 @@ extern acpi_status acpi_pci_osc_control_set(acpi_handle handle,
308 u32 *mask, u32 req); 306 u32 *mask, u32 req);
309extern void acpi_early_init(void); 307extern void acpi_early_init(void);
310 308
309int acpi_os_map_generic_address(struct acpi_generic_address *addr);
310void acpi_os_unmap_generic_address(struct acpi_generic_address *addr);
311
311#else /* !CONFIG_ACPI */ 312#else /* !CONFIG_ACPI */
312 313
313#define acpi_disabled 1 314#define acpi_disabled 1
@@ -344,12 +345,6 @@ static inline int acpi_check_region(resource_size_t start, resource_size_t n,
344 return 0; 345 return 0;
345} 346}
346 347
347static inline int acpi_check_mem_region(resource_size_t start,
348 resource_size_t n, const char *name)
349{
350 return 0;
351}
352
353struct acpi_table_header; 348struct acpi_table_header;
354static inline int acpi_table_parse(char *id, 349static inline int acpi_table_parse(char *id,
355 int (*handler)(struct acpi_table_header *)) 350 int (*handler)(struct acpi_table_header *))
diff --git a/include/linux/altera_uart.h b/include/linux/altera_uart.h
index 8d441064a30d..a10a90791976 100644
--- a/include/linux/altera_uart.h
+++ b/include/linux/altera_uart.h
@@ -5,10 +5,15 @@
5#ifndef __ALTUART_H 5#ifndef __ALTUART_H
6#define __ALTUART_H 6#define __ALTUART_H
7 7
8#include <linux/init.h>
9
8struct altera_uart_platform_uart { 10struct altera_uart_platform_uart {
9 unsigned long mapbase; /* Physical address base */ 11 unsigned long mapbase; /* Physical address base */
10 unsigned int irq; /* Interrupt vector */ 12 unsigned int irq; /* Interrupt vector */
11 unsigned int uartclk; /* UART clock rate */ 13 unsigned int uartclk; /* UART clock rate */
14 unsigned int bus_shift; /* Bus shift (address stride) */
12}; 15};
13 16
17int __init early_altera_uart_setup(struct altera_uart_platform_uart *platp);
18
14#endif /* __ALTUART_H */ 19#endif /* __ALTUART_H */
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h
new file mode 100644
index 000000000000..521a0f8974ac
--- /dev/null
+++ b/include/linux/amba/pl08x.h
@@ -0,0 +1,222 @@
1/*
2 * linux/amba/pl08x.h - ARM PrimeCell DMA Controller driver
3 *
4 * Copyright (C) 2005 ARM Ltd
5 * Copyright (C) 2010 ST-Ericsson SA
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * pl08x information required by platform code
12 *
13 * Please credit ARM.com
14 * Documentation: ARM DDI 0196D
15 *
16 */
17
18#ifndef AMBA_PL08X_H
19#define AMBA_PL08X_H
20
21/* We need sizes of structs from this header */
22#include <linux/dmaengine.h>
23#include <linux/interrupt.h>
24
25/**
26 * struct pl08x_channel_data - data structure to pass info between
27 * platform and PL08x driver regarding channel configuration
28 * @bus_id: name of this device channel, not just a device name since
29 * devices may have more than one channel e.g. "foo_tx"
30 * @min_signal: the minimum DMA signal number to be muxed in for this
31 * channel (for platforms supporting muxed signals). If you have
32 * static assignments, make sure this is set to the assigned signal
33 * number, PL08x have 16 possible signals in number 0 thru 15 so
34 * when these are not enough they often get muxed (in hardware)
35 * disabling simultaneous use of the same channel for two devices.
36 * @max_signal: the maximum DMA signal number to be muxed in for
37 * the channel. Set to the same as min_signal for
38 * devices with static assignments
39 * @muxval: a number usually used to poke into some mux regiser to
40 * mux in the signal to this channel
41 * @cctl_opt: default options for the channel control register
42 * @addr: source/target address in physical memory for this DMA channel,
43 * can be the address of a FIFO register for burst requests for example.
44 * This can be left undefined if the PrimeCell API is used for configuring
45 * this.
46 * @circular_buffer: whether the buffer passed in is circular and
47 * shall simply be looped round round (like a record baby round
48 * round round round)
49 * @single: the device connected to this channel will request single
50 * DMA transfers, not bursts. (Bursts are default.)
51 */
52struct pl08x_channel_data {
53 char *bus_id;
54 int min_signal;
55 int max_signal;
56 u32 muxval;
57 u32 cctl;
58 u32 ccfg;
59 dma_addr_t addr;
60 bool circular_buffer;
61 bool single;
62};
63
64/**
65 * Struct pl08x_bus_data - information of source or destination
66 * busses for a transfer
67 * @addr: current address
68 * @maxwidth: the maximum width of a transfer on this bus
69 * @buswidth: the width of this bus in bytes: 1, 2 or 4
70 * @fill_bytes: bytes required to fill to the next bus memory
71 * boundary
72 */
73struct pl08x_bus_data {
74 dma_addr_t addr;
75 u8 maxwidth;
76 u8 buswidth;
77 u32 fill_bytes;
78};
79
80/**
81 * struct pl08x_phy_chan - holder for the physical channels
82 * @id: physical index to this channel
83 * @lock: a lock to use when altering an instance of this struct
84 * @signal: the physical signal (aka channel) serving this
85 * physical channel right now
86 * @serving: the virtual channel currently being served by this
87 * physical channel
88 */
89struct pl08x_phy_chan {
90 unsigned int id;
91 void __iomem *base;
92 spinlock_t lock;
93 int signal;
94 struct pl08x_dma_chan *serving;
95 u32 csrc;
96 u32 cdst;
97 u32 clli;
98 u32 cctl;
99 u32 ccfg;
100};
101
102/**
103 * struct pl08x_txd - wrapper for struct dma_async_tx_descriptor
104 * @llis_bus: DMA memory address (physical) start for the LLIs
105 * @llis_va: virtual memory address start for the LLIs
106 */
107struct pl08x_txd {
108 struct dma_async_tx_descriptor tx;
109 struct list_head node;
110 enum dma_data_direction direction;
111 struct pl08x_bus_data srcbus;
112 struct pl08x_bus_data dstbus;
113 int len;
114 dma_addr_t llis_bus;
115 void *llis_va;
116 struct pl08x_channel_data *cd;
117 bool active;
118 /*
119 * Settings to be put into the physical channel when we
120 * trigger this txd
121 */
122 u32 csrc;
123 u32 cdst;
124 u32 clli;
125 u32 cctl;
126};
127
128/**
129 * struct pl08x_dma_chan_state - holds the PL08x specific virtual
130 * channel states
131 * @PL08X_CHAN_IDLE: the channel is idle
132 * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport
133 * channel and is running a transfer on it
134 * @PL08X_CHAN_PAUSED: the channel has allocated a physical transport
135 * channel, but the transfer is currently paused
136 * @PL08X_CHAN_WAITING: the channel is waiting for a physical transport
137 * channel to become available (only pertains to memcpy channels)
138 */
139enum pl08x_dma_chan_state {
140 PL08X_CHAN_IDLE,
141 PL08X_CHAN_RUNNING,
142 PL08X_CHAN_PAUSED,
143 PL08X_CHAN_WAITING,
144};
145
146/**
147 * struct pl08x_dma_chan - this structure wraps a DMA ENGINE channel
148 * @chan: wrappped abstract channel
149 * @phychan: the physical channel utilized by this channel, if there is one
150 * @tasklet: tasklet scheduled by the IRQ to handle actual work etc
151 * @name: name of channel
152 * @cd: channel platform data
153 * @runtime_addr: address for RX/TX according to the runtime config
154 * @runtime_direction: current direction of this channel according to
155 * runtime config
156 * @lc: last completed transaction on this channel
157 * @desc_list: queued transactions pending on this channel
158 * @at: active transaction on this channel
159 * @lockflags: sometimes we let a lock last between two function calls,
160 * especially prep/submit, and then we need to store the IRQ flags
161 * in the channel state, here
162 * @lock: a lock for this channel data
163 * @host: a pointer to the host (internal use)
164 * @state: whether the channel is idle, paused, running etc
165 * @slave: whether this channel is a device (slave) or for memcpy
166 * @waiting: a TX descriptor on this channel which is waiting for
167 * a physical channel to become available
168 */
169struct pl08x_dma_chan {
170 struct dma_chan chan;
171 struct pl08x_phy_chan *phychan;
172 struct tasklet_struct tasklet;
173 char *name;
174 struct pl08x_channel_data *cd;
175 dma_addr_t runtime_addr;
176 enum dma_data_direction runtime_direction;
177 atomic_t last_issued;
178 dma_cookie_t lc;
179 struct list_head desc_list;
180 struct pl08x_txd *at;
181 unsigned long lockflags;
182 spinlock_t lock;
183 void *host;
184 enum pl08x_dma_chan_state state;
185 bool slave;
186 struct pl08x_txd *waiting;
187};
188
189/**
190 * struct pl08x_platform_data - the platform configuration for the
191 * PL08x PrimeCells.
192 * @slave_channels: the channels defined for the different devices on the
193 * platform, all inclusive, including multiplexed channels. The available
194 * physical channels will be multiplexed around these signals as they
195 * are requested, just enumerate all possible channels.
196 * @get_signal: request a physical signal to be used for a DMA
197 * transfer immediately: if there is some multiplexing or similar blocking
198 * the use of the channel the transfer can be denied by returning
199 * less than zero, else it returns the allocated signal number
200 * @put_signal: indicate to the platform that this physical signal is not
201 * running any DMA transfer and multiplexing can be recycled
202 * @bus_bit_lli: Bit[0] of the address indicated which AHB bus master the
203 * LLI addresses are on 0/1 Master 1/2.
204 */
205struct pl08x_platform_data {
206 struct pl08x_channel_data *slave_channels;
207 unsigned int num_slave_channels;
208 struct pl08x_channel_data memcpy_channel;
209 int (*get_signal)(struct pl08x_dma_chan *);
210 void (*put_signal)(struct pl08x_dma_chan *);
211};
212
213#ifdef CONFIG_AMBA_PL08X
214bool pl08x_filter_id(struct dma_chan *chan, void *chan_id);
215#else
216static inline bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
217{
218 return false;
219}
220#endif
221
222#endif /* AMBA_PL08X_H */
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index f6481daf6e52..a8e4e832cdbb 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -449,7 +449,7 @@ void vcc_insert_socket(struct sock *sk);
449 449
450static inline int atm_guess_pdu2truesize(int size) 450static inline int atm_guess_pdu2truesize(int size)
451{ 451{
452 return (SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info)); 452 return SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info);
453} 453}
454 454
455 455
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 35b00746c712..4ce34fa937d4 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -111,6 +111,7 @@ void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi);
111 111
112extern spinlock_t bdi_lock; 112extern spinlock_t bdi_lock;
113extern struct list_head bdi_list; 113extern struct list_head bdi_list;
114extern struct list_head bdi_pending_list;
114 115
115static inline int wb_has_dirty_io(struct bdi_writeback *wb) 116static inline int wb_has_dirty_io(struct bdi_writeback *wb)
116{ 117{
@@ -285,7 +286,7 @@ enum {
285void clear_bdi_congested(struct backing_dev_info *bdi, int sync); 286void clear_bdi_congested(struct backing_dev_info *bdi, int sync);
286void set_bdi_congested(struct backing_dev_info *bdi, int sync); 287void set_bdi_congested(struct backing_dev_info *bdi, int sync);
287long congestion_wait(int sync, long timeout); 288long congestion_wait(int sync, long timeout);
288 289long wait_iff_congested(struct zone *zone, int sync, long timeout);
289 290
290static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) 291static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi)
291{ 292{
diff --git a/include/linux/basic_mmio_gpio.h b/include/linux/basic_mmio_gpio.h
new file mode 100644
index 000000000000..198087a16fc4
--- /dev/null
+++ b/include/linux/basic_mmio_gpio.h
@@ -0,0 +1,20 @@
1/*
2 * Basic memory-mapped GPIO controllers.
3 *
4 * Copyright 2008 MontaVista Software, Inc.
5 * Copyright 2008,2010 Anton Vorontsov <cbouatmailru@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef __BASIC_MMIO_GPIO_H
14#define __BASIC_MMIO_GPIO_H
15
16struct bgpio_pdata {
17 int base;
18};
19
20#endif /* __BASIC_MMIO_GPIO_H */
diff --git a/include/linux/bfin_mac.h b/include/linux/bfin_mac.h
new file mode 100644
index 000000000000..904dec7d03a1
--- /dev/null
+++ b/include/linux/bfin_mac.h
@@ -0,0 +1,29 @@
1/*
2 * Blackfin On-Chip MAC Driver
3 *
4 * Copyright 2004-2010 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 */
10
11#ifndef _LINUX_BFIN_MAC_H_
12#define _LINUX_BFIN_MAC_H_
13
14#include <linux/phy.h>
15
16struct bfin_phydev_platform_data {
17 unsigned short addr;
18 int irq;
19};
20
21struct bfin_mii_bus_platform_data {
22 int phydev_number;
23 struct bfin_phydev_platform_data *phydev_data;
24 const unsigned short *mac_peripherals;
25 int phy_mode;
26 unsigned int phy_mask;
27};
28
29#endif
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 5274103434ad..ba679992d39b 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -346,8 +346,15 @@ static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags)
346} 346}
347 347
348#else 348#else
349#define bvec_kmap_irq(bvec, flags) (page_address((bvec)->bv_page) + (bvec)->bv_offset) 349static inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags)
350#define bvec_kunmap_irq(buf, flags) do { *(flags) = 0; } while (0) 350{
351 return page_address(bvec->bv_page) + bvec->bv_offset;
352}
353
354static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags)
355{
356 *flags = 0;
357}
351#endif 358#endif
352 359
353static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx, 360static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,
@@ -496,6 +503,10 @@ static inline struct bio *bio_list_get(struct bio_list *bl)
496#define bip_for_each_vec(bvl, bip, i) \ 503#define bip_for_each_vec(bvl, bip, i) \
497 __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx) 504 __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx)
498 505
506#define bio_for_each_integrity_vec(_bvl, _bio, _iter) \
507 for_each_bio(_bio) \
508 bip_for_each_vec(_bvl, _bio->bi_integrity, _iter)
509
499#define bio_integrity(bio) (bio->bi_integrity != NULL) 510#define bio_integrity(bio) (bio->bi_integrity != NULL)
500 511
501extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *); 512extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *);
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index fc68053378ce..827cc95711ef 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -136,28 +136,6 @@ static inline unsigned long __ffs64(u64 word)
136} 136}
137 137
138#ifdef __KERNEL__ 138#ifdef __KERNEL__
139#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
140
141/**
142 * find_first_bit - find the first set bit in a memory region
143 * @addr: The address to start the search at
144 * @size: The maximum size to search
145 *
146 * Returns the bit number of the first set bit.
147 */
148extern unsigned long find_first_bit(const unsigned long *addr,
149 unsigned long size);
150
151/**
152 * find_first_zero_bit - find the first cleared bit in a memory region
153 * @addr: The address to start the search at
154 * @size: The maximum size to search
155 *
156 * Returns the bit number of the first cleared bit.
157 */
158extern unsigned long find_first_zero_bit(const unsigned long *addr,
159 unsigned long size);
160#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
161 139
162#ifdef CONFIG_GENERIC_FIND_LAST_BIT 140#ifdef CONFIG_GENERIC_FIND_LAST_BIT
163/** 141/**
@@ -171,28 +149,5 @@ extern unsigned long find_last_bit(const unsigned long *addr,
171 unsigned long size); 149 unsigned long size);
172#endif /* CONFIG_GENERIC_FIND_LAST_BIT */ 150#endif /* CONFIG_GENERIC_FIND_LAST_BIT */
173 151
174#ifdef CONFIG_GENERIC_FIND_NEXT_BIT
175
176/**
177 * find_next_bit - find the next set bit in a memory region
178 * @addr: The address to base the search on
179 * @offset: The bitnumber to start searching at
180 * @size: The bitmap size in bits
181 */
182extern unsigned long find_next_bit(const unsigned long *addr,
183 unsigned long size, unsigned long offset);
184
185/**
186 * find_next_zero_bit - find the next cleared bit in a memory region
187 * @addr: The address to base the search on
188 * @offset: The bitnumber to start searching at
189 * @size: The bitmap size in bits
190 */
191
192extern unsigned long find_next_zero_bit(const unsigned long *addr,
193 unsigned long size,
194 unsigned long offset);
195
196#endif /* CONFIG_GENERIC_FIND_NEXT_BIT */
197#endif /* __KERNEL__ */ 152#endif /* __KERNEL__ */
198#endif 153#endif
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index ca83a97c9715..0437ab6bb54c 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -97,6 +97,7 @@ struct bio {
97#define BIO_NULL_MAPPED 9 /* contains invalid user pages */ 97#define BIO_NULL_MAPPED 9 /* contains invalid user pages */
98#define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */ 98#define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */
99#define BIO_QUIET 11 /* Make BIO Quiet */ 99#define BIO_QUIET 11 /* Make BIO Quiet */
100#define BIO_MAPPED_INTEGRITY 12/* integrity metadata has been remapped */
100#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) 101#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag)))
101 102
102/* 103/*
@@ -130,6 +131,8 @@ enum rq_flag_bits {
130 /* bio only flags */ 131 /* bio only flags */
131 __REQ_UNPLUG, /* unplug the immediately after submission */ 132 __REQ_UNPLUG, /* unplug the immediately after submission */
132 __REQ_RAHEAD, /* read ahead, can fail anytime */ 133 __REQ_RAHEAD, /* read ahead, can fail anytime */
134 __REQ_THROTTLED, /* This bio has already been subjected to
135 * throttling rules. Don't do it again. */
133 136
134 /* request only flags */ 137 /* request only flags */
135 __REQ_SORTED, /* elevator knows about this request */ 138 __REQ_SORTED, /* elevator knows about this request */
@@ -143,10 +146,8 @@ enum rq_flag_bits {
143 __REQ_FAILED, /* set if the request failed */ 146 __REQ_FAILED, /* set if the request failed */
144 __REQ_QUIET, /* don't worry about errors */ 147 __REQ_QUIET, /* don't worry about errors */
145 __REQ_PREEMPT, /* set for "ide_preempt" requests */ 148 __REQ_PREEMPT, /* set for "ide_preempt" requests */
146 __REQ_ORDERED_COLOR, /* is before or after barrier */
147 __REQ_ALLOCED, /* request came from our alloc pool */ 149 __REQ_ALLOCED, /* request came from our alloc pool */
148 __REQ_COPY_USER, /* contains copies of user pages */ 150 __REQ_COPY_USER, /* contains copies of user pages */
149 __REQ_INTEGRITY, /* integrity metadata has been remapped */
150 __REQ_FLUSH, /* request for cache flush */ 151 __REQ_FLUSH, /* request for cache flush */
151 __REQ_IO_STAT, /* account I/O stat */ 152 __REQ_IO_STAT, /* account I/O stat */
152 __REQ_MIXED_MERGE, /* merge of different types, fail separately */ 153 __REQ_MIXED_MERGE, /* merge of different types, fail separately */
@@ -168,10 +169,12 @@ enum rq_flag_bits {
168 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) 169 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER)
169#define REQ_COMMON_MASK \ 170#define REQ_COMMON_MASK \
170 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_HARDBARRIER | REQ_SYNC | \ 171 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_HARDBARRIER | REQ_SYNC | \
171 REQ_META| REQ_DISCARD | REQ_NOIDLE) 172 REQ_META | REQ_DISCARD | REQ_NOIDLE | REQ_FLUSH | REQ_FUA)
173#define REQ_CLONE_MASK REQ_COMMON_MASK
172 174
173#define REQ_UNPLUG (1 << __REQ_UNPLUG) 175#define REQ_UNPLUG (1 << __REQ_UNPLUG)
174#define REQ_RAHEAD (1 << __REQ_RAHEAD) 176#define REQ_RAHEAD (1 << __REQ_RAHEAD)
177#define REQ_THROTTLED (1 << __REQ_THROTTLED)
175 178
176#define REQ_SORTED (1 << __REQ_SORTED) 179#define REQ_SORTED (1 << __REQ_SORTED)
177#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) 180#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
@@ -184,10 +187,8 @@ enum rq_flag_bits {
184#define REQ_FAILED (1 << __REQ_FAILED) 187#define REQ_FAILED (1 << __REQ_FAILED)
185#define REQ_QUIET (1 << __REQ_QUIET) 188#define REQ_QUIET (1 << __REQ_QUIET)
186#define REQ_PREEMPT (1 << __REQ_PREEMPT) 189#define REQ_PREEMPT (1 << __REQ_PREEMPT)
187#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
188#define REQ_ALLOCED (1 << __REQ_ALLOCED) 190#define REQ_ALLOCED (1 << __REQ_ALLOCED)
189#define REQ_COPY_USER (1 << __REQ_COPY_USER) 191#define REQ_COPY_USER (1 << __REQ_COPY_USER)
190#define REQ_INTEGRITY (1 << __REQ_INTEGRITY)
191#define REQ_FLUSH (1 << __REQ_FLUSH) 192#define REQ_FLUSH (1 << __REQ_FLUSH)
192#define REQ_IO_STAT (1 << __REQ_IO_STAT) 193#define REQ_IO_STAT (1 << __REQ_IO_STAT)
193#define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) 194#define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2c54906f678f..646b462d04df 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -124,6 +124,9 @@ struct request {
124 * physical address coalescing is performed. 124 * physical address coalescing is performed.
125 */ 125 */
126 unsigned short nr_phys_segments; 126 unsigned short nr_phys_segments;
127#if defined(CONFIG_BLK_DEV_INTEGRITY)
128 unsigned short nr_integrity_segments;
129#endif
127 130
128 unsigned short ioprio; 131 unsigned short ioprio;
129 132
@@ -243,6 +246,7 @@ struct queue_limits {
243 246
244 unsigned short logical_block_size; 247 unsigned short logical_block_size;
245 unsigned short max_segments; 248 unsigned short max_segments;
249 unsigned short max_integrity_segments;
246 250
247 unsigned char misaligned; 251 unsigned char misaligned;
248 unsigned char discard_misaligned; 252 unsigned char discard_misaligned;
@@ -355,18 +359,25 @@ struct request_queue
355 struct blk_trace *blk_trace; 359 struct blk_trace *blk_trace;
356#endif 360#endif
357 /* 361 /*
358 * reserved for flush operations 362 * for flush operations
359 */ 363 */
360 unsigned int ordered, next_ordered, ordseq; 364 unsigned int flush_flags;
361 int orderr, ordcolor; 365 unsigned int flush_seq;
362 struct request pre_flush_rq, bar_rq, post_flush_rq; 366 int flush_err;
363 struct request *orig_bar_rq; 367 struct request flush_rq;
368 struct request *orig_flush_rq;
369 struct list_head pending_flushes;
364 370
365 struct mutex sysfs_lock; 371 struct mutex sysfs_lock;
366 372
367#if defined(CONFIG_BLK_DEV_BSG) 373#if defined(CONFIG_BLK_DEV_BSG)
368 struct bsg_class_device bsg_dev; 374 struct bsg_class_device bsg_dev;
369#endif 375#endif
376
377#ifdef CONFIG_BLK_DEV_THROTTLING
378 /* Throttle data */
379 struct throtl_data *td;
380#endif
370}; 381};
371 382
372#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 383#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
@@ -462,56 +473,6 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
462 __clear_bit(flag, &q->queue_flags); 473 __clear_bit(flag, &q->queue_flags);
463} 474}
464 475
465enum {
466 /*
467 * Hardbarrier is supported with one of the following methods.
468 *
469 * NONE : hardbarrier unsupported
470 * DRAIN : ordering by draining is enough
471 * DRAIN_FLUSH : ordering by draining w/ pre and post flushes
472 * DRAIN_FUA : ordering by draining w/ pre flush and FUA write
473 * TAG : ordering by tag is enough
474 * TAG_FLUSH : ordering by tag w/ pre and post flushes
475 * TAG_FUA : ordering by tag w/ pre flush and FUA write
476 */
477 QUEUE_ORDERED_BY_DRAIN = 0x01,
478 QUEUE_ORDERED_BY_TAG = 0x02,
479 QUEUE_ORDERED_DO_PREFLUSH = 0x10,
480 QUEUE_ORDERED_DO_BAR = 0x20,
481 QUEUE_ORDERED_DO_POSTFLUSH = 0x40,
482 QUEUE_ORDERED_DO_FUA = 0x80,
483
484 QUEUE_ORDERED_NONE = 0x00,
485
486 QUEUE_ORDERED_DRAIN = QUEUE_ORDERED_BY_DRAIN |
487 QUEUE_ORDERED_DO_BAR,
488 QUEUE_ORDERED_DRAIN_FLUSH = QUEUE_ORDERED_DRAIN |
489 QUEUE_ORDERED_DO_PREFLUSH |
490 QUEUE_ORDERED_DO_POSTFLUSH,
491 QUEUE_ORDERED_DRAIN_FUA = QUEUE_ORDERED_DRAIN |
492 QUEUE_ORDERED_DO_PREFLUSH |
493 QUEUE_ORDERED_DO_FUA,
494
495 QUEUE_ORDERED_TAG = QUEUE_ORDERED_BY_TAG |
496 QUEUE_ORDERED_DO_BAR,
497 QUEUE_ORDERED_TAG_FLUSH = QUEUE_ORDERED_TAG |
498 QUEUE_ORDERED_DO_PREFLUSH |
499 QUEUE_ORDERED_DO_POSTFLUSH,
500 QUEUE_ORDERED_TAG_FUA = QUEUE_ORDERED_TAG |
501 QUEUE_ORDERED_DO_PREFLUSH |
502 QUEUE_ORDERED_DO_FUA,
503
504 /*
505 * Ordered operation sequence
506 */
507 QUEUE_ORDSEQ_STARTED = 0x01, /* flushing in progress */
508 QUEUE_ORDSEQ_DRAIN = 0x02, /* waiting for the queue to be drained */
509 QUEUE_ORDSEQ_PREFLUSH = 0x04, /* pre-flushing in progress */
510 QUEUE_ORDSEQ_BAR = 0x08, /* original barrier req in progress */
511 QUEUE_ORDSEQ_POSTFLUSH = 0x10, /* post-flushing in progress */
512 QUEUE_ORDSEQ_DONE = 0x20,
513};
514
515#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) 476#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
516#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) 477#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
517#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) 478#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
@@ -521,7 +482,6 @@ enum {
521#define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) 482#define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags)
522#define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags) 483#define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
523#define blk_queue_add_random(q) test_bit(QUEUE_FLAG_ADD_RANDOM, &(q)->queue_flags) 484#define blk_queue_add_random(q) test_bit(QUEUE_FLAG_ADD_RANDOM, &(q)->queue_flags)
524#define blk_queue_flushing(q) ((q)->ordseq)
525#define blk_queue_stackable(q) \ 485#define blk_queue_stackable(q) \
526 test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags) 486 test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags)
527#define blk_queue_discard(q) test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags) 487#define blk_queue_discard(q) test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags)
@@ -592,7 +552,8 @@ static inline void blk_clear_queue_full(struct request_queue *q, int sync)
592 * it already be started by driver. 552 * it already be started by driver.
593 */ 553 */
594#define RQ_NOMERGE_FLAGS \ 554#define RQ_NOMERGE_FLAGS \
595 (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) 555 (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER | \
556 REQ_FLUSH | REQ_FUA)
596#define rq_mergeable(rq) \ 557#define rq_mergeable(rq) \
597 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ 558 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \
598 (((rq)->cmd_flags & REQ_DISCARD) || \ 559 (((rq)->cmd_flags & REQ_DISCARD) || \
@@ -851,7 +812,7 @@ extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
851extern void blk_queue_max_discard_sectors(struct request_queue *q, 812extern void blk_queue_max_discard_sectors(struct request_queue *q,
852 unsigned int max_discard_sectors); 813 unsigned int max_discard_sectors);
853extern void blk_queue_logical_block_size(struct request_queue *, unsigned short); 814extern void blk_queue_logical_block_size(struct request_queue *, unsigned short);
854extern void blk_queue_physical_block_size(struct request_queue *, unsigned short); 815extern void blk_queue_physical_block_size(struct request_queue *, unsigned int);
855extern void blk_queue_alignment_offset(struct request_queue *q, 816extern void blk_queue_alignment_offset(struct request_queue *q,
856 unsigned int alignment); 817 unsigned int alignment);
857extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min); 818extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min);
@@ -881,12 +842,8 @@ extern void blk_queue_update_dma_alignment(struct request_queue *, int);
881extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); 842extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *);
882extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); 843extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *);
883extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); 844extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);
845extern void blk_queue_flush(struct request_queue *q, unsigned int flush);
884extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); 846extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
885extern int blk_queue_ordered(struct request_queue *, unsigned);
886extern bool blk_do_ordered(struct request_queue *, struct request **);
887extern unsigned blk_ordered_cur_seq(struct request_queue *);
888extern unsigned blk_ordered_req_seq(struct request *);
889extern bool blk_ordered_complete_seq(struct request_queue *, unsigned, int);
890 847
891extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); 848extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
892extern void blk_dump_rq_flags(struct request *, char *); 849extern void blk_dump_rq_flags(struct request *, char *);
@@ -919,27 +876,20 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
919 return NULL; 876 return NULL;
920 return bqt->tag_index[tag]; 877 return bqt->tag_index[tag];
921} 878}
922enum{ 879
923 BLKDEV_WAIT, /* wait for completion */ 880#define BLKDEV_DISCARD_SECURE 0x01 /* secure discard */
924 BLKDEV_BARRIER, /* issue request with barrier */ 881
925 BLKDEV_SECURE, /* secure discard */ 882extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *);
926};
927#define BLKDEV_IFL_WAIT (1 << BLKDEV_WAIT)
928#define BLKDEV_IFL_BARRIER (1 << BLKDEV_BARRIER)
929#define BLKDEV_IFL_SECURE (1 << BLKDEV_SECURE)
930extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *,
931 unsigned long);
932extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector, 883extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
933 sector_t nr_sects, gfp_t gfp_mask, unsigned long flags); 884 sector_t nr_sects, gfp_t gfp_mask, unsigned long flags);
934extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, 885extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
935 sector_t nr_sects, gfp_t gfp_mask, unsigned long flags); 886 sector_t nr_sects, gfp_t gfp_mask);
936static inline int sb_issue_discard(struct super_block *sb, 887static inline int sb_issue_discard(struct super_block *sb, sector_t block,
937 sector_t block, sector_t nr_blocks) 888 sector_t nr_blocks, gfp_t gfp_mask, unsigned long flags)
938{ 889{
939 block <<= (sb->s_blocksize_bits - 9); 890 return blkdev_issue_discard(sb->s_bdev, block << (sb->s_blocksize_bits - 9),
940 nr_blocks <<= (sb->s_blocksize_bits - 9); 891 nr_blocks << (sb->s_blocksize_bits - 9),
941 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_NOFS, 892 gfp_mask, flags);
942 BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
943} 893}
944 894
945extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); 895extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
@@ -1004,7 +954,7 @@ static inline unsigned int queue_physical_block_size(struct request_queue *q)
1004 return q->limits.physical_block_size; 954 return q->limits.physical_block_size;
1005} 955}
1006 956
1007static inline int bdev_physical_block_size(struct block_device *bdev) 957static inline unsigned int bdev_physical_block_size(struct block_device *bdev)
1008{ 958{
1009 return queue_physical_block_size(bdev_get_queue(bdev)); 959 return queue_physical_block_size(bdev_get_queue(bdev));
1010} 960}
@@ -1093,11 +1043,11 @@ static inline int queue_dma_alignment(struct request_queue *q)
1093 return q ? q->dma_alignment : 511; 1043 return q ? q->dma_alignment : 511;
1094} 1044}
1095 1045
1096static inline int blk_rq_aligned(struct request_queue *q, void *addr, 1046static inline int blk_rq_aligned(struct request_queue *q, unsigned long addr,
1097 unsigned int len) 1047 unsigned int len)
1098{ 1048{
1099 unsigned int alignment = queue_dma_alignment(q) | q->dma_pad_mask; 1049 unsigned int alignment = queue_dma_alignment(q) | q->dma_pad_mask;
1100 return !((unsigned long)addr & alignment) && !(len & alignment); 1050 return !(addr & alignment) && !(len & alignment);
1101} 1051}
1102 1052
1103/* assumes size > 256 */ 1053/* assumes size > 256 */
@@ -1127,6 +1077,7 @@ static inline void put_dev_sector(Sector p)
1127 1077
1128struct work_struct; 1078struct work_struct;
1129int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); 1079int kblockd_schedule_work(struct request_queue *q, struct work_struct *work);
1080int kblockd_schedule_delayed_work(struct request_queue *q, struct delayed_work *dwork, unsigned long delay);
1130 1081
1131#ifdef CONFIG_BLK_CGROUP 1082#ifdef CONFIG_BLK_CGROUP
1132/* 1083/*
@@ -1170,6 +1121,24 @@ static inline uint64_t rq_io_start_time_ns(struct request *req)
1170} 1121}
1171#endif 1122#endif
1172 1123
1124#ifdef CONFIG_BLK_DEV_THROTTLING
1125extern int blk_throtl_init(struct request_queue *q);
1126extern void blk_throtl_exit(struct request_queue *q);
1127extern int blk_throtl_bio(struct request_queue *q, struct bio **bio);
1128extern void throtl_schedule_delayed_work(struct request_queue *q, unsigned long delay);
1129extern void throtl_shutdown_timer_wq(struct request_queue *q);
1130#else /* CONFIG_BLK_DEV_THROTTLING */
1131static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio)
1132{
1133 return 0;
1134}
1135
1136static inline int blk_throtl_init(struct request_queue *q) { return 0; }
1137static inline int blk_throtl_exit(struct request_queue *q) { return 0; }
1138static inline void throtl_schedule_delayed_work(struct request_queue *q, unsigned long delay) {}
1139static inline void throtl_shutdown_timer_wq(struct request_queue *q) {}
1140#endif /* CONFIG_BLK_DEV_THROTTLING */
1141
1173#define MODULE_ALIAS_BLOCKDEV(major,minor) \ 1142#define MODULE_ALIAS_BLOCKDEV(major,minor) \
1174 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) 1143 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
1175#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ 1144#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \
@@ -1213,8 +1182,13 @@ struct blk_integrity {
1213extern int blk_integrity_register(struct gendisk *, struct blk_integrity *); 1182extern int blk_integrity_register(struct gendisk *, struct blk_integrity *);
1214extern void blk_integrity_unregister(struct gendisk *); 1183extern void blk_integrity_unregister(struct gendisk *);
1215extern int blk_integrity_compare(struct gendisk *, struct gendisk *); 1184extern int blk_integrity_compare(struct gendisk *, struct gendisk *);
1216extern int blk_rq_map_integrity_sg(struct request *, struct scatterlist *); 1185extern int blk_rq_map_integrity_sg(struct request_queue *, struct bio *,
1217extern int blk_rq_count_integrity_sg(struct request *); 1186 struct scatterlist *);
1187extern int blk_rq_count_integrity_sg(struct request_queue *, struct bio *);
1188extern int blk_integrity_merge_rq(struct request_queue *, struct request *,
1189 struct request *);
1190extern int blk_integrity_merge_bio(struct request_queue *, struct request *,
1191 struct bio *);
1218 1192
1219static inline 1193static inline
1220struct blk_integrity *bdev_get_integrity(struct block_device *bdev) 1194struct blk_integrity *bdev_get_integrity(struct block_device *bdev)
@@ -1235,16 +1209,32 @@ static inline int blk_integrity_rq(struct request *rq)
1235 return bio_integrity(rq->bio); 1209 return bio_integrity(rq->bio);
1236} 1210}
1237 1211
1212static inline void blk_queue_max_integrity_segments(struct request_queue *q,
1213 unsigned int segs)
1214{
1215 q->limits.max_integrity_segments = segs;
1216}
1217
1218static inline unsigned short
1219queue_max_integrity_segments(struct request_queue *q)
1220{
1221 return q->limits.max_integrity_segments;
1222}
1223
1238#else /* CONFIG_BLK_DEV_INTEGRITY */ 1224#else /* CONFIG_BLK_DEV_INTEGRITY */
1239 1225
1240#define blk_integrity_rq(rq) (0) 1226#define blk_integrity_rq(rq) (0)
1241#define blk_rq_count_integrity_sg(a) (0) 1227#define blk_rq_count_integrity_sg(a, b) (0)
1242#define blk_rq_map_integrity_sg(a, b) (0) 1228#define blk_rq_map_integrity_sg(a, b, c) (0)
1243#define bdev_get_integrity(a) (0) 1229#define bdev_get_integrity(a) (0)
1244#define blk_get_integrity(a) (0) 1230#define blk_get_integrity(a) (0)
1245#define blk_integrity_compare(a, b) (0) 1231#define blk_integrity_compare(a, b) (0)
1246#define blk_integrity_register(a, b) (0) 1232#define blk_integrity_register(a, b) (0)
1247#define blk_integrity_unregister(a) do { } while (0); 1233#define blk_integrity_unregister(a) do { } while (0);
1234#define blk_queue_max_integrity_segments(a, b) do { } while (0);
1235#define queue_max_integrity_segments(a) (0)
1236#define blk_integrity_merge_rq(a, b, c) (0)
1237#define blk_integrity_merge_bio(a, b, c) (0)
1248 1238
1249#endif /* CONFIG_BLK_DEV_INTEGRITY */ 1239#endif /* CONFIG_BLK_DEV_INTEGRITY */
1250 1240
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index ec94c12f21da..68d1fe7b877c 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -32,7 +32,6 @@ enum bh_state_bits {
32 BH_Delay, /* Buffer is not yet allocated on disk */ 32 BH_Delay, /* Buffer is not yet allocated on disk */
33 BH_Boundary, /* Block is followed by a discontiguity */ 33 BH_Boundary, /* Block is followed by a discontiguity */
34 BH_Write_EIO, /* I/O error on write */ 34 BH_Write_EIO, /* I/O error on write */
35 BH_Eopnotsupp, /* operation not supported (barrier) */
36 BH_Unwritten, /* Buffer is allocated on disk but not written */ 35 BH_Unwritten, /* Buffer is allocated on disk but not written */
37 BH_Quiet, /* Buffer Error Prinks to be quiet */ 36 BH_Quiet, /* Buffer Error Prinks to be quiet */
38 37
@@ -124,7 +123,6 @@ BUFFER_FNS(Async_Write, async_write)
124BUFFER_FNS(Delay, delay) 123BUFFER_FNS(Delay, delay)
125BUFFER_FNS(Boundary, boundary) 124BUFFER_FNS(Boundary, boundary)
126BUFFER_FNS(Write_EIO, write_io_error) 125BUFFER_FNS(Write_EIO, write_io_error)
127BUFFER_FNS(Eopnotsupp, eopnotsupp)
128BUFFER_FNS(Unwritten, unwritten) 126BUFFER_FNS(Unwritten, unwritten)
129 127
130#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) 128#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK)
@@ -214,7 +212,6 @@ int generic_write_end(struct file *, struct address_space *,
214 loff_t, unsigned, unsigned, 212 loff_t, unsigned, unsigned,
215 struct page *, void *); 213 struct page *, void *);
216void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); 214void page_zero_new_buffers(struct page *page, unsigned from, unsigned to);
217int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*);
218int cont_write_begin(struct file *, struct address_space *, loff_t, 215int cont_write_begin(struct file *, struct address_space *, loff_t,
219 unsigned, unsigned, struct page **, void **, 216 unsigned, unsigned, struct page **, void **,
220 get_block_t *, loff_t *); 217 get_block_t *, loff_t *);
diff --git a/include/linux/can/platform/mcp251x.h b/include/linux/can/platform/mcp251x.h
index dba28268e651..8e20540043f5 100644
--- a/include/linux/can/platform/mcp251x.h
+++ b/include/linux/can/platform/mcp251x.h
@@ -12,7 +12,6 @@
12/** 12/**
13 * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data 13 * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data
14 * @oscillator_frequency: - oscillator frequency in Hz 14 * @oscillator_frequency: - oscillator frequency in Hz
15 * @model: - actual type of chip
16 * @board_specific_setup: - called before probing the chip (power,reset) 15 * @board_specific_setup: - called before probing the chip (power,reset)
17 * @transceiver_enable: - called to power on/off the transceiver 16 * @transceiver_enable: - called to power on/off the transceiver
18 * @power_enable: - called to power on/off the mcp *and* the 17 * @power_enable: - called to power on/off the mcp *and* the
@@ -25,9 +24,6 @@
25 24
26struct mcp251x_platform_data { 25struct mcp251x_platform_data {
27 unsigned long oscillator_frequency; 26 unsigned long oscillator_frequency;
28 int model;
29#define CAN_MCP251X_MCP2510 0x2510
30#define CAN_MCP251X_MCP2515 0x2515
31 int (*board_specific_setup)(struct spi_device *spi); 27 int (*board_specific_setup)(struct spi_device *spi);
32 int (*transceiver_enable)(int enable); 28 int (*transceiver_enable)(int enable);
33 int (*power_enable) (int enable); 29 int (*power_enable) (int enable);
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 709dfb901d11..ed4ba111bc8d 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -154,6 +154,10 @@ enum {
154 * A thread in rmdir() is wating for this cgroup. 154 * A thread in rmdir() is wating for this cgroup.
155 */ 155 */
156 CGRP_WAIT_ON_RMDIR, 156 CGRP_WAIT_ON_RMDIR,
157 /*
158 * Clone cgroup values when creating a new child cgroup
159 */
160 CGRP_CLONE_CHILDREN,
157}; 161};
158 162
159/* which pidlist file are we talking about? */ 163/* which pidlist file are we talking about? */
diff --git a/include/linux/coda_fs_i.h b/include/linux/coda_fs_i.h
index b3ef0c461578..e35071b1de0e 100644
--- a/include/linux/coda_fs_i.h
+++ b/include/linux/coda_fs_i.h
@@ -10,19 +10,24 @@
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/list.h> 12#include <linux/list.h>
13#include <linux/spinlock.h>
13#include <linux/coda.h> 14#include <linux/coda.h>
14 15
15/* 16/*
16 * coda fs inode data 17 * coda fs inode data
18 * c_lock protects accesses to c_flags, c_mapcount, c_cached_epoch, c_uid and
19 * c_cached_perm.
20 * vfs_inode is set only when the inode is created and never changes.
21 * c_fid is set when the inode is created and should be considered immutable.
17 */ 22 */
18struct coda_inode_info { 23struct coda_inode_info {
19 struct CodaFid c_fid; /* Coda identifier */ 24 struct CodaFid c_fid; /* Coda identifier */
20 u_short c_flags; /* flags (see below) */ 25 u_short c_flags; /* flags (see below) */
21 struct list_head c_cilist; /* list of all coda inodes */
22 unsigned int c_mapcount; /* nr of times this inode is mapped */ 26 unsigned int c_mapcount; /* nr of times this inode is mapped */
23 unsigned int c_cached_epoch; /* epoch for cached permissions */ 27 unsigned int c_cached_epoch; /* epoch for cached permissions */
24 vuid_t c_uid; /* fsuid for cached permissions */ 28 vuid_t c_uid; /* fsuid for cached permissions */
25 unsigned int c_cached_perm; /* cached access permissions */ 29 unsigned int c_cached_perm; /* cached access permissions */
30 spinlock_t c_lock;
26 struct inode vfs_inode; 31 struct inode vfs_inode;
27}; 32};
28 33
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index dcc228aa335a..2e914d0771b9 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -89,7 +89,11 @@ static __inline__ char *coda_i2s(struct inode *inode)
89/* this will not zap the inode away */ 89/* this will not zap the inode away */
90static __inline__ void coda_flag_inode(struct inode *inode, int flag) 90static __inline__ void coda_flag_inode(struct inode *inode, int flag)
91{ 91{
92 ITOC(inode)->c_flags |= flag; 92 struct coda_inode_info *cii = ITOC(inode);
93
94 spin_lock(&cii->c_lock);
95 cii->c_flags |= flag;
96 spin_unlock(&cii->c_lock);
93} 97}
94 98
95#endif 99#endif
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index 284b520934a0..72f2d2f0af91 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -8,6 +8,7 @@
8 8
9#ifdef __KERNEL__ 9#ifdef __KERNEL__
10#include <linux/backing-dev.h> 10#include <linux/backing-dev.h>
11#include <linux/mutex.h>
11 12
12struct kstatfs; 13struct kstatfs;
13 14
@@ -20,6 +21,7 @@ struct venus_comm {
20 int vc_inuse; 21 int vc_inuse;
21 struct super_block *vc_sb; 22 struct super_block *vc_sb;
22 struct backing_dev_info bdi; 23 struct backing_dev_info bdi;
24 struct mutex vc_mutex;
23}; 25};
24 26
25 27
@@ -63,7 +65,7 @@ int venus_symlink(struct super_block *sb, struct CodaFid *fid,
63int venus_access(struct super_block *sb, struct CodaFid *fid, int mask); 65int venus_access(struct super_block *sb, struct CodaFid *fid, int mask);
64int venus_pioctl(struct super_block *sb, struct CodaFid *fid, 66int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
65 unsigned int cmd, struct PioctlData *data); 67 unsigned int cmd, struct PioctlData *data);
66int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); 68int coda_downcall(struct venus_comm *vcp, int opcode, union outputArgs *out);
67int venus_fsync(struct super_block *sb, struct CodaFid *fid); 69int venus_fsync(struct super_block *sb, struct CodaFid *fid);
68int venus_statfs(struct dentry *dentry, struct kstatfs *sfs); 70int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
69 71
diff --git a/include/linux/completion.h b/include/linux/completion.h
index 51e3145196f6..36d57f74cd01 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -10,7 +10,7 @@
10 10
11#include <linux/wait.h> 11#include <linux/wait.h>
12 12
13/** 13/*
14 * struct completion - structure used to maintain state for a "completion" 14 * struct completion - structure used to maintain state for a "completion"
15 * 15 *
16 * This is the opaque structure used to maintain the state for a "completion". 16 * This is the opaque structure used to maintain the state for a "completion".
@@ -34,7 +34,7 @@ struct completion {
34 ({ init_completion(&work); work; }) 34 ({ init_completion(&work); work; })
35 35
36/** 36/**
37 * DECLARE_COMPLETION: - declare and initialize a completion structure 37 * DECLARE_COMPLETION - declare and initialize a completion structure
38 * @work: identifier for the completion structure 38 * @work: identifier for the completion structure
39 * 39 *
40 * This macro declares and initializes a completion structure. Generally used 40 * This macro declares and initializes a completion structure. Generally used
@@ -50,7 +50,7 @@ struct completion {
50 * are on the kernel stack: 50 * are on the kernel stack:
51 */ 51 */
52/** 52/**
53 * DECLARE_COMPLETION_ONSTACK: - declare and initialize a completion structure 53 * DECLARE_COMPLETION_ONSTACK - declare and initialize a completion structure
54 * @work: identifier for the completion structure 54 * @work: identifier for the completion structure
55 * 55 *
56 * This macro declares and initializes a completion structure on the kernel 56 * This macro declares and initializes a completion structure on the kernel
@@ -64,7 +64,7 @@ struct completion {
64#endif 64#endif
65 65
66/** 66/**
67 * init_completion: - Initialize a dynamically allocated completion 67 * init_completion - Initialize a dynamically allocated completion
68 * @x: completion structure that is to be initialized 68 * @x: completion structure that is to be initialized
69 * 69 *
70 * This inline function will initialize a dynamically created completion 70 * This inline function will initialize a dynamically created completion
@@ -92,7 +92,7 @@ extern void complete(struct completion *);
92extern void complete_all(struct completion *); 92extern void complete_all(struct completion *);
93 93
94/** 94/**
95 * INIT_COMPLETION: - reinitialize a completion structure 95 * INIT_COMPLETION - reinitialize a completion structure
96 * @x: completion structure to be reinitialized 96 * @x: completion structure to be reinitialized
97 * 97 *
98 * This macro should be used to reinitialize a completion structure so it can 98 * This macro should be used to reinitialize a completion structure so it can
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 3a779ffba60b..7e8ca75d2dad 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -88,12 +88,6 @@ struct cn_queue_dev {
88 unsigned char name[CN_CBQ_NAMELEN]; 88 unsigned char name[CN_CBQ_NAMELEN];
89 89
90 struct workqueue_struct *cn_queue; 90 struct workqueue_struct *cn_queue;
91 /* Sent to kevent to create cn_queue only when needed */
92 struct work_struct wq_creation;
93 /* Tell if the wq_creation job is pending/completed */
94 atomic_t wq_requested;
95 /* Wait for cn_queue to be created */
96 wait_queue_head_t wq_created;
97 91
98 struct list_head queue_list; 92 struct list_head queue_list;
99 spinlock_t queue_lock; 93 spinlock_t queue_lock;
@@ -141,8 +135,6 @@ int cn_netlink_send(struct cn_msg *, u32, gfp_t);
141int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *, struct netlink_skb_parms *)); 135int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *, struct netlink_skb_parms *));
142void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); 136void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id);
143 137
144int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work);
145
146struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); 138struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *);
147void cn_queue_free_dev(struct cn_queue_dev *dev); 139void cn_queue_free_dev(struct cn_queue_dev *dev);
148 140
diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h
index 7c930dba477c..5dd428532f79 100644
--- a/include/linux/davinci_emac.h
+++ b/include/linux/davinci_emac.h
@@ -14,16 +14,26 @@
14#include <linux/if_ether.h> 14#include <linux/if_ether.h>
15#include <linux/memory.h> 15#include <linux/memory.h>
16 16
17struct mdio_platform_data {
18 unsigned long bus_freq;
19};
20
17struct emac_platform_data { 21struct emac_platform_data {
18 char mac_addr[ETH_ALEN]; 22 char mac_addr[ETH_ALEN];
19 u32 ctrl_reg_offset; 23 u32 ctrl_reg_offset;
20 u32 ctrl_mod_reg_offset; 24 u32 ctrl_mod_reg_offset;
21 u32 ctrl_ram_offset; 25 u32 ctrl_ram_offset;
22 u32 hw_ram_addr; 26 u32 hw_ram_addr;
23 u32 mdio_reg_offset;
24 u32 ctrl_ram_size; 27 u32 ctrl_ram_size;
25 u32 phy_mask; 28
26 u32 mdio_max_freq; 29 /*
30 * phy_id can be one of the following:
31 * - NULL : use the first phy on the bus,
32 * - "" : force to 100/full, no mdio control
33 * - "<bus>:<addr>" : use the specified bus and phy
34 */
35 const char *phy_id;
36
27 u8 rmii_en; 37 u8 rmii_en;
28 u8 version; 38 u8 version;
29 void (*interrupt_enable) (void); 39 void (*interrupt_enable) (void);
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 7434a8353e23..7187bd8a75f6 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -165,8 +165,10 @@ enum {
165 DCCPO_TIMESTAMP_ECHO = 42, 165 DCCPO_TIMESTAMP_ECHO = 42,
166 DCCPO_ELAPSED_TIME = 43, 166 DCCPO_ELAPSED_TIME = 43,
167 DCCPO_MAX = 45, 167 DCCPO_MAX = 45,
168 DCCPO_MIN_CCID_SPECIFIC = 128, 168 DCCPO_MIN_RX_CCID_SPECIFIC = 128, /* from sender to receiver */
169 DCCPO_MAX_CCID_SPECIFIC = 255, 169 DCCPO_MAX_RX_CCID_SPECIFIC = 191,
170 DCCPO_MIN_TX_CCID_SPECIFIC = 192, /* from receiver to sender */
171 DCCPO_MAX_TX_CCID_SPECIFIC = 255,
170}; 172};
171/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */ 173/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */
172#define DCCP_SINGLE_OPT_MAXLEN 253 174#define DCCP_SINGLE_OPT_MAXLEN 253
diff --git a/include/linux/device.h b/include/linux/device.h
index 516fecacf27b..dd4895313468 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -751,4 +751,11 @@ do { \
751 MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) 751 MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
752#define MODULE_ALIAS_CHARDEV_MAJOR(major) \ 752#define MODULE_ALIAS_CHARDEV_MAJOR(major) \
753 MODULE_ALIAS("char-major-" __stringify(major) "-*") 753 MODULE_ALIAS("char-major-" __stringify(major) "-*")
754
755#ifdef CONFIG_SYSFS_DEPRECATED
756extern long sysfs_deprecated;
757#else
758#define sysfs_deprecated 0
759#endif
760
754#endif /* _DEVICE_H_ */ 761#endif /* _DEVICE_H_ */
diff --git a/include/linux/dlm.h b/include/linux/dlm.h
index 0b3518c42356..d4e02f5353a0 100644
--- a/include/linux/dlm.h
+++ b/include/linux/dlm.h
@@ -48,10 +48,10 @@ typedef void dlm_lockspace_t;
48 * 48 *
49 * 0 if lock request was successful 49 * 0 if lock request was successful
50 * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE 50 * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE
51 * -ENOMEM if there is no memory to process request
52 * -EINVAL if there are invalid parameters
53 * -DLM_EUNLOCK if unlock request was successful 51 * -DLM_EUNLOCK if unlock request was successful
54 * -DLM_ECANCEL if a cancel completed successfully 52 * -DLM_ECANCEL if a cancel completed successfully
53 * -EDEADLK if a deadlock was detected
54 * -ETIMEDOUT if the lock request was canceled due to a timeout
55 */ 55 */
56 56
57#define DLM_SBF_DEMOTED 0x01 57#define DLM_SBF_DEMOTED 0x01
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index e2106495cc11..9d8688b92d8b 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -64,13 +64,15 @@ enum dma_transaction_type {
64 DMA_PQ_VAL, 64 DMA_PQ_VAL,
65 DMA_MEMSET, 65 DMA_MEMSET,
66 DMA_INTERRUPT, 66 DMA_INTERRUPT,
67 DMA_SG,
67 DMA_PRIVATE, 68 DMA_PRIVATE,
68 DMA_ASYNC_TX, 69 DMA_ASYNC_TX,
69 DMA_SLAVE, 70 DMA_SLAVE,
71 DMA_CYCLIC,
70}; 72};
71 73
72/* last transaction type for creation of the capabilities mask */ 74/* last transaction type for creation of the capabilities mask */
73#define DMA_TX_TYPE_END (DMA_SLAVE + 1) 75#define DMA_TX_TYPE_END (DMA_CYCLIC + 1)
74 76
75 77
76/** 78/**
@@ -119,12 +121,15 @@ enum dma_ctrl_flags {
119 * configuration data in statically from the platform). An additional 121 * configuration data in statically from the platform). An additional
120 * argument of struct dma_slave_config must be passed in with this 122 * argument of struct dma_slave_config must be passed in with this
121 * command. 123 * command.
124 * @FSLDMA_EXTERNAL_START: this command will put the Freescale DMA controller
125 * into external start mode.
122 */ 126 */
123enum dma_ctrl_cmd { 127enum dma_ctrl_cmd {
124 DMA_TERMINATE_ALL, 128 DMA_TERMINATE_ALL,
125 DMA_PAUSE, 129 DMA_PAUSE,
126 DMA_RESUME, 130 DMA_RESUME,
127 DMA_SLAVE_CONFIG, 131 DMA_SLAVE_CONFIG,
132 FSLDMA_EXTERNAL_START,
128}; 133};
129 134
130/** 135/**
@@ -316,14 +321,14 @@ struct dma_async_tx_descriptor {
316 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); 321 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
317 dma_async_tx_callback callback; 322 dma_async_tx_callback callback;
318 void *callback_param; 323 void *callback_param;
319#ifndef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH 324#ifdef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH
320 struct dma_async_tx_descriptor *next; 325 struct dma_async_tx_descriptor *next;
321 struct dma_async_tx_descriptor *parent; 326 struct dma_async_tx_descriptor *parent;
322 spinlock_t lock; 327 spinlock_t lock;
323#endif 328#endif
324}; 329};
325 330
326#ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH 331#ifndef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH
327static inline void txd_lock(struct dma_async_tx_descriptor *txd) 332static inline void txd_lock(struct dma_async_tx_descriptor *txd)
328{ 333{
329} 334}
@@ -422,6 +427,9 @@ struct dma_tx_state {
422 * @device_prep_dma_memset: prepares a memset operation 427 * @device_prep_dma_memset: prepares a memset operation
423 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation 428 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation
424 * @device_prep_slave_sg: prepares a slave dma operation 429 * @device_prep_slave_sg: prepares a slave dma operation
430 * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio.
431 * The function takes a buffer of size buf_len. The callback function will
432 * be called after period_len bytes have been transferred.
425 * @device_control: manipulate all pending operations on a channel, returns 433 * @device_control: manipulate all pending operations on a channel, returns
426 * zero or error code 434 * zero or error code
427 * @device_tx_status: poll for transaction completion, the optional 435 * @device_tx_status: poll for transaction completion, the optional
@@ -473,11 +481,19 @@ struct dma_device {
473 unsigned long flags); 481 unsigned long flags);
474 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( 482 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
475 struct dma_chan *chan, unsigned long flags); 483 struct dma_chan *chan, unsigned long flags);
484 struct dma_async_tx_descriptor *(*device_prep_dma_sg)(
485 struct dma_chan *chan,
486 struct scatterlist *dst_sg, unsigned int dst_nents,
487 struct scatterlist *src_sg, unsigned int src_nents,
488 unsigned long flags);
476 489
477 struct dma_async_tx_descriptor *(*device_prep_slave_sg)( 490 struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
478 struct dma_chan *chan, struct scatterlist *sgl, 491 struct dma_chan *chan, struct scatterlist *sgl,
479 unsigned int sg_len, enum dma_data_direction direction, 492 unsigned int sg_len, enum dma_data_direction direction,
480 unsigned long flags); 493 unsigned long flags);
494 struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)(
495 struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
496 size_t period_len, enum dma_data_direction direction);
481 int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd, 497 int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
482 unsigned long arg); 498 unsigned long arg);
483 499
@@ -487,6 +503,40 @@ struct dma_device {
487 void (*device_issue_pending)(struct dma_chan *chan); 503 void (*device_issue_pending)(struct dma_chan *chan);
488}; 504};
489 505
506static inline int dmaengine_device_control(struct dma_chan *chan,
507 enum dma_ctrl_cmd cmd,
508 unsigned long arg)
509{
510 return chan->device->device_control(chan, cmd, arg);
511}
512
513static inline int dmaengine_slave_config(struct dma_chan *chan,
514 struct dma_slave_config *config)
515{
516 return dmaengine_device_control(chan, DMA_SLAVE_CONFIG,
517 (unsigned long)config);
518}
519
520static inline int dmaengine_terminate_all(struct dma_chan *chan)
521{
522 return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0);
523}
524
525static inline int dmaengine_pause(struct dma_chan *chan)
526{
527 return dmaengine_device_control(chan, DMA_PAUSE, 0);
528}
529
530static inline int dmaengine_resume(struct dma_chan *chan)
531{
532 return dmaengine_device_control(chan, DMA_RESUME, 0);
533}
534
535static inline int dmaengine_submit(struct dma_async_tx_descriptor *desc)
536{
537 return desc->tx_submit(desc);
538}
539
490static inline bool dmaengine_check_align(u8 align, size_t off1, size_t off2, size_t len) 540static inline bool dmaengine_check_align(u8 align, size_t off1, size_t off2, size_t len)
491{ 541{
492 size_t mask; 542 size_t mask;
@@ -606,11 +656,11 @@ static inline void net_dmaengine_put(void)
606#ifdef CONFIG_ASYNC_TX_DMA 656#ifdef CONFIG_ASYNC_TX_DMA
607#define async_dmaengine_get() dmaengine_get() 657#define async_dmaengine_get() dmaengine_get()
608#define async_dmaengine_put() dmaengine_put() 658#define async_dmaengine_put() dmaengine_put()
609#ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH 659#ifndef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH
610#define async_dma_find_channel(type) dma_find_channel(DMA_ASYNC_TX) 660#define async_dma_find_channel(type) dma_find_channel(DMA_ASYNC_TX)
611#else 661#else
612#define async_dma_find_channel(type) dma_find_channel(type) 662#define async_dma_find_channel(type) dma_find_channel(type)
613#endif /* CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH */ 663#endif /* CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH */
614#else 664#else
615static inline void async_dmaengine_get(void) 665static inline void async_dmaengine_get(void)
616{ 666{
diff --git a/include/linux/drbd.h b/include/linux/drbd.h
index 479ee3a1d901..9b2a0158f399 100644
--- a/include/linux/drbd.h
+++ b/include/linux/drbd.h
@@ -53,10 +53,10 @@
53 53
54 54
55extern const char *drbd_buildtag(void); 55extern const char *drbd_buildtag(void);
56#define REL_VERSION "8.3.8.1" 56#define REL_VERSION "8.3.9rc2"
57#define API_VERSION 88 57#define API_VERSION 88
58#define PRO_VERSION_MIN 86 58#define PRO_VERSION_MIN 86
59#define PRO_VERSION_MAX 94 59#define PRO_VERSION_MAX 95
60 60
61 61
62enum drbd_io_error_p { 62enum drbd_io_error_p {
@@ -91,6 +91,11 @@ enum drbd_after_sb_p {
91 ASB_VIOLENTLY 91 ASB_VIOLENTLY
92}; 92};
93 93
94enum drbd_on_no_data {
95 OND_IO_ERROR,
96 OND_SUSPEND_IO
97};
98
94/* KEEP the order, do not delete or insert. Only append. */ 99/* KEEP the order, do not delete or insert. Only append. */
95enum drbd_ret_codes { 100enum drbd_ret_codes {
96 ERR_CODE_BASE = 100, 101 ERR_CODE_BASE = 100,
@@ -140,6 +145,7 @@ enum drbd_ret_codes {
140 ERR_CONNECTED = 151, /* DRBD 8.3 only */ 145 ERR_CONNECTED = 151, /* DRBD 8.3 only */
141 ERR_PERM = 152, 146 ERR_PERM = 152,
142 ERR_NEED_APV_93 = 153, 147 ERR_NEED_APV_93 = 153,
148 ERR_STONITH_AND_PROT_A = 154,
143 149
144 /* insert new ones above this line */ 150 /* insert new ones above this line */
145 AFTER_LAST_ERR_CODE 151 AFTER_LAST_ERR_CODE
@@ -226,13 +232,17 @@ union drbd_state {
226 unsigned conn:5 ; /* 17/32 cstates */ 232 unsigned conn:5 ; /* 17/32 cstates */
227 unsigned disk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */ 233 unsigned disk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
228 unsigned pdsk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */ 234 unsigned pdsk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
229 unsigned susp:1 ; /* 2/2 IO suspended no/yes */ 235 unsigned susp:1 ; /* 2/2 IO suspended no/yes (by user) */
230 unsigned aftr_isp:1 ; /* isp .. imposed sync pause */ 236 unsigned aftr_isp:1 ; /* isp .. imposed sync pause */
231 unsigned peer_isp:1 ; 237 unsigned peer_isp:1 ;
232 unsigned user_isp:1 ; 238 unsigned user_isp:1 ;
233 unsigned _pad:11; /* 0 unused */ 239 unsigned susp_nod:1 ; /* IO suspended because no data */
240 unsigned susp_fen:1 ; /* IO suspended because fence peer handler runs*/
241 unsigned _pad:9; /* 0 unused */
234#elif defined(__BIG_ENDIAN_BITFIELD) 242#elif defined(__BIG_ENDIAN_BITFIELD)
235 unsigned _pad:11; /* 0 unused */ 243 unsigned _pad:9;
244 unsigned susp_fen:1 ;
245 unsigned susp_nod:1 ;
236 unsigned user_isp:1 ; 246 unsigned user_isp:1 ;
237 unsigned peer_isp:1 ; 247 unsigned peer_isp:1 ;
238 unsigned aftr_isp:1 ; /* isp .. imposed sync pause */ 248 unsigned aftr_isp:1 ; /* isp .. imposed sync pause */
@@ -312,6 +322,8 @@ enum drbd_timeout_flag {
312 322
313#define DRBD_MAGIC 0x83740267 323#define DRBD_MAGIC 0x83740267
314#define BE_DRBD_MAGIC __constant_cpu_to_be32(DRBD_MAGIC) 324#define BE_DRBD_MAGIC __constant_cpu_to_be32(DRBD_MAGIC)
325#define DRBD_MAGIC_BIG 0x835a
326#define BE_DRBD_MAGIC_BIG __constant_cpu_to_be16(DRBD_MAGIC_BIG)
315 327
316/* these are of type "int" */ 328/* these are of type "int" */
317#define DRBD_MD_INDEX_INTERNAL -1 329#define DRBD_MD_INDEX_INTERNAL -1
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h
index 440b42e38e89..4ac33f34b77e 100644
--- a/include/linux/drbd_limits.h
+++ b/include/linux/drbd_limits.h
@@ -128,26 +128,31 @@
128#define DRBD_AFTER_SB_1P_DEF ASB_DISCONNECT 128#define DRBD_AFTER_SB_1P_DEF ASB_DISCONNECT
129#define DRBD_AFTER_SB_2P_DEF ASB_DISCONNECT 129#define DRBD_AFTER_SB_2P_DEF ASB_DISCONNECT
130#define DRBD_RR_CONFLICT_DEF ASB_DISCONNECT 130#define DRBD_RR_CONFLICT_DEF ASB_DISCONNECT
131#define DRBD_ON_NO_DATA_DEF OND_IO_ERROR
131 132
132#define DRBD_MAX_BIO_BVECS_MIN 0 133#define DRBD_MAX_BIO_BVECS_MIN 0
133#define DRBD_MAX_BIO_BVECS_MAX 128 134#define DRBD_MAX_BIO_BVECS_MAX 128
134#define DRBD_MAX_BIO_BVECS_DEF 0 135#define DRBD_MAX_BIO_BVECS_DEF 0
135 136
136#define DRBD_DP_VOLUME_MIN 4 137#define DRBD_C_PLAN_AHEAD_MIN 0
137#define DRBD_DP_VOLUME_MAX 1048576 138#define DRBD_C_PLAN_AHEAD_MAX 300
138#define DRBD_DP_VOLUME_DEF 16384 139#define DRBD_C_PLAN_AHEAD_DEF 0 /* RS rate controller disabled by default */
139 140
140#define DRBD_DP_INTERVAL_MIN 1 141#define DRBD_C_DELAY_TARGET_MIN 1
141#define DRBD_DP_INTERVAL_MAX 600 142#define DRBD_C_DELAY_TARGET_MAX 100
142#define DRBD_DP_INTERVAL_DEF 5 143#define DRBD_C_DELAY_TARGET_DEF 10
143 144
144#define DRBD_RS_THROTTLE_TH_MIN 1 145#define DRBD_C_FILL_TARGET_MIN 0
145#define DRBD_RS_THROTTLE_TH_MAX 600 146#define DRBD_C_FILL_TARGET_MAX (1<<20) /* 500MByte in sec */
146#define DRBD_RS_THROTTLE_TH_DEF 20 147#define DRBD_C_FILL_TARGET_DEF 0 /* By default disabled -> controlled by delay_target */
147 148
148#define DRBD_RS_HOLD_OFF_TH_MIN 1 149#define DRBD_C_MAX_RATE_MIN 250 /* kByte/sec */
149#define DRBD_RS_HOLD_OFF_TH_MAX 6000 150#define DRBD_C_MAX_RATE_MAX (4 << 20)
150#define DRBD_RS_HOLD_OFF_TH_DEF 100 151#define DRBD_C_MAX_RATE_DEF 102400
152
153#define DRBD_C_MIN_RATE_MIN 0 /* kByte/sec */
154#define DRBD_C_MIN_RATE_MAX (4 << 20)
155#define DRBD_C_MIN_RATE_DEF 4096
151 156
152#undef RANGE 157#undef RANGE
153#endif 158#endif
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h
index 5f042810a56c..ade91107c9a5 100644
--- a/include/linux/drbd_nl.h
+++ b/include/linux/drbd_nl.h
@@ -87,6 +87,12 @@ NL_PACKET(syncer_conf, 8,
87 NL_STRING( 51, T_MAY_IGNORE, cpu_mask, 32) 87 NL_STRING( 51, T_MAY_IGNORE, cpu_mask, 32)
88 NL_STRING( 64, T_MAY_IGNORE, csums_alg, SHARED_SECRET_MAX) 88 NL_STRING( 64, T_MAY_IGNORE, csums_alg, SHARED_SECRET_MAX)
89 NL_BIT( 65, T_MAY_IGNORE, use_rle) 89 NL_BIT( 65, T_MAY_IGNORE, use_rle)
90 NL_INTEGER( 75, T_MAY_IGNORE, on_no_data)
91 NL_INTEGER( 76, T_MAY_IGNORE, c_plan_ahead)
92 NL_INTEGER( 77, T_MAY_IGNORE, c_delay_target)
93 NL_INTEGER( 78, T_MAY_IGNORE, c_fill_target)
94 NL_INTEGER( 79, T_MAY_IGNORE, c_max_rate)
95 NL_INTEGER( 80, T_MAY_IGNORE, c_min_rate)
90) 96)
91 97
92NL_PACKET(invalidate, 9, ) 98NL_PACKET(invalidate, 9, )
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index bef3cda44c4c..a90b3892074a 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -83,7 +83,7 @@ static inline int ddebug_remove_module(const char *mod)
83 83
84#define dynamic_pr_debug(fmt, ...) \ 84#define dynamic_pr_debug(fmt, ...) \
85 do { if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0) 85 do { if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0)
86#define dynamic_dev_dbg(dev, format, ...) \ 86#define dynamic_dev_dbg(dev, fmt, ...) \
87 do { if (0) dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); } while (0) 87 do { if (0) dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); } while (0)
88#endif 88#endif
89 89
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 2308fbb4523a..f16a01081e15 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -71,7 +71,7 @@ static inline int is_zero_ether_addr(const u8 *addr)
71 */ 71 */
72static inline int is_multicast_ether_addr(const u8 *addr) 72static inline int is_multicast_ether_addr(const u8 *addr)
73{ 73{
74 return (0x01 & addr[0]); 74 return 0x01 & addr[0];
75} 75}
76 76
77/** 77/**
@@ -82,7 +82,7 @@ static inline int is_multicast_ether_addr(const u8 *addr)
82 */ 82 */
83static inline int is_local_ether_addr(const u8 *addr) 83static inline int is_local_ether_addr(const u8 *addr)
84{ 84{
85 return (0x02 & addr[0]); 85 return 0x02 & addr[0];
86} 86}
87 87
88/** 88/**
@@ -237,13 +237,29 @@ static inline bool is_etherdev_addr(const struct net_device *dev,
237 * entry points. 237 * entry points.
238 */ 238 */
239 239
240static inline int compare_ether_header(const void *a, const void *b) 240static inline unsigned long compare_ether_header(const void *a, const void *b)
241{ 241{
242#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
243 unsigned long fold;
244
245 /*
246 * We want to compare 14 bytes:
247 * [a0 ... a13] ^ [b0 ... b13]
248 * Use two long XOR, ORed together, with an overlap of two bytes.
249 * [a0 a1 a2 a3 a4 a5 a6 a7 ] ^ [b0 b1 b2 b3 b4 b5 b6 b7 ] |
250 * [a6 a7 a8 a9 a10 a11 a12 a13] ^ [b6 b7 b8 b9 b10 b11 b12 b13]
251 * This means the [a6 a7] ^ [b6 b7] part is done two times.
252 */
253 fold = *(unsigned long *)a ^ *(unsigned long *)b;
254 fold |= *(unsigned long *)(a + 6) ^ *(unsigned long *)(b + 6);
255 return fold;
256#else
242 u32 *a32 = (u32 *)((u8 *)a + 2); 257 u32 *a32 = (u32 *)((u8 *)a + 2);
243 u32 *b32 = (u32 *)((u8 *)b + 2); 258 u32 *b32 = (u32 *)((u8 *)b + 2);
244 259
245 return (*(u16 *)a ^ *(u16 *)b) | (a32[0] ^ b32[0]) | 260 return (*(u16 *)a ^ *(u16 *)b) | (a32[0] ^ b32[0]) |
246 (a32[1] ^ b32[1]) | (a32[2] ^ b32[2]); 261 (a32[1] ^ b32[1]) | (a32[2] ^ b32[2]);
262#endif
247} 263}
248 264
249#endif /* _LINUX_ETHERDEVICE_H */ 265#endif /* _LINUX_ETHERDEVICE_H */
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 991269e5b152..6628a507fd3b 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -14,6 +14,7 @@
14#define _LINUX_ETHTOOL_H 14#define _LINUX_ETHTOOL_H
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/if_ether.h>
17 18
18/* This should work for both 32 and 64 bit userland. */ 19/* This should work for both 32 and 64 bit userland. */
19struct ethtool_cmd { 20struct ethtool_cmd {
@@ -308,15 +309,28 @@ struct ethtool_perm_addr {
308 * flag differs from the read-only value. 309 * flag differs from the read-only value.
309 */ 310 */
310enum ethtool_flags { 311enum ethtool_flags {
312 ETH_FLAG_TXVLAN = (1 << 7), /* TX VLAN offload enabled */
313 ETH_FLAG_RXVLAN = (1 << 8), /* RX VLAN offload enabled */
311 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ 314 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
312 ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ 315 ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
313 ETH_FLAG_RXHASH = (1 << 28), 316 ETH_FLAG_RXHASH = (1 << 28),
314}; 317};
315 318
316/* The following structures are for supporting RX network flow 319/* The following structures are for supporting RX network flow
317 * classification configuration. Note, all multibyte fields, e.g., 320 * classification and RX n-tuple configuration. Note, all multibyte
318 * ip4src, ip4dst, psrc, pdst, spi, etc. are expected to be in network 321 * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to
319 * byte order. 322 * be in network byte order.
323 */
324
325/**
326 * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc.
327 * @ip4src: Source host
328 * @ip4dst: Destination host
329 * @psrc: Source port
330 * @pdst: Destination port
331 * @tos: Type-of-service
332 *
333 * This can be used to specify a TCP/IPv4, UDP/IPv4 or SCTP/IPv4 flow.
320 */ 334 */
321struct ethtool_tcpip4_spec { 335struct ethtool_tcpip4_spec {
322 __be32 ip4src; 336 __be32 ip4src;
@@ -326,6 +340,15 @@ struct ethtool_tcpip4_spec {
326 __u8 tos; 340 __u8 tos;
327}; 341};
328 342
343/**
344 * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4
345 * @ip4src: Source host
346 * @ip4dst: Destination host
347 * @spi: Security parameters index
348 * @tos: Type-of-service
349 *
350 * This can be used to specify an IPsec transport or tunnel over IPv4.
351 */
329struct ethtool_ah_espip4_spec { 352struct ethtool_ah_espip4_spec {
330 __be32 ip4src; 353 __be32 ip4src;
331 __be32 ip4dst; 354 __be32 ip4dst;
@@ -333,21 +356,17 @@ struct ethtool_ah_espip4_spec {
333 __u8 tos; 356 __u8 tos;
334}; 357};
335 358
336struct ethtool_rawip4_spec {
337 __be32 ip4src;
338 __be32 ip4dst;
339 __u8 hdata[64];
340};
341
342struct ethtool_ether_spec {
343 __be16 ether_type;
344 __u8 frame_size;
345 __u8 eframe[16];
346};
347
348#define ETH_RX_NFC_IP4 1 359#define ETH_RX_NFC_IP4 1
349#define ETH_RX_NFC_IP6 2
350 360
361/**
362 * struct ethtool_usrip4_spec - general flow specification for IPv4
363 * @ip4src: Source host
364 * @ip4dst: Destination host
365 * @l4_4_bytes: First 4 bytes of transport (layer 4) header
366 * @tos: Type-of-service
367 * @ip_ver: Value must be %ETH_RX_NFC_IP4; mask must be 0
368 * @proto: Transport protocol number; mask must be 0
369 */
351struct ethtool_usrip4_spec { 370struct ethtool_usrip4_spec {
352 __be32 ip4src; 371 __be32 ip4src;
353 __be32 ip4dst; 372 __be32 ip4dst;
@@ -357,6 +376,15 @@ struct ethtool_usrip4_spec {
357 __u8 proto; 376 __u8 proto;
358}; 377};
359 378
379/**
380 * struct ethtool_rx_flow_spec - specification for RX flow filter
381 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
382 * @h_u: Flow fields to match (dependent on @flow_type)
383 * @m_u: Masks for flow field bits to be ignored
384 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
385 * if packets should be discarded
386 * @location: Index of filter in hardware table
387 */
360struct ethtool_rx_flow_spec { 388struct ethtool_rx_flow_spec {
361 __u32 flow_type; 389 __u32 flow_type;
362 union { 390 union {
@@ -365,36 +393,91 @@ struct ethtool_rx_flow_spec {
365 struct ethtool_tcpip4_spec sctp_ip4_spec; 393 struct ethtool_tcpip4_spec sctp_ip4_spec;
366 struct ethtool_ah_espip4_spec ah_ip4_spec; 394 struct ethtool_ah_espip4_spec ah_ip4_spec;
367 struct ethtool_ah_espip4_spec esp_ip4_spec; 395 struct ethtool_ah_espip4_spec esp_ip4_spec;
368 struct ethtool_rawip4_spec raw_ip4_spec;
369 struct ethtool_ether_spec ether_spec;
370 struct ethtool_usrip4_spec usr_ip4_spec; 396 struct ethtool_usrip4_spec usr_ip4_spec;
371 __u8 hdata[64]; 397 struct ethhdr ether_spec;
372 } h_u, m_u; /* entry, mask */ 398 __u8 hdata[72];
399 } h_u, m_u;
373 __u64 ring_cookie; 400 __u64 ring_cookie;
374 __u32 location; 401 __u32 location;
375}; 402};
376 403
404/**
405 * struct ethtool_rxnfc - command to get or set RX flow classification rules
406 * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH,
407 * %ETHTOOL_GRXRINGS, %ETHTOOL_GRXCLSRLCNT, %ETHTOOL_GRXCLSRULE,
408 * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
409 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
410 * @data: Command-dependent value
411 * @fs: Flow filter specification
412 * @rule_cnt: Number of rules to be affected
413 * @rule_locs: Array of valid rule indices
414 *
415 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
416 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following
417 * structure fields must not be used.
418 *
419 * For %ETHTOOL_GRXRINGS, @data is set to the number of RX rings/queues
420 * on return.
421 *
422 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
423 * rules on return.
424 *
425 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the index of an
426 * existing filter rule on entry and @fs contains the rule on return.
427 *
428 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
429 * user buffer for @rule_locs on entry. On return, @data is the size
430 * of the filter table and @rule_locs contains the indices of the
431 * defined rules.
432 *
433 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the filter rule to add or
434 * update. @fs.@location specifies the index to use and must not be
435 * ignored.
436 *
437 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the index of an
438 * existing filter rule on entry.
439 *
440 * Implementation of indexed classification rules generally requires a
441 * TCAM.
442 */
377struct ethtool_rxnfc { 443struct ethtool_rxnfc {
378 __u32 cmd; 444 __u32 cmd;
379 __u32 flow_type; 445 __u32 flow_type;
380 /* The rx flow hash value or the rule DB size */
381 __u64 data; 446 __u64 data;
382 /* The following fields are not valid and must not be used for
383 * the ETHTOOL_{G,X}RXFH commands. */
384 struct ethtool_rx_flow_spec fs; 447 struct ethtool_rx_flow_spec fs;
385 __u32 rule_cnt; 448 __u32 rule_cnt;
386 __u32 rule_locs[0]; 449 __u32 rule_locs[0];
387}; 450};
388 451
452/**
453 * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
454 * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
455 * @size: On entry, the array size of the user buffer. On return from
456 * %ETHTOOL_GRXFHINDIR, the array size of the hardware indirection table.
457 * @ring_index: RX ring/queue index for each hash value
458 */
389struct ethtool_rxfh_indir { 459struct ethtool_rxfh_indir {
390 __u32 cmd; 460 __u32 cmd;
391 /* On entry, this is the array size of the user buffer. On
392 * return from ETHTOOL_GRXFHINDIR, this is the array size of
393 * the hardware indirection table. */
394 __u32 size; 461 __u32 size;
395 __u32 ring_index[0]; /* ring/queue index for each hash value */ 462 __u32 ring_index[0];
396}; 463};
397 464
465/**
466 * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
467 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
468 * @h_u: Flow field values to match (dependent on @flow_type)
469 * @m_u: Masks for flow field value bits to be ignored
470 * @vlan_tag: VLAN tag to match
471 * @vlan_tag_mask: Mask for VLAN tag bits to be ignored
472 * @data: Driver-dependent data to match
473 * @data_mask: Mask for driver-dependent data bits to be ignored
474 * @action: RX ring/queue index to deliver to (non-negative) or other action
475 * (negative, e.g. %ETHTOOL_RXNTUPLE_ACTION_DROP)
476 *
477 * For flow types %TCP_V4_FLOW, %UDP_V4_FLOW and %SCTP_V4_FLOW, where
478 * a field value and mask are both zero this is treated as if all mask
479 * bits are set i.e. the field is ignored.
480 */
398struct ethtool_rx_ntuple_flow_spec { 481struct ethtool_rx_ntuple_flow_spec {
399 __u32 flow_type; 482 __u32 flow_type;
400 union { 483 union {
@@ -403,22 +486,26 @@ struct ethtool_rx_ntuple_flow_spec {
403 struct ethtool_tcpip4_spec sctp_ip4_spec; 486 struct ethtool_tcpip4_spec sctp_ip4_spec;
404 struct ethtool_ah_espip4_spec ah_ip4_spec; 487 struct ethtool_ah_espip4_spec ah_ip4_spec;
405 struct ethtool_ah_espip4_spec esp_ip4_spec; 488 struct ethtool_ah_espip4_spec esp_ip4_spec;
406 struct ethtool_rawip4_spec raw_ip4_spec;
407 struct ethtool_ether_spec ether_spec;
408 struct ethtool_usrip4_spec usr_ip4_spec; 489 struct ethtool_usrip4_spec usr_ip4_spec;
409 __u8 hdata[64]; 490 struct ethhdr ether_spec;
410 } h_u, m_u; /* entry, mask */ 491 __u8 hdata[72];
492 } h_u, m_u;
411 493
412 __u16 vlan_tag; 494 __u16 vlan_tag;
413 __u16 vlan_tag_mask; 495 __u16 vlan_tag_mask;
414 __u64 data; /* user-defined flow spec data */ 496 __u64 data;
415 __u64 data_mask; /* user-defined flow spec mask */ 497 __u64 data_mask;
416 498
417 /* signed to distinguish between queue and actions (DROP) */
418 __s32 action; 499 __s32 action;
419#define ETHTOOL_RXNTUPLE_ACTION_DROP -1 500#define ETHTOOL_RXNTUPLE_ACTION_DROP (-1) /* drop packet */
501#define ETHTOOL_RXNTUPLE_ACTION_CLEAR (-2) /* clear filter */
420}; 502};
421 503
504/**
505 * struct ethtool_rx_ntuple - command to set or clear RX flow filter
506 * @cmd: Command number - %ETHTOOL_SRXNTUPLE
507 * @fs: Flow filter specification
508 */
422struct ethtool_rx_ntuple { 509struct ethtool_rx_ntuple {
423 __u32 cmd; 510 __u32 cmd;
424 struct ethtool_rx_ntuple_flow_spec fs; 511 struct ethtool_rx_ntuple_flow_spec fs;
@@ -759,22 +846,23 @@ struct ethtool_ops {
759#define WAKE_MAGIC (1 << 5) 846#define WAKE_MAGIC (1 << 5)
760#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */ 847#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
761 848
762/* L3-L4 network traffic flow types */ 849/* L2-L4 network traffic flow types */
763#define TCP_V4_FLOW 0x01 850#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
764#define UDP_V4_FLOW 0x02 851#define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
765#define SCTP_V4_FLOW 0x03 852#define SCTP_V4_FLOW 0x03 /* hash or spec (sctp_ip4_spec) */
766#define AH_ESP_V4_FLOW 0x04 853#define AH_ESP_V4_FLOW 0x04 /* hash only */
767#define TCP_V6_FLOW 0x05 854#define TCP_V6_FLOW 0x05 /* hash only */
768#define UDP_V6_FLOW 0x06 855#define UDP_V6_FLOW 0x06 /* hash only */
769#define SCTP_V6_FLOW 0x07 856#define SCTP_V6_FLOW 0x07 /* hash only */
770#define AH_ESP_V6_FLOW 0x08 857#define AH_ESP_V6_FLOW 0x08 /* hash only */
771#define AH_V4_FLOW 0x09 858#define AH_V4_FLOW 0x09 /* hash or spec (ah_ip4_spec) */
772#define ESP_V4_FLOW 0x0a 859#define ESP_V4_FLOW 0x0a /* hash or spec (esp_ip4_spec) */
773#define AH_V6_FLOW 0x0b 860#define AH_V6_FLOW 0x0b /* hash only */
774#define ESP_V6_FLOW 0x0c 861#define ESP_V6_FLOW 0x0c /* hash only */
775#define IP_USER_FLOW 0x0d 862#define IP_USER_FLOW 0x0d /* spec only (usr_ip4_spec) */
776#define IPV4_FLOW 0x10 863#define IPV4_FLOW 0x10 /* hash only */
777#define IPV6_FLOW 0x11 864#define IPV6_FLOW 0x11 /* hash only */
865#define ETHER_FLOW 0x12 /* spec only (ether_spec) */
778 866
779/* L3-L4 network traffic flow hash options */ 867/* L3-L4 network traffic flow hash options */
780#define RXH_L2DA (1 << 1) 868#define RXH_L2DA (1 << 1)
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
index a9cd507f8cd2..28028988c862 100644
--- a/include/linux/exportfs.h
+++ b/include/linux/exportfs.h
@@ -67,6 +67,19 @@ enum fid_type {
67 * 32 bit parent block number, 32 bit parent generation number 67 * 32 bit parent block number, 32 bit parent generation number
68 */ 68 */
69 FILEID_UDF_WITH_PARENT = 0x52, 69 FILEID_UDF_WITH_PARENT = 0x52,
70
71 /*
72 * 64 bit checkpoint number, 64 bit inode number,
73 * 32 bit generation number.
74 */
75 FILEID_NILFS_WITHOUT_PARENT = 0x61,
76
77 /*
78 * 64 bit checkpoint number, 64 bit inode number,
79 * 32 bit generation number, 32 bit parent generation.
80 * 64 bit parent inode number.
81 */
82 FILEID_NILFS_WITH_PARENT = 0x62,
70}; 83};
71 84
72struct fid { 85struct fid {
diff --git a/include/linux/fb.h b/include/linux/fb.h
index f0268deca658..7fca3dc4e475 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -931,6 +931,8 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
931#define fb_writel sbus_writel 931#define fb_writel sbus_writel
932#define fb_writeq sbus_writeq 932#define fb_writeq sbus_writeq
933#define fb_memset sbus_memset_io 933#define fb_memset sbus_memset_io
934#define fb_memcpy_fromfb sbus_memcpy_fromio
935#define fb_memcpy_tofb sbus_memcpy_toio
934 936
935#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) || defined(__bfin__) 937#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) || defined(__bfin__)
936 938
@@ -943,6 +945,8 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
943#define fb_writel __raw_writel 945#define fb_writel __raw_writel
944#define fb_writeq __raw_writeq 946#define fb_writeq __raw_writeq
945#define fb_memset memset_io 947#define fb_memset memset_io
948#define fb_memcpy_fromfb memcpy_fromio
949#define fb_memcpy_tofb memcpy_toio
946 950
947#else 951#else
948 952
@@ -955,6 +959,8 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
955#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b)) 959#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b))
956#define fb_writeq(b,addr) (*(volatile u64 *) (addr) = (b)) 960#define fb_writeq(b,addr) (*(volatile u64 *) (addr) = (b))
957#define fb_memset memset 961#define fb_memset memset
962#define fb_memcpy_fromfb memcpy
963#define fb_memcpy_tofb memcpy
958 964
959#endif 965#endif
960 966
diff --git a/include/linux/fdreg.h b/include/linux/fdreg.h
index c2eeb63b72db..61ce64169004 100644
--- a/include/linux/fdreg.h
+++ b/include/linux/fdreg.h
@@ -89,7 +89,7 @@
89/* the following commands are new in the 82078. They are not used in the 89/* the following commands are new in the 82078. They are not used in the
90 * floppy driver, except the first three. These commands may be useful for apps 90 * floppy driver, except the first three. These commands may be useful for apps
91 * which use the FDRAWCMD interface. For doc, get the 82078 spec sheets at 91 * which use the FDRAWCMD interface. For doc, get the 82078 spec sheets at
92 * http://www-techdoc.intel.com/docs/periph/fd_contr/datasheets/ */ 92 * http://www.intel.com/design/archives/periphrl/docs/29046803.htm */
93 93
94#define FD_PARTID 0x18 /* part id ("extended" version cmd) */ 94#define FD_PARTID 0x18 /* part id ("extended" version cmd) */
95#define FD_SAVE 0x2e /* save fdc regs for later restore */ 95#define FD_SAVE 0x2e /* save fdc regs for later restore */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7d6f18fddfdb..b2a6009cba10 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -34,9 +34,9 @@
34 34
35/* And dynamically-tunable limits and defaults: */ 35/* And dynamically-tunable limits and defaults: */
36struct files_stat_struct { 36struct files_stat_struct {
37 int nr_files; /* read only */ 37 unsigned long nr_files; /* read only */
38 int nr_free_files; /* read only */ 38 unsigned long nr_free_files; /* read only */
39 int max_files; /* tunable */ 39 unsigned long max_files; /* tunable */
40}; 40};
41 41
42struct inodes_stat_t { 42struct inodes_stat_t {
@@ -92,6 +92,9 @@ struct inodes_stat_t {
92/* Expect random access pattern */ 92/* Expect random access pattern */
93#define FMODE_RANDOM ((__force fmode_t)0x1000) 93#define FMODE_RANDOM ((__force fmode_t)0x1000)
94 94
95/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */
96#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000)
97
95/* File was opened by fanotify and shouldn't generate fanotify events */ 98/* File was opened by fanotify and shouldn't generate fanotify events */
96#define FMODE_NONOTIFY ((__force fmode_t)0x1000000) 99#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
97 100
@@ -135,12 +138,12 @@ struct inodes_stat_t {
135 * immediately after submission. The write equivalent 138 * immediately after submission. The write equivalent
136 * of READ_SYNC. 139 * of READ_SYNC.
137 * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only. 140 * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only.
138 * WRITE_BARRIER Like WRITE_SYNC, but tells the block layer that all 141 * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush.
139 * previously submitted writes must be safely on storage 142 * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on
140 * before this one is started. Also guarantees that when 143 * non-volatile media on completion.
141 * this write is complete, it itself is also safely on 144 * WRITE_FLUSH_FUA Combination of WRITE_FLUSH and FUA. The IO is preceded
142 * storage. Prevents reordering of writes on both sides 145 * by a cache flush and data is guaranteed to be on
143 * of this IO. 146 * non-volatile media on completion.
144 * 147 *
145 */ 148 */
146#define RW_MASK REQ_WRITE 149#define RW_MASK REQ_WRITE
@@ -156,16 +159,12 @@ struct inodes_stat_t {
156#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG) 159#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG)
157#define WRITE_ODIRECT_PLUG (WRITE | REQ_SYNC) 160#define WRITE_ODIRECT_PLUG (WRITE | REQ_SYNC)
158#define WRITE_META (WRITE | REQ_META) 161#define WRITE_META (WRITE | REQ_META)
159#define WRITE_BARRIER (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ 162#define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \
160 REQ_HARDBARRIER) 163 REQ_FLUSH)
161 164#define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \
162/* 165 REQ_FUA)
163 * These aren't really reads or writes, they pass down information about 166#define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \
164 * parts of device that are now unused by the file system. 167 REQ_FLUSH | REQ_FUA)
165 */
166#define DISCARD_NOBARRIER (WRITE | REQ_DISCARD)
167#define DISCARD_BARRIER (WRITE | REQ_DISCARD | REQ_HARDBARRIER)
168#define DISCARD_SECURE (DISCARD_NOBARRIER | REQ_SECURE)
169 168
170#define SEL_IN 1 169#define SEL_IN 1
171#define SEL_OUT 2 170#define SEL_OUT 2
@@ -235,6 +234,7 @@ struct inodes_stat_t {
235#define S_NOCMTIME 128 /* Do not update file c/mtime */ 234#define S_NOCMTIME 128 /* Do not update file c/mtime */
236#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ 235#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */
237#define S_PRIVATE 512 /* Inode is fs-internal */ 236#define S_PRIVATE 512 /* Inode is fs-internal */
237#define S_IMA 1024 /* Inode has an associated IMA struct */
238 238
239/* 239/*
240 * Note that nosuid etc flags are inode-specific: setting some file-system 240 * Note that nosuid etc flags are inode-specific: setting some file-system
@@ -269,6 +269,7 @@ struct inodes_stat_t {
269#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) 269#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
270#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) 270#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE)
271#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) 271#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE)
272#define IS_IMA(inode) ((inode)->i_flags & S_IMA)
272 273
273/* the read-only stuff doesn't really belong here, but any other place is 274/* the read-only stuff doesn't really belong here, but any other place is
274 probably as bad and I don't want to create yet another include file. */ 275 probably as bad and I don't want to create yet another include file. */
@@ -404,7 +405,7 @@ extern void __init inode_init_early(void);
404extern void __init files_init(unsigned long); 405extern void __init files_init(unsigned long);
405 406
406extern struct files_stat_struct files_stat; 407extern struct files_stat_struct files_stat;
407extern int get_max_files(void); 408extern unsigned long get_max_files(void);
408extern int sysctl_nr_open; 409extern int sysctl_nr_open;
409extern struct inodes_stat_t inodes_stat; 410extern struct inodes_stat_t inodes_stat;
410extern int leases_enable, lease_break_time; 411extern int leases_enable, lease_break_time;
@@ -724,7 +725,8 @@ struct posix_acl;
724 725
725struct inode { 726struct inode {
726 struct hlist_node i_hash; 727 struct hlist_node i_hash;
727 struct list_head i_list; /* backing dev IO list */ 728 struct list_head i_wb_list; /* backing dev IO list */
729 struct list_head i_lru; /* inode LRU list */
728 struct list_head i_sb_list; 730 struct list_head i_sb_list;
729 struct list_head i_dentry; 731 struct list_head i_dentry;
730 unsigned long i_ino; 732 unsigned long i_ino;
@@ -776,6 +778,10 @@ struct inode {
776 778
777 unsigned int i_flags; 779 unsigned int i_flags;
778 780
781#ifdef CONFIG_IMA
782 /* protected by i_lock */
783 unsigned int i_readcount; /* struct files open RO */
784#endif
779 atomic_t i_writecount; 785 atomic_t i_writecount;
780#ifdef CONFIG_SECURITY 786#ifdef CONFIG_SECURITY
781 void *i_security; 787 void *i_security;
@@ -787,6 +793,11 @@ struct inode {
787 void *i_private; /* fs or device private pointer */ 793 void *i_private; /* fs or device private pointer */
788}; 794};
789 795
796static inline int inode_unhashed(struct inode *inode)
797{
798 return hlist_unhashed(&inode->i_hash);
799}
800
790/* 801/*
791 * inode->i_mutex nesting subclasses for the lock validator: 802 * inode->i_mutex nesting subclasses for the lock validator:
792 * 803 *
@@ -1093,10 +1104,6 @@ struct file_lock {
1093 1104
1094#include <linux/fcntl.h> 1105#include <linux/fcntl.h>
1095 1106
1096/* temporary stubs for BKL removal */
1097#define lock_flocks() lock_kernel()
1098#define unlock_flocks() unlock_kernel()
1099
1100extern void send_sigio(struct fown_struct *fown, int fd, int band); 1107extern void send_sigio(struct fown_struct *fown, int fd, int band);
1101 1108
1102#ifdef CONFIG_FILE_LOCKING 1109#ifdef CONFIG_FILE_LOCKING
@@ -1115,6 +1122,7 @@ extern int fcntl_getlease(struct file *filp);
1115 1122
1116/* fs/locks.c */ 1123/* fs/locks.c */
1117extern void locks_init_lock(struct file_lock *); 1124extern void locks_init_lock(struct file_lock *);
1125extern struct file_lock * locks_alloc_lock(void);
1118extern void locks_copy_lock(struct file_lock *, struct file_lock *); 1126extern void locks_copy_lock(struct file_lock *, struct file_lock *);
1119extern void __locks_copy_lock(struct file_lock *, const struct file_lock *); 1127extern void __locks_copy_lock(struct file_lock *, const struct file_lock *);
1120extern void locks_remove_posix(struct file *, fl_owner_t); 1128extern void locks_remove_posix(struct file *, fl_owner_t);
@@ -1135,6 +1143,8 @@ extern int vfs_setlease(struct file *, long, struct file_lock **);
1135extern int lease_modify(struct file_lock **, int); 1143extern int lease_modify(struct file_lock **, int);
1136extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 1144extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
1137extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 1145extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
1146extern void lock_flocks(void);
1147extern void unlock_flocks(void);
1138#else /* !CONFIG_FILE_LOCKING */ 1148#else /* !CONFIG_FILE_LOCKING */
1139static inline int fcntl_getlk(struct file *file, struct flock __user *user) 1149static inline int fcntl_getlk(struct file *file, struct flock __user *user)
1140{ 1150{
@@ -1277,6 +1287,14 @@ static inline int lock_may_write(struct inode *inode, loff_t start,
1277 return 1; 1287 return 1;
1278} 1288}
1279 1289
1290static inline void lock_flocks(void)
1291{
1292}
1293
1294static inline void unlock_flocks(void)
1295{
1296}
1297
1280#endif /* !CONFIG_FILE_LOCKING */ 1298#endif /* !CONFIG_FILE_LOCKING */
1281 1299
1282 1300
@@ -1293,6 +1311,11 @@ struct fasync_struct {
1293 1311
1294/* SMP safe fasync helpers: */ 1312/* SMP safe fasync helpers: */
1295extern int fasync_helper(int, struct file *, int, struct fasync_struct **); 1313extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
1314extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struct fasync_struct *);
1315extern int fasync_remove_entry(struct file *, struct fasync_struct **);
1316extern struct fasync_struct *fasync_alloc(void);
1317extern void fasync_free(struct fasync_struct *);
1318
1296/* can be called from interrupts */ 1319/* can be called from interrupts */
1297extern void kill_fasync(struct fasync_struct **, int, int); 1320extern void kill_fasync(struct fasync_struct **, int, int);
1298 1321
@@ -1631,16 +1654,17 @@ struct super_operations {
1631 * 1654 *
1632 * Q: What is the difference between I_WILL_FREE and I_FREEING? 1655 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1633 */ 1656 */
1634#define I_DIRTY_SYNC 1 1657#define I_DIRTY_SYNC (1 << 0)
1635#define I_DIRTY_DATASYNC 2 1658#define I_DIRTY_DATASYNC (1 << 1)
1636#define I_DIRTY_PAGES 4 1659#define I_DIRTY_PAGES (1 << 2)
1637#define __I_NEW 3 1660#define __I_NEW 3
1638#define I_NEW (1 << __I_NEW) 1661#define I_NEW (1 << __I_NEW)
1639#define I_WILL_FREE 16 1662#define I_WILL_FREE (1 << 4)
1640#define I_FREEING 32 1663#define I_FREEING (1 << 5)
1641#define I_CLEAR 64 1664#define I_CLEAR (1 << 6)
1642#define __I_SYNC 7 1665#define __I_SYNC 7
1643#define I_SYNC (1 << __I_SYNC) 1666#define I_SYNC (1 << __I_SYNC)
1667#define I_REFERENCED (1 << 8)
1644 1668
1645#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) 1669#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
1646 1670
@@ -1732,6 +1756,7 @@ static inline void file_accessed(struct file *file)
1732} 1756}
1733 1757
1734int sync_inode(struct inode *inode, struct writeback_control *wbc); 1758int sync_inode(struct inode *inode, struct writeback_control *wbc);
1759int sync_inode_metadata(struct inode *inode, int wait);
1735 1760
1736struct file_system_type { 1761struct file_system_type {
1737 const char *name; 1762 const char *name;
@@ -2076,7 +2101,6 @@ extern int check_disk_change(struct block_device *);
2076extern int __invalidate_device(struct block_device *); 2101extern int __invalidate_device(struct block_device *);
2077extern int invalidate_partition(struct gendisk *, int); 2102extern int invalidate_partition(struct gendisk *, int);
2078#endif 2103#endif
2079extern int invalidate_inodes(struct super_block *);
2080unsigned long invalidate_mapping_pages(struct address_space *mapping, 2104unsigned long invalidate_mapping_pages(struct address_space *mapping,
2081 pgoff_t start, pgoff_t end); 2105 pgoff_t start, pgoff_t end);
2082 2106
@@ -2160,7 +2184,7 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
2160 2184
2161extern int inode_init_always(struct super_block *, struct inode *); 2185extern int inode_init_always(struct super_block *, struct inode *);
2162extern void inode_init_once(struct inode *); 2186extern void inode_init_once(struct inode *);
2163extern void inode_add_to_lists(struct super_block *, struct inode *); 2187extern void ihold(struct inode * inode);
2164extern void iput(struct inode *); 2188extern void iput(struct inode *);
2165extern struct inode * igrab(struct inode *); 2189extern struct inode * igrab(struct inode *);
2166extern ino_t iunique(struct super_block *, ino_t); 2190extern ino_t iunique(struct super_block *, ino_t);
@@ -2180,11 +2204,11 @@ extern struct inode * iget_locked(struct super_block *, unsigned long);
2180extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); 2204extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
2181extern int insert_inode_locked(struct inode *); 2205extern int insert_inode_locked(struct inode *);
2182extern void unlock_new_inode(struct inode *); 2206extern void unlock_new_inode(struct inode *);
2207extern unsigned int get_next_ino(void);
2183 2208
2184extern void __iget(struct inode * inode); 2209extern void __iget(struct inode * inode);
2185extern void iget_failed(struct inode *); 2210extern void iget_failed(struct inode *);
2186extern void end_writeback(struct inode *); 2211extern void end_writeback(struct inode *);
2187extern void destroy_inode(struct inode *);
2188extern void __destroy_inode(struct inode *); 2212extern void __destroy_inode(struct inode *);
2189extern struct inode *new_inode(struct super_block *); 2213extern struct inode *new_inode(struct super_block *);
2190extern int should_remove_suid(struct dentry *); 2214extern int should_remove_suid(struct dentry *);
@@ -2192,9 +2216,11 @@ extern int file_remove_suid(struct file *);
2192 2216
2193extern void __insert_inode_hash(struct inode *, unsigned long hashval); 2217extern void __insert_inode_hash(struct inode *, unsigned long hashval);
2194extern void remove_inode_hash(struct inode *); 2218extern void remove_inode_hash(struct inode *);
2195static inline void insert_inode_hash(struct inode *inode) { 2219static inline void insert_inode_hash(struct inode *inode)
2220{
2196 __insert_inode_hash(inode, inode->i_ino); 2221 __insert_inode_hash(inode, inode->i_ino);
2197} 2222}
2223extern void inode_sb_list_add(struct inode *inode);
2198 2224
2199#ifdef CONFIG_BLOCK 2225#ifdef CONFIG_BLOCK
2200extern void submit_bio(int, struct bio *); 2226extern void submit_bio(int, struct bio *);
@@ -2456,6 +2482,7 @@ static const struct file_operations __fops = { \
2456 .release = simple_attr_release, \ 2482 .release = simple_attr_release, \
2457 .read = simple_attr_read, \ 2483 .read = simple_attr_read, \
2458 .write = simple_attr_write, \ 2484 .write = simple_attr_write, \
2485 .llseek = generic_file_llseek, \
2459}; 2486};
2460 2487
2461static inline void __attribute__((format(printf, 1, 2))) 2488static inline void __attribute__((format(printf, 1, 2)))
@@ -2476,7 +2503,10 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,
2476struct ctl_table; 2503struct ctl_table;
2477int proc_nr_files(struct ctl_table *table, int write, 2504int proc_nr_files(struct ctl_table *table, int write,
2478 void __user *buffer, size_t *lenp, loff_t *ppos); 2505 void __user *buffer, size_t *lenp, loff_t *ppos);
2479 2506int proc_nr_dentry(struct ctl_table *table, int write,
2507 void __user *buffer, size_t *lenp, loff_t *ppos);
2508int proc_nr_inodes(struct ctl_table *table, int write,
2509 void __user *buffer, size_t *lenp, loff_t *ppos);
2480int __init get_filesystem_list(char *buf); 2510int __init get_filesystem_list(char *buf);
2481 2511
2482#define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) 2512#define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE])
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 28e33fea5107..4eb56ed75fbc 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -58,17 +58,35 @@ enum fsl_usb2_phy_modes {
58 FSL_USB2_PHY_SERIAL, 58 FSL_USB2_PHY_SERIAL,
59}; 59};
60 60
61struct clk;
62struct platform_device;
63
61struct fsl_usb2_platform_data { 64struct fsl_usb2_platform_data {
62 /* board specific information */ 65 /* board specific information */
63 enum fsl_usb2_operating_modes operating_mode; 66 enum fsl_usb2_operating_modes operating_mode;
64 enum fsl_usb2_phy_modes phy_mode; 67 enum fsl_usb2_phy_modes phy_mode;
65 unsigned int port_enables; 68 unsigned int port_enables;
69 unsigned int workaround;
70
71 int (*init)(struct platform_device *);
72 void (*exit)(struct platform_device *);
73 void __iomem *regs; /* ioremap'd register base */
74 struct clk *clk;
75 unsigned big_endian_mmio:1;
76 unsigned big_endian_desc:1;
77 unsigned es:1; /* need USBMODE:ES */
78 unsigned le_setup_buf:1;
79 unsigned have_sysif_regs:1;
80 unsigned invert_drvvbus:1;
81 unsigned invert_pwr_fault:1;
66}; 82};
67 83
68/* Flags in fsl_usb2_mph_platform_data */ 84/* Flags in fsl_usb2_mph_platform_data */
69#define FSL_USB2_PORT0_ENABLED 0x00000001 85#define FSL_USB2_PORT0_ENABLED 0x00000001
70#define FSL_USB2_PORT1_ENABLED 0x00000002 86#define FSL_USB2_PORT1_ENABLED 0x00000002
71 87
88#define FLS_USB2_WORKAROUND_ENGCM09152 (1 << 0)
89
72struct spi_device; 90struct spi_device;
73 91
74struct fsl_spi_platform_data { 92struct fsl_spi_platform_data {
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 361d1cc288d0..b65a6f472775 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -53,9 +53,7 @@ struct gameport {
53#define to_gameport_port(d) container_of(d, struct gameport, dev) 53#define to_gameport_port(d) container_of(d, struct gameport, dev)
54 54
55struct gameport_driver { 55struct gameport_driver {
56 56 const char *description;
57 void *private;
58 char *description;
59 57
60 int (*connect)(struct gameport *, struct gameport_driver *drv); 58 int (*connect)(struct gameport *, struct gameport_driver *drv);
61 int (*reconnect)(struct gameport *); 59 int (*reconnect)(struct gameport *);
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index af3f06b41dc1..7a7b9c1644e4 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -12,6 +12,7 @@
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/kdev_t.h> 13#include <linux/kdev_t.h>
14#include <linux/rcupdate.h> 14#include <linux/rcupdate.h>
15#include <linux/slab.h>
15 16
16#ifdef CONFIG_BLOCK 17#ifdef CONFIG_BLOCK
17 18
@@ -86,7 +87,15 @@ struct disk_stats {
86 unsigned long io_ticks; 87 unsigned long io_ticks;
87 unsigned long time_in_queue; 88 unsigned long time_in_queue;
88}; 89};
89 90
91#define PARTITION_META_INFO_VOLNAMELTH 64
92#define PARTITION_META_INFO_UUIDLTH 16
93
94struct partition_meta_info {
95 u8 uuid[PARTITION_META_INFO_UUIDLTH]; /* always big endian */
96 u8 volname[PARTITION_META_INFO_VOLNAMELTH];
97};
98
90struct hd_struct { 99struct hd_struct {
91 sector_t start_sect; 100 sector_t start_sect;
92 sector_t nr_sects; 101 sector_t nr_sects;
@@ -95,6 +104,7 @@ struct hd_struct {
95 struct device __dev; 104 struct device __dev;
96 struct kobject *holder_dir; 105 struct kobject *holder_dir;
97 int policy, partno; 106 int policy, partno;
107 struct partition_meta_info *info;
98#ifdef CONFIG_FAIL_MAKE_REQUEST 108#ifdef CONFIG_FAIL_MAKE_REQUEST
99 int make_it_fail; 109 int make_it_fail;
100#endif 110#endif
@@ -181,6 +191,30 @@ static inline struct gendisk *part_to_disk(struct hd_struct *part)
181 return NULL; 191 return NULL;
182} 192}
183 193
194static inline void part_pack_uuid(const u8 *uuid_str, u8 *to)
195{
196 int i;
197 for (i = 0; i < 16; ++i) {
198 *to++ = (hex_to_bin(*uuid_str) << 4) |
199 (hex_to_bin(*(uuid_str + 1)));
200 uuid_str += 2;
201 switch (i) {
202 case 3:
203 case 5:
204 case 7:
205 case 9:
206 uuid_str++;
207 continue;
208 }
209 }
210}
211
212static inline char *part_unpack_uuid(const u8 *uuid, char *out)
213{
214 sprintf(out, "%pU", uuid);
215 return out;
216}
217
184static inline int disk_max_parts(struct gendisk *disk) 218static inline int disk_max_parts(struct gendisk *disk)
185{ 219{
186 if (disk->flags & GENHD_FL_EXT_DEVT) 220 if (disk->flags & GENHD_FL_EXT_DEVT)
@@ -342,6 +376,19 @@ static inline int part_in_flight(struct hd_struct *part)
342 return part->in_flight[0] + part->in_flight[1]; 376 return part->in_flight[0] + part->in_flight[1];
343} 377}
344 378
379static inline struct partition_meta_info *alloc_part_info(struct gendisk *disk)
380{
381 if (disk)
382 return kzalloc_node(sizeof(struct partition_meta_info),
383 GFP_KERNEL, disk->node_id);
384 return kzalloc(sizeof(struct partition_meta_info), GFP_KERNEL);
385}
386
387static inline void free_part_info(struct hd_struct *part)
388{
389 kfree(part->info);
390}
391
345/* block/blk-core.c */ 392/* block/blk-core.c */
346extern void part_round_stats(int cpu, struct hd_struct *part); 393extern void part_round_stats(int cpu, struct hd_struct *part);
347 394
@@ -533,7 +580,9 @@ extern int disk_expand_part_tbl(struct gendisk *disk, int target);
533extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); 580extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev);
534extern struct hd_struct * __must_check add_partition(struct gendisk *disk, 581extern struct hd_struct * __must_check add_partition(struct gendisk *disk,
535 int partno, sector_t start, 582 int partno, sector_t start,
536 sector_t len, int flags); 583 sector_t len, int flags,
584 struct partition_meta_info
585 *info);
537extern void delete_partition(struct gendisk *, int); 586extern void delete_partition(struct gendisk *, int);
538extern void printk_all_partitions(void); 587extern void printk_all_partitions(void);
539 588
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 975609cb8548..e8713d55360a 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -9,6 +9,32 @@
9 9
10struct vm_area_struct; 10struct vm_area_struct;
11 11
12/* Plain integer GFP bitmasks. Do not use this directly. */
13#define ___GFP_DMA 0x01u
14#define ___GFP_HIGHMEM 0x02u
15#define ___GFP_DMA32 0x04u
16#define ___GFP_MOVABLE 0x08u
17#define ___GFP_WAIT 0x10u
18#define ___GFP_HIGH 0x20u
19#define ___GFP_IO 0x40u
20#define ___GFP_FS 0x80u
21#define ___GFP_COLD 0x100u
22#define ___GFP_NOWARN 0x200u
23#define ___GFP_REPEAT 0x400u
24#define ___GFP_NOFAIL 0x800u
25#define ___GFP_NORETRY 0x1000u
26#define ___GFP_COMP 0x4000u
27#define ___GFP_ZERO 0x8000u
28#define ___GFP_NOMEMALLOC 0x10000u
29#define ___GFP_HARDWALL 0x20000u
30#define ___GFP_THISNODE 0x40000u
31#define ___GFP_RECLAIMABLE 0x80000u
32#ifdef CONFIG_KMEMCHECK
33#define ___GFP_NOTRACK 0x200000u
34#else
35#define ___GFP_NOTRACK 0
36#endif
37
12/* 38/*
13 * GFP bitmasks.. 39 * GFP bitmasks..
14 * 40 *
@@ -18,10 +44,10 @@ struct vm_area_struct;
18 * without the underscores and use them consistently. The definitions here may 44 * without the underscores and use them consistently. The definitions here may
19 * be used in bit comparisons. 45 * be used in bit comparisons.
20 */ 46 */
21#define __GFP_DMA ((__force gfp_t)0x01u) 47#define __GFP_DMA ((__force gfp_t)___GFP_DMA)
22#define __GFP_HIGHMEM ((__force gfp_t)0x02u) 48#define __GFP_HIGHMEM ((__force gfp_t)___GFP_HIGHMEM)
23#define __GFP_DMA32 ((__force gfp_t)0x04u) 49#define __GFP_DMA32 ((__force gfp_t)___GFP_DMA32)
24#define __GFP_MOVABLE ((__force gfp_t)0x08u) /* Page is movable */ 50#define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* Page is movable */
25#define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) 51#define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE)
26/* 52/*
27 * Action modifiers - doesn't change the zoning 53 * Action modifiers - doesn't change the zoning
@@ -38,27 +64,22 @@ struct vm_area_struct;
38 * __GFP_MOVABLE: Flag that this page will be movable by the page migration 64 * __GFP_MOVABLE: Flag that this page will be movable by the page migration
39 * mechanism or reclaimed 65 * mechanism or reclaimed
40 */ 66 */
41#define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */ 67#define __GFP_WAIT ((__force gfp_t)___GFP_WAIT) /* Can wait and reschedule? */
42#define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */ 68#define __GFP_HIGH ((__force gfp_t)___GFP_HIGH) /* Should access emergency pools? */
43#define __GFP_IO ((__force gfp_t)0x40u) /* Can start physical IO? */ 69#define __GFP_IO ((__force gfp_t)___GFP_IO) /* Can start physical IO? */
44#define __GFP_FS ((__force gfp_t)0x80u) /* Can call down to low-level FS? */ 70#define __GFP_FS ((__force gfp_t)___GFP_FS) /* Can call down to low-level FS? */
45#define __GFP_COLD ((__force gfp_t)0x100u) /* Cache-cold page required */ 71#define __GFP_COLD ((__force gfp_t)___GFP_COLD) /* Cache-cold page required */
46#define __GFP_NOWARN ((__force gfp_t)0x200u) /* Suppress page allocation failure warning */ 72#define __GFP_NOWARN ((__force gfp_t)___GFP_NOWARN) /* Suppress page allocation failure warning */
47#define __GFP_REPEAT ((__force gfp_t)0x400u) /* See above */ 73#define __GFP_REPEAT ((__force gfp_t)___GFP_REPEAT) /* See above */
48#define __GFP_NOFAIL ((__force gfp_t)0x800u) /* See above */ 74#define __GFP_NOFAIL ((__force gfp_t)___GFP_NOFAIL) /* See above */
49#define __GFP_NORETRY ((__force gfp_t)0x1000u)/* See above */ 75#define __GFP_NORETRY ((__force gfp_t)___GFP_NORETRY) /* See above */
50#define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */ 76#define __GFP_COMP ((__force gfp_t)___GFP_COMP) /* Add compound page metadata */
51#define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ 77#define __GFP_ZERO ((__force gfp_t)___GFP_ZERO) /* Return zeroed page on success */
52#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ 78#define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) /* Don't use emergency reserves */
53#define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ 79#define __GFP_HARDWALL ((__force gfp_t)___GFP_HARDWALL) /* Enforce hardwall cpuset memory allocs */
54#define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ 80#define __GFP_THISNODE ((__force gfp_t)___GFP_THISNODE)/* No fallback, no policies */
55#define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ 81#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
56 82#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */
57#ifdef CONFIG_KMEMCHECK
58#define __GFP_NOTRACK ((__force gfp_t)0x200000u) /* Don't track with kmemcheck */
59#else
60#define __GFP_NOTRACK ((__force gfp_t)0)
61#endif
62 83
63/* 84/*
64 * This may seem redundant, but it's a way of annotating false positives vs. 85 * This may seem redundant, but it's a way of annotating false positives vs.
@@ -186,14 +207,14 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
186#endif 207#endif
187 208
188#define GFP_ZONE_TABLE ( \ 209#define GFP_ZONE_TABLE ( \
189 (ZONE_NORMAL << 0 * ZONES_SHIFT) \ 210 (ZONE_NORMAL << 0 * ZONES_SHIFT) \
190 | (OPT_ZONE_DMA << __GFP_DMA * ZONES_SHIFT) \ 211 | (OPT_ZONE_DMA << ___GFP_DMA * ZONES_SHIFT) \
191 | (OPT_ZONE_HIGHMEM << __GFP_HIGHMEM * ZONES_SHIFT) \ 212 | (OPT_ZONE_HIGHMEM << ___GFP_HIGHMEM * ZONES_SHIFT) \
192 | (OPT_ZONE_DMA32 << __GFP_DMA32 * ZONES_SHIFT) \ 213 | (OPT_ZONE_DMA32 << ___GFP_DMA32 * ZONES_SHIFT) \
193 | (ZONE_NORMAL << __GFP_MOVABLE * ZONES_SHIFT) \ 214 | (ZONE_NORMAL << ___GFP_MOVABLE * ZONES_SHIFT) \
194 | (OPT_ZONE_DMA << (__GFP_MOVABLE | __GFP_DMA) * ZONES_SHIFT) \ 215 | (OPT_ZONE_DMA << (___GFP_MOVABLE | ___GFP_DMA) * ZONES_SHIFT) \
195 | (ZONE_MOVABLE << (__GFP_MOVABLE | __GFP_HIGHMEM) * ZONES_SHIFT)\ 216 | (ZONE_MOVABLE << (___GFP_MOVABLE | ___GFP_HIGHMEM) * ZONES_SHIFT) \
196 | (OPT_ZONE_DMA32 << (__GFP_MOVABLE | __GFP_DMA32) * ZONES_SHIFT)\ 217 | (OPT_ZONE_DMA32 << (___GFP_MOVABLE | ___GFP_DMA32) * ZONES_SHIFT) \
197) 218)
198 219
199/* 220/*
@@ -203,20 +224,20 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
203 * allowed. 224 * allowed.
204 */ 225 */
205#define GFP_ZONE_BAD ( \ 226#define GFP_ZONE_BAD ( \
206 1 << (__GFP_DMA | __GFP_HIGHMEM) \ 227 1 << (___GFP_DMA | ___GFP_HIGHMEM) \
207 | 1 << (__GFP_DMA | __GFP_DMA32) \ 228 | 1 << (___GFP_DMA | ___GFP_DMA32) \
208 | 1 << (__GFP_DMA32 | __GFP_HIGHMEM) \ 229 | 1 << (___GFP_DMA32 | ___GFP_HIGHMEM) \
209 | 1 << (__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM) \ 230 | 1 << (___GFP_DMA | ___GFP_DMA32 | ___GFP_HIGHMEM) \
210 | 1 << (__GFP_MOVABLE | __GFP_HIGHMEM | __GFP_DMA) \ 231 | 1 << (___GFP_MOVABLE | ___GFP_HIGHMEM | ___GFP_DMA) \
211 | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA) \ 232 | 1 << (___GFP_MOVABLE | ___GFP_DMA32 | ___GFP_DMA) \
212 | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_HIGHMEM) \ 233 | 1 << (___GFP_MOVABLE | ___GFP_DMA32 | ___GFP_HIGHMEM) \
213 | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA | __GFP_HIGHMEM)\ 234 | 1 << (___GFP_MOVABLE | ___GFP_DMA32 | ___GFP_DMA | ___GFP_HIGHMEM) \
214) 235)
215 236
216static inline enum zone_type gfp_zone(gfp_t flags) 237static inline enum zone_type gfp_zone(gfp_t flags)
217{ 238{
218 enum zone_type z; 239 enum zone_type z;
219 int bit = flags & GFP_ZONEMASK; 240 int bit = (__force int) (flags & GFP_ZONEMASK);
220 241
221 z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) & 242 z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) &
222 ((1 << ZONES_SHIFT) - 1); 243 ((1 << ZONES_SHIFT) - 1);
diff --git a/include/linux/gpio-fan.h b/include/linux/gpio-fan.h
new file mode 100644
index 000000000000..096659169215
--- /dev/null
+++ b/include/linux/gpio-fan.h
@@ -0,0 +1,36 @@
1/*
2 * include/linux/gpio-fan.h
3 *
4 * Platform data structure for GPIO fan driver
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __LINUX_GPIO_FAN_H
12#define __LINUX_GPIO_FAN_H
13
14struct gpio_fan_alarm {
15 unsigned gpio;
16 unsigned active_low;
17};
18
19struct gpio_fan_speed {
20 int rpm;
21 int ctrl_val;
22};
23
24struct gpio_fan_platform_data {
25 int num_ctrl;
26 unsigned *ctrl; /* fan control GPIOs. */
27 struct gpio_fan_alarm *alarm; /* fan alarm GPIO. */
28 /*
29 * Speed conversion array: rpm from/to GPIO bit field.
30 * This array _must_ be sorted in ascending rpm order.
31 */
32 int num_speed;
33 struct gpio_fan_speed *speed;
34};
35
36#endif /* __LINUX_GPIO_FAN_H */
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 42a0f1d11365..bb0f56f5c01e 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -316,6 +316,7 @@ struct hid_item {
316#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 316#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
317#define HID_QUIRK_NO_INIT_REPORTS 0x20000000 317#define HID_QUIRK_NO_INIT_REPORTS 0x20000000
318#define HID_QUIRK_NO_IGNORE 0x40000000 318#define HID_QUIRK_NO_IGNORE 0x40000000
319#define HID_QUIRK_NO_INPUT_SYNC 0x80000000
319 320
320/* 321/*
321 * This is the global environment of the parser. This information is 322 * This is the global environment of the parser. This information is
@@ -626,8 +627,8 @@ struct hid_driver {
626 int (*event)(struct hid_device *hdev, struct hid_field *field, 627 int (*event)(struct hid_device *hdev, struct hid_field *field,
627 struct hid_usage *usage, __s32 value); 628 struct hid_usage *usage, __s32 value);
628 629
629 void (*report_fixup)(struct hid_device *hdev, __u8 *buf, 630 __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf,
630 unsigned int size); 631 unsigned int *size);
631 632
632 int (*input_mapping)(struct hid_device *hdev, 633 int (*input_mapping)(struct hid_device *hdev,
633 struct hid_input *hidinput, struct hid_field *field, 634 struct hid_input *hidinput, struct hid_field *field,
diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h
index bb6f58baf319..a3f481a3063b 100644
--- a/include/linux/hiddev.h
+++ b/include/linux/hiddev.h
@@ -226,8 +226,6 @@ void hiddev_disconnect(struct hid_device *);
226void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, 226void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
227 struct hid_usage *usage, __s32 value); 227 struct hid_usage *usage, __s32 value);
228void hiddev_report_event(struct hid_device *hid, struct hid_report *report); 228void hiddev_report_event(struct hid_device *hid, struct hid_report *report);
229int __init hiddev_init(void);
230void hiddev_exit(void);
231#else 229#else
232static inline int hiddev_connect(struct hid_device *hid, 230static inline int hiddev_connect(struct hid_device *hid,
233 unsigned int force) 231 unsigned int force)
@@ -236,8 +234,6 @@ static inline void hiddev_disconnect(struct hid_device *hid) { }
236static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, 234static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
237 struct hid_usage *usage, __s32 value) { } 235 struct hid_usage *usage, __s32 value) { }
238static inline void hiddev_report_event(struct hid_device *hid, struct hid_report *report) { } 236static inline void hiddev_report_event(struct hid_device *hid, struct hid_report *report) { }
239static inline int hiddev_init(void) { return 0; }
240static inline void hiddev_exit(void) { }
241#endif 237#endif
242 238
243#endif 239#endif
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index e3060ef85b6d..e9138198e823 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -28,18 +28,6 @@ static inline void invalidate_kernel_vmap_range(void *vaddr, int size)
28 28
29#include <asm/kmap_types.h> 29#include <asm/kmap_types.h>
30 30
31#ifdef CONFIG_DEBUG_HIGHMEM
32
33void debug_kmap_atomic(enum km_type type);
34
35#else
36
37static inline void debug_kmap_atomic(enum km_type type)
38{
39}
40
41#endif
42
43#ifdef CONFIG_HIGHMEM 31#ifdef CONFIG_HIGHMEM
44#include <asm/highmem.h> 32#include <asm/highmem.h>
45 33
@@ -66,19 +54,19 @@ static inline void kunmap(struct page *page)
66{ 54{
67} 55}
68 56
69static inline void *kmap_atomic(struct page *page, enum km_type idx) 57static inline void *__kmap_atomic(struct page *page)
70{ 58{
71 pagefault_disable(); 59 pagefault_disable();
72 return page_address(page); 60 return page_address(page);
73} 61}
74#define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) 62#define kmap_atomic_prot(page, prot) __kmap_atomic(page)
75 63
76static inline void kunmap_atomic_notypecheck(void *addr, enum km_type idx) 64static inline void __kunmap_atomic(void *addr)
77{ 65{
78 pagefault_enable(); 66 pagefault_enable();
79} 67}
80 68
81#define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) 69#define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn))
82#define kmap_atomic_to_page(ptr) virt_to_page(ptr) 70#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
83 71
84#define kmap_flush_unused() do {} while(0) 72#define kmap_flush_unused() do {} while(0)
@@ -86,12 +74,50 @@ static inline void kunmap_atomic_notypecheck(void *addr, enum km_type idx)
86 74
87#endif /* CONFIG_HIGHMEM */ 75#endif /* CONFIG_HIGHMEM */
88 76
89/* Prevent people trying to call kunmap_atomic() as if it were kunmap() */ 77#if defined(CONFIG_HIGHMEM) || defined(CONFIG_X86_32)
90/* kunmap_atomic() should get the return value of kmap_atomic, not the page. */ 78
91#define kunmap_atomic(addr, idx) do { \ 79DECLARE_PER_CPU(int, __kmap_atomic_idx);
92 BUILD_BUG_ON(__same_type((addr), struct page *)); \ 80
93 kunmap_atomic_notypecheck((addr), (idx)); \ 81static inline int kmap_atomic_idx_push(void)
94 } while (0) 82{
83 int idx = __get_cpu_var(__kmap_atomic_idx)++;
84#ifdef CONFIG_DEBUG_HIGHMEM
85 WARN_ON_ONCE(in_irq() && !irqs_disabled());
86 BUG_ON(idx > KM_TYPE_NR);
87#endif
88 return idx;
89}
90
91static inline int kmap_atomic_idx(void)
92{
93 return __get_cpu_var(__kmap_atomic_idx) - 1;
94}
95
96static inline int kmap_atomic_idx_pop(void)
97{
98 int idx = --__get_cpu_var(__kmap_atomic_idx);
99#ifdef CONFIG_DEBUG_HIGHMEM
100 BUG_ON(idx < 0);
101#endif
102 return idx;
103}
104
105#endif
106
107/*
108 * Make both: kmap_atomic(page, idx) and kmap_atomic(page) work.
109 */
110#define kmap_atomic(page, args...) __kmap_atomic(page)
111
112/*
113 * Prevent people trying to call kunmap_atomic() as if it were kunmap()
114 * kunmap_atomic() should get the return value of kmap_atomic, not the page.
115 */
116#define kunmap_atomic(addr, args...) \
117do { \
118 BUILD_BUG_ON(__same_type((addr), struct page *)); \
119 __kunmap_atomic(addr); \
120} while (0)
95 121
96/* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ 122/* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */
97#ifndef clear_user_highpage 123#ifndef clear_user_highpage
@@ -201,8 +227,8 @@ static inline void copy_user_highpage(struct page *to, struct page *from,
201 vfrom = kmap_atomic(from, KM_USER0); 227 vfrom = kmap_atomic(from, KM_USER0);
202 vto = kmap_atomic(to, KM_USER1); 228 vto = kmap_atomic(to, KM_USER1);
203 copy_user_page(vto, vfrom, vaddr, to); 229 copy_user_page(vto, vfrom, vaddr, to);
204 kunmap_atomic(vfrom, KM_USER0);
205 kunmap_atomic(vto, KM_USER1); 230 kunmap_atomic(vto, KM_USER1);
231 kunmap_atomic(vfrom, KM_USER0);
206} 232}
207 233
208#endif 234#endif
@@ -214,8 +240,8 @@ static inline void copy_highpage(struct page *to, struct page *from)
214 vfrom = kmap_atomic(from, KM_USER0); 240 vfrom = kmap_atomic(from, KM_USER0);
215 vto = kmap_atomic(to, KM_USER1); 241 vto = kmap_atomic(to, KM_USER1);
216 copy_page(vto, vfrom); 242 copy_page(vto, vfrom);
217 kunmap_atomic(vfrom, KM_USER0);
218 kunmap_atomic(vto, KM_USER1); 243 kunmap_atomic(vto, KM_USER1);
244 kunmap_atomic(vfrom, KM_USER0);
219} 245}
220 246
221#endif /* _LINUX_HIGHMEM_H */ 247#endif /* _LINUX_HIGHMEM_H */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index f479700df61b..943c76b3d4bb 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -43,7 +43,8 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to,
43 struct vm_area_struct *vma, 43 struct vm_area_struct *vma,
44 int acctflags); 44 int acctflags);
45void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); 45void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
46void __isolate_hwpoisoned_huge_page(struct page *page); 46int dequeue_hwpoisoned_huge_page(struct page *page);
47void copy_huge_page(struct page *dst, struct page *src);
47 48
48extern unsigned long hugepages_treat_as_movable; 49extern unsigned long hugepages_treat_as_movable;
49extern const unsigned long hugetlb_zero, hugetlb_infinity; 50extern const unsigned long hugetlb_zero, hugetlb_infinity;
@@ -101,7 +102,10 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
101#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) 102#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
102#define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; }) 103#define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; })
103#define huge_pte_offset(mm, address) 0 104#define huge_pte_offset(mm, address) 0
104#define __isolate_hwpoisoned_huge_page(page) 0 105#define dequeue_hwpoisoned_huge_page(page) 0
106static inline void copy_huge_page(struct page *dst, struct page *src)
107{
108}
105 109
106#define hugetlb_change_protection(vma, address, end, newprot) 110#define hugetlb_change_protection(vma, address, end, newprot)
107 111
@@ -228,6 +232,8 @@ struct huge_bootmem_page {
228 struct hstate *hstate; 232 struct hstate *hstate;
229}; 233};
230 234
235struct page *alloc_huge_page_node(struct hstate *h, int nid);
236
231/* arch callback */ 237/* arch callback */
232int __init alloc_bootmem_huge_page(struct hstate *h); 238int __init alloc_bootmem_huge_page(struct hstate *h);
233 239
@@ -301,8 +307,14 @@ static inline struct hstate *page_hstate(struct page *page)
301 return size_to_hstate(PAGE_SIZE << compound_order(page)); 307 return size_to_hstate(PAGE_SIZE << compound_order(page));
302} 308}
303 309
310static inline unsigned hstate_index_to_shift(unsigned index)
311{
312 return hstates[index].order + PAGE_SHIFT;
313}
314
304#else 315#else
305struct hstate {}; 316struct hstate {};
317#define alloc_huge_page_node(h, nid) NULL
306#define alloc_bootmem_huge_page(h) NULL 318#define alloc_bootmem_huge_page(h) NULL
307#define hstate_file(f) NULL 319#define hstate_file(f) NULL
308#define hstate_vma(v) NULL 320#define hstate_vma(v) NULL
@@ -317,6 +329,7 @@ static inline unsigned int pages_per_huge_page(struct hstate *h)
317{ 329{
318 return 1; 330 return 1;
319} 331}
332#define hstate_index_to_shift(index) 0
320#endif 333#endif
321 334
322#endif /* _LINUX_HUGETLB_H */ 335#endif /* _LINUX_HUGETLB_H */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 4bae0b72ed3c..1f66fa06a97c 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -384,11 +384,15 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
384 dev_set_drvdata(&dev->dev, data); 384 dev_set_drvdata(&dev->dev, data);
385} 385}
386 386
387static inline int i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) 387static inline struct i2c_adapter *
388i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
388{ 389{
389 return adapter->dev.parent != NULL 390 struct device *parent = adapter->dev.parent;
390 && adapter->dev.parent->bus == &i2c_bus_type 391
391 && adapter->dev.parent->type == &i2c_adapter_type; 392 if (parent != NULL && parent->type == &i2c_adapter_type)
393 return to_i2c_adapter(parent);
394 else
395 return NULL;
392} 396}
393 397
394/* Adapter locking functions, exported for shared pin cases */ 398/* Adapter locking functions, exported for shared pin cases */
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h
index 269181b8f623..3c5d6b6e765c 100644
--- a/include/linux/i2c/adp5588.h
+++ b/include/linux/i2c/adp5588.h
@@ -74,6 +74,20 @@
74 74
75#define ADP5588_DEVICE_ID_MASK 0xF 75#define ADP5588_DEVICE_ID_MASK 0xF
76 76
77 /* Configuration Register1 */
78#define ADP5588_AUTO_INC (1 << 7)
79#define ADP5588_GPIEM_CFG (1 << 6)
80#define ADP5588_INT_CFG (1 << 4)
81#define ADP5588_GPI_IEN (1 << 1)
82
83/* Interrupt Status Register */
84#define ADP5588_GPI_INT (1 << 1)
85#define ADP5588_KE_INT (1 << 0)
86
87#define ADP5588_MAXGPIO 18
88#define ADP5588_BANK(offs) ((offs) >> 3)
89#define ADP5588_BIT(offs) (1u << ((offs) & 0x7))
90
77/* Put one of these structures in i2c_board_info platform_data */ 91/* Put one of these structures in i2c_board_info platform_data */
78 92
79#define ADP5588_KEYMAPSIZE 80 93#define ADP5588_KEYMAPSIZE 80
@@ -126,9 +140,12 @@ struct adp5588_kpad_platform_data {
126 const struct adp5588_gpio_platform_data *gpio_data; 140 const struct adp5588_gpio_platform_data *gpio_data;
127}; 141};
128 142
143struct i2c_client; /* forward declaration */
144
129struct adp5588_gpio_platform_data { 145struct adp5588_gpio_platform_data {
130 unsigned gpio_start; /* GPIO Chip base # */ 146 int gpio_start; /* GPIO Chip base # */
131 unsigned pullup_dis_mask; /* Pull-Up Disable Mask */ 147 unsigned irq_base; /* interrupt base # */
148 unsigned pullup_dis_mask; /* Pull-Up Disable Mask */
132 int (*setup)(struct i2c_client *client, 149 int (*setup)(struct i2c_client *client,
133 int gpio, unsigned ngpio, 150 int gpio, unsigned ngpio,
134 void *context); 151 void *context);
diff --git a/include/linux/i2c/apds990x.h b/include/linux/i2c/apds990x.h
new file mode 100644
index 000000000000..d186fcc5d257
--- /dev/null
+++ b/include/linux/i2c/apds990x.h
@@ -0,0 +1,79 @@
1/*
2 * This file is part of the APDS990x sensor driver.
3 * Chip is combined proximity and ambient light sensor.
4 *
5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 *
7 * Contact: Samu Onkalo <samu.p.onkalo@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * 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 Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
25#ifndef __APDS990X_H__
26#define __APDS990X_H__
27
28
29#define APDS_IRLED_CURR_12mA 0x3
30#define APDS_IRLED_CURR_25mA 0x2
31#define APDS_IRLED_CURR_50mA 0x1
32#define APDS_IRLED_CURR_100mA 0x0
33
34/**
35 * struct apds990x_chip_factors - defines effect of the cover window
36 * @ga: Total glass attenuation
37 * @cf1: clear channel factor 1 for raw to lux conversion
38 * @irf1: IR channel factor 1 for raw to lux conversion
39 * @cf2: clear channel factor 2 for raw to lux conversion
40 * @irf2: IR channel factor 2 for raw to lux conversion
41 * @df: device factor for conversion formulas
42 *
43 * Structure for tuning ALS calculation to match with environment.
44 * Values depend on the material above the sensor and the sensor
45 * itself. If the GA is zero, driver will use uncovered sensor default values
46 * format: decimal value * APDS_PARAM_SCALE except df which is plain integer.
47 */
48#define APDS_PARAM_SCALE 4096
49struct apds990x_chip_factors {
50 int ga;
51 int cf1;
52 int irf1;
53 int cf2;
54 int irf2;
55 int df;
56};
57
58/**
59 * struct apds990x_platform_data - platform data for apsd990x.c driver
60 * @cf: chip factor data
61 * @pddrive: IR-led driving current
62 * @ppcount: number of IR pulses used for proximity estimation
63 * @setup_resources: interrupt line setup call back function
64 * @release_resources: interrupt line release call back function
65 *
66 * Proximity detection result depends heavily on correct ppcount, pdrive
67 * and cover window.
68 *
69 */
70
71struct apds990x_platform_data {
72 struct apds990x_chip_factors cf;
73 u8 pdrive;
74 u8 ppcount;
75 int (*setup_resources)(void);
76 int (*release_resources)(void);
77};
78
79#endif
diff --git a/include/linux/i2c/bh1770glc.h b/include/linux/i2c/bh1770glc.h
new file mode 100644
index 000000000000..8b5e2df36c72
--- /dev/null
+++ b/include/linux/i2c/bh1770glc.h
@@ -0,0 +1,53 @@
1/*
2 * This file is part of the ROHM BH1770GLC / OSRAM SFH7770 sensor driver.
3 * Chip is combined proximity and ambient light sensor.
4 *
5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 *
7 * Contact: Samu Onkalo <samu.p.onkalo@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * 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 Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
25#ifndef __BH1770_H__
26#define __BH1770_H__
27
28/**
29 * struct bh1770_platform_data - platform data for bh1770glc driver
30 * @led_def_curr: IR led driving current.
31 * @glass_attenuation: Attenuation factor for covering window.
32 * @setup_resources: Call back for interrupt line setup function
33 * @release_resources: Call back for interrupte line release function
34 *
35 * Example of glass attenuation: 16384 * 385 / 100 means attenuation factor
36 * of 3.85. i.e. light_above_sensor = light_above_cover_window / 3.85
37 */
38
39struct bh1770_platform_data {
40#define BH1770_LED_5mA 0
41#define BH1770_LED_10mA 1
42#define BH1770_LED_20mA 2
43#define BH1770_LED_50mA 3
44#define BH1770_LED_100mA 4
45#define BH1770_LED_150mA 5
46#define BH1770_LED_200mA 6
47 __u8 led_def_curr;
48#define BH1770_NEUTRAL_GA 16384 /* 16384 / 16384 = 1 */
49 __u32 glass_attenuation;
50 int (*setup_resources)(void);
51 int (*release_resources)(void);
52};
53#endif
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 6de90bfc6acd..4793d8a7f480 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -553,8 +553,12 @@ extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
553extern int twl4030_remove_script(u8 flags); 553extern int twl4030_remove_script(u8 flags);
554 554
555struct twl4030_codec_audio_data { 555struct twl4030_codec_audio_data {
556 unsigned int audio_mclk; 556 unsigned int audio_mclk; /* not used, will be removed */
557 unsigned int digimic_delay; /* in ms */
557 unsigned int ramp_delay_value; 558 unsigned int ramp_delay_value;
559 unsigned int offset_cncl_path;
560 unsigned int check_defaults:1;
561 unsigned int reset_registers:1;
558 unsigned int hs_extmute:1; 562 unsigned int hs_extmute:1;
559 void (*set_hs_extmute)(int mute); 563 void (*set_hs_extmute)(int mute);
560}; 564};
diff --git a/include/linux/idr.h b/include/linux/idr.h
index cdb715e58e3e..13a801f3d028 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -81,6 +81,7 @@ struct idr {
81#define _idr_rc_to_errno(rc) ((rc) == -1 ? -EAGAIN : -ENOSPC) 81#define _idr_rc_to_errno(rc) ((rc) == -1 ? -EAGAIN : -ENOSPC)
82 82
83/** 83/**
84 * DOC: idr sync
84 * idr synchronization (stolen from radix-tree.h) 85 * idr synchronization (stolen from radix-tree.h)
85 * 86 *
86 * idr_find() is able to be called locklessly, using RCU. The caller must 87 * idr_find() is able to be called locklessly, using RCU. The caller must
@@ -117,10 +118,13 @@ void idr_init(struct idr *idp);
117/* 118/*
118 * IDA - IDR based id allocator, use when translation from id to 119 * IDA - IDR based id allocator, use when translation from id to
119 * pointer isn't necessary. 120 * pointer isn't necessary.
121 *
122 * IDA_BITMAP_LONGS is calculated to be one less to accommodate
123 * ida_bitmap->nr_busy so that the whole struct fits in 128 bytes.
120 */ 124 */
121#define IDA_CHUNK_SIZE 128 /* 128 bytes per chunk */ 125#define IDA_CHUNK_SIZE 128 /* 128 bytes per chunk */
122#define IDA_BITMAP_LONGS (128 / sizeof(long) - 1) 126#define IDA_BITMAP_LONGS (IDA_CHUNK_SIZE / sizeof(long) - 1)
123#define IDA_BITMAP_BITS (IDA_BITMAP_LONGS * sizeof(long) * 8) 127#define IDA_BITMAP_BITS (IDA_BITMAP_LONGS * sizeof(long) * 8)
124 128
125struct ida_bitmap { 129struct ida_bitmap {
126 long nr_busy; 130 long nr_busy;
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 97b2eae6a22c..ed5a03cbe184 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -986,6 +986,7 @@ struct ieee80211_ht_info {
986#define WLAN_AUTH_OPEN 0 986#define WLAN_AUTH_OPEN 0
987#define WLAN_AUTH_SHARED_KEY 1 987#define WLAN_AUTH_SHARED_KEY 1
988#define WLAN_AUTH_FT 2 988#define WLAN_AUTH_FT 2
989#define WLAN_AUTH_SAE 3
989#define WLAN_AUTH_LEAP 128 990#define WLAN_AUTH_LEAP 128
990 991
991#define WLAN_AUTH_CHALLENGE_LEN 128 992#define WLAN_AUTH_CHALLENGE_LEN 128
@@ -1072,6 +1073,10 @@ enum ieee80211_statuscode {
1072 WLAN_STATUS_NO_DIRECT_LINK = 48, 1073 WLAN_STATUS_NO_DIRECT_LINK = 48,
1073 WLAN_STATUS_STA_NOT_PRESENT = 49, 1074 WLAN_STATUS_STA_NOT_PRESENT = 49,
1074 WLAN_STATUS_STA_NOT_QSTA = 50, 1075 WLAN_STATUS_STA_NOT_QSTA = 50,
1076 /* 802.11s */
1077 WLAN_STATUS_ANTI_CLOG_REQUIRED = 76,
1078 WLAN_STATUS_FCG_NOT_SUPP = 78,
1079 WLAN_STATUS_STA_NO_TBTT = 78,
1075}; 1080};
1076 1081
1077 1082
@@ -1112,6 +1117,22 @@ enum ieee80211_reasoncode {
1112 WLAN_REASON_QSTA_REQUIRE_SETUP = 38, 1117 WLAN_REASON_QSTA_REQUIRE_SETUP = 38,
1113 WLAN_REASON_QSTA_TIMEOUT = 39, 1118 WLAN_REASON_QSTA_TIMEOUT = 39,
1114 WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45, 1119 WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45,
1120 /* 802.11s */
1121 WLAN_REASON_MESH_PEER_CANCELED = 52,
1122 WLAN_REASON_MESH_MAX_PEERS = 53,
1123 WLAN_REASON_MESH_CONFIG = 54,
1124 WLAN_REASON_MESH_CLOSE = 55,
1125 WLAN_REASON_MESH_MAX_RETRIES = 56,
1126 WLAN_REASON_MESH_CONFIRM_TIMEOUT = 57,
1127 WLAN_REASON_MESH_INVALID_GTK = 58,
1128 WLAN_REASON_MESH_INCONSISTENT_PARAM = 59,
1129 WLAN_REASON_MESH_INVALID_SECURITY = 60,
1130 WLAN_REASON_MESH_PATH_ERROR = 61,
1131 WLAN_REASON_MESH_PATH_NOFORWARD = 62,
1132 WLAN_REASON_MESH_PATH_DEST_UNREACHABLE = 63,
1133 WLAN_REASON_MAC_EXISTS_IN_MBSS = 64,
1134 WLAN_REASON_MESH_CHAN_REGULATORY = 65,
1135 WLAN_REASON_MESH_CHAN = 66,
1115}; 1136};
1116 1137
1117 1138
@@ -1139,20 +1160,33 @@ enum ieee80211_eid {
1139 WLAN_EID_TS_DELAY = 43, 1160 WLAN_EID_TS_DELAY = 43,
1140 WLAN_EID_TCLAS_PROCESSING = 44, 1161 WLAN_EID_TCLAS_PROCESSING = 44,
1141 WLAN_EID_QOS_CAPA = 46, 1162 WLAN_EID_QOS_CAPA = 46,
1142 /* 802.11s 1163 /* 802.11s */
1143 * 1164 WLAN_EID_MESH_CONFIG = 113,
1144 * All mesh EID numbers are pending IEEE 802.11 ANA approval. 1165 WLAN_EID_MESH_ID = 114,
1145 * The numbers have been incremented from those suggested in 1166 WLAN_EID_LINK_METRIC_REPORT = 115,
1146 * 802.11s/D2.0 so that MESH_CONFIG does not conflict with 1167 WLAN_EID_CONGESTION_NOTIFICATION = 116,
1147 * EXT_SUPP_RATES. 1168 /* Note that the Peer Link IE has been replaced with the similar
1169 * Peer Management IE. We will keep the former definition until mesh
1170 * code is changed to comply with latest 802.11s drafts.
1148 */ 1171 */
1149 WLAN_EID_MESH_CONFIG = 51, 1172 WLAN_EID_PEER_LINK = 55, /* no longer in 802.11s drafts */
1150 WLAN_EID_MESH_ID = 52, 1173 WLAN_EID_PEER_MGMT = 117,
1151 WLAN_EID_PEER_LINK = 55, 1174 WLAN_EID_CHAN_SWITCH_PARAM = 118,
1152 WLAN_EID_PREQ = 68, 1175 WLAN_EID_MESH_AWAKE_WINDOW = 119,
1153 WLAN_EID_PREP = 69, 1176 WLAN_EID_BEACON_TIMING = 120,
1154 WLAN_EID_PERR = 70, 1177 WLAN_EID_MCCAOP_SETUP_REQ = 121,
1155 WLAN_EID_RANN = 49, /* compatible with FreeBSD */ 1178 WLAN_EID_MCCAOP_SETUP_RESP = 122,
1179 WLAN_EID_MCCAOP_ADVERT = 123,
1180 WLAN_EID_MCCAOP_TEARDOWN = 124,
1181 WLAN_EID_GANN = 125,
1182 WLAN_EID_RANN = 126,
1183 WLAN_EID_PREQ = 130,
1184 WLAN_EID_PREP = 131,
1185 WLAN_EID_PERR = 132,
1186 WLAN_EID_PXU = 137,
1187 WLAN_EID_PXUC = 138,
1188 WLAN_EID_AUTH_MESH_PEER_EXCH = 139,
1189 WLAN_EID_MIC = 140,
1156 1190
1157 WLAN_EID_PWR_CONSTRAINT = 32, 1191 WLAN_EID_PWR_CONSTRAINT = 32,
1158 WLAN_EID_PWR_CAPABILITY = 33, 1192 WLAN_EID_PWR_CAPABILITY = 33,
@@ -1211,9 +1245,14 @@ enum ieee80211_category {
1211 WLAN_CATEGORY_HT = 7, 1245 WLAN_CATEGORY_HT = 7,
1212 WLAN_CATEGORY_SA_QUERY = 8, 1246 WLAN_CATEGORY_SA_QUERY = 8,
1213 WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9, 1247 WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9,
1248 WLAN_CATEGORY_MESH_ACTION = 13,
1249 WLAN_CATEGORY_MULTIHOP_ACTION = 14,
1250 WLAN_CATEGORY_SELF_PROTECTED = 15,
1214 WLAN_CATEGORY_WMM = 17, 1251 WLAN_CATEGORY_WMM = 17,
1215 WLAN_CATEGORY_MESH_PLINK = 30, /* Pending ANA approval */ 1252 /* TODO: remove MESH_PLINK and MESH_PATH_SEL after */
1216 WLAN_CATEGORY_MESH_PATH_SEL = 32, /* Pending ANA approval */ 1253 /* mesh is updated to current 802.11s draft */
1254 WLAN_CATEGORY_MESH_PLINK = 30,
1255 WLAN_CATEGORY_MESH_PATH_SEL = 32,
1217 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, 1256 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
1218 WLAN_CATEGORY_VENDOR_SPECIFIC = 127, 1257 WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
1219}; 1258};
@@ -1351,6 +1390,8 @@ enum ieee80211_sa_query_action {
1351/* AKM suite selectors */ 1390/* AKM suite selectors */
1352#define WLAN_AKM_SUITE_8021X 0x000FAC01 1391#define WLAN_AKM_SUITE_8021X 0x000FAC01
1353#define WLAN_AKM_SUITE_PSK 0x000FAC02 1392#define WLAN_AKM_SUITE_PSK 0x000FAC02
1393#define WLAN_AKM_SUITE_SAE 0x000FAC08
1394#define WLAN_AKM_SUITE_FT_OVER_SAE 0x000FAC09
1354 1395
1355#define WLAN_MAX_KEY_LEN 32 1396#define WLAN_MAX_KEY_LEN 32
1356 1397
diff --git a/include/linux/if.h b/include/linux/if.h
index 53558ec59e1b..123959927745 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -75,6 +75,8 @@
75#define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */ 75#define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */
76#define IFF_MACVLAN_PORT 0x4000 /* device used as macvlan port */ 76#define IFF_MACVLAN_PORT 0x4000 /* device used as macvlan port */
77#define IFF_BRIDGE_PORT 0x8000 /* device used as bridge port */ 77#define IFF_BRIDGE_PORT 0x8000 /* device used as bridge port */
78#define IFF_OVS_DATAPATH 0x10000 /* device used as Open vSwitch
79 * datapath port */
78 80
79#define IF_GET_IFACE 0x0001 /* for querying only */ 81#define IF_GET_IFACE 0x0001 /* for querying only */
80#define IF_GET_PROTO 0x0002 82#define IF_GET_PROTO 0x0002
diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h
index 2c7994372bde..a17edda8a781 100644
--- a/include/linux/if_bonding.h
+++ b/include/linux/if_bonding.h
@@ -84,6 +84,9 @@
84#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */ 84#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */
85 85
86#define BOND_DEFAULT_TX_QUEUES 16 /* Default number of tx queues per device */ 86#define BOND_DEFAULT_TX_QUEUES 16 /* Default number of tx queues per device */
87
88#define BOND_DEFAULT_RESEND_IGMP 1 /* Default number of IGMP membership reports */
89
87/* hashing types */ 90/* hashing types */
88#define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */ 91#define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */
89#define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */ 92#define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index bed7a4682b90..f9c3df03db0f 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -137,8 +137,6 @@ extern struct ctl_table ether_table[];
137 137
138extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); 138extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
139 139
140#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
141
142#endif 140#endif
143 141
144#endif /* _LINUX_IF_ETHER_H */ 142#endif /* _LINUX_IF_ETHER_H */
diff --git a/include/linux/if_infiniband.h b/include/linux/if_infiniband.h
index 3e659ec7dfdd..7d958475d4ac 100644
--- a/include/linux/if_infiniband.h
+++ b/include/linux/if_infiniband.h
@@ -5,7 +5,7 @@
5 * <http://www.fsf.org/copyleft/gpl.html>, or the OpenIB.org BSD 5 * <http://www.fsf.org/copyleft/gpl.html>, or the OpenIB.org BSD
6 * license, available in the LICENSE.TXT file accompanying this 6 * license, available in the LICENSE.TXT file accompanying this
7 * software. These details are also available at 7 * software. These details are also available at
8 * <http://openib.org/license.html>. 8 * <http://www.openfabrics.org/software_license.htm>.
9 * 9 *
10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 11 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 35280b302290..8a2fd66a8b5f 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -40,6 +40,12 @@ struct macvlan_rx_stats {
40 unsigned long rx_errors; 40 unsigned long rx_errors;
41}; 41};
42 42
43/*
44 * Maximum times a macvtap device can be opened. This can be used to
45 * configure the number of receive queue, e.g. for multiqueue virtio.
46 */
47#define MAX_MACVTAP_QUEUES (NR_CPUS < 16 ? NR_CPUS : 16)
48
43struct macvlan_dev { 49struct macvlan_dev {
44 struct net_device *dev; 50 struct net_device *dev;
45 struct list_head list; 51 struct list_head list;
@@ -50,7 +56,8 @@ struct macvlan_dev {
50 enum macvlan_mode mode; 56 enum macvlan_mode mode;
51 int (*receive)(struct sk_buff *skb); 57 int (*receive)(struct sk_buff *skb);
52 int (*forward)(struct net_device *dev, struct sk_buff *skb); 58 int (*forward)(struct net_device *dev, struct sk_buff *skb);
53 struct macvtap_queue *tap; 59 struct macvtap_queue *taps[MAX_MACVTAP_QUEUES];
60 int numvtaps;
54}; 61};
55 62
56static inline void macvlan_count_rx(const struct macvlan_dev *vlan, 63static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 27741e05446f..397921b09ef9 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -40,25 +40,35 @@
40 * PPPoE addressing definition 40 * PPPoE addressing definition
41 */ 41 */
42typedef __be16 sid_t; 42typedef __be16 sid_t;
43struct pppoe_addr{ 43struct pppoe_addr {
44 sid_t sid; /* Session identifier */ 44 sid_t sid; /* Session identifier */
45 unsigned char remote[ETH_ALEN]; /* Remote address */ 45 unsigned char remote[ETH_ALEN]; /* Remote address */
46 char dev[IFNAMSIZ]; /* Local device to use */ 46 char dev[IFNAMSIZ]; /* Local device to use */
47}; 47};
48 48
49/************************************************************************ 49/************************************************************************
50 * Protocols supported by AF_PPPOX 50 * PPTP addressing definition
51 */ 51 */
52struct pptp_addr {
53 __be16 call_id;
54 struct in_addr sin_addr;
55};
56
57/************************************************************************
58 * Protocols supported by AF_PPPOX
59 */
52#define PX_PROTO_OE 0 /* Currently just PPPoE */ 60#define PX_PROTO_OE 0 /* Currently just PPPoE */
53#define PX_PROTO_OL2TP 1 /* Now L2TP also */ 61#define PX_PROTO_OL2TP 1 /* Now L2TP also */
54#define PX_MAX_PROTO 2 62#define PX_PROTO_PPTP 2
55 63#define PX_MAX_PROTO 3
56struct sockaddr_pppox { 64
57 sa_family_t sa_family; /* address family, AF_PPPOX */ 65struct sockaddr_pppox {
58 unsigned int sa_protocol; /* protocol identifier */ 66 sa_family_t sa_family; /* address family, AF_PPPOX */
59 union{ 67 unsigned int sa_protocol; /* protocol identifier */
60 struct pppoe_addr pppoe; 68 union {
61 }sa_addr; 69 struct pppoe_addr pppoe;
70 struct pptp_addr pptp;
71 } sa_addr;
62} __attribute__((packed)); 72} __attribute__((packed));
63 73
64/* The use of the above union isn't viable because the size of this 74/* The use of the above union isn't viable because the size of this
@@ -150,15 +160,23 @@ struct pppoe_opt {
150 relayed to (PPPoE relaying) */ 160 relayed to (PPPoE relaying) */
151}; 161};
152 162
163struct pptp_opt {
164 struct pptp_addr src_addr;
165 struct pptp_addr dst_addr;
166 u32 ack_sent, ack_recv;
167 u32 seq_sent, seq_recv;
168 int ppp_flags;
169};
153#include <net/sock.h> 170#include <net/sock.h>
154 171
155struct pppox_sock { 172struct pppox_sock {
156 /* struct sock must be the first member of pppox_sock */ 173 /* struct sock must be the first member of pppox_sock */
157 struct sock sk; 174 struct sock sk;
158 struct ppp_channel chan; 175 struct ppp_channel chan;
159 struct pppox_sock *next; /* for hash table */ 176 struct pppox_sock *next; /* for hash table */
160 union { 177 union {
161 struct pppoe_opt pppoe; 178 struct pppoe_opt pppoe;
179 struct pptp_opt pptp;
162 } proto; 180 } proto;
163 __be16 num; 181 __be16 num;
164}; 182};
@@ -186,7 +204,7 @@ struct pppox_proto {
186 struct module *owner; 204 struct module *owner;
187}; 205};
188 206
189extern int register_pppox_proto(int proto_num, struct pppox_proto *pp); 207extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp);
190extern void unregister_pppox_proto(int proto_num); 208extern void unregister_pppox_proto(int proto_num);
191extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ 209extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
192extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); 210extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 3d870fda8c4f..c2f3a72712ce 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -16,6 +16,7 @@
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17#include <linux/netdevice.h> 17#include <linux/netdevice.h>
18#include <linux/etherdevice.h> 18#include <linux/etherdevice.h>
19#include <linux/rtnetlink.h>
19 20
20#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header) 21#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header)
21 * that VLAN requires. 22 * that VLAN requires.
@@ -68,6 +69,7 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
68#define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */ 69#define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */
69#define VLAN_TAG_PRESENT VLAN_CFI_MASK 70#define VLAN_TAG_PRESENT VLAN_CFI_MASK
70#define VLAN_VID_MASK 0x0fff /* VLAN Identifier */ 71#define VLAN_VID_MASK 0x0fff /* VLAN Identifier */
72#define VLAN_N_VID 4096
71 73
72/* found in socket.c */ 74/* found in socket.c */
73extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); 75extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
@@ -76,9 +78,8 @@ extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
76 * depends on completely exhausting the VLAN identifier space. Thus 78 * depends on completely exhausting the VLAN identifier space. Thus
77 * it gives constant time look-up, but in many cases it wastes memory. 79 * it gives constant time look-up, but in many cases it wastes memory.
78 */ 80 */
79#define VLAN_GROUP_ARRAY_LEN 4096
80#define VLAN_GROUP_ARRAY_SPLIT_PARTS 8 81#define VLAN_GROUP_ARRAY_SPLIT_PARTS 8
81#define VLAN_GROUP_ARRAY_PART_LEN (VLAN_GROUP_ARRAY_LEN/VLAN_GROUP_ARRAY_SPLIT_PARTS) 82#define VLAN_GROUP_ARRAY_PART_LEN (VLAN_N_VID/VLAN_GROUP_ARRAY_SPLIT_PARTS)
82 83
83struct vlan_group { 84struct vlan_group {
84 struct net_device *real_dev; /* The ethernet(like) device 85 struct net_device *real_dev; /* The ethernet(like) device
@@ -114,12 +115,24 @@ static inline void vlan_group_set_device(struct vlan_group *vg,
114#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) 115#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
115 116
116#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 117#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
118/* Must be invoked with rcu_read_lock or with RTNL. */
119static inline struct net_device *vlan_find_dev(struct net_device *real_dev,
120 u16 vlan_id)
121{
122 struct vlan_group *grp = rcu_dereference_rtnl(real_dev->vlgrp);
123
124 if (grp)
125 return vlan_group_get_device(grp, vlan_id);
126
127 return NULL;
128}
129
117extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); 130extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
118extern u16 vlan_dev_vlan_id(const struct net_device *dev); 131extern u16 vlan_dev_vlan_id(const struct net_device *dev);
119 132
120extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, 133extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
121 u16 vlan_tci, int polling); 134 u16 vlan_tci, int polling);
122extern int vlan_hwaccel_do_receive(struct sk_buff *skb); 135extern bool vlan_hwaccel_do_receive(struct sk_buff **skb);
123extern gro_result_t 136extern gro_result_t
124vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, 137vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
125 unsigned int vlan_tci, struct sk_buff *skb); 138 unsigned int vlan_tci, struct sk_buff *skb);
@@ -128,6 +141,12 @@ vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
128 unsigned int vlan_tci); 141 unsigned int vlan_tci);
129 142
130#else 143#else
144static inline struct net_device *vlan_find_dev(struct net_device *real_dev,
145 u16 vlan_id)
146{
147 return NULL;
148}
149
131static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) 150static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
132{ 151{
133 BUG(); 152 BUG();
@@ -147,9 +166,11 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
147 return NET_XMIT_SUCCESS; 166 return NET_XMIT_SUCCESS;
148} 167}
149 168
150static inline int vlan_hwaccel_do_receive(struct sk_buff *skb) 169static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb)
151{ 170{
152 return 0; 171 if ((*skb)->vlan_tci & VLAN_VID_MASK)
172 (*skb)->pkt_type = PACKET_OTHERHOST;
173 return false;
153} 174}
154 175
155static inline gro_result_t 176static inline gro_result_t
diff --git a/include/linux/in.h b/include/linux/in.h
index 41d88a4689af..beeb6dee2b49 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -250,6 +250,25 @@ struct sockaddr_in {
250 250
251#ifdef __KERNEL__ 251#ifdef __KERNEL__
252 252
253#include <linux/errno.h>
254
255static inline int proto_ports_offset(int proto)
256{
257 switch (proto) {
258 case IPPROTO_TCP:
259 case IPPROTO_UDP:
260 case IPPROTO_DCCP:
261 case IPPROTO_ESP: /* SPI */
262 case IPPROTO_SCTP:
263 case IPPROTO_UDPLITE:
264 return 0;
265 case IPPROTO_AH: /* SPI */
266 return 4;
267 default:
268 return -EINVAL;
269 }
270}
271
253static inline bool ipv4_is_loopback(__be32 addr) 272static inline bool ipv4_is_loopback(__be32 addr)
254{ 273{
255 return (addr & htonl(0xff000000)) == htonl(0x7f000000); 274 return (addr & htonl(0xff000000)) == htonl(0x7f000000);
diff --git a/include/linux/in6.h b/include/linux/in6.h
index c4bf46f764bf..097a34b55560 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -268,6 +268,10 @@ struct in6_flowlabel_req {
268/* RFC5082: Generalized Ttl Security Mechanism */ 268/* RFC5082: Generalized Ttl Security Mechanism */
269#define IPV6_MINHOPCOUNT 73 269#define IPV6_MINHOPCOUNT 73
270 270
271#define IPV6_ORIGDSTADDR 74
272#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
273#define IPV6_TRANSPARENT 75
274
271/* 275/*
272 * Multicast Routing: 276 * Multicast Routing:
273 * see include/linux/mroute6.h. 277 * see include/linux/mroute6.h.
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 2be1a1a2beb9..ccd5b07d678d 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -9,6 +9,7 @@
9#include <linux/rcupdate.h> 9#include <linux/rcupdate.h>
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/sysctl.h> 11#include <linux/sysctl.h>
12#include <linux/rtnetlink.h>
12 13
13enum 14enum
14{ 15{
@@ -158,7 +159,12 @@ struct in_ifaddr {
158extern int register_inetaddr_notifier(struct notifier_block *nb); 159extern int register_inetaddr_notifier(struct notifier_block *nb);
159extern int unregister_inetaddr_notifier(struct notifier_block *nb); 160extern int unregister_inetaddr_notifier(struct notifier_block *nb);
160 161
161extern struct net_device *ip_dev_find(struct net *net, __be32 addr); 162extern struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref);
163static inline struct net_device *ip_dev_find(struct net *net, __be32 addr)
164{
165 return __ip_dev_find(net, addr, true);
166}
167
162extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); 168extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b);
163extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *); 169extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *);
164extern void devinet_init(void); 170extern void devinet_init(void);
@@ -198,14 +204,10 @@ static __inline__ int bad_mask(__be32 mask, __be32 addr)
198 204
199static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev) 205static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev)
200{ 206{
201 struct in_device *in_dev = dev->ip_ptr; 207 return rcu_dereference(dev->ip_ptr);
202 if (in_dev)
203 in_dev = rcu_dereference(in_dev);
204 return in_dev;
205} 208}
206 209
207static __inline__ struct in_device * 210static inline struct in_device *in_dev_get(const struct net_device *dev)
208in_dev_get(const struct net_device *dev)
209{ 211{
210 struct in_device *in_dev; 212 struct in_device *in_dev;
211 213
@@ -217,10 +219,9 @@ in_dev_get(const struct net_device *dev)
217 return in_dev; 219 return in_dev;
218} 220}
219 221
220static __inline__ struct in_device * 222static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev)
221__in_dev_get_rtnl(const struct net_device *dev)
222{ 223{
223 return (struct in_device*)dev->ip_ptr; 224 return rcu_dereference_check(dev->ip_ptr, lockdep_rtnl_is_held());
224} 225}
225 226
226extern void in_dev_finish_destroy(struct in_device *idev); 227extern void in_dev_finish_destroy(struct in_device *idev);
diff --git a/include/linux/init.h b/include/linux/init.h
index de994304e0bb..577671c55153 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -46,16 +46,23 @@
46#define __exitdata __section(.exit.data) 46#define __exitdata __section(.exit.data)
47#define __exit_call __used __section(.exitcall.exit) 47#define __exit_call __used __section(.exitcall.exit)
48 48
49/* modpost check for section mismatches during the kernel build. 49/*
50 * modpost check for section mismatches during the kernel build.
50 * A section mismatch happens when there are references from a 51 * A section mismatch happens when there are references from a
51 * code or data section to an init section (both code or data). 52 * code or data section to an init section (both code or data).
52 * The init sections are (for most archs) discarded by the kernel 53 * The init sections are (for most archs) discarded by the kernel
53 * when early init has completed so all such references are potential bugs. 54 * when early init has completed so all such references are potential bugs.
54 * For exit sections the same issue exists. 55 * For exit sections the same issue exists.
56 *
55 * The following markers are used for the cases where the reference to 57 * The following markers are used for the cases where the reference to
56 * the *init / *exit section (code or data) is valid and will teach 58 * the *init / *exit section (code or data) is valid and will teach
57 * modpost not to issue a warning. 59 * modpost not to issue a warning. Intended semantics is that a code or
58 * The markers follow same syntax rules as __init / __initdata. */ 60 * data tagged __ref* can reference code or data from init section without
61 * producing a warning (of course, no warning does not mean code is
62 * correct, so optimally document why the __ref is needed and why it's OK).
63 *
64 * The markers follow same syntax rules as __init / __initdata.
65 */
59#define __ref __section(.ref.text) noinline 66#define __ref __section(.ref.text) noinline
60#define __refdata __section(.ref.data) 67#define __refdata __section(.ref.data)
61#define __refconst __section(.ref.rodata) 68#define __refconst __section(.ref.rodata)
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 2fea6c8ef6ba..1f8c06ce0fa6 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -29,6 +29,8 @@ extern struct fs_struct init_fs;
29 .running = 0, \ 29 .running = 0, \
30 .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \ 30 .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \
31 }, \ 31 }, \
32 .cred_guard_mutex = \
33 __MUTEX_INITIALIZER(sig.cred_guard_mutex), \
32} 34}
33 35
34extern struct nsproxy init_nsproxy; 36extern struct nsproxy init_nsproxy;
@@ -145,8 +147,6 @@ extern struct cred init_cred;
145 .group_leader = &tsk, \ 147 .group_leader = &tsk, \
146 RCU_INIT_POINTER(.real_cred, &init_cred), \ 148 RCU_INIT_POINTER(.real_cred, &init_cred), \
147 RCU_INIT_POINTER(.cred, &init_cred), \ 149 RCU_INIT_POINTER(.cred, &init_cred), \
148 .cred_guard_mutex = \
149 __MUTEX_INITIALIZER(tsk.cred_guard_mutex), \
150 .comm = "swapper", \ 150 .comm = "swapper", \
151 .thread = INIT_THREAD, \ 151 .thread = INIT_THREAD, \
152 .fs = &init_fs, \ 152 .fs = &init_fs, \
diff --git a/include/linux/input.h b/include/linux/input.h
index d6ae1761be97..51af441f3a21 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -34,7 +34,7 @@ struct input_event {
34 * Protocol version. 34 * Protocol version.
35 */ 35 */
36 36
37#define EV_VERSION 0x010000 37#define EV_VERSION 0x010001
38 38
39/* 39/*
40 * IOCTLs (0x00 - 0x7f) 40 * IOCTLs (0x00 - 0x7f)
@@ -56,25 +56,50 @@ struct input_absinfo {
56 __s32 resolution; 56 __s32 resolution;
57}; 57};
58 58
59/**
60 * struct input_keymap_entry - used by EVIOCGKEYCODE/EVIOCSKEYCODE ioctls
61 * @scancode: scancode represented in machine-endian form.
62 * @len: length of the scancode that resides in @scancode buffer.
63 * @index: index in the keymap, may be used instead of scancode
64 * @flags: allows to specify how kernel should handle the request. For
65 * example, setting INPUT_KEYMAP_BY_INDEX flag indicates that kernel
66 * should perform lookup in keymap by @index instead of @scancode
67 * @keycode: key code assigned to this scancode
68 *
69 * The structure is used to retrieve and modify keymap data. Users have
70 * option of performing lookup either by @scancode itself or by @index
71 * in keymap entry. EVIOCGKEYCODE will also return scancode or index
72 * (depending on which element was used to perform lookup).
73 */
74struct input_keymap_entry {
75#define INPUT_KEYMAP_BY_INDEX (1 << 0)
76 __u8 flags;
77 __u8 len;
78 __u16 index;
79 __u32 keycode;
80 __u8 scancode[32];
81};
82
59#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ 83#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
60#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ 84#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
61#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */ 85#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */
62#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */ 86#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */
63#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */ 87
64#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */ 88#define EVIOCGKEYCODE _IOR('E', 0x04, struct input_keymap_entry) /* get keycode */
89#define EVIOCSKEYCODE _IOW('E', 0x04, struct input_keymap_entry) /* set keycode */
65 90
66#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ 91#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */
67#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ 92#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */
68#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ 93#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */
69 94
70#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ 95#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */
71#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ 96#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */
72#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ 97#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
73#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */ 98#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
74 99
75#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ 100#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */
76#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ 101#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */
77#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */ 102#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */
78 103
79#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */ 104#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */
80#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */ 105#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */
@@ -1088,13 +1113,13 @@ struct input_mt_slot {
1088 * @keycodemax: size of keycode table 1113 * @keycodemax: size of keycode table
1089 * @keycodesize: size of elements in keycode table 1114 * @keycodesize: size of elements in keycode table
1090 * @keycode: map of scancodes to keycodes for this device 1115 * @keycode: map of scancodes to keycodes for this device
1116 * @getkeycode: optional legacy method to retrieve current keymap.
1091 * @setkeycode: optional method to alter current keymap, used to implement 1117 * @setkeycode: optional method to alter current keymap, used to implement
1092 * sparse keymaps. If not supplied default mechanism will be used. 1118 * sparse keymaps. If not supplied default mechanism will be used.
1093 * The method is being called while holding event_lock and thus must 1119 * The method is being called while holding event_lock and thus must
1094 * not sleep 1120 * not sleep
1095 * @getkeycode: optional method to retrieve current keymap. If not supplied 1121 * @getkeycode_new: transition method
1096 * default mechanism will be used. The method is being called while 1122 * @setkeycode_new: transition method
1097 * holding event_lock and thus must not sleep
1098 * @ff: force feedback structure associated with the device if device 1123 * @ff: force feedback structure associated with the device if device
1099 * supports force feedback effects 1124 * supports force feedback effects
1100 * @repeat_key: stores key code of the last key pressed; used to implement 1125 * @repeat_key: stores key code of the last key pressed; used to implement
@@ -1168,10 +1193,16 @@ struct input_dev {
1168 unsigned int keycodemax; 1193 unsigned int keycodemax;
1169 unsigned int keycodesize; 1194 unsigned int keycodesize;
1170 void *keycode; 1195 void *keycode;
1196
1171 int (*setkeycode)(struct input_dev *dev, 1197 int (*setkeycode)(struct input_dev *dev,
1172 unsigned int scancode, unsigned int keycode); 1198 unsigned int scancode, unsigned int keycode);
1173 int (*getkeycode)(struct input_dev *dev, 1199 int (*getkeycode)(struct input_dev *dev,
1174 unsigned int scancode, unsigned int *keycode); 1200 unsigned int scancode, unsigned int *keycode);
1201 int (*setkeycode_new)(struct input_dev *dev,
1202 const struct input_keymap_entry *ke,
1203 unsigned int *old_keycode);
1204 int (*getkeycode_new)(struct input_dev *dev,
1205 struct input_keymap_entry *ke);
1175 1206
1176 struct ff_device *ff; 1207 struct ff_device *ff;
1177 1208
@@ -1478,10 +1509,12 @@ INPUT_GENERATE_ABS_ACCESSORS(fuzz, fuzz)
1478INPUT_GENERATE_ABS_ACCESSORS(flat, flat) 1509INPUT_GENERATE_ABS_ACCESSORS(flat, flat)
1479INPUT_GENERATE_ABS_ACCESSORS(res, resolution) 1510INPUT_GENERATE_ABS_ACCESSORS(res, resolution)
1480 1511
1481int input_get_keycode(struct input_dev *dev, 1512int input_scancode_to_scalar(const struct input_keymap_entry *ke,
1482 unsigned int scancode, unsigned int *keycode); 1513 unsigned int *scancode);
1514
1515int input_get_keycode(struct input_dev *dev, struct input_keymap_entry *ke);
1483int input_set_keycode(struct input_dev *dev, 1516int input_set_keycode(struct input_dev *dev,
1484 unsigned int scancode, unsigned int keycode); 1517 const struct input_keymap_entry *ke);
1485 1518
1486extern struct class input_class; 1519extern struct class input_class;
1487 1520
diff --git a/include/linux/input/bu21013.h b/include/linux/input/bu21013.h
new file mode 100644
index 000000000000..e470d387dd49
--- /dev/null
+++ b/include/linux/input/bu21013.h
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 * Author: Naveen Kumar G <naveen.gaddipati@stericsson.com> for ST-Ericsson
4 * License terms:GNU General Public License (GPL) version 2
5 */
6
7#ifndef _BU21013_H
8#define _BU21013_H
9
10/**
11 * struct bu21013_platform_device - Handle the platform data
12 * @cs_en: pointer to the cs enable function
13 * @cs_dis: pointer to the cs disable function
14 * @irq_read_val: pointer to read the pen irq value function
15 * @x_max_res: xmax resolution
16 * @y_max_res: ymax resolution
17 * @touch_x_max: touch x max
18 * @touch_y_max: touch y max
19 * @cs_pin: chip select pin
20 * @irq: irq pin
21 * @ext_clk: external clock flag
22 * @x_flip: x flip flag
23 * @y_flip: y flip flag
24 * @wakeup: wakeup flag
25 *
26 * This is used to handle the platform data
27 */
28struct bu21013_platform_device {
29 int (*cs_en)(int reset_pin);
30 int (*cs_dis)(int reset_pin);
31 int (*irq_read_val)(void);
32 int x_max_res;
33 int y_max_res;
34 int touch_x_max;
35 int touch_y_max;
36 unsigned int cs_pin;
37 unsigned int irq;
38 bool ext_clk;
39 bool x_flip;
40 bool y_flip;
41 bool wakeup;
42};
43
44#endif
diff --git a/include/linux/intel_mid_dma.h b/include/linux/intel_mid_dma.h
index d9d08b6269b6..10496bd24c5c 100644
--- a/include/linux/intel_mid_dma.h
+++ b/include/linux/intel_mid_dma.h
@@ -27,14 +27,7 @@
27 27
28#include <linux/dmaengine.h> 28#include <linux/dmaengine.h>
29 29
30/*DMA transaction width, src and dstn width would be same 30#define DMA_PREP_CIRCULAR_LIST (1 << 10)
31The DMA length must be width aligned,
32for 32 bit width the length must be 32 bit (4bytes) aligned only*/
33enum intel_mid_dma_width {
34 LNW_DMA_WIDTH_8BIT = 0x0,
35 LNW_DMA_WIDTH_16BIT = 0x1,
36 LNW_DMA_WIDTH_32BIT = 0x2,
37};
38 31
39/*DMA mode configurations*/ 32/*DMA mode configurations*/
40enum intel_mid_dma_mode { 33enum intel_mid_dma_mode {
@@ -69,18 +62,15 @@ enum intel_mid_dma_msize {
69 * @cfg_mode: DMA data transfer mode (per-per/mem-per/mem-mem) 62 * @cfg_mode: DMA data transfer mode (per-per/mem-per/mem-mem)
70 * @src_msize: Source DMA burst size 63 * @src_msize: Source DMA burst size
71 * @dst_msize: Dst DMA burst size 64 * @dst_msize: Dst DMA burst size
65 * @per_addr: Periphral address
72 * @device_instance: DMA peripheral device instance, we can have multiple 66 * @device_instance: DMA peripheral device instance, we can have multiple
73 * peripheral device connected to single DMAC 67 * peripheral device connected to single DMAC
74 */ 68 */
75struct intel_mid_dma_slave { 69struct intel_mid_dma_slave {
76 enum dma_data_direction dirn;
77 enum intel_mid_dma_width src_width; /*width of DMA src txn*/
78 enum intel_mid_dma_width dst_width; /*width of DMA dst txn*/
79 enum intel_mid_dma_hs_mode hs_mode; /*handshaking*/ 70 enum intel_mid_dma_hs_mode hs_mode; /*handshaking*/
80 enum intel_mid_dma_mode cfg_mode; /*mode configuration*/ 71 enum intel_mid_dma_mode cfg_mode; /*mode configuration*/
81 enum intel_mid_dma_msize src_msize; /*size if src burst*/
82 enum intel_mid_dma_msize dst_msize; /*size of dst burst*/
83 unsigned int device_instance; /*0, 1 for periphral instance*/ 72 unsigned int device_instance; /*0, 1 for periphral instance*/
73 struct dma_slave_config dma_slave;
84}; 74};
85 75
86#endif /*__INTEL_MID_DMA_H__*/ 76#endif /*__INTEL_MID_DMA_H__*/
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 07f741a075a7..79d0c4f6d071 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -416,7 +416,6 @@ static inline void __raise_softirq_irqoff(unsigned int nr)
416 416
417extern void raise_softirq_irqoff(unsigned int nr); 417extern void raise_softirq_irqoff(unsigned int nr);
418extern void raise_softirq(unsigned int nr); 418extern void raise_softirq(unsigned int nr);
419extern void wakeup_softirqd(void);
420 419
421/* This is the worklist that queues up per-cpu softirq work. 420/* This is the worklist that queues up per-cpu softirq work.
422 * 421 *
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index 7fb592793738..8cdcc2a199ad 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -81,8 +81,7 @@ io_mapping_free(struct io_mapping *mapping)
81/* Atomic map/unmap */ 81/* Atomic map/unmap */
82static inline void __iomem * 82static inline void __iomem *
83io_mapping_map_atomic_wc(struct io_mapping *mapping, 83io_mapping_map_atomic_wc(struct io_mapping *mapping,
84 unsigned long offset, 84 unsigned long offset)
85 int slot)
86{ 85{
87 resource_size_t phys_addr; 86 resource_size_t phys_addr;
88 unsigned long pfn; 87 unsigned long pfn;
@@ -90,13 +89,13 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping,
90 BUG_ON(offset >= mapping->size); 89 BUG_ON(offset >= mapping->size);
91 phys_addr = mapping->base + offset; 90 phys_addr = mapping->base + offset;
92 pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); 91 pfn = (unsigned long) (phys_addr >> PAGE_SHIFT);
93 return iomap_atomic_prot_pfn(pfn, slot, mapping->prot); 92 return iomap_atomic_prot_pfn(pfn, mapping->prot);
94} 93}
95 94
96static inline void 95static inline void
97io_mapping_unmap_atomic(void __iomem *vaddr, int slot) 96io_mapping_unmap_atomic(void __iomem *vaddr)
98{ 97{
99 iounmap_atomic(vaddr, slot); 98 iounmap_atomic(vaddr);
100} 99}
101 100
102static inline void __iomem * 101static inline void __iomem *
@@ -137,14 +136,13 @@ io_mapping_free(struct io_mapping *mapping)
137/* Atomic map/unmap */ 136/* Atomic map/unmap */
138static inline void __iomem * 137static inline void __iomem *
139io_mapping_map_atomic_wc(struct io_mapping *mapping, 138io_mapping_map_atomic_wc(struct io_mapping *mapping,
140 unsigned long offset, 139 unsigned long offset)
141 int slot)
142{ 140{
143 return ((char __force __iomem *) mapping) + offset; 141 return ((char __force __iomem *) mapping) + offset;
144} 142}
145 143
146static inline void 144static inline void
147io_mapping_unmap_atomic(void __iomem *vaddr, int slot) 145io_mapping_unmap_atomic(void __iomem *vaddr)
148{ 146{
149} 147}
150 148
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h
index 9708de265bb1..5f43a3b2e3ad 100644
--- a/include/linux/ip_vs.h
+++ b/include/linux/ip_vs.h
@@ -70,6 +70,7 @@
70 70
71/* 71/*
72 * IPVS Connection Flags 72 * IPVS Connection Flags
73 * Only flags 0..15 are sent to backup server
73 */ 74 */
74#define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */ 75#define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */
75#define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */ 76#define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */
@@ -88,9 +89,20 @@
88#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ 89#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */
89#define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */ 90#define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */
90 91
92/* Flags that are not sent to backup server start from bit 16 */
93#define IP_VS_CONN_F_NFCT (1 << 16) /* use netfilter conntrack */
94
95/* Connection flags from destination that can be changed by user space */
96#define IP_VS_CONN_F_DEST_MASK (IP_VS_CONN_F_FWD_MASK | \
97 IP_VS_CONN_F_ONE_PACKET | \
98 IP_VS_CONN_F_NFCT | \
99 0)
100
91#define IP_VS_SCHEDNAME_MAXLEN 16 101#define IP_VS_SCHEDNAME_MAXLEN 16
102#define IP_VS_PENAME_MAXLEN 16
92#define IP_VS_IFNAME_MAXLEN 16 103#define IP_VS_IFNAME_MAXLEN 16
93 104
105#define IP_VS_PEDATA_MAXLEN 255
94 106
95/* 107/*
96 * The struct ip_vs_service_user and struct ip_vs_dest_user are 108 * The struct ip_vs_service_user and struct ip_vs_dest_user are
@@ -324,6 +336,9 @@ enum {
324 IPVS_SVC_ATTR_NETMASK, /* persistent netmask */ 336 IPVS_SVC_ATTR_NETMASK, /* persistent netmask */
325 337
326 IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */ 338 IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */
339
340 IPVS_SVC_ATTR_PE_NAME, /* name of ct retriever */
341
327 __IPVS_SVC_ATTR_MAX, 342 __IPVS_SVC_ATTR_MAX,
328}; 343};
329 344
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index e62683ba88e6..8e429d0e0405 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -341,7 +341,9 @@ struct ipv6_pinfo {
341 odstopts:1, 341 odstopts:1,
342 rxflow:1, 342 rxflow:1,
343 rxtclass:1, 343 rxtclass:1,
344 rxpmtu:1; 344 rxpmtu:1,
345 rxorigdstaddr:1;
346 /* 2 bits hole */
345 } bits; 347 } bits;
346 __u16 all; 348 __u16 all;
347 } rxopt; 349 } rxopt;
diff --git a/include/linux/jhash.h b/include/linux/jhash.h
index 2a2f99fbcb16..ced1159fa4f2 100644
--- a/include/linux/jhash.h
+++ b/include/linux/jhash.h
@@ -116,7 +116,7 @@ static inline u32 jhash2(const u32 *k, u32 length, u32 initval)
116/* A special ultra-optimized versions that knows they are hashing exactly 116/* A special ultra-optimized versions that knows they are hashing exactly
117 * 3, 2 or 1 word(s). 117 * 3, 2 or 1 word(s).
118 * 118 *
119 * NOTE: In partilar the "c += length; __jhash_mix(a,b,c);" normally 119 * NOTE: In particular the "c += length; __jhash_mix(a,b,c);" normally
120 * done at the end is not done here. 120 * done at the end is not done here.
121 */ 121 */
122static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval) 122static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval)
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index b67cb180e6e9..7880f18e4b86 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -1,7 +1,7 @@
1#ifndef _LINUX_JUMP_LABEL_H 1#ifndef _LINUX_JUMP_LABEL_H
2#define _LINUX_JUMP_LABEL_H 2#define _LINUX_JUMP_LABEL_H
3 3
4#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_HAVE_ARCH_JUMP_LABEL) 4#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
5# include <asm/jump_label.h> 5# include <asm/jump_label.h>
6# define HAVE_JUMP_LABEL 6# define HAVE_JUMP_LABEL
7#endif 7#endif
@@ -18,6 +18,8 @@ struct module;
18extern struct jump_entry __start___jump_table[]; 18extern struct jump_entry __start___jump_table[];
19extern struct jump_entry __stop___jump_table[]; 19extern struct jump_entry __stop___jump_table[];
20 20
21extern void jump_label_lock(void);
22extern void jump_label_unlock(void);
21extern void arch_jump_label_transform(struct jump_entry *entry, 23extern void arch_jump_label_transform(struct jump_entry *entry,
22 enum jump_label_type type); 24 enum jump_label_type type);
23extern void arch_jump_label_text_poke_early(jump_label_t addr); 25extern void arch_jump_label_text_poke_early(jump_label_t addr);
@@ -59,6 +61,9 @@ static inline int jump_label_text_reserved(void *start, void *end)
59 return 0; 61 return 0;
60} 62}
61 63
64static inline void jump_label_lock(void) {}
65static inline void jump_label_unlock(void) {}
66
62#endif 67#endif
63 68
64#define COND_STMT(key, stmt) \ 69#define COND_STMT(key, stmt) \
diff --git a/include/linux/kdb.h b/include/linux/kdb.h
index ea6e5244ed3f..aadff7cc2b84 100644
--- a/include/linux/kdb.h
+++ b/include/linux/kdb.h
@@ -28,6 +28,41 @@ extern int kdb_poll_idx;
28extern int kdb_initial_cpu; 28extern int kdb_initial_cpu;
29extern atomic_t kdb_event; 29extern atomic_t kdb_event;
30 30
31/* Types and messages used for dynamically added kdb shell commands */
32
33#define KDB_MAXARGS 16 /* Maximum number of arguments to a function */
34
35typedef enum {
36 KDB_REPEAT_NONE = 0, /* Do not repeat this command */
37 KDB_REPEAT_NO_ARGS, /* Repeat the command without arguments */
38 KDB_REPEAT_WITH_ARGS, /* Repeat the command including its arguments */
39} kdb_repeat_t;
40
41typedef int (*kdb_func_t)(int, const char **);
42
43/* KDB return codes from a command or internal kdb function */
44#define KDB_NOTFOUND (-1)
45#define KDB_ARGCOUNT (-2)
46#define KDB_BADWIDTH (-3)
47#define KDB_BADRADIX (-4)
48#define KDB_NOTENV (-5)
49#define KDB_NOENVVALUE (-6)
50#define KDB_NOTIMP (-7)
51#define KDB_ENVFULL (-8)
52#define KDB_ENVBUFFULL (-9)
53#define KDB_TOOMANYBPT (-10)
54#define KDB_TOOMANYDBREGS (-11)
55#define KDB_DUPBPT (-12)
56#define KDB_BPTNOTFOUND (-13)
57#define KDB_BADMODE (-14)
58#define KDB_BADINT (-15)
59#define KDB_INVADDRFMT (-16)
60#define KDB_BADREG (-17)
61#define KDB_BADCPUNUM (-18)
62#define KDB_BADLENGTH (-19)
63#define KDB_NOBP (-20)
64#define KDB_BADADDR (-21)
65
31/* 66/*
32 * kdb_diemsg 67 * kdb_diemsg
33 * 68 *
@@ -104,10 +139,26 @@ int kdb_process_cpu(const struct task_struct *p)
104 139
105/* kdb access to register set for stack dumping */ 140/* kdb access to register set for stack dumping */
106extern struct pt_regs *kdb_current_regs; 141extern struct pt_regs *kdb_current_regs;
142#ifdef CONFIG_KALLSYMS
143extern const char *kdb_walk_kallsyms(loff_t *pos);
144#else /* ! CONFIG_KALLSYMS */
145static inline const char *kdb_walk_kallsyms(loff_t *pos)
146{
147 return NULL;
148}
149#endif /* ! CONFIG_KALLSYMS */
107 150
151/* Dynamic kdb shell command registration */
152extern int kdb_register(char *, kdb_func_t, char *, char *, short);
153extern int kdb_register_repeat(char *, kdb_func_t, char *, char *,
154 short, kdb_repeat_t);
155extern int kdb_unregister(char *);
108#else /* ! CONFIG_KGDB_KDB */ 156#else /* ! CONFIG_KGDB_KDB */
109#define kdb_printf(...) 157#define kdb_printf(...)
110#define kdb_init(x) 158#define kdb_init(x)
159#define kdb_register(...)
160#define kdb_register_repeat(...)
161#define kdb_uregister(x)
111#endif /* CONFIG_KGDB_KDB */ 162#endif /* CONFIG_KGDB_KDB */
112enum { 163enum {
113 KDB_NOT_INITIALIZED, 164 KDB_NOT_INITIALIZED,
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 1759ba5adce8..450092c1e35f 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -173,6 +173,11 @@ extern int _cond_resched(void);
173 (__x < 0) ? -__x : __x; \ 173 (__x < 0) ? -__x : __x; \
174 }) 174 })
175 175
176#define abs64(x) ({ \
177 s64 __x = (x); \
178 (__x < 0) ? -__x : __x; \
179 })
180
176#ifdef CONFIG_PROVE_LOCKING 181#ifdef CONFIG_PROVE_LOCKING
177void might_fault(void); 182void might_fault(void);
178#else 183#else
@@ -203,10 +208,10 @@ extern unsigned long simple_strtoul(const char *,char **,unsigned int);
203extern long simple_strtol(const char *,char **,unsigned int); 208extern long simple_strtol(const char *,char **,unsigned int);
204extern unsigned long long simple_strtoull(const char *,char **,unsigned int); 209extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
205extern long long simple_strtoll(const char *,char **,unsigned int); 210extern long long simple_strtoll(const char *,char **,unsigned int);
206extern int strict_strtoul(const char *, unsigned int, unsigned long *); 211extern int __must_check strict_strtoul(const char *, unsigned int, unsigned long *);
207extern int strict_strtol(const char *, unsigned int, long *); 212extern int __must_check strict_strtol(const char *, unsigned int, long *);
208extern int strict_strtoull(const char *, unsigned int, unsigned long long *); 213extern int __must_check strict_strtoull(const char *, unsigned int, unsigned long long *);
209extern int strict_strtoll(const char *, unsigned int, long long *); 214extern int __must_check strict_strtoll(const char *, unsigned int, long long *);
210extern int sprintf(char * buf, const char * fmt, ...) 215extern int sprintf(char * buf, const char * fmt, ...)
211 __attribute__ ((format (printf, 2, 3))); 216 __attribute__ ((format (printf, 2, 3)));
212extern int vsprintf(char *buf, const char *, va_list) 217extern int vsprintf(char *buf, const char *, va_list)
@@ -277,6 +282,11 @@ asmlinkage int vprintk(const char *fmt, va_list args)
277asmlinkage int printk(const char * fmt, ...) 282asmlinkage int printk(const char * fmt, ...)
278 __attribute__ ((format (printf, 1, 2))) __cold; 283 __attribute__ ((format (printf, 1, 2))) __cold;
279 284
285/*
286 * Please don't use printk_ratelimit(), because it shares ratelimiting state
287 * with all other unrelated printk_ratelimit() callsites. Instead use
288 * printk_ratelimited() or plain old __ratelimit().
289 */
280extern int __printk_ratelimit(const char *func); 290extern int __printk_ratelimit(const char *func);
281#define printk_ratelimit() __printk_ratelimit(__func__) 291#define printk_ratelimit() __printk_ratelimit(__func__)
282extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, 292extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
@@ -651,6 +661,34 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
651 (void) (&_max1 == &_max2); \ 661 (void) (&_max1 == &_max2); \
652 _max1 > _max2 ? _max1 : _max2; }) 662 _max1 > _max2 ? _max1 : _max2; })
653 663
664#define min3(x, y, z) ({ \
665 typeof(x) _min1 = (x); \
666 typeof(y) _min2 = (y); \
667 typeof(z) _min3 = (z); \
668 (void) (&_min1 == &_min2); \
669 (void) (&_min1 == &_min3); \
670 _min1 < _min2 ? (_min1 < _min3 ? _min1 : _min3) : \
671 (_min2 < _min3 ? _min2 : _min3); })
672
673#define max3(x, y, z) ({ \
674 typeof(x) _max1 = (x); \
675 typeof(y) _max2 = (y); \
676 typeof(z) _max3 = (z); \
677 (void) (&_max1 == &_max2); \
678 (void) (&_max1 == &_max3); \
679 _max1 > _max2 ? (_max1 > _max3 ? _max1 : _max3) : \
680 (_max2 > _max3 ? _max2 : _max3); })
681
682/**
683 * min_not_zero - return the minimum that is _not_ zero, unless both are zero
684 * @x: value1
685 * @y: value2
686 */
687#define min_not_zero(x, y) ({ \
688 typeof(x) __x = (x); \
689 typeof(y) __y = (y); \
690 __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); })
691
654/** 692/**
655 * clamp - return a value clamped to a given range with strict typechecking 693 * clamp - return a value clamped to a given range with strict typechecking
656 * @val: current value 694 * @val: current value
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index c059044bc6dc..ad54c846911b 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -33,6 +33,7 @@ struct kernel_stat {
33#ifndef CONFIG_GENERIC_HARDIRQS 33#ifndef CONFIG_GENERIC_HARDIRQS
34 unsigned int irqs[NR_IRQS]; 34 unsigned int irqs[NR_IRQS];
35#endif 35#endif
36 unsigned long irqs_sum;
36 unsigned int softirqs[NR_SOFTIRQS]; 37 unsigned int softirqs[NR_SOFTIRQS];
37}; 38};
38 39
@@ -54,6 +55,7 @@ static inline void kstat_incr_irqs_this_cpu(unsigned int irq,
54 struct irq_desc *desc) 55 struct irq_desc *desc)
55{ 56{
56 kstat_this_cpu.irqs[irq]++; 57 kstat_this_cpu.irqs[irq]++;
58 kstat_this_cpu.irqs_sum++;
57} 59}
58 60
59static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) 61static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
@@ -65,8 +67,9 @@ static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
65extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); 67extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu);
66#define kstat_irqs_this_cpu(DESC) \ 68#define kstat_irqs_this_cpu(DESC) \
67 ((DESC)->kstat_irqs[smp_processor_id()]) 69 ((DESC)->kstat_irqs[smp_processor_id()])
68#define kstat_incr_irqs_this_cpu(irqno, DESC) \ 70#define kstat_incr_irqs_this_cpu(irqno, DESC) do {\
69 ((DESC)->kstat_irqs[smp_processor_id()]++) 71 ((DESC)->kstat_irqs[smp_processor_id()]++);\
72 kstat_this_cpu.irqs_sum++; } while (0)
70 73
71#endif 74#endif
72 75
@@ -83,6 +86,7 @@ static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu)
83/* 86/*
84 * Number of interrupts per specific IRQ source, since bootup 87 * Number of interrupts per specific IRQ source, since bootup
85 */ 88 */
89#ifndef CONFIG_GENERIC_HARDIRQS
86static inline unsigned int kstat_irqs(unsigned int irq) 90static inline unsigned int kstat_irqs(unsigned int irq)
87{ 91{
88 unsigned int sum = 0; 92 unsigned int sum = 0;
@@ -93,7 +97,17 @@ static inline unsigned int kstat_irqs(unsigned int irq)
93 97
94 return sum; 98 return sum;
95} 99}
100#else
101extern unsigned int kstat_irqs(unsigned int irq);
102#endif
96 103
104/*
105 * Number of interrupts per cpu, since bootup
106 */
107static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu)
108{
109 return kstat_cpu(cpu).irqs_sum;
110}
97 111
98/* 112/*
99 * Lock/unlock the current runqueue - to extract task statistics: 113 * Lock/unlock the current runqueue - to extract task statistics:
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 62dbee554f60..10308c6a3d1c 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -172,7 +172,13 @@ struct kfifo_rec_ptr_2 __STRUCT_KFIFO_PTR(unsigned char, 2, void);
172 172
173 173
174static inline unsigned int __must_check 174static inline unsigned int __must_check
175__kfifo_must_check_helper(unsigned int val) 175__kfifo_uint_must_check_helper(unsigned int val)
176{
177 return val;
178}
179
180static inline int __must_check
181__kfifo_int_must_check_helper(int val)
176{ 182{
177 return val; 183 return val;
178} 184}
@@ -267,7 +273,7 @@ __kfifo_must_check_helper(unsigned int val)
267 * @fifo: address of the fifo to be used 273 * @fifo: address of the fifo to be used
268 */ 274 */
269#define kfifo_avail(fifo) \ 275#define kfifo_avail(fifo) \
270__kfifo_must_check_helper( \ 276__kfifo_uint_must_check_helper( \
271({ \ 277({ \
272 typeof((fifo) + 1) __tmpq = (fifo); \ 278 typeof((fifo) + 1) __tmpq = (fifo); \
273 const size_t __recsize = sizeof(*__tmpq->rectype); \ 279 const size_t __recsize = sizeof(*__tmpq->rectype); \
@@ -300,7 +306,7 @@ __kfifo_must_check_helper( \
300 * This function returns the size of the next fifo record in number of bytes. 306 * This function returns the size of the next fifo record in number of bytes.
301 */ 307 */
302#define kfifo_peek_len(fifo) \ 308#define kfifo_peek_len(fifo) \
303__kfifo_must_check_helper( \ 309__kfifo_uint_must_check_helper( \
304({ \ 310({ \
305 typeof((fifo) + 1) __tmp = (fifo); \ 311 typeof((fifo) + 1) __tmp = (fifo); \
306 const size_t __recsize = sizeof(*__tmp->rectype); \ 312 const size_t __recsize = sizeof(*__tmp->rectype); \
@@ -323,7 +329,7 @@ __kfifo_must_check_helper( \
323 * Return 0 if no error, otherwise an error code. 329 * Return 0 if no error, otherwise an error code.
324 */ 330 */
325#define kfifo_alloc(fifo, size, gfp_mask) \ 331#define kfifo_alloc(fifo, size, gfp_mask) \
326__kfifo_must_check_helper( \ 332__kfifo_int_must_check_helper( \
327({ \ 333({ \
328 typeof((fifo) + 1) __tmp = (fifo); \ 334 typeof((fifo) + 1) __tmp = (fifo); \
329 struct __kfifo *__kfifo = &__tmp->kfifo; \ 335 struct __kfifo *__kfifo = &__tmp->kfifo; \
@@ -419,7 +425,7 @@ __kfifo_must_check_helper( \
419 * writer, you don't need extra locking to use these macro. 425 * writer, you don't need extra locking to use these macro.
420 */ 426 */
421#define kfifo_get(fifo, val) \ 427#define kfifo_get(fifo, val) \
422__kfifo_must_check_helper( \ 428__kfifo_uint_must_check_helper( \
423({ \ 429({ \
424 typeof((fifo) + 1) __tmp = (fifo); \ 430 typeof((fifo) + 1) __tmp = (fifo); \
425 typeof((val) + 1) __val = (val); \ 431 typeof((val) + 1) __val = (val); \
@@ -460,7 +466,7 @@ __kfifo_must_check_helper( \
460 * writer, you don't need extra locking to use these macro. 466 * writer, you don't need extra locking to use these macro.
461 */ 467 */
462#define kfifo_peek(fifo, val) \ 468#define kfifo_peek(fifo, val) \
463__kfifo_must_check_helper( \ 469__kfifo_uint_must_check_helper( \
464({ \ 470({ \
465 typeof((fifo) + 1) __tmp = (fifo); \ 471 typeof((fifo) + 1) __tmp = (fifo); \
466 typeof((val) + 1) __val = (val); \ 472 typeof((val) + 1) __val = (val); \
@@ -552,7 +558,7 @@ __kfifo_must_check_helper( \
552 * writer, you don't need extra locking to use these macro. 558 * writer, you don't need extra locking to use these macro.
553 */ 559 */
554#define kfifo_out(fifo, buf, n) \ 560#define kfifo_out(fifo, buf, n) \
555__kfifo_must_check_helper( \ 561__kfifo_uint_must_check_helper( \
556({ \ 562({ \
557 typeof((fifo) + 1) __tmp = (fifo); \ 563 typeof((fifo) + 1) __tmp = (fifo); \
558 typeof((buf) + 1) __buf = (buf); \ 564 typeof((buf) + 1) __buf = (buf); \
@@ -580,7 +586,7 @@ __kfifo_must_check_helper( \
580 * copied. 586 * copied.
581 */ 587 */
582#define kfifo_out_spinlocked(fifo, buf, n, lock) \ 588#define kfifo_out_spinlocked(fifo, buf, n, lock) \
583__kfifo_must_check_helper( \ 589__kfifo_uint_must_check_helper( \
584({ \ 590({ \
585 unsigned long __flags; \ 591 unsigned long __flags; \
586 unsigned int __ret; \ 592 unsigned int __ret; \
@@ -609,7 +615,7 @@ __kfifo_must_check_helper( \
609 * writer, you don't need extra locking to use these macro. 615 * writer, you don't need extra locking to use these macro.
610 */ 616 */
611#define kfifo_from_user(fifo, from, len, copied) \ 617#define kfifo_from_user(fifo, from, len, copied) \
612__kfifo_must_check_helper( \ 618__kfifo_uint_must_check_helper( \
613({ \ 619({ \
614 typeof((fifo) + 1) __tmp = (fifo); \ 620 typeof((fifo) + 1) __tmp = (fifo); \
615 const void __user *__from = (from); \ 621 const void __user *__from = (from); \
@@ -637,7 +643,7 @@ __kfifo_must_check_helper( \
637 * writer, you don't need extra locking to use these macro. 643 * writer, you don't need extra locking to use these macro.
638 */ 644 */
639#define kfifo_to_user(fifo, to, len, copied) \ 645#define kfifo_to_user(fifo, to, len, copied) \
640__kfifo_must_check_helper( \ 646__kfifo_uint_must_check_helper( \
641({ \ 647({ \
642 typeof((fifo) + 1) __tmp = (fifo); \ 648 typeof((fifo) + 1) __tmp = (fifo); \
643 void __user *__to = (to); \ 649 void __user *__to = (to); \
@@ -764,7 +770,7 @@ __kfifo_must_check_helper( \
764 * writer, you don't need extra locking to use these macro. 770 * writer, you don't need extra locking to use these macro.
765 */ 771 */
766#define kfifo_out_peek(fifo, buf, n) \ 772#define kfifo_out_peek(fifo, buf, n) \
767__kfifo_must_check_helper( \ 773__kfifo_uint_must_check_helper( \
768({ \ 774({ \
769 typeof((fifo) + 1) __tmp = (fifo); \ 775 typeof((fifo) + 1) __tmp = (fifo); \
770 typeof((buf) + 1) __buf = (buf); \ 776 typeof((buf) + 1) __buf = (buf); \
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 7950a37a7146..8f6d12151048 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -191,6 +191,8 @@ static inline struct kobj_type *get_ktype(struct kobject *kobj)
191} 191}
192 192
193extern struct kobject *kset_find_obj(struct kset *, const char *); 193extern struct kobject *kset_find_obj(struct kset *, const char *);
194extern struct kobject *kset_find_obj_hinted(struct kset *, const char *,
195 struct kobject *);
194 196
195/* The global /sys/kernel/ kobject for people to chain off of */ 197/* The global /sys/kernel/ kobject for people to chain off of */
196extern struct kobject *kernel_kobj; 198extern struct kobject *kernel_kobj;
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 636fc381c897..919ae53adc5c 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -414,6 +414,14 @@ struct kvm_enable_cap {
414 __u8 pad[64]; 414 __u8 pad[64];
415}; 415};
416 416
417/* for KVM_PPC_GET_PVINFO */
418struct kvm_ppc_pvinfo {
419 /* out */
420 __u32 flags;
421 __u32 hcall[4];
422 __u8 pad[108];
423};
424
417#define KVMIO 0xAE 425#define KVMIO 0xAE
418 426
419/* 427/*
@@ -530,6 +538,8 @@ struct kvm_enable_cap {
530#ifdef __KVM_HAVE_XCRS 538#ifdef __KVM_HAVE_XCRS
531#define KVM_CAP_XCRS 56 539#define KVM_CAP_XCRS 56
532#endif 540#endif
541#define KVM_CAP_PPC_GET_PVINFO 57
542#define KVM_CAP_PPC_IRQ_LEVEL 58
533 543
534#ifdef KVM_CAP_IRQ_ROUTING 544#ifdef KVM_CAP_IRQ_ROUTING
535 545
@@ -664,6 +674,8 @@ struct kvm_clock_data {
664/* Available with KVM_CAP_PIT_STATE2 */ 674/* Available with KVM_CAP_PIT_STATE2 */
665#define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2) 675#define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2)
666#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2) 676#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2)
677/* Available with KVM_CAP_PPC_GET_PVINFO */
678#define KVM_PPC_GET_PVINFO _IOW(KVMIO, 0xa1, struct kvm_ppc_pvinfo)
667 679
668/* 680/*
669 * ioctls for vcpu fds 681 * ioctls for vcpu fds
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index ac740b26eb10..a0557422715e 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -36,9 +36,10 @@
36#define KVM_REQ_PENDING_TIMER 5 36#define KVM_REQ_PENDING_TIMER 5
37#define KVM_REQ_UNHALT 6 37#define KVM_REQ_UNHALT 6
38#define KVM_REQ_MMU_SYNC 7 38#define KVM_REQ_MMU_SYNC 7
39#define KVM_REQ_KVMCLOCK_UPDATE 8 39#define KVM_REQ_CLOCK_UPDATE 8
40#define KVM_REQ_KICK 9 40#define KVM_REQ_KICK 9
41#define KVM_REQ_DEACTIVATE_FPU 10 41#define KVM_REQ_DEACTIVATE_FPU 10
42#define KVM_REQ_EVENT 11
42 43
43#define KVM_USERSPACE_IRQ_SOURCE_ID 0 44#define KVM_USERSPACE_IRQ_SOURCE_ID 0
44 45
@@ -289,6 +290,9 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
289void kvm_disable_largepages(void); 290void kvm_disable_largepages(void);
290void kvm_arch_flush_shadow(struct kvm *kvm); 291void kvm_arch_flush_shadow(struct kvm *kvm);
291 292
293int gfn_to_page_many_atomic(struct kvm *kvm, gfn_t gfn, struct page **pages,
294 int nr_pages);
295
292struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); 296struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
293unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); 297unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn);
294void kvm_release_page_clean(struct page *page); 298void kvm_release_page_clean(struct page *page);
@@ -296,6 +300,8 @@ void kvm_release_page_dirty(struct page *page);
296void kvm_set_page_dirty(struct page *page); 300void kvm_set_page_dirty(struct page *page);
297void kvm_set_page_accessed(struct page *page); 301void kvm_set_page_accessed(struct page *page);
298 302
303pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr);
304pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn);
299pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); 305pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn);
300pfn_t gfn_to_pfn_memslot(struct kvm *kvm, 306pfn_t gfn_to_pfn_memslot(struct kvm *kvm,
301 struct kvm_memory_slot *slot, gfn_t gfn); 307 struct kvm_memory_slot *slot, gfn_t gfn);
@@ -477,8 +483,7 @@ int kvm_deassign_device(struct kvm *kvm,
477 struct kvm_assigned_dev_kernel *assigned_dev); 483 struct kvm_assigned_dev_kernel *assigned_dev);
478#else /* CONFIG_IOMMU_API */ 484#else /* CONFIG_IOMMU_API */
479static inline int kvm_iommu_map_pages(struct kvm *kvm, 485static inline int kvm_iommu_map_pages(struct kvm *kvm,
480 gfn_t base_gfn, 486 struct kvm_memory_slot *slot)
481 unsigned long npages)
482{ 487{
483 return 0; 488 return 0;
484} 489}
@@ -518,11 +523,22 @@ static inline void kvm_guest_exit(void)
518 current->flags &= ~PF_VCPU; 523 current->flags &= ~PF_VCPU;
519} 524}
520 525
526static inline unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot,
527 gfn_t gfn)
528{
529 return slot->userspace_addr + (gfn - slot->base_gfn) * PAGE_SIZE;
530}
531
521static inline gpa_t gfn_to_gpa(gfn_t gfn) 532static inline gpa_t gfn_to_gpa(gfn_t gfn)
522{ 533{
523 return (gpa_t)gfn << PAGE_SHIFT; 534 return (gpa_t)gfn << PAGE_SHIFT;
524} 535}
525 536
537static inline gfn_t gpa_to_gfn(gpa_t gpa)
538{
539 return (gfn_t)(gpa >> PAGE_SHIFT);
540}
541
526static inline hpa_t pfn_to_hpa(pfn_t pfn) 542static inline hpa_t pfn_to_hpa(pfn_t pfn)
527{ 543{
528 return (hpa_t)pfn << PAGE_SHIFT; 544 return (hpa_t)pfn << PAGE_SHIFT;
diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h
index d73109243fda..47a070b0520e 100644
--- a/include/linux/kvm_para.h
+++ b/include/linux/kvm_para.h
@@ -17,6 +17,8 @@
17 17
18#define KVM_HC_VAPIC_POLL_IRQ 1 18#define KVM_HC_VAPIC_POLL_IRQ 1
19#define KVM_HC_MMU_OP 2 19#define KVM_HC_MMU_OP 2
20#define KVM_HC_FEATURES 3
21#define KVM_HC_PPC_MAP_MAGIC_PAGE 4
20 22
21/* 23/*
22 * hypercalls use architecture specific 24 * hypercalls use architecture specific
@@ -24,11 +26,6 @@
24#include <asm/kvm_para.h> 26#include <asm/kvm_para.h>
25 27
26#ifdef __KERNEL__ 28#ifdef __KERNEL__
27#ifdef CONFIG_KVM_GUEST
28void __init kvm_guest_init(void);
29#else
30#define kvm_guest_init() do { } while (0)
31#endif
32 29
33static inline int kvm_para_has_feature(unsigned int feature) 30static inline int kvm_para_has_feature(unsigned int feature)
34{ 31{
diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h
index 0e8a346424bb..d4292c8431e0 100644
--- a/include/linux/lis3lv02d.h
+++ b/include/linux/lis3lv02d.h
@@ -1,6 +1,52 @@
1#ifndef __LIS3LV02D_H_ 1#ifndef __LIS3LV02D_H_
2#define __LIS3LV02D_H_ 2#define __LIS3LV02D_H_
3 3
4/**
5 * struct lis3lv02d_platform_data - lis3 chip family platform data
6 * @click_flags: Click detection unit configuration
7 * @click_thresh_x: Click detection unit x axis threshold
8 * @click_thresh_y: Click detection unit y axis threshold
9 * @click_thresh_z: Click detection unit z axis threshold
10 * @click_time_limit: Click detection unit time parameter
11 * @click_latency: Click detection unit latency parameter
12 * @click_window: Click detection unit window parameter
13 * @irq_cfg: On chip irq source and type configuration (click /
14 * data available / wake up, open drain, polarity)
15 * @irq_flags1: Additional irq triggering flags for irq channel 0
16 * @irq_flags2: Additional irq triggering flags for irq channel 1
17 * @duration1: Wake up unit 1 duration parameter
18 * @duration2: Wake up unit 2 duration parameter
19 * @wakeup_flags: Wake up unit 1 flags
20 * @wakeup_thresh: Wake up unit 1 threshold value
21 * @wakeup_flags2: Wake up unit 2 flags
22 * @wakeup_thresh2: Wake up unit 2 threshold value
23 * @hipass_ctrl: High pass filter control (enable / disable, cut off
24 * frequency)
25 * @axis_x: Sensor orientation remapping for x-axis
26 * @axis_y: Sensor orientation remapping for y-axis
27 * @axis_z: Sensor orientation remapping for z-axis
28 * @driver_features: Enable bits for different features. Disabled by default
29 * @default_rate: Default sampling rate. 0 means reset default
30 * @setup_resources: Interrupt line setup call back function
31 * @release_resources: Interrupt line release call back function
32 * @st_min_limits[3]: Selftest acceptance minimum values
33 * @st_max_limits[3]: Selftest acceptance maximum values
34 * @irq2: Irq line 2 number
35 *
36 * Platform data is used to setup the sensor chip. Meaning of the different
37 * chip features can be found from the data sheet. It is publicly available
38 * at www.st.com web pages. Currently the platform data is used
39 * only for the 8 bit device. The 8 bit device has two wake up / free fall
40 * detection units and click detection unit. There are plenty of ways to
41 * configure the chip which makes is quite hard to explain deeper meaning of
42 * the fields here. Behaviour of the detection blocks varies heavily depending
43 * on the configuration. For example, interrupt detection block can use high
44 * pass filtered data which makes it react to the changes in the acceleration.
45 * Irq_flags can be used to enable interrupt detection on the both edges.
46 * With proper chip configuration this produces interrupt when some trigger
47 * starts and when it goes away.
48 */
49
4struct lis3lv02d_platform_data { 50struct lis3lv02d_platform_data {
5 /* please note: the 'click' feature is only supported for 51 /* please note: the 'click' feature is only supported for
6 * LIS[32]02DL variants of the chip and will be ignored for 52 * LIS[32]02DL variants of the chip and will be ignored for
@@ -36,7 +82,10 @@ struct lis3lv02d_platform_data {
36#define LIS3_IRQ_OPEN_DRAIN (1 << 6) 82#define LIS3_IRQ_OPEN_DRAIN (1 << 6)
37#define LIS3_IRQ_ACTIVE_LOW (1 << 7) 83#define LIS3_IRQ_ACTIVE_LOW (1 << 7)
38 unsigned char irq_cfg; 84 unsigned char irq_cfg;
39 85 unsigned char irq_flags1; /* Additional irq edge / level flags */
86 unsigned char irq_flags2; /* Additional irq edge / level flags */
87 unsigned char duration1;
88 unsigned char duration2;
40#define LIS3_WAKEUP_X_LO (1 << 0) 89#define LIS3_WAKEUP_X_LO (1 << 0)
41#define LIS3_WAKEUP_X_HI (1 << 1) 90#define LIS3_WAKEUP_X_HI (1 << 1)
42#define LIS3_WAKEUP_Y_LO (1 << 2) 91#define LIS3_WAKEUP_Y_LO (1 << 2)
@@ -64,6 +113,10 @@ struct lis3lv02d_platform_data {
64 s8 axis_x; 113 s8 axis_x;
65 s8 axis_y; 114 s8 axis_y;
66 s8 axis_z; 115 s8 axis_z;
116#define LIS3_USE_REGULATOR_CTRL 0x01
117#define LIS3_USE_BLOCK_READ 0x02
118 u16 driver_features;
119 int default_rate;
67 int (*setup_resources)(void); 120 int (*setup_resources)(void);
68 int (*release_resources)(void); 121 int (*release_resources)(void);
69 /* Limits for selftest are specified in chip data sheet */ 122 /* Limits for selftest are specified in chip data sheet */
diff --git a/include/linux/list.h b/include/linux/list.h
index 88a000617d77..9a5f8a71810c 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -636,6 +636,12 @@ static inline void hlist_add_after(struct hlist_node *n,
636 next->next->pprev = &next->next; 636 next->next->pprev = &next->next;
637} 637}
638 638
639/* after that we'll appear to be on some hlist and hlist_del will work */
640static inline void hlist_add_fake(struct hlist_node *n)
641{
642 n->pprev = &n->next;
643}
644
639/* 645/*
640 * Move a list from one list head to another. Fixup the pprev 646 * Move a list from one list head to another. Fixup the pprev
641 * reference of the first entry if it exists. 647 * reference of the first entry if it exists.
diff --git a/include/linux/math64.h b/include/linux/math64.h
index c87f1528703a..23fcdfcba81b 100644
--- a/include/linux/math64.h
+++ b/include/linux/math64.h
@@ -35,6 +35,14 @@ static inline u64 div64_u64(u64 dividend, u64 divisor)
35 return dividend / divisor; 35 return dividend / divisor;
36} 36}
37 37
38/**
39 * div64_s64 - signed 64bit divide with 64bit divisor
40 */
41static inline s64 div64_s64(s64 dividend, s64 divisor)
42{
43 return dividend / divisor;
44}
45
38#elif BITS_PER_LONG == 32 46#elif BITS_PER_LONG == 32
39 47
40#ifndef div_u64_rem 48#ifndef div_u64_rem
@@ -53,6 +61,10 @@ extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder);
53extern u64 div64_u64(u64 dividend, u64 divisor); 61extern u64 div64_u64(u64 dividend, u64 divisor);
54#endif 62#endif
55 63
64#ifndef div64_s64
65extern s64 div64_s64(s64 dividend, s64 divisor);
66#endif
67
56#endif /* BITS_PER_LONG */ 68#endif /* BITS_PER_LONG */
57 69
58/** 70/**
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 85582e1bcee9..06c1fa0a5c7b 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -23,6 +23,8 @@
23struct memory_block { 23struct memory_block {
24 unsigned long phys_index; 24 unsigned long phys_index;
25 unsigned long state; 25 unsigned long state;
26 int section_count;
27
26 /* 28 /*
27 * This serializes all state change requests. It isn't 29 * This serializes all state change requests. It isn't
28 * held during creation because the control files are 30 * held during creation because the control files are
@@ -113,6 +115,8 @@ extern int memory_dev_init(void);
113extern int remove_memory_block(unsigned long, struct mem_section *, int); 115extern int remove_memory_block(unsigned long, struct mem_section *, int);
114extern int memory_notify(unsigned long val, void *v); 116extern int memory_notify(unsigned long val, void *v);
115extern int memory_isolate_notify(unsigned long val, void *v); 117extern int memory_isolate_notify(unsigned long val, void *v);
118extern struct memory_block *find_memory_block_hinted(struct mem_section *,
119 struct memory_block *);
116extern struct memory_block *find_memory_block(struct mem_section *); 120extern struct memory_block *find_memory_block(struct mem_section *);
117#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) 121#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
118enum mem_add_context { BOOT, HOTPLUG }; 122enum mem_add_context { BOOT, HOTPLUG };
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 864035fb8f8a..4307231bd22f 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -70,6 +70,10 @@ extern void online_page(struct page *page);
70extern int online_pages(unsigned long, unsigned long); 70extern int online_pages(unsigned long, unsigned long);
71extern void __offline_isolated_pages(unsigned long, unsigned long); 71extern void __offline_isolated_pages(unsigned long, unsigned long);
72 72
73#ifdef CONFIG_MEMORY_HOTREMOVE
74extern bool is_pageblock_removable_nolock(struct page *page);
75#endif /* CONFIG_MEMORY_HOTREMOVE */
76
73/* reasonably generic interface to expand the physical pages in a zone */ 77/* reasonably generic interface to expand the physical pages in a zone */
74extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, 78extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn,
75 unsigned long nr_pages); 79 unsigned long nr_pages);
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 7238231b8dd4..085527fb8261 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -14,6 +14,8 @@ extern int migrate_page(struct address_space *,
14 struct page *, struct page *); 14 struct page *, struct page *);
15extern int migrate_pages(struct list_head *l, new_page_t x, 15extern int migrate_pages(struct list_head *l, new_page_t x,
16 unsigned long private, int offlining); 16 unsigned long private, int offlining);
17extern int migrate_huge_pages(struct list_head *l, new_page_t x,
18 unsigned long private, int offlining);
17 19
18extern int fail_migrate_page(struct address_space *, 20extern int fail_migrate_page(struct address_space *,
19 struct page *, struct page *); 21 struct page *, struct page *);
@@ -23,12 +25,17 @@ extern int migrate_prep_local(void);
23extern int migrate_vmas(struct mm_struct *mm, 25extern int migrate_vmas(struct mm_struct *mm,
24 const nodemask_t *from, const nodemask_t *to, 26 const nodemask_t *from, const nodemask_t *to,
25 unsigned long flags); 27 unsigned long flags);
28extern void migrate_page_copy(struct page *newpage, struct page *page);
29extern int migrate_huge_page_move_mapping(struct address_space *mapping,
30 struct page *newpage, struct page *page);
26#else 31#else
27#define PAGE_MIGRATION 0 32#define PAGE_MIGRATION 0
28 33
29static inline void putback_lru_pages(struct list_head *l) {} 34static inline void putback_lru_pages(struct list_head *l) {}
30static inline int migrate_pages(struct list_head *l, new_page_t x, 35static inline int migrate_pages(struct list_head *l, new_page_t x,
31 unsigned long private, int offlining) { return -ENOSYS; } 36 unsigned long private, int offlining) { return -ENOSYS; }
37static inline int migrate_huge_pages(struct list_head *l, new_page_t x,
38 unsigned long private, int offlining) { return -ENOSYS; }
32 39
33static inline int migrate_prep(void) { return -ENOSYS; } 40static inline int migrate_prep(void) { return -ENOSYS; }
34static inline int migrate_prep_local(void) { return -ENOSYS; } 41static inline int migrate_prep_local(void) { return -ENOSYS; }
@@ -40,6 +47,15 @@ static inline int migrate_vmas(struct mm_struct *mm,
40 return -ENOSYS; 47 return -ENOSYS;
41} 48}
42 49
50static inline void migrate_page_copy(struct page *newpage,
51 struct page *page) {}
52
53static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
54 struct page *newpage, struct page *page)
55{
56 return -ENOSYS;
57}
58
43/* Possible settings for the migrate_page() method in address_operations */ 59/* Possible settings for the migrate_page() method in address_operations */
44#define migrate_page NULL 60#define migrate_page NULL
45#define fail_migrate_page NULL 61#define fail_migrate_page NULL
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 0f82293a82ed..9a18667c13cc 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -56,7 +56,9 @@ enum {
56 MLX4_CMD_QUERY_HCA = 0xb, 56 MLX4_CMD_QUERY_HCA = 0xb,
57 MLX4_CMD_QUERY_PORT = 0x43, 57 MLX4_CMD_QUERY_PORT = 0x43,
58 MLX4_CMD_SENSE_PORT = 0x4d, 58 MLX4_CMD_SENSE_PORT = 0x4d,
59 MLX4_CMD_HW_HEALTH_CHECK = 0x50,
59 MLX4_CMD_SET_PORT = 0xc, 60 MLX4_CMD_SET_PORT = 0xc,
61 MLX4_CMD_SET_NODE = 0x5a,
60 MLX4_CMD_ACCESS_DDR = 0x2e, 62 MLX4_CMD_ACCESS_DDR = 0x2e,
61 MLX4_CMD_MAP_ICM = 0xffa, 63 MLX4_CMD_MAP_ICM = 0xffa,
62 MLX4_CMD_UNMAP_ICM = 0xff9, 64 MLX4_CMD_UNMAP_ICM = 0xff9,
@@ -140,6 +142,7 @@ enum {
140 MLX4_SET_PORT_MAC_TABLE = 0x2, 142 MLX4_SET_PORT_MAC_TABLE = 0x2,
141 MLX4_SET_PORT_VLAN_TABLE = 0x3, 143 MLX4_SET_PORT_VLAN_TABLE = 0x3,
142 MLX4_SET_PORT_PRIO_MAP = 0x4, 144 MLX4_SET_PORT_PRIO_MAP = 0x4,
145 MLX4_SET_PORT_GID_TABLE = 0x5,
143}; 146};
144 147
145struct mlx4_dev; 148struct mlx4_dev;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 7a7f9c1e679a..a7b15bc7648e 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -67,7 +67,8 @@ enum {
67 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, 67 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18,
68 MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, 68 MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19,
69 MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, 69 MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20,
70 MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21 70 MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21,
71 MLX4_DEV_CAP_FLAG_IBOE = 1 << 30
71}; 72};
72 73
73enum { 74enum {
@@ -171,6 +172,10 @@ enum {
171 MLX4_NUM_FEXCH = 64 * 1024, 172 MLX4_NUM_FEXCH = 64 * 1024,
172}; 173};
173 174
175enum {
176 MLX4_MAX_FAST_REG_PAGES = 511,
177};
178
174static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) 179static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
175{ 180{
176 return (major << 32) | (minor << 16) | subminor; 181 return (major << 32) | (minor << 16) | subminor;
@@ -186,6 +191,10 @@ struct mlx4_caps {
186 int eth_mtu_cap[MLX4_MAX_PORTS + 1]; 191 int eth_mtu_cap[MLX4_MAX_PORTS + 1];
187 int gid_table_len[MLX4_MAX_PORTS + 1]; 192 int gid_table_len[MLX4_MAX_PORTS + 1];
188 int pkey_table_len[MLX4_MAX_PORTS + 1]; 193 int pkey_table_len[MLX4_MAX_PORTS + 1];
194 int trans_type[MLX4_MAX_PORTS + 1];
195 int vendor_oui[MLX4_MAX_PORTS + 1];
196 int wavelength[MLX4_MAX_PORTS + 1];
197 u64 trans_code[MLX4_MAX_PORTS + 1];
189 int local_ca_ack_delay; 198 int local_ca_ack_delay;
190 int num_uars; 199 int num_uars;
191 int bf_reg_size; 200 int bf_reg_size;
@@ -229,6 +238,8 @@ struct mlx4_caps {
229 u32 bmme_flags; 238 u32 bmme_flags;
230 u32 reserved_lkey; 239 u32 reserved_lkey;
231 u16 stat_rate_support; 240 u16 stat_rate_support;
241 int udp_rss;
242 int loopback_support;
232 u8 port_width_cap[MLX4_MAX_PORTS + 1]; 243 u8 port_width_cap[MLX4_MAX_PORTS + 1];
233 int max_gso_sz; 244 int max_gso_sz;
234 int reserved_qps_cnt[MLX4_NUM_QP_REGION]; 245 int reserved_qps_cnt[MLX4_NUM_QP_REGION];
@@ -373,6 +384,27 @@ struct mlx4_av {
373 u8 dgid[16]; 384 u8 dgid[16];
374}; 385};
375 386
387struct mlx4_eth_av {
388 __be32 port_pd;
389 u8 reserved1;
390 u8 smac_idx;
391 u16 reserved2;
392 u8 reserved3;
393 u8 gid_index;
394 u8 stat_rate;
395 u8 hop_limit;
396 __be32 sl_tclass_flowlabel;
397 u8 dgid[16];
398 u32 reserved4[2];
399 __be16 vlan;
400 u8 mac[6];
401};
402
403union mlx4_ext_av {
404 struct mlx4_av ib;
405 struct mlx4_eth_av eth;
406};
407
376struct mlx4_dev { 408struct mlx4_dev {
377 struct pci_dev *pdev; 409 struct pci_dev *pdev;
378 unsigned long flags; 410 unsigned long flags;
@@ -401,6 +433,12 @@ struct mlx4_init_port_param {
401 if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \ 433 if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \
402 ~(dev)->caps.port_mask) & 1 << ((port) - 1)) 434 ~(dev)->caps.port_mask) & 1 << ((port) - 1))
403 435
436#define mlx4_foreach_ib_transport_port(port, dev) \
437 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
438 if (((dev)->caps.port_mask & 1 << ((port) - 1)) || \
439 ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE))
440
441
404int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, 442int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
405 struct mlx4_buf *buf); 443 struct mlx4_buf *buf);
406void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); 444void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf);
@@ -468,6 +506,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]);
468int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index); 506int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index);
469void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index); 507void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index);
470 508
509int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
471int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 510int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
472void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index); 511void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index);
473 512
@@ -480,5 +519,6 @@ void mlx4_fmr_unmap(struct mlx4_dev *dev, struct mlx4_fmr *fmr,
480 u32 *lkey, u32 *rkey); 519 u32 *lkey, u32 *rkey);
481int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr); 520int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr);
482int mlx4_SYNC_TPT(struct mlx4_dev *dev); 521int mlx4_SYNC_TPT(struct mlx4_dev *dev);
522int mlx4_test_interrupts(struct mlx4_dev *dev);
483 523
484#endif /* MLX4_DEVICE_H */ 524#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h
index 53c5fdb6eac4..f407cd4bfb34 100644
--- a/include/linux/mlx4/driver.h
+++ b/include/linux/mlx4/driver.h
@@ -44,15 +44,24 @@ enum mlx4_dev_event {
44 MLX4_DEV_EVENT_PORT_REINIT, 44 MLX4_DEV_EVENT_PORT_REINIT,
45}; 45};
46 46
47enum mlx4_protocol {
48 MLX4_PROTOCOL_IB,
49 MLX4_PROTOCOL_EN,
50};
51
47struct mlx4_interface { 52struct mlx4_interface {
48 void * (*add) (struct mlx4_dev *dev); 53 void * (*add) (struct mlx4_dev *dev);
49 void (*remove)(struct mlx4_dev *dev, void *context); 54 void (*remove)(struct mlx4_dev *dev, void *context);
50 void (*event) (struct mlx4_dev *dev, void *context, 55 void (*event) (struct mlx4_dev *dev, void *context,
51 enum mlx4_dev_event event, int port); 56 enum mlx4_dev_event event, int port);
57 void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port);
52 struct list_head list; 58 struct list_head list;
59 enum mlx4_protocol protocol;
53}; 60};
54 61
55int mlx4_register_interface(struct mlx4_interface *intf); 62int mlx4_register_interface(struct mlx4_interface *intf);
56void mlx4_unregister_interface(struct mlx4_interface *intf); 63void mlx4_unregister_interface(struct mlx4_interface *intf);
57 64
65void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port);
66
58#endif /* MLX4_DRIVER_H */ 67#endif /* MLX4_DRIVER_H */
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 7abe64326f72..0eeb2a1a867c 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -109,10 +109,11 @@ struct mlx4_qp_path {
109 __be32 tclass_flowlabel; 109 __be32 tclass_flowlabel;
110 u8 rgid[16]; 110 u8 rgid[16];
111 u8 sched_queue; 111 u8 sched_queue;
112 u8 snooper_flags; 112 u8 vlan_index;
113 u8 reserved3[2]; 113 u8 reserved3[2];
114 u8 counter_index; 114 u8 counter_index;
115 u8 reserved4[7]; 115 u8 reserved4;
116 u8 dmac[6];
116}; 117};
117 118
118struct mlx4_qp_context { 119struct mlx4_qp_context {
@@ -166,6 +167,7 @@ enum {
166 MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, 167 MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5,
167 MLX4_WQE_CTRL_INS_VLAN = 1 << 6, 168 MLX4_WQE_CTRL_INS_VLAN = 1 << 6,
168 MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7, 169 MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7,
170 MLX4_WQE_CTRL_FORCE_LOOPBACK = 1 << 0,
169}; 171};
170 172
171struct mlx4_wqe_ctrl_seg { 173struct mlx4_wqe_ctrl_seg {
@@ -219,7 +221,8 @@ struct mlx4_wqe_datagram_seg {
219 __be32 av[8]; 221 __be32 av[8];
220 __be32 dqpn; 222 __be32 dqpn;
221 __be32 qkey; 223 __be32 qkey;
222 __be32 reservd[2]; 224 __be16 vlan;
225 u8 mac[6];
223}; 226};
224 227
225struct mlx4_wqe_lso_seg { 228struct mlx4_wqe_lso_seg {
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7687228dd3b7..721f451c3029 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -144,6 +144,7 @@ extern pgprot_t protection_map[16];
144#define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ 144#define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */
145#define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ 145#define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */
146#define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ 146#define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */
147#define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */
147 148
148/* 149/*
149 * This interface is used by x86 PAT code to identify a pfn mapping that is 150 * This interface is used by x86 PAT code to identify a pfn mapping that is
@@ -497,8 +498,8 @@ static inline void set_compound_order(struct page *page, unsigned long order)
497#define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) 498#define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0))
498#define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) 499#define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0))
499 500
500/* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allcator */ 501/* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */
501#ifdef NODE_NOT_IN_PAGEFLAGS 502#ifdef NODE_NOT_IN_PAGE_FLAGS
502#define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT) 503#define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT)
503#define ZONEID_PGOFF ((SECTIONS_PGOFF < ZONES_PGOFF)? \ 504#define ZONEID_PGOFF ((SECTIONS_PGOFF < ZONES_PGOFF)? \
504 SECTIONS_PGOFF : ZONES_PGOFF) 505 SECTIONS_PGOFF : ZONES_PGOFF)
@@ -718,12 +719,21 @@ static inline int page_mapped(struct page *page)
718#define VM_FAULT_SIGBUS 0x0002 719#define VM_FAULT_SIGBUS 0x0002
719#define VM_FAULT_MAJOR 0x0004 720#define VM_FAULT_MAJOR 0x0004
720#define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */ 721#define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */
721#define VM_FAULT_HWPOISON 0x0010 /* Hit poisoned page */ 722#define VM_FAULT_HWPOISON 0x0010 /* Hit poisoned small page */
723#define VM_FAULT_HWPOISON_LARGE 0x0020 /* Hit poisoned large page. Index encoded in upper bits */
722 724
723#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ 725#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */
724#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ 726#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */
727#define VM_FAULT_RETRY 0x0400 /* ->fault blocked, must retry */
728
729#define VM_FAULT_HWPOISON_LARGE_MASK 0xf000 /* encodes hpage index for large hwpoison */
730
731#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON | \
732 VM_FAULT_HWPOISON_LARGE)
725 733
726#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON) 734/* Encode hstate index for a hwpoisoned large page */
735#define VM_FAULT_SET_HINDEX(x) ((x) << 12)
736#define VM_FAULT_GET_HINDEX(x) (((x) >> 12) & 0xf)
727 737
728/* 738/*
729 * Can be called by the pagefault handler when it gets a VM_FAULT_OOM. 739 * Can be called by the pagefault handler when it gets a VM_FAULT_OOM.
@@ -860,6 +870,7 @@ int __set_page_dirty_no_writeback(struct page *page);
860int redirty_page_for_writepage(struct writeback_control *wbc, 870int redirty_page_for_writepage(struct writeback_control *wbc,
861 struct page *page); 871 struct page *page);
862void account_page_dirtied(struct page *page, struct address_space *mapping); 872void account_page_dirtied(struct page *page, struct address_space *mapping);
873void account_page_writeback(struct page *page);
863int set_page_dirty(struct page *page); 874int set_page_dirty(struct page *page);
864int set_page_dirty_lock(struct page *page); 875int set_page_dirty_lock(struct page *page);
865int clear_page_dirty_for_io(struct page *page); 876int clear_page_dirty_for_io(struct page *page);
@@ -1023,7 +1034,15 @@ extern void unregister_shrinker(struct shrinker *);
1023 1034
1024int vma_wants_writenotify(struct vm_area_struct *vma); 1035int vma_wants_writenotify(struct vm_area_struct *vma);
1025 1036
1026extern pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl); 1037extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
1038 spinlock_t **ptl);
1039static inline pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr,
1040 spinlock_t **ptl)
1041{
1042 pte_t *ptep;
1043 __cond_lock(*ptl, ptep = __get_locked_pte(mm, addr, ptl));
1044 return ptep;
1045}
1027 1046
1028#ifdef __PAGETABLE_PUD_FOLDED 1047#ifdef __PAGETABLE_PUD_FOLDED
1029static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, 1048static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd,
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index cb57d657ce4d..bb7288a782fd 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -310,6 +310,8 @@ struct mm_struct {
310#ifdef CONFIG_MMU_NOTIFIER 310#ifdef CONFIG_MMU_NOTIFIER
311 struct mmu_notifier_mm *mmu_notifier_mm; 311 struct mmu_notifier_mm *mmu_notifier_mm;
312#endif 312#endif
313 /* How many tasks sharing this mm are OOM_DISABLE */
314 atomic_t oom_disable_count;
313}; 315};
314 316
315/* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ 317/* Future-safe accessor for struct mm_struct's cpu_vm_mask. */
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index 33b2ea09a4ad..a36ab3bc7b03 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -18,6 +18,7 @@
18#define SDIO_CLASS_PHS 0x06 /* PHS standard interface */ 18#define SDIO_CLASS_PHS 0x06 /* PHS standard interface */
19#define SDIO_CLASS_WLAN 0x07 /* WLAN interface */ 19#define SDIO_CLASS_WLAN 0x07 /* WLAN interface */
20#define SDIO_CLASS_ATA 0x08 /* Embedded SDIO-ATA std interface */ 20#define SDIO_CLASS_ATA 0x08 /* Embedded SDIO-ATA std interface */
21#define SDIO_CLASS_BT_AMP 0x09 /* Type-A Bluetooth AMP interface */
21 22
22/* 23/*
23 * Vendors and devices. Sort key: vendor first, device next. 24 * Vendors and devices. Sort key: vendor first, device next.
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 3984c4eb41fd..39c24ebe9cfd 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -104,6 +104,8 @@ enum zone_stat_item {
104 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ 104 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */
105 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ 105 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */
106 NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */ 106 NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */
107 NR_DIRTIED, /* page dirtyings since bootup */
108 NR_WRITTEN, /* page writings since bootup */
107#ifdef CONFIG_NUMA 109#ifdef CONFIG_NUMA
108 NUMA_HIT, /* allocated in intended node */ 110 NUMA_HIT, /* allocated in intended node */
109 NUMA_MISS, /* allocated in non intended node */ 111 NUMA_MISS, /* allocated in non intended node */
@@ -421,6 +423,9 @@ struct zone {
421typedef enum { 423typedef enum {
422 ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */ 424 ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */
423 ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */ 425 ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */
426 ZONE_CONGESTED, /* zone has many dirty pages backed by
427 * a congested BDI
428 */
424} zone_flags_t; 429} zone_flags_t;
425 430
426static inline void zone_set_flag(struct zone *zone, zone_flags_t flag) 431static inline void zone_set_flag(struct zone *zone, zone_flags_t flag)
@@ -438,6 +443,11 @@ static inline void zone_clear_flag(struct zone *zone, zone_flags_t flag)
438 clear_bit(flag, &zone->flags); 443 clear_bit(flag, &zone->flags);
439} 444}
440 445
446static inline int zone_is_reclaim_congested(const struct zone *zone)
447{
448 return test_bit(ZONE_CONGESTED, &zone->flags);
449}
450
441static inline int zone_is_reclaim_locked(const struct zone *zone) 451static inline int zone_is_reclaim_locked(const struct zone *zone)
442{ 452{
443 return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); 453 return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags);
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 9d2f1837b3d8..112adf8bd47d 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -21,8 +21,8 @@
21#define __module_cat(a,b) ___module_cat(a,b) 21#define __module_cat(a,b) ___module_cat(a,b)
22#define __MODULE_INFO(tag, name, info) \ 22#define __MODULE_INFO(tag, name, info) \
23static const char __module_cat(name,__LINE__)[] \ 23static const char __module_cat(name,__LINE__)[] \
24 __used \ 24 __used __attribute__((section(".modinfo"), unused, aligned(1))) \
25 __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info 25 = __stringify(tag) "=" info
26#else /* !MODULE */ 26#else /* !MODULE */
27#define __MODULE_INFO(tag, name, info) 27#define __MODULE_INFO(tag, name, info)
28#endif 28#endif
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index fa04b246c9ae..0fa7a3a874c8 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -213,6 +213,7 @@ struct mfc_cache {
213 unsigned char ttls[MAXVIFS]; /* TTL thresholds */ 213 unsigned char ttls[MAXVIFS]; /* TTL thresholds */
214 } res; 214 } res;
215 } mfc_un; 215 } mfc_un;
216 struct rcu_head rcu;
216}; 217};
217 218
218#define MFC_STATIC 1 219#define MFC_STATIC 1
diff --git a/include/linux/mtio.h b/include/linux/mtio.h
index ef01d6aa5934..8f825756c459 100644
--- a/include/linux/mtio.h
+++ b/include/linux/mtio.h
@@ -63,6 +63,7 @@ struct mtop {
63#define MTCOMPRESSION 32/* control compression with SCSI mode page 15 */ 63#define MTCOMPRESSION 32/* control compression with SCSI mode page 15 */
64#define MTSETPART 33 /* Change the active tape partition */ 64#define MTSETPART 33 /* Change the active tape partition */
65#define MTMKPART 34 /* Format the tape with one or two partitions */ 65#define MTMKPART 34 /* Format the tape with one or two partitions */
66#define MTWEOFI 35 /* write an end-of-file record (mark) in immediate mode */
66 67
67/* structure for MTIOCGET - mag tape get status command */ 68/* structure for MTIOCGET - mag tape get status command */
68 69
diff --git a/include/linux/n_r3964.h b/include/linux/n_r3964.h
index de24af79ebd3..54b8e0d8d916 100644
--- a/include/linux/n_r3964.h
+++ b/include/linux/n_r3964.h
@@ -4,7 +4,6 @@
4 * Copyright by 4 * Copyright by
5 * Philips Automation Projects 5 * Philips Automation Projects
6 * Kassel (Germany) 6 * Kassel (Germany)
7 * http://www.pap-philips.de
8 * ----------------------------------------------------------- 7 * -----------------------------------------------------------
9 * This software may be used and distributed according to the terms of 8 * This software may be used and distributed according to the terms of
10 * the GNU General Public License, incorporated herein by reference. 9 * the GNU General Public License, incorporated herein by reference.
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 4522aed00906..ef663061d5ac 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -241,34 +241,6 @@ int ncp_mmap(struct file *, struct vm_area_struct *);
241/* linux/fs/ncpfs/ncplib_kernel.c */ 241/* linux/fs/ncpfs/ncplib_kernel.c */
242int ncp_make_closed(struct inode *); 242int ncp_make_closed(struct inode *);
243 243
244#define ncp_namespace(i) (NCP_SERVER(i)->name_space[NCP_FINFO(i)->volNumber])
245
246static inline int ncp_preserve_entry_case(struct inode *i, __u32 nscreator)
247{
248#ifdef CONFIG_NCPFS_SMALLDOS
249 int ns = ncp_namespace(i);
250
251 if ((ns == NW_NS_DOS)
252#ifdef CONFIG_NCPFS_OS2_NS
253 || ((ns == NW_NS_OS2) && (nscreator == NW_NS_DOS))
254#endif /* CONFIG_NCPFS_OS2_NS */
255 )
256 return 0;
257#endif /* CONFIG_NCPFS_SMALLDOS */
258 return 1;
259}
260
261#define ncp_preserve_case(i) (ncp_namespace(i) != NW_NS_DOS)
262
263static inline int ncp_case_sensitive(struct inode *i)
264{
265#ifdef CONFIG_NCPFS_NFS_NS
266 return ncp_namespace(i) == NW_NS_NFS;
267#else
268 return 0;
269#endif /* CONFIG_NCPFS_NFS_NS */
270}
271
272#endif /* __KERNEL__ */ 244#endif /* __KERNEL__ */
273 245
274#endif /* _LINUX_NCP_FS_H */ 246#endif /* _LINUX_NCP_FS_H */
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h
index 8da05bc098ca..d64b0e894336 100644
--- a/include/linux/ncp_fs_sb.h
+++ b/include/linux/ncp_fs_sb.h
@@ -62,6 +62,7 @@ struct ncp_server {
62 int ncp_reply_size; 62 int ncp_reply_size;
63 63
64 int root_setuped; 64 int root_setuped;
65 struct mutex root_setup_lock;
65 66
66 /* info for packet signing */ 67 /* info for packet signing */
67 int sign_wanted; /* 1=Server needs signed packets */ 68 int sign_wanted; /* 1=Server needs signed packets */
@@ -81,13 +82,14 @@ struct ncp_server {
81 size_t len; 82 size_t len;
82 void* data; 83 void* data;
83 } priv; 84 } priv;
85 struct rw_semaphore auth_rwsem;
84 86
85 /* nls info: codepage for volume and charset for I/O */ 87 /* nls info: codepage for volume and charset for I/O */
86 struct nls_table *nls_vol; 88 struct nls_table *nls_vol;
87 struct nls_table *nls_io; 89 struct nls_table *nls_io;
88 90
89 /* maximum age in jiffies */ 91 /* maximum age in jiffies */
90 int dentry_ttl; 92 atomic_t dentry_ttl;
91 93
92 /* miscellaneous */ 94 /* miscellaneous */
93 unsigned int flags; 95 unsigned int flags;
diff --git a/include/linux/net.h b/include/linux/net.h
index dee0b11a8759..16faa130088c 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -229,6 +229,8 @@ enum {
229extern int sock_wake_async(struct socket *sk, int how, int band); 229extern int sock_wake_async(struct socket *sk, int how, int band);
230extern int sock_register(const struct net_proto_family *fam); 230extern int sock_register(const struct net_proto_family *fam);
231extern void sock_unregister(int family); 231extern void sock_unregister(int family);
232extern int __sock_create(struct net *net, int family, int type, int proto,
233 struct socket **res, int kern);
232extern int sock_create(int family, int type, int proto, 234extern int sock_create(int family, int type, int proto,
233 struct socket **res); 235 struct socket **res);
234extern int sock_create_kern(int family, int type, int proto, 236extern int sock_create_kern(int family, int type, int proto,
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 46c36ffe20ee..072652d94d9f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -228,9 +228,9 @@ struct netdev_hw_addr {
228#define NETDEV_HW_ADDR_T_SLAVE 3 228#define NETDEV_HW_ADDR_T_SLAVE 3
229#define NETDEV_HW_ADDR_T_UNICAST 4 229#define NETDEV_HW_ADDR_T_UNICAST 4
230#define NETDEV_HW_ADDR_T_MULTICAST 5 230#define NETDEV_HW_ADDR_T_MULTICAST 5
231 int refcount;
232 bool synced; 231 bool synced;
233 bool global_use; 232 bool global_use;
233 int refcount;
234 struct rcu_head rcu_head; 234 struct rcu_head rcu_head;
235}; 235};
236 236
@@ -281,6 +281,12 @@ struct hh_cache {
281 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; 281 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)];
282}; 282};
283 283
284static inline void hh_cache_put(struct hh_cache *hh)
285{
286 if (atomic_dec_and_test(&hh->hh_refcnt))
287 kfree(hh);
288}
289
284/* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much. 290/* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much.
285 * Alternative is: 291 * Alternative is:
286 * dev->hard_header_len ? (dev->hard_header_len + 292 * dev->hard_header_len ? (dev->hard_header_len +
@@ -579,15 +585,15 @@ static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table,
579 table->ents[hash & table->mask] = RPS_NO_CPU; 585 table->ents[hash & table->mask] = RPS_NO_CPU;
580} 586}
581 587
582extern struct rps_sock_flow_table *rps_sock_flow_table; 588extern struct rps_sock_flow_table __rcu *rps_sock_flow_table;
583 589
584/* This structure contains an instance of an RX queue. */ 590/* This structure contains an instance of an RX queue. */
585struct netdev_rx_queue { 591struct netdev_rx_queue {
586 struct rps_map *rps_map; 592 struct rps_map __rcu *rps_map;
587 struct rps_dev_flow_table *rps_flow_table; 593 struct rps_dev_flow_table __rcu *rps_flow_table;
588 struct kobject kobj; 594 struct kobject kobj;
589 struct netdev_rx_queue *first; 595 struct netdev_rx_queue *first;
590 atomic_t count; 596 atomic_t count;
591} ____cacheline_aligned_in_smp; 597} ____cacheline_aligned_in_smp;
592#endif /* CONFIG_RPS */ 598#endif /* CONFIG_RPS */
593 599
@@ -884,6 +890,9 @@ struct net_device {
884 int iflink; 890 int iflink;
885 891
886 struct net_device_stats stats; 892 struct net_device_stats stats;
893 atomic_long_t rx_dropped; /* dropped packets by core network
894 * Do not use this in drivers.
895 */
887 896
888#ifdef CONFIG_WIRELESS_EXT 897#ifdef CONFIG_WIRELESS_EXT
889 /* List of functions to handle Wireless Extensions (instead of ioctl). 898 /* List of functions to handle Wireless Extensions (instead of ioctl).
@@ -901,7 +910,7 @@ struct net_device {
901 910
902 unsigned int flags; /* interface flags (a la BSD) */ 911 unsigned int flags; /* interface flags (a la BSD) */
903 unsigned short gflags; 912 unsigned short gflags;
904 unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ 913 unsigned int priv_flags; /* Like 'flags' but invisible to userspace. */
905 unsigned short padded; /* How much padding added by alloc_netdev() */ 914 unsigned short padded; /* How much padding added by alloc_netdev() */
906 915
907 unsigned char operstate; /* RFC2863 operstate */ 916 unsigned char operstate; /* RFC2863 operstate */
@@ -918,10 +927,6 @@ struct net_device {
918 unsigned short needed_headroom; 927 unsigned short needed_headroom;
919 unsigned short needed_tailroom; 928 unsigned short needed_tailroom;
920 929
921 struct net_device *master; /* Pointer to master device of a group,
922 * which this device is member of.
923 */
924
925 /* Interface address info. */ 930 /* Interface address info. */
926 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ 931 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */
927 unsigned char addr_assign_type; /* hw address assignment type */ 932 unsigned char addr_assign_type; /* hw address assignment type */
@@ -937,23 +942,37 @@ struct net_device {
937 942
938 943
939 /* Protocol specific pointers */ 944 /* Protocol specific pointers */
940 945
946#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
947 struct vlan_group __rcu *vlgrp; /* VLAN group */
948#endif
941#ifdef CONFIG_NET_DSA 949#ifdef CONFIG_NET_DSA
942 void *dsa_ptr; /* dsa specific data */ 950 void *dsa_ptr; /* dsa specific data */
943#endif 951#endif
944 void *atalk_ptr; /* AppleTalk link */ 952 void *atalk_ptr; /* AppleTalk link */
945 void *ip_ptr; /* IPv4 specific data */ 953 struct in_device __rcu *ip_ptr; /* IPv4 specific data */
946 void *dn_ptr; /* DECnet specific data */ 954 void *dn_ptr; /* DECnet specific data */
947 void *ip6_ptr; /* IPv6 specific data */ 955 struct inet6_dev __rcu *ip6_ptr; /* IPv6 specific data */
948 void *ec_ptr; /* Econet specific data */ 956 void *ec_ptr; /* Econet specific data */
949 void *ax25_ptr; /* AX.25 specific data */ 957 void *ax25_ptr; /* AX.25 specific data */
950 struct wireless_dev *ieee80211_ptr; /* IEEE 802.11 specific data, 958 struct wireless_dev *ieee80211_ptr; /* IEEE 802.11 specific data,
951 assign before registering */ 959 assign before registering */
952 960
953/* 961/*
954 * Cache line mostly used on receive path (including eth_type_trans()) 962 * Cache lines mostly used on receive path (including eth_type_trans())
955 */ 963 */
956 unsigned long last_rx; /* Time of last Rx */ 964 unsigned long last_rx; /* Time of last Rx
965 * This should not be set in
966 * drivers, unless really needed,
967 * because network stack (bonding)
968 * use it if/when necessary, to
969 * avoid dirtying this cache line.
970 */
971
972 struct net_device *master; /* Pointer to master device of a group,
973 * which this device is member of.
974 */
975
957 /* Interface address info used in eth_type_trans() */ 976 /* Interface address info used in eth_type_trans() */
958 unsigned char *dev_addr; /* hw address, (before bcast 977 unsigned char *dev_addr; /* hw address, (before bcast
959 because most packets are 978 because most packets are
@@ -969,14 +988,21 @@ struct net_device {
969 988
970 struct netdev_rx_queue *_rx; 989 struct netdev_rx_queue *_rx;
971 990
972 /* Number of RX queues allocated at alloc_netdev_mq() time */ 991 /* Number of RX queues allocated at register_netdev() time */
973 unsigned int num_rx_queues; 992 unsigned int num_rx_queues;
993
994 /* Number of RX queues currently active in device */
995 unsigned int real_num_rx_queues;
974#endif 996#endif
975 997
976 struct netdev_queue rx_queue;
977 rx_handler_func_t *rx_handler; 998 rx_handler_func_t *rx_handler;
978 void *rx_handler_data; 999 void *rx_handler_data;
979 1000
1001 struct netdev_queue __rcu *ingress_queue;
1002
1003/*
1004 * Cache lines mostly used on transmit path
1005 */
980 struct netdev_queue *_tx ____cacheline_aligned_in_smp; 1006 struct netdev_queue *_tx ____cacheline_aligned_in_smp;
981 1007
982 /* Number of TX queues allocated at alloc_netdev_mq() time */ 1008 /* Number of TX queues allocated at alloc_netdev_mq() time */
@@ -990,9 +1016,7 @@ struct net_device {
990 1016
991 unsigned long tx_queue_len; /* Max frames per queue allowed */ 1017 unsigned long tx_queue_len; /* Max frames per queue allowed */
992 spinlock_t tx_global_lock; 1018 spinlock_t tx_global_lock;
993/* 1019
994 * One part is mostly used on xmit path (device)
995 */
996 /* These may be needed for future network-power-down code. */ 1020 /* These may be needed for future network-power-down code. */
997 1021
998 /* 1022 /*
@@ -1005,7 +1029,7 @@ struct net_device {
1005 struct timer_list watchdog_timer; 1029 struct timer_list watchdog_timer;
1006 1030
1007 /* Number of references to this device */ 1031 /* Number of references to this device */
1008 atomic_t refcnt ____cacheline_aligned_in_smp; 1032 int __percpu *pcpu_refcnt;
1009 1033
1010 /* delayed register/unregister */ 1034 /* delayed register/unregister */
1011 struct list_head todo_list; 1035 struct list_head todo_list;
@@ -1041,10 +1065,14 @@ struct net_device {
1041#endif 1065#endif
1042 1066
1043 /* mid-layer private */ 1067 /* mid-layer private */
1044 void *ml_priv; 1068 union {
1045 1069 void *ml_priv;
1070 struct pcpu_lstats __percpu *lstats; /* loopback stats */
1071 struct pcpu_tstats __percpu *tstats; /* tunnel stats */
1072 struct pcpu_dstats __percpu *dstats; /* dummy stats */
1073 };
1046 /* GARP */ 1074 /* GARP */
1047 struct garp_port *garp_port; 1075 struct garp_port __rcu *garp_port;
1048 1076
1049 /* class/net/name entry */ 1077 /* class/net/name entry */
1050 struct device dev; 1078 struct device dev;
@@ -1305,6 +1333,7 @@ static inline void unregister_netdevice(struct net_device *dev)
1305 unregister_netdevice_queue(dev, NULL); 1333 unregister_netdevice_queue(dev, NULL);
1306} 1334}
1307 1335
1336extern int netdev_refcnt_read(const struct net_device *dev);
1308extern void free_netdev(struct net_device *dev); 1337extern void free_netdev(struct net_device *dev);
1309extern void synchronize_net(void); 1338extern void synchronize_net(void);
1310extern int register_netdevice_notifier(struct notifier_block *nb); 1339extern int register_netdevice_notifier(struct notifier_block *nb);
@@ -1667,11 +1696,34 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
1667 */ 1696 */
1668static inline int netif_is_multiqueue(const struct net_device *dev) 1697static inline int netif_is_multiqueue(const struct net_device *dev)
1669{ 1698{
1670 return (dev->num_tx_queues > 1); 1699 return dev->num_tx_queues > 1;
1671} 1700}
1672 1701
1673extern void netif_set_real_num_tx_queues(struct net_device *dev, 1702extern int netif_set_real_num_tx_queues(struct net_device *dev,
1674 unsigned int txq); 1703 unsigned int txq);
1704
1705#ifdef CONFIG_RPS
1706extern int netif_set_real_num_rx_queues(struct net_device *dev,
1707 unsigned int rxq);
1708#else
1709static inline int netif_set_real_num_rx_queues(struct net_device *dev,
1710 unsigned int rxq)
1711{
1712 return 0;
1713}
1714#endif
1715
1716static inline int netif_copy_real_num_queues(struct net_device *to_dev,
1717 const struct net_device *from_dev)
1718{
1719 netif_set_real_num_tx_queues(to_dev, from_dev->real_num_tx_queues);
1720#ifdef CONFIG_RPS
1721 return netif_set_real_num_rx_queues(to_dev,
1722 from_dev->real_num_rx_queues);
1723#else
1724 return 0;
1725#endif
1726}
1675 1727
1676/* Use this variant when it is known for sure that it 1728/* Use this variant when it is known for sure that it
1677 * is executing from hardware interrupt context or with hardware interrupts 1729 * is executing from hardware interrupt context or with hardware interrupts
@@ -1695,8 +1747,7 @@ extern gro_result_t dev_gro_receive(struct napi_struct *napi,
1695extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); 1747extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
1696extern gro_result_t napi_gro_receive(struct napi_struct *napi, 1748extern gro_result_t napi_gro_receive(struct napi_struct *napi,
1697 struct sk_buff *skb); 1749 struct sk_buff *skb);
1698extern void napi_reuse_skb(struct napi_struct *napi, 1750extern void napi_gro_flush(struct napi_struct *napi);
1699 struct sk_buff *skb);
1700extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 1751extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
1701extern gro_result_t napi_frags_finish(struct napi_struct *napi, 1752extern gro_result_t napi_frags_finish(struct napi_struct *napi,
1702 struct sk_buff *skb, 1753 struct sk_buff *skb,
@@ -1715,7 +1766,6 @@ extern int netdev_rx_handler_register(struct net_device *dev,
1715 void *rx_handler_data); 1766 void *rx_handler_data);
1716extern void netdev_rx_handler_unregister(struct net_device *dev); 1767extern void netdev_rx_handler_unregister(struct net_device *dev);
1717 1768
1718extern void netif_nit_deliver(struct sk_buff *skb);
1719extern int dev_valid_name(const char *name); 1769extern int dev_valid_name(const char *name);
1720extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); 1770extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
1721extern int dev_ethtool(struct net *net, struct ifreq *); 1771extern int dev_ethtool(struct net *net, struct ifreq *);
@@ -1749,7 +1799,7 @@ extern void netdev_run_todo(void);
1749 */ 1799 */
1750static inline void dev_put(struct net_device *dev) 1800static inline void dev_put(struct net_device *dev)
1751{ 1801{
1752 atomic_dec(&dev->refcnt); 1802 irqsafe_cpu_dec(*dev->pcpu_refcnt);
1753} 1803}
1754 1804
1755/** 1805/**
@@ -1760,7 +1810,7 @@ static inline void dev_put(struct net_device *dev)
1760 */ 1810 */
1761static inline void dev_hold(struct net_device *dev) 1811static inline void dev_hold(struct net_device *dev)
1762{ 1812{
1763 atomic_inc(&dev->refcnt); 1813 irqsafe_cpu_inc(*dev->pcpu_refcnt);
1764} 1814}
1765 1815
1766/* Carrier loss detection, dial on demand. The functions netif_carrier_on 1816/* Carrier loss detection, dial on demand. The functions netif_carrier_on
@@ -2171,6 +2221,8 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
2171extern int netdev_class_create_file(struct class_attribute *class_attr); 2221extern int netdev_class_create_file(struct class_attribute *class_attr);
2172extern void netdev_class_remove_file(struct class_attribute *class_attr); 2222extern void netdev_class_remove_file(struct class_attribute *class_attr);
2173 2223
2224extern struct kobj_ns_type_operations net_ns_type_operations;
2225
2174extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); 2226extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len);
2175 2227
2176extern void linkwatch_run_queue(void); 2228extern void linkwatch_run_queue(void);
@@ -2191,14 +2243,22 @@ static inline int net_gso_ok(int features, int gso_type)
2191static inline int skb_gso_ok(struct sk_buff *skb, int features) 2243static inline int skb_gso_ok(struct sk_buff *skb, int features)
2192{ 2244{
2193 return net_gso_ok(features, skb_shinfo(skb)->gso_type) && 2245 return net_gso_ok(features, skb_shinfo(skb)->gso_type) &&
2194 (!skb_has_frags(skb) || (features & NETIF_F_FRAGLIST)); 2246 (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST));
2195} 2247}
2196 2248
2197static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) 2249static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
2198{ 2250{
2199 return skb_is_gso(skb) && 2251 if (skb_is_gso(skb)) {
2200 (!skb_gso_ok(skb, dev->features) || 2252 int features = dev->features;
2201 unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); 2253
2254 if (skb->protocol == htons(ETH_P_8021Q) || skb->vlan_tci)
2255 features &= dev->vlan_features;
2256
2257 return (!skb_gso_ok(skb, features) ||
2258 unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
2259 }
2260
2261 return 0;
2202} 2262}
2203 2263
2204static inline void netif_set_gso_max_size(struct net_device *dev, 2264static inline void netif_set_gso_max_size(struct net_device *dev,
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index 1afd18c855ec..50cdc2559a5a 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -98,8 +98,14 @@ enum ip_conntrack_events {
98 98
99enum ip_conntrack_expect_events { 99enum ip_conntrack_expect_events {
100 IPEXP_NEW, /* new expectation */ 100 IPEXP_NEW, /* new expectation */
101 IPEXP_DESTROY, /* destroyed expectation */
101}; 102};
102 103
104/* expectation flags */
105#define NF_CT_EXPECT_PERMANENT 0x1
106#define NF_CT_EXPECT_INACTIVE 0x2
107#define NF_CT_EXPECT_USERSPACE 0x4
108
103#ifdef __KERNEL__ 109#ifdef __KERNEL__
104struct ip_conntrack_stat { 110struct ip_conntrack_stat {
105 unsigned int searched; 111 unsigned int searched;
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
index ff8cfbcf3b81..0ce91d56a5f2 100644
--- a/include/linux/netfilter/nf_conntrack_sip.h
+++ b/include/linux/netfilter/nf_conntrack_sip.h
@@ -89,6 +89,7 @@ enum sip_header_types {
89 SIP_HDR_VIA_TCP, 89 SIP_HDR_VIA_TCP,
90 SIP_HDR_EXPIRES, 90 SIP_HDR_EXPIRES,
91 SIP_HDR_CONTENT_LENGTH, 91 SIP_HDR_CONTENT_LENGTH,
92 SIP_HDR_CALL_ID,
92}; 93};
93 94
94enum sdp_header_types { 95enum sdp_header_types {
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index 70cd0603911c..19711e3ffd42 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -162,6 +162,7 @@ enum ctattr_expect {
162 CTA_EXPECT_ID, 162 CTA_EXPECT_ID,
163 CTA_EXPECT_HELP_NAME, 163 CTA_EXPECT_HELP_NAME,
164 CTA_EXPECT_ZONE, 164 CTA_EXPECT_ZONE,
165 CTA_EXPECT_FLAGS,
165 __CTA_EXPECT_MAX 166 __CTA_EXPECT_MAX
166}; 167};
167#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) 168#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1)
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 24e5d01d27d0..742bec051440 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -66,6 +66,11 @@ struct xt_standard_target {
66 int verdict; 66 int verdict;
67}; 67};
68 68
69struct xt_error_target {
70 struct xt_entry_target target;
71 char errorname[XT_FUNCTION_MAXNAMELEN];
72};
73
69/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision 74/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision
70 * kernel supports, if >= revision. */ 75 * kernel supports, if >= revision. */
71struct xt_get_revision { 76struct xt_get_revision {
diff --git a/include/linux/netfilter/xt_TPROXY.h b/include/linux/netfilter/xt_TPROXY.h
index 152e8f97132b..3f3d69361289 100644
--- a/include/linux/netfilter/xt_TPROXY.h
+++ b/include/linux/netfilter/xt_TPROXY.h
@@ -1,5 +1,5 @@
1#ifndef _XT_TPROXY_H_target 1#ifndef _XT_TPROXY_H
2#define _XT_TPROXY_H_target 2#define _XT_TPROXY_H
3 3
4/* TPROXY target is capable of marking the packet to perform 4/* TPROXY target is capable of marking the packet to perform
5 * redirection. We can get rid of that whenever we get support for 5 * redirection. We can get rid of that whenever we get support for
@@ -11,4 +11,11 @@ struct xt_tproxy_target_info {
11 __be16 lport; 11 __be16 lport;
12}; 12};
13 13
14#endif /* _XT_TPROXY_H_target */ 14struct xt_tproxy_target_info_v1 {
15 u_int32_t mark_mask;
16 u_int32_t mark_value;
17 union nf_inet_addr laddr;
18 __be16 lport;
19};
20
21#endif /* _XT_TPROXY_H */
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index e9948c0560f6..adbf4bff87ed 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -21,8 +21,21 @@
21 21
22#include <linux/netfilter/x_tables.h> 22#include <linux/netfilter/x_tables.h>
23 23
24#ifndef __KERNEL__
24#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 25#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
25#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 26#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
27#define arpt_entry_target xt_entry_target
28#define arpt_standard_target xt_standard_target
29#define arpt_error_target xt_error_target
30#define ARPT_CONTINUE XT_CONTINUE
31#define ARPT_RETURN XT_RETURN
32#define arpt_counters_info xt_counters_info
33#define arpt_counters xt_counters
34#define ARPT_STANDARD_TARGET XT_STANDARD_TARGET
35#define ARPT_ERROR_TARGET XT_ERROR_TARGET
36#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
37 XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args)
38#endif
26 39
27#define ARPT_DEV_ADDR_LEN_MAX 16 40#define ARPT_DEV_ADDR_LEN_MAX 16
28 41
@@ -63,9 +76,6 @@ struct arpt_arp {
63 u_int16_t invflags; 76 u_int16_t invflags;
64}; 77};
65 78
66#define arpt_entry_target xt_entry_target
67#define arpt_standard_target xt_standard_target
68
69/* Values for "flag" field in struct arpt_ip (general arp structure). 79/* Values for "flag" field in struct arpt_ip (general arp structure).
70 * No flags defined yet. 80 * No flags defined yet.
71 */ 81 */
@@ -125,16 +135,10 @@ struct arpt_entry
125#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3) 135#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
126#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET) 136#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET)
127 137
128/* CONTINUE verdict for targets */
129#define ARPT_CONTINUE XT_CONTINUE
130
131/* For standard target */
132#define ARPT_RETURN XT_RETURN
133
134/* The argument to ARPT_SO_GET_INFO */ 138/* The argument to ARPT_SO_GET_INFO */
135struct arpt_getinfo { 139struct arpt_getinfo {
136 /* Which table: caller fills this in. */ 140 /* Which table: caller fills this in. */
137 char name[ARPT_TABLE_MAXNAMELEN]; 141 char name[XT_TABLE_MAXNAMELEN];
138 142
139 /* Kernel fills these in. */ 143 /* Kernel fills these in. */
140 /* Which hook entry points are valid: bitmask */ 144 /* Which hook entry points are valid: bitmask */
@@ -156,7 +160,7 @@ struct arpt_getinfo {
156/* The argument to ARPT_SO_SET_REPLACE. */ 160/* The argument to ARPT_SO_SET_REPLACE. */
157struct arpt_replace { 161struct arpt_replace {
158 /* Which table. */ 162 /* Which table. */
159 char name[ARPT_TABLE_MAXNAMELEN]; 163 char name[XT_TABLE_MAXNAMELEN];
160 164
161 /* Which hook entry points are valid: bitmask. You can't 165 /* Which hook entry points are valid: bitmask. You can't
162 change this. */ 166 change this. */
@@ -184,14 +188,10 @@ struct arpt_replace {
184 struct arpt_entry entries[0]; 188 struct arpt_entry entries[0];
185}; 189};
186 190
187/* The argument to ARPT_SO_ADD_COUNTERS. */
188#define arpt_counters_info xt_counters_info
189#define arpt_counters xt_counters
190
191/* The argument to ARPT_SO_GET_ENTRIES. */ 191/* The argument to ARPT_SO_GET_ENTRIES. */
192struct arpt_get_entries { 192struct arpt_get_entries {
193 /* Which table: user fills this in. */ 193 /* Which table: user fills this in. */
194 char name[ARPT_TABLE_MAXNAMELEN]; 194 char name[XT_TABLE_MAXNAMELEN];
195 195
196 /* User fills this in: total entry size. */ 196 /* User fills this in: total entry size. */
197 unsigned int size; 197 unsigned int size;
@@ -200,23 +200,12 @@ struct arpt_get_entries {
200 struct arpt_entry entrytable[0]; 200 struct arpt_entry entrytable[0];
201}; 201};
202 202
203/* Standard return verdict, or do jump. */
204#define ARPT_STANDARD_TARGET XT_STANDARD_TARGET
205/* Error verdict. */
206#define ARPT_ERROR_TARGET XT_ERROR_TARGET
207
208/* Helper functions */ 203/* Helper functions */
209static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e) 204static __inline__ struct xt_entry_target *arpt_get_target(struct arpt_entry *e)
210{ 205{
211 return (void *)e + e->target_offset; 206 return (void *)e + e->target_offset;
212} 207}
213 208
214#ifndef __KERNEL__
215/* fn returns 0 to continue iteration */
216#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
217 XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args)
218#endif
219
220/* 209/*
221 * Main firewall chains definitions and global var's definitions. 210 * Main firewall chains definitions and global var's definitions.
222 */ 211 */
@@ -225,17 +214,12 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e
225/* Standard entry. */ 214/* Standard entry. */
226struct arpt_standard { 215struct arpt_standard {
227 struct arpt_entry entry; 216 struct arpt_entry entry;
228 struct arpt_standard_target target; 217 struct xt_standard_target target;
229};
230
231struct arpt_error_target {
232 struct arpt_entry_target target;
233 char errorname[ARPT_FUNCTION_MAXNAMELEN];
234}; 218};
235 219
236struct arpt_error { 220struct arpt_error {
237 struct arpt_entry entry; 221 struct arpt_entry entry;
238 struct arpt_error_target target; 222 struct xt_error_target target;
239}; 223};
240 224
241#define ARPT_ENTRY_INIT(__size) \ 225#define ARPT_ENTRY_INIT(__size) \
@@ -247,16 +231,16 @@ struct arpt_error {
247#define ARPT_STANDARD_INIT(__verdict) \ 231#define ARPT_STANDARD_INIT(__verdict) \
248{ \ 232{ \
249 .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_standard)), \ 233 .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_standard)), \
250 .target = XT_TARGET_INIT(ARPT_STANDARD_TARGET, \ 234 .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \
251 sizeof(struct arpt_standard_target)), \ 235 sizeof(struct xt_standard_target)), \
252 .target.verdict = -(__verdict) - 1, \ 236 .target.verdict = -(__verdict) - 1, \
253} 237}
254 238
255#define ARPT_ERROR_INIT \ 239#define ARPT_ERROR_INIT \
256{ \ 240{ \
257 .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_error)), \ 241 .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_error)), \
258 .target = XT_TARGET_INIT(ARPT_ERROR_TARGET, \ 242 .target = XT_TARGET_INIT(XT_ERROR_TARGET, \
259 sizeof(struct arpt_error_target)), \ 243 sizeof(struct xt_error_target)), \
260 .target.errorname = "ERROR", \ 244 .target.errorname = "ERROR", \
261} 245}
262 246
@@ -271,8 +255,6 @@ extern unsigned int arpt_do_table(struct sk_buff *skb,
271 const struct net_device *out, 255 const struct net_device *out,
272 struct xt_table *table); 256 struct xt_table *table);
273 257
274#define ARPT_ALIGN(s) XT_ALIGN(s)
275
276#ifdef CONFIG_COMPAT 258#ifdef CONFIG_COMPAT
277#include <net/compat.h> 259#include <net/compat.h>
278 260
@@ -285,14 +267,12 @@ struct compat_arpt_entry {
285 unsigned char elems[0]; 267 unsigned char elems[0];
286}; 268};
287 269
288static inline struct arpt_entry_target * 270static inline struct xt_entry_target *
289compat_arpt_get_target(struct compat_arpt_entry *e) 271compat_arpt_get_target(struct compat_arpt_entry *e)
290{ 272{
291 return (void *)e + e->target_offset; 273 return (void *)e + e->target_offset;
292} 274}
293 275
294#define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s)
295
296#endif /* CONFIG_COMPAT */ 276#endif /* CONFIG_COMPAT */
297#endif /*__KERNEL__*/ 277#endif /*__KERNEL__*/
298#endif /* _ARPTABLES_H */ 278#endif /* _ARPTABLES_H */
diff --git a/include/linux/netfilter_bridge/Kbuild b/include/linux/netfilter_bridge/Kbuild
index d4d78672873e..e48f1a3f5a4a 100644
--- a/include/linux/netfilter_bridge/Kbuild
+++ b/include/linux/netfilter_bridge/Kbuild
@@ -3,11 +3,13 @@ header-y += ebt_among.h
3header-y += ebt_arp.h 3header-y += ebt_arp.h
4header-y += ebt_arpreply.h 4header-y += ebt_arpreply.h
5header-y += ebt_ip.h 5header-y += ebt_ip.h
6header-y += ebt_ip6.h
6header-y += ebt_limit.h 7header-y += ebt_limit.h
7header-y += ebt_log.h 8header-y += ebt_log.h
8header-y += ebt_mark_m.h 9header-y += ebt_mark_m.h
9header-y += ebt_mark_t.h 10header-y += ebt_mark_t.h
10header-y += ebt_nat.h 11header-y += ebt_nat.h
12header-y += ebt_nflog.h
11header-y += ebt_pkttype.h 13header-y += ebt_pkttype.h
12header-y += ebt_redirect.h 14header-y += ebt_redirect.h
13header-y += ebt_stp.h 15header-y += ebt_stp.h
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 704a7b6e8169..64a5d95c58e8 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -27,12 +27,49 @@
27 27
28#include <linux/netfilter/x_tables.h> 28#include <linux/netfilter/x_tables.h>
29 29
30#ifndef __KERNEL__
30#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 31#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
31#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 32#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
32#define ipt_match xt_match 33#define ipt_match xt_match
33#define ipt_target xt_target 34#define ipt_target xt_target
34#define ipt_table xt_table 35#define ipt_table xt_table
35#define ipt_get_revision xt_get_revision 36#define ipt_get_revision xt_get_revision
37#define ipt_entry_match xt_entry_match
38#define ipt_entry_target xt_entry_target
39#define ipt_standard_target xt_standard_target
40#define ipt_error_target xt_error_target
41#define ipt_counters xt_counters
42#define IPT_CONTINUE XT_CONTINUE
43#define IPT_RETURN XT_RETURN
44
45/* This group is older than old (iptables < v1.4.0-rc1~89) */
46#include <linux/netfilter/xt_tcpudp.h>
47#define ipt_udp xt_udp
48#define ipt_tcp xt_tcp
49#define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
50#define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
51#define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
52#define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
53#define IPT_TCP_INV_MASK XT_TCP_INV_MASK
54#define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
55#define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
56#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
57
58/* The argument to IPT_SO_ADD_COUNTERS. */
59#define ipt_counters_info xt_counters_info
60/* Standard return verdict, or do jump. */
61#define IPT_STANDARD_TARGET XT_STANDARD_TARGET
62/* Error verdict. */
63#define IPT_ERROR_TARGET XT_ERROR_TARGET
64
65/* fn returns 0 to continue iteration */
66#define IPT_MATCH_ITERATE(e, fn, args...) \
67 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
68
69/* fn returns 0 to continue iteration */
70#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
71 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
72#endif
36 73
37/* Yes, Virginia, you have to zero the padding. */ 74/* Yes, Virginia, you have to zero the padding. */
38struct ipt_ip { 75struct ipt_ip {
@@ -52,12 +89,6 @@ struct ipt_ip {
52 u_int8_t invflags; 89 u_int8_t invflags;
53}; 90};
54 91
55#define ipt_entry_match xt_entry_match
56#define ipt_entry_target xt_entry_target
57#define ipt_standard_target xt_standard_target
58
59#define ipt_counters xt_counters
60
61/* Values for "flag" field in struct ipt_ip (general ip structure). */ 92/* Values for "flag" field in struct ipt_ip (general ip structure). */
62#define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */ 93#define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */
63#define IPT_F_GOTO 0x02 /* Set if jump is a goto */ 94#define IPT_F_GOTO 0x02 /* Set if jump is a goto */
@@ -116,23 +147,6 @@ struct ipt_entry {
116#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3) 147#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
117#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET 148#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET
118 149
119#define IPT_CONTINUE XT_CONTINUE
120#define IPT_RETURN XT_RETURN
121
122#include <linux/netfilter/xt_tcpudp.h>
123#define ipt_udp xt_udp
124#define ipt_tcp xt_tcp
125
126#define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
127#define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
128#define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
129#define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
130#define IPT_TCP_INV_MASK XT_TCP_INV_MASK
131
132#define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
133#define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
134#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
135
136/* ICMP matching stuff */ 150/* ICMP matching stuff */
137struct ipt_icmp { 151struct ipt_icmp {
138 u_int8_t type; /* type to match */ 152 u_int8_t type; /* type to match */
@@ -146,7 +160,7 @@ struct ipt_icmp {
146/* The argument to IPT_SO_GET_INFO */ 160/* The argument to IPT_SO_GET_INFO */
147struct ipt_getinfo { 161struct ipt_getinfo {
148 /* Which table: caller fills this in. */ 162 /* Which table: caller fills this in. */
149 char name[IPT_TABLE_MAXNAMELEN]; 163 char name[XT_TABLE_MAXNAMELEN];
150 164
151 /* Kernel fills these in. */ 165 /* Kernel fills these in. */
152 /* Which hook entry points are valid: bitmask */ 166 /* Which hook entry points are valid: bitmask */
@@ -168,7 +182,7 @@ struct ipt_getinfo {
168/* The argument to IPT_SO_SET_REPLACE. */ 182/* The argument to IPT_SO_SET_REPLACE. */
169struct ipt_replace { 183struct ipt_replace {
170 /* Which table. */ 184 /* Which table. */
171 char name[IPT_TABLE_MAXNAMELEN]; 185 char name[XT_TABLE_MAXNAMELEN];
172 186
173 /* Which hook entry points are valid: bitmask. You can't 187 /* Which hook entry points are valid: bitmask. You can't
174 change this. */ 188 change this. */
@@ -196,13 +210,10 @@ struct ipt_replace {
196 struct ipt_entry entries[0]; 210 struct ipt_entry entries[0];
197}; 211};
198 212
199/* The argument to IPT_SO_ADD_COUNTERS. */
200#define ipt_counters_info xt_counters_info
201
202/* The argument to IPT_SO_GET_ENTRIES. */ 213/* The argument to IPT_SO_GET_ENTRIES. */
203struct ipt_get_entries { 214struct ipt_get_entries {
204 /* Which table: user fills this in. */ 215 /* Which table: user fills this in. */
205 char name[IPT_TABLE_MAXNAMELEN]; 216 char name[XT_TABLE_MAXNAMELEN];
206 217
207 /* User fills this in: total entry size. */ 218 /* User fills this in: total entry size. */
208 unsigned int size; 219 unsigned int size;
@@ -211,28 +222,13 @@ struct ipt_get_entries {
211 struct ipt_entry entrytable[0]; 222 struct ipt_entry entrytable[0];
212}; 223};
213 224
214/* Standard return verdict, or do jump. */
215#define IPT_STANDARD_TARGET XT_STANDARD_TARGET
216/* Error verdict. */
217#define IPT_ERROR_TARGET XT_ERROR_TARGET
218
219/* Helper functions */ 225/* Helper functions */
220static __inline__ struct ipt_entry_target * 226static __inline__ struct xt_entry_target *
221ipt_get_target(struct ipt_entry *e) 227ipt_get_target(struct ipt_entry *e)
222{ 228{
223 return (void *)e + e->target_offset; 229 return (void *)e + e->target_offset;
224} 230}
225 231
226#ifndef __KERNEL__
227/* fn returns 0 to continue iteration */
228#define IPT_MATCH_ITERATE(e, fn, args...) \
229 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
230
231/* fn returns 0 to continue iteration */
232#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
233 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
234#endif
235
236/* 232/*
237 * Main firewall chains definitions and global var's definitions. 233 * Main firewall chains definitions and global var's definitions.
238 */ 234 */
@@ -249,17 +245,12 @@ extern void ipt_unregister_table(struct net *net, struct xt_table *table);
249/* Standard entry. */ 245/* Standard entry. */
250struct ipt_standard { 246struct ipt_standard {
251 struct ipt_entry entry; 247 struct ipt_entry entry;
252 struct ipt_standard_target target; 248 struct xt_standard_target target;
253};
254
255struct ipt_error_target {
256 struct ipt_entry_target target;
257 char errorname[IPT_FUNCTION_MAXNAMELEN];
258}; 249};
259 250
260struct ipt_error { 251struct ipt_error {
261 struct ipt_entry entry; 252 struct ipt_entry entry;
262 struct ipt_error_target target; 253 struct xt_error_target target;
263}; 254};
264 255
265#define IPT_ENTRY_INIT(__size) \ 256#define IPT_ENTRY_INIT(__size) \
@@ -271,7 +262,7 @@ struct ipt_error {
271#define IPT_STANDARD_INIT(__verdict) \ 262#define IPT_STANDARD_INIT(__verdict) \
272{ \ 263{ \
273 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_standard)), \ 264 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_standard)), \
274 .target = XT_TARGET_INIT(IPT_STANDARD_TARGET, \ 265 .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \
275 sizeof(struct xt_standard_target)), \ 266 sizeof(struct xt_standard_target)), \
276 .target.verdict = -(__verdict) - 1, \ 267 .target.verdict = -(__verdict) - 1, \
277} 268}
@@ -279,8 +270,8 @@ struct ipt_error {
279#define IPT_ERROR_INIT \ 270#define IPT_ERROR_INIT \
280{ \ 271{ \
281 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_error)), \ 272 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_error)), \
282 .target = XT_TARGET_INIT(IPT_ERROR_TARGET, \ 273 .target = XT_TARGET_INIT(XT_ERROR_TARGET, \
283 sizeof(struct ipt_error_target)), \ 274 sizeof(struct xt_error_target)), \
284 .target.errorname = "ERROR", \ 275 .target.errorname = "ERROR", \
285} 276}
286 277
@@ -291,8 +282,6 @@ extern unsigned int ipt_do_table(struct sk_buff *skb,
291 const struct net_device *out, 282 const struct net_device *out,
292 struct xt_table *table); 283 struct xt_table *table);
293 284
294#define IPT_ALIGN(s) XT_ALIGN(s)
295
296#ifdef CONFIG_COMPAT 285#ifdef CONFIG_COMPAT
297#include <net/compat.h> 286#include <net/compat.h>
298 287
@@ -307,14 +296,12 @@ struct compat_ipt_entry {
307}; 296};
308 297
309/* Helper functions */ 298/* Helper functions */
310static inline struct ipt_entry_target * 299static inline struct xt_entry_target *
311compat_ipt_get_target(struct compat_ipt_entry *e) 300compat_ipt_get_target(struct compat_ipt_entry *e)
312{ 301{
313 return (void *)e + e->target_offset; 302 return (void *)e + e->target_offset;
314} 303}
315 304
316#define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s)
317
318#endif /* CONFIG_COMPAT */ 305#endif /* CONFIG_COMPAT */
319#endif /*__KERNEL__*/ 306#endif /*__KERNEL__*/
320#endif /* _IPTABLES_H */ 307#endif /* _IPTABLES_H */
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 18442ff19c07..c9784f7a9c1f 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -27,13 +27,42 @@
27 27
28#include <linux/netfilter/x_tables.h> 28#include <linux/netfilter/x_tables.h>
29 29
30#ifndef __KERNEL__
30#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 31#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
31#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 32#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
32
33#define ip6t_match xt_match 33#define ip6t_match xt_match
34#define ip6t_target xt_target 34#define ip6t_target xt_target
35#define ip6t_table xt_table 35#define ip6t_table xt_table
36#define ip6t_get_revision xt_get_revision 36#define ip6t_get_revision xt_get_revision
37#define ip6t_entry_match xt_entry_match
38#define ip6t_entry_target xt_entry_target
39#define ip6t_standard_target xt_standard_target
40#define ip6t_error_target xt_error_target
41#define ip6t_counters xt_counters
42#define IP6T_CONTINUE XT_CONTINUE
43#define IP6T_RETURN XT_RETURN
44
45/* Pre-iptables-1.4.0 */
46#include <linux/netfilter/xt_tcpudp.h>
47#define ip6t_tcp xt_tcp
48#define ip6t_udp xt_udp
49#define IP6T_TCP_INV_SRCPT XT_TCP_INV_SRCPT
50#define IP6T_TCP_INV_DSTPT XT_TCP_INV_DSTPT
51#define IP6T_TCP_INV_FLAGS XT_TCP_INV_FLAGS
52#define IP6T_TCP_INV_OPTION XT_TCP_INV_OPTION
53#define IP6T_TCP_INV_MASK XT_TCP_INV_MASK
54#define IP6T_UDP_INV_SRCPT XT_UDP_INV_SRCPT
55#define IP6T_UDP_INV_DSTPT XT_UDP_INV_DSTPT
56#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK
57
58#define ip6t_counters_info xt_counters_info
59#define IP6T_STANDARD_TARGET XT_STANDARD_TARGET
60#define IP6T_ERROR_TARGET XT_ERROR_TARGET
61#define IP6T_MATCH_ITERATE(e, fn, args...) \
62 XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args)
63#define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \
64 XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args)
65#endif
37 66
38/* Yes, Virginia, you have to zero the padding. */ 67/* Yes, Virginia, you have to zero the padding. */
39struct ip6t_ip6 { 68struct ip6t_ip6 {
@@ -62,12 +91,6 @@ struct ip6t_ip6 {
62 u_int8_t invflags; 91 u_int8_t invflags;
63}; 92};
64 93
65#define ip6t_entry_match xt_entry_match
66#define ip6t_entry_target xt_entry_target
67#define ip6t_standard_target xt_standard_target
68
69#define ip6t_counters xt_counters
70
71/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */ 94/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
72#define IP6T_F_PROTO 0x01 /* Set if rule cares about upper 95#define IP6T_F_PROTO 0x01 /* Set if rule cares about upper
73 protocols */ 96 protocols */
@@ -112,17 +135,12 @@ struct ip6t_entry {
112/* Standard entry */ 135/* Standard entry */
113struct ip6t_standard { 136struct ip6t_standard {
114 struct ip6t_entry entry; 137 struct ip6t_entry entry;
115 struct ip6t_standard_target target; 138 struct xt_standard_target target;
116};
117
118struct ip6t_error_target {
119 struct ip6t_entry_target target;
120 char errorname[IP6T_FUNCTION_MAXNAMELEN];
121}; 139};
122 140
123struct ip6t_error { 141struct ip6t_error {
124 struct ip6t_entry entry; 142 struct ip6t_entry entry;
125 struct ip6t_error_target target; 143 struct xt_error_target target;
126}; 144};
127 145
128#define IP6T_ENTRY_INIT(__size) \ 146#define IP6T_ENTRY_INIT(__size) \
@@ -134,16 +152,16 @@ struct ip6t_error {
134#define IP6T_STANDARD_INIT(__verdict) \ 152#define IP6T_STANDARD_INIT(__verdict) \
135{ \ 153{ \
136 .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \ 154 .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \
137 .target = XT_TARGET_INIT(IP6T_STANDARD_TARGET, \ 155 .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \
138 sizeof(struct ip6t_standard_target)), \ 156 sizeof(struct xt_standard_target)), \
139 .target.verdict = -(__verdict) - 1, \ 157 .target.verdict = -(__verdict) - 1, \
140} 158}
141 159
142#define IP6T_ERROR_INIT \ 160#define IP6T_ERROR_INIT \
143{ \ 161{ \
144 .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)), \ 162 .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)), \
145 .target = XT_TARGET_INIT(IP6T_ERROR_TARGET, \ 163 .target = XT_TARGET_INIT(XT_ERROR_TARGET, \
146 sizeof(struct ip6t_error_target)), \ 164 sizeof(struct xt_error_target)), \
147 .target.errorname = "ERROR", \ 165 .target.errorname = "ERROR", \
148} 166}
149 167
@@ -166,30 +184,6 @@ struct ip6t_error {
166#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) 184#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
167#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET 185#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
168 186
169/* CONTINUE verdict for targets */
170#define IP6T_CONTINUE XT_CONTINUE
171
172/* For standard target */
173#define IP6T_RETURN XT_RETURN
174
175/* TCP/UDP matching stuff */
176#include <linux/netfilter/xt_tcpudp.h>
177
178#define ip6t_tcp xt_tcp
179#define ip6t_udp xt_udp
180
181/* Values for "inv" field in struct ipt_tcp. */
182#define IP6T_TCP_INV_SRCPT XT_TCP_INV_SRCPT
183#define IP6T_TCP_INV_DSTPT XT_TCP_INV_DSTPT
184#define IP6T_TCP_INV_FLAGS XT_TCP_INV_FLAGS
185#define IP6T_TCP_INV_OPTION XT_TCP_INV_OPTION
186#define IP6T_TCP_INV_MASK XT_TCP_INV_MASK
187
188/* Values for "invflags" field in struct ipt_udp. */
189#define IP6T_UDP_INV_SRCPT XT_UDP_INV_SRCPT
190#define IP6T_UDP_INV_DSTPT XT_UDP_INV_DSTPT
191#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK
192
193/* ICMP matching stuff */ 187/* ICMP matching stuff */
194struct ip6t_icmp { 188struct ip6t_icmp {
195 u_int8_t type; /* type to match */ 189 u_int8_t type; /* type to match */
@@ -203,7 +197,7 @@ struct ip6t_icmp {
203/* The argument to IP6T_SO_GET_INFO */ 197/* The argument to IP6T_SO_GET_INFO */
204struct ip6t_getinfo { 198struct ip6t_getinfo {
205 /* Which table: caller fills this in. */ 199 /* Which table: caller fills this in. */
206 char name[IP6T_TABLE_MAXNAMELEN]; 200 char name[XT_TABLE_MAXNAMELEN];
207 201
208 /* Kernel fills these in. */ 202 /* Kernel fills these in. */
209 /* Which hook entry points are valid: bitmask */ 203 /* Which hook entry points are valid: bitmask */
@@ -225,7 +219,7 @@ struct ip6t_getinfo {
225/* The argument to IP6T_SO_SET_REPLACE. */ 219/* The argument to IP6T_SO_SET_REPLACE. */
226struct ip6t_replace { 220struct ip6t_replace {
227 /* Which table. */ 221 /* Which table. */
228 char name[IP6T_TABLE_MAXNAMELEN]; 222 char name[XT_TABLE_MAXNAMELEN];
229 223
230 /* Which hook entry points are valid: bitmask. You can't 224 /* Which hook entry points are valid: bitmask. You can't
231 change this. */ 225 change this. */
@@ -253,13 +247,10 @@ struct ip6t_replace {
253 struct ip6t_entry entries[0]; 247 struct ip6t_entry entries[0];
254}; 248};
255 249
256/* The argument to IP6T_SO_ADD_COUNTERS. */
257#define ip6t_counters_info xt_counters_info
258
259/* The argument to IP6T_SO_GET_ENTRIES. */ 250/* The argument to IP6T_SO_GET_ENTRIES. */
260struct ip6t_get_entries { 251struct ip6t_get_entries {
261 /* Which table: user fills this in. */ 252 /* Which table: user fills this in. */
262 char name[IP6T_TABLE_MAXNAMELEN]; 253 char name[XT_TABLE_MAXNAMELEN];
263 254
264 /* User fills this in: total entry size. */ 255 /* User fills this in: total entry size. */
265 unsigned int size; 256 unsigned int size;
@@ -268,28 +259,13 @@ struct ip6t_get_entries {
268 struct ip6t_entry entrytable[0]; 259 struct ip6t_entry entrytable[0];
269}; 260};
270 261
271/* Standard return verdict, or do jump. */
272#define IP6T_STANDARD_TARGET XT_STANDARD_TARGET
273/* Error verdict. */
274#define IP6T_ERROR_TARGET XT_ERROR_TARGET
275
276/* Helper functions */ 262/* Helper functions */
277static __inline__ struct ip6t_entry_target * 263static __inline__ struct xt_entry_target *
278ip6t_get_target(struct ip6t_entry *e) 264ip6t_get_target(struct ip6t_entry *e)
279{ 265{
280 return (void *)e + e->target_offset; 266 return (void *)e + e->target_offset;
281} 267}
282 268
283#ifndef __KERNEL__
284/* fn returns 0 to continue iteration */
285#define IP6T_MATCH_ITERATE(e, fn, args...) \
286 XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args)
287
288/* fn returns 0 to continue iteration */
289#define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \
290 XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args)
291#endif
292
293/* 269/*
294 * Main firewall chains definitions and global var's definitions. 270 * Main firewall chains definitions and global var's definitions.
295 */ 271 */
@@ -316,8 +292,6 @@ extern int ip6t_ext_hdr(u8 nexthdr);
316extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, 292extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
317 int target, unsigned short *fragoff); 293 int target, unsigned short *fragoff);
318 294
319#define IP6T_ALIGN(s) XT_ALIGN(s)
320
321#ifdef CONFIG_COMPAT 295#ifdef CONFIG_COMPAT
322#include <net/compat.h> 296#include <net/compat.h>
323 297
@@ -331,14 +305,12 @@ struct compat_ip6t_entry {
331 unsigned char elems[0]; 305 unsigned char elems[0];
332}; 306};
333 307
334static inline struct ip6t_entry_target * 308static inline struct xt_entry_target *
335compat_ip6t_get_target(struct compat_ip6t_entry *e) 309compat_ip6t_get_target(struct compat_ip6t_entry *e)
336{ 310{
337 return (void *)e + e->target_offset; 311 return (void *)e + e->target_offset;
338} 312}
339 313
340#define COMPAT_IP6T_ALIGN(s) COMPAT_XT_ALIGN(s)
341
342#endif /* CONFIG_COMPAT */ 314#endif /* CONFIG_COMPAT */
343#endif /*__KERNEL__*/ 315#endif /*__KERNEL__*/
344#endif /* _IP6_TABLES_H */ 316#endif /* _IP6_TABLES_H */
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 50d8009be86c..79358bb712c6 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -14,7 +14,6 @@
14 14
15struct netpoll { 15struct netpoll {
16 struct net_device *dev; 16 struct net_device *dev;
17 struct net_device *real_dev;
18 char dev_name[IFNAMSIZ]; 17 char dev_name[IFNAMSIZ];
19 const char *name; 18 const char *name;
20 void (*rx_hook)(struct netpoll *, int, char *, int); 19 void (*rx_hook)(struct netpoll *, int, char *, int);
@@ -53,7 +52,13 @@ void netpoll_set_trap(int trap);
53void __netpoll_cleanup(struct netpoll *np); 52void __netpoll_cleanup(struct netpoll *np);
54void netpoll_cleanup(struct netpoll *np); 53void netpoll_cleanup(struct netpoll *np);
55int __netpoll_rx(struct sk_buff *skb); 54int __netpoll_rx(struct sk_buff *skb);
56void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); 55void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
56 struct net_device *dev);
57static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
58{
59 netpoll_send_skb_on_dev(np, skb, np->dev);
60}
61
57 62
58 63
59#ifdef CONFIG_NETPOLL 64#ifdef CONFIG_NETPOLL
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 07e40c625972..4925b22219d2 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -17,7 +17,9 @@
17 17
18#define NFS4_BITMAP_SIZE 2 18#define NFS4_BITMAP_SIZE 2
19#define NFS4_VERIFIER_SIZE 8 19#define NFS4_VERIFIER_SIZE 8
20#define NFS4_STATEID_SIZE 16 20#define NFS4_STATEID_SEQID_SIZE 4
21#define NFS4_STATEID_OTHER_SIZE 12
22#define NFS4_STATEID_SIZE (NFS4_STATEID_SEQID_SIZE + NFS4_STATEID_OTHER_SIZE)
21#define NFS4_FHSIZE 128 23#define NFS4_FHSIZE 128
22#define NFS4_MAXPATHLEN PATH_MAX 24#define NFS4_MAXPATHLEN PATH_MAX
23#define NFS4_MAXNAMLEN NAME_MAX 25#define NFS4_MAXNAMLEN NAME_MAX
@@ -61,6 +63,9 @@
61#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000 63#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000
62#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED 0x20000 64#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED 0x20000
63 65
66#define NFS4_CDFC4_FORE 0x1
67#define NFS4_CDFC4_BACK 0x2
68
64#define NFS4_SET_TO_SERVER_TIME 0 69#define NFS4_SET_TO_SERVER_TIME 0
65#define NFS4_SET_TO_CLIENT_TIME 1 70#define NFS4_SET_TO_CLIENT_TIME 1
66 71
@@ -167,7 +172,16 @@ struct nfs4_acl {
167}; 172};
168 173
169typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; 174typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier;
170typedef struct { char data[NFS4_STATEID_SIZE]; } nfs4_stateid; 175
176struct nfs41_stateid {
177 __be32 seqid;
178 char other[NFS4_STATEID_OTHER_SIZE];
179} __attribute__ ((packed));
180
181typedef union {
182 char data[NFS4_STATEID_SIZE];
183 struct nfs41_stateid stateid;
184} nfs4_stateid;
171 185
172enum nfs_opnum4 { 186enum nfs_opnum4 {
173 OP_ACCESS = 3, 187 OP_ACCESS = 3,
@@ -471,6 +485,8 @@ enum lock_type4 {
471#define FATTR4_WORD1_TIME_MODIFY (1UL << 21) 485#define FATTR4_WORD1_TIME_MODIFY (1UL << 21)
472#define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22) 486#define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22)
473#define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23) 487#define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23)
488#define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30)
489#define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1)
474 490
475#define NFSPROC4_NULL 0 491#define NFSPROC4_NULL 0
476#define NFSPROC4_COMPOUND 1 492#define NFSPROC4_COMPOUND 1
@@ -532,6 +548,8 @@ enum {
532 NFSPROC4_CLNT_SEQUENCE, 548 NFSPROC4_CLNT_SEQUENCE,
533 NFSPROC4_CLNT_GET_LEASE_TIME, 549 NFSPROC4_CLNT_GET_LEASE_TIME,
534 NFSPROC4_CLNT_RECLAIM_COMPLETE, 550 NFSPROC4_CLNT_RECLAIM_COMPLETE,
551 NFSPROC4_CLNT_LAYOUTGET,
552 NFSPROC4_CLNT_GETDEVICEINFO,
535}; 553};
536 554
537/* nfs41 types */ 555/* nfs41 types */
@@ -550,6 +568,49 @@ enum state_protect_how4 {
550 SP4_SSV = 2 568 SP4_SSV = 2
551}; 569};
552 570
571enum pnfs_layouttype {
572 LAYOUT_NFSV4_1_FILES = 1,
573 LAYOUT_OSD2_OBJECTS = 2,
574 LAYOUT_BLOCK_VOLUME = 3,
575};
576
577/* used for both layout return and recall */
578enum pnfs_layoutreturn_type {
579 RETURN_FILE = 1,
580 RETURN_FSID = 2,
581 RETURN_ALL = 3
582};
583
584enum pnfs_iomode {
585 IOMODE_READ = 1,
586 IOMODE_RW = 2,
587 IOMODE_ANY = 3,
588};
589
590enum pnfs_notify_deviceid_type4 {
591 NOTIFY_DEVICEID4_CHANGE = 1 << 1,
592 NOTIFY_DEVICEID4_DELETE = 1 << 2,
593};
594
595#define NFL4_UFLG_MASK 0x0000003F
596#define NFL4_UFLG_DENSE 0x00000001
597#define NFL4_UFLG_COMMIT_THRU_MDS 0x00000002
598#define NFL4_UFLG_STRIPE_UNIT_SIZE_MASK 0xFFFFFFC0
599
600/* Encoded in the loh_body field of type layouthint4 */
601enum filelayout_hint_care4 {
602 NFLH4_CARE_DENSE = NFL4_UFLG_DENSE,
603 NFLH4_CARE_COMMIT_THRU_MDS = NFL4_UFLG_COMMIT_THRU_MDS,
604 NFLH4_CARE_STRIPE_UNIT_SIZE = 0x00000040,
605 NFLH4_CARE_STRIPE_COUNT = 0x00000080
606};
607
608#define NFS4_DEVICEID4_SIZE 16
609
610struct nfs4_deviceid {
611 char data[NFS4_DEVICEID4_SIZE];
612};
613
553#endif 614#endif
554#endif 615#endif
555 616
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index d0edf7d823ae..bba26684acdc 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -188,6 +188,9 @@ struct nfs_inode {
188 struct nfs_delegation __rcu *delegation; 188 struct nfs_delegation __rcu *delegation;
189 fmode_t delegation_state; 189 fmode_t delegation_state;
190 struct rw_semaphore rwsem; 190 struct rw_semaphore rwsem;
191
192 /* pNFS layout information */
193 struct pnfs_layout_hdr *layout;
191#endif /* CONFIG_NFS_V4*/ 194#endif /* CONFIG_NFS_V4*/
192#ifdef CONFIG_NFS_FSCACHE 195#ifdef CONFIG_NFS_FSCACHE
193 struct fscache_cookie *fscache; 196 struct fscache_cookie *fscache;
@@ -360,10 +363,13 @@ extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr);
360extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 363extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
361extern void put_nfs_open_context(struct nfs_open_context *ctx); 364extern void put_nfs_open_context(struct nfs_open_context *ctx);
362extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); 365extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode);
366extern struct nfs_open_context *alloc_nfs_open_context(struct path *path, struct rpc_cred *cred, fmode_t f_mode);
367extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx);
363extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); 368extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx);
364extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); 369extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx);
365extern u64 nfs_compat_user_ino64(u64 fileid); 370extern u64 nfs_compat_user_ino64(u64 fileid);
366extern void nfs_fattr_init(struct nfs_fattr *fattr); 371extern void nfs_fattr_init(struct nfs_fattr *fattr);
372extern unsigned long nfs_inc_attr_generation_counter(void);
367 373
368extern struct nfs_fattr *nfs_alloc_fattr(void); 374extern struct nfs_fattr *nfs_alloc_fattr(void);
369 375
@@ -379,9 +385,12 @@ static inline void nfs_free_fhandle(const struct nfs_fh *fh)
379 kfree(fh); 385 kfree(fh);
380} 386}
381 387
388/*
389 * linux/fs/nfs/nfsroot.c
390 */
391extern int nfs_root_data(char **root_device, char **root_data); /*__init*/
382/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ 392/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
383extern __be32 root_nfs_parse_addr(char *name); /*__init*/ 393extern __be32 root_nfs_parse_addr(char *name); /*__init*/
384extern unsigned long nfs_inc_attr_generation_counter(void);
385 394
386/* 395/*
387 * linux/fs/nfs/file.c 396 * linux/fs/nfs/file.c
@@ -479,10 +488,10 @@ extern void nfs_release_automount_timer(void);
479/* 488/*
480 * linux/fs/nfs/unlink.c 489 * linux/fs/nfs/unlink.c
481 */ 490 */
482extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry);
483extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); 491extern void nfs_complete_unlink(struct dentry *dentry, struct inode *);
484extern void nfs_block_sillyrename(struct dentry *dentry); 492extern void nfs_block_sillyrename(struct dentry *dentry);
485extern void nfs_unblock_sillyrename(struct dentry *dentry); 493extern void nfs_unblock_sillyrename(struct dentry *dentry);
494extern int nfs_sillyrename(struct inode *dir, struct dentry *dentry);
486 495
487/* 496/*
488 * linux/fs/nfs/write.c 497 * linux/fs/nfs/write.c
@@ -584,10 +593,6 @@ nfs_fileid_to_ino_t(u64 fileid)
584 return ino; 593 return ino;
585} 594}
586 595
587/* NFS root */
588
589extern void * nfs_root_data(void);
590
591#define nfs_wait_event(clnt, wq, condition) \ 596#define nfs_wait_event(clnt, wq, condition) \
592({ \ 597({ \
593 int __retval = wait_event_killable(wq, condition); \ 598 int __retval = wait_event_killable(wq, condition); \
@@ -613,6 +618,8 @@ extern void * nfs_root_data(void);
613#define NFSDBG_CLIENT 0x0200 618#define NFSDBG_CLIENT 0x0200
614#define NFSDBG_MOUNT 0x0400 619#define NFSDBG_MOUNT 0x0400
615#define NFSDBG_FSCACHE 0x0800 620#define NFSDBG_FSCACHE 0x0800
621#define NFSDBG_PNFS 0x1000
622#define NFSDBG_PNFS_LD 0x2000
616#define NFSDBG_ALL 0xFFFF 623#define NFSDBG_ALL 0xFFFF
617 624
618#ifdef __KERNEL__ 625#ifdef __KERNEL__
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index c82ee7cd6288..452d96436d26 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -82,6 +82,8 @@ struct nfs_client {
82 /* The flags used for obtaining the clientid during EXCHANGE_ID */ 82 /* The flags used for obtaining the clientid during EXCHANGE_ID */
83 u32 cl_exchange_flags; 83 u32 cl_exchange_flags;
84 struct nfs4_session *cl_session; /* sharred session */ 84 struct nfs4_session *cl_session; /* sharred session */
85 struct list_head cl_layouts;
86 struct pnfs_deviceid_cache *cl_devid_cache; /* pNFS deviceid cache */
85#endif /* CONFIG_NFS_V4_1 */ 87#endif /* CONFIG_NFS_V4_1 */
86 88
87#ifdef CONFIG_NFS_FSCACHE 89#ifdef CONFIG_NFS_FSCACHE
@@ -124,6 +126,7 @@ struct nfs_server {
124 126
125 struct nfs_fsid fsid; 127 struct nfs_fsid fsid;
126 __u64 maxfilesize; /* maximum file size */ 128 __u64 maxfilesize; /* maximum file size */
129 struct timespec time_delta; /* smallest time granularity */
127 unsigned long mount_time; /* when this fs was mounted */ 130 unsigned long mount_time; /* when this fs was mounted */
128 dev_t s_dev; /* superblock dev numbers */ 131 dev_t s_dev; /* superblock dev numbers */
129 132
@@ -144,6 +147,7 @@ struct nfs_server {
144 u32 acl_bitmask; /* V4 bitmask representing the ACEs 147 u32 acl_bitmask; /* V4 bitmask representing the ACEs
145 that are supported on this 148 that are supported on this
146 filesystem */ 149 filesystem */
150 struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */
147#endif 151#endif
148 void (*destroy)(struct nfs_server *); 152 void (*destroy)(struct nfs_server *);
149 153
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h
index 91a1c24e0cbf..e8352dc5afb5 100644
--- a/include/linux/nfs_idmap.h
+++ b/include/linux/nfs_idmap.h
@@ -66,13 +66,40 @@ struct idmap_msg {
66/* Forward declaration to make this header independent of others */ 66/* Forward declaration to make this header independent of others */
67struct nfs_client; 67struct nfs_client;
68 68
69#ifdef CONFIG_NFS_USE_NEW_IDMAPPER
70
71int nfs_idmap_init(void);
72void nfs_idmap_quit(void);
73
74static inline int nfs_idmap_new(struct nfs_client *clp)
75{
76 return 0;
77}
78
79static inline void nfs_idmap_delete(struct nfs_client *clp)
80{
81}
82
83#else /* CONFIG_NFS_USE_NEW_IDMAPPER not set */
84
85static inline int nfs_idmap_init(void)
86{
87 return 0;
88}
89
90static inline void nfs_idmap_quit(void)
91{
92}
93
69int nfs_idmap_new(struct nfs_client *); 94int nfs_idmap_new(struct nfs_client *);
70void nfs_idmap_delete(struct nfs_client *); 95void nfs_idmap_delete(struct nfs_client *);
71 96
97#endif /* CONFIG_NFS_USE_NEW_IDMAPPER */
98
72int nfs_map_name_to_uid(struct nfs_client *, const char *, size_t, __u32 *); 99int nfs_map_name_to_uid(struct nfs_client *, const char *, size_t, __u32 *);
73int nfs_map_group_to_gid(struct nfs_client *, const char *, size_t, __u32 *); 100int nfs_map_group_to_gid(struct nfs_client *, const char *, size_t, __u32 *);
74int nfs_map_uid_to_name(struct nfs_client *, __u32, char *); 101int nfs_map_uid_to_name(struct nfs_client *, __u32, char *, size_t);
75int nfs_map_gid_to_group(struct nfs_client *, __u32, char *); 102int nfs_map_gid_to_group(struct nfs_client *, __u32, char *, size_t);
76 103
77extern unsigned int nfs_idmap_cache_timeout; 104extern unsigned int nfs_idmap_cache_timeout;
78#endif /* __KERNEL__ */ 105#endif /* __KERNEL__ */
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h
index 5d59ae861aa6..576bddd72e04 100644
--- a/include/linux/nfs_mount.h
+++ b/include/linux/nfs_mount.h
@@ -71,4 +71,7 @@ struct nfs_mount_data {
71#define NFS_MOUNT_NORESVPORT 0x40000 71#define NFS_MOUNT_NORESVPORT 0x40000
72#define NFS_MOUNT_LEGACY_INTERFACE 0x80000 72#define NFS_MOUNT_LEGACY_INTERFACE 0x80000
73 73
74#define NFS_MOUNT_LOCAL_FLOCK 0x100000
75#define NFS_MOUNT_LOCAL_FCNTL 0x200000
76
74#endif 77#endif
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index fc461926c412..ba6cc8f223c9 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -112,7 +112,9 @@ struct nfs_fsinfo {
112 __u32 wtmult; /* writes should be multiple of this */ 112 __u32 wtmult; /* writes should be multiple of this */
113 __u32 dtpref; /* pref. readdir transfer size */ 113 __u32 dtpref; /* pref. readdir transfer size */
114 __u64 maxfilesize; 114 __u64 maxfilesize;
115 struct timespec time_delta; /* server time granularity */
115 __u32 lease_time; /* in seconds */ 116 __u32 lease_time; /* in seconds */
117 __u32 layouttype; /* supported pnfs layout driver */
116}; 118};
117 119
118struct nfs_fsstat { 120struct nfs_fsstat {
@@ -170,7 +172,7 @@ struct nfs4_sequence_args {
170 172
171struct nfs4_sequence_res { 173struct nfs4_sequence_res {
172 struct nfs4_session *sr_session; 174 struct nfs4_session *sr_session;
173 u8 sr_slotid; /* slot used to send request */ 175 struct nfs4_slot *sr_slot; /* slot used to send request */
174 int sr_status; /* sequence operation status */ 176 int sr_status; /* sequence operation status */
175 unsigned long sr_renewal_time; 177 unsigned long sr_renewal_time;
176 u32 sr_status_flags; 178 u32 sr_status_flags;
@@ -185,6 +187,55 @@ struct nfs4_get_lease_time_res {
185 struct nfs4_sequence_res lr_seq_res; 187 struct nfs4_sequence_res lr_seq_res;
186}; 188};
187 189
190#define PNFS_LAYOUT_MAXSIZE 4096
191
192struct nfs4_layoutdriver_data {
193 __u32 len;
194 void *buf;
195};
196
197struct pnfs_layout_range {
198 u32 iomode;
199 u64 offset;
200 u64 length;
201};
202
203struct nfs4_layoutget_args {
204 __u32 type;
205 struct pnfs_layout_range range;
206 __u64 minlength;
207 __u32 maxcount;
208 struct inode *inode;
209 struct nfs_open_context *ctx;
210 struct nfs4_sequence_args seq_args;
211};
212
213struct nfs4_layoutget_res {
214 __u32 return_on_close;
215 struct pnfs_layout_range range;
216 __u32 type;
217 nfs4_stateid stateid;
218 struct nfs4_layoutdriver_data layout;
219 struct nfs4_sequence_res seq_res;
220};
221
222struct nfs4_layoutget {
223 struct nfs4_layoutget_args args;
224 struct nfs4_layoutget_res res;
225 struct pnfs_layout_segment **lsegpp;
226 int status;
227};
228
229struct nfs4_getdeviceinfo_args {
230 struct pnfs_device *pdev;
231 struct nfs4_sequence_args seq_args;
232};
233
234struct nfs4_getdeviceinfo_res {
235 struct pnfs_device *pdev;
236 struct nfs4_sequence_res seq_res;
237};
238
188/* 239/*
189 * Arguments to the open call. 240 * Arguments to the open call.
190 */ 241 */
@@ -400,6 +451,27 @@ struct nfs_removeres {
400}; 451};
401 452
402/* 453/*
454 * Common arguments to the rename call
455 */
456struct nfs_renameargs {
457 const struct nfs_fh *old_dir;
458 const struct nfs_fh *new_dir;
459 const struct qstr *old_name;
460 const struct qstr *new_name;
461 const u32 *bitmask;
462 struct nfs4_sequence_args seq_args;
463};
464
465struct nfs_renameres {
466 const struct nfs_server *server;
467 struct nfs4_change_info old_cinfo;
468 struct nfs_fattr *old_fattr;
469 struct nfs4_change_info new_cinfo;
470 struct nfs_fattr *new_fattr;
471 struct nfs4_sequence_res seq_res;
472};
473
474/*
403 * Argument struct for decode_entry function 475 * Argument struct for decode_entry function
404 */ 476 */
405struct nfs_entry { 477struct nfs_entry {
@@ -434,15 +506,6 @@ struct nfs_createargs {
434 struct iattr * sattr; 506 struct iattr * sattr;
435}; 507};
436 508
437struct nfs_renameargs {
438 struct nfs_fh * fromfh;
439 const char * fromname;
440 unsigned int fromlen;
441 struct nfs_fh * tofh;
442 const char * toname;
443 unsigned int tolen;
444};
445
446struct nfs_setattrargs { 509struct nfs_setattrargs {
447 struct nfs_fh * fh; 510 struct nfs_fh * fh;
448 nfs4_stateid stateid; 511 nfs4_stateid stateid;
@@ -586,15 +649,6 @@ struct nfs3_mknodargs {
586 dev_t rdev; 649 dev_t rdev;
587}; 650};
588 651
589struct nfs3_renameargs {
590 struct nfs_fh * fromfh;
591 const char * fromname;
592 unsigned int fromlen;
593 struct nfs_fh * tofh;
594 const char * toname;
595 unsigned int tolen;
596};
597
598struct nfs3_linkargs { 652struct nfs3_linkargs {
599 struct nfs_fh * fromfh; 653 struct nfs_fh * fromfh;
600 struct nfs_fh * tofh; 654 struct nfs_fh * tofh;
@@ -629,11 +683,6 @@ struct nfs3_readlinkargs {
629 struct page ** pages; 683 struct page ** pages;
630}; 684};
631 685
632struct nfs3_renameres {
633 struct nfs_fattr * fromattr;
634 struct nfs_fattr * toattr;
635};
636
637struct nfs3_linkres { 686struct nfs3_linkres {
638 struct nfs_fattr * dir_attr; 687 struct nfs_fattr * dir_attr;
639 struct nfs_fattr * fattr; 688 struct nfs_fattr * fattr;
@@ -780,6 +829,7 @@ struct nfs4_readdir_arg {
780 struct page ** pages; /* zero-copy data */ 829 struct page ** pages; /* zero-copy data */
781 unsigned int pgbase; /* zero-copy data */ 830 unsigned int pgbase; /* zero-copy data */
782 const u32 * bitmask; 831 const u32 * bitmask;
832 int plus;
783 struct nfs4_sequence_args seq_args; 833 struct nfs4_sequence_args seq_args;
784}; 834};
785 835
@@ -801,24 +851,6 @@ struct nfs4_readlink_res {
801 struct nfs4_sequence_res seq_res; 851 struct nfs4_sequence_res seq_res;
802}; 852};
803 853
804struct nfs4_rename_arg {
805 const struct nfs_fh * old_dir;
806 const struct nfs_fh * new_dir;
807 const struct qstr * old_name;
808 const struct qstr * new_name;
809 const u32 * bitmask;
810 struct nfs4_sequence_args seq_args;
811};
812
813struct nfs4_rename_res {
814 const struct nfs_server * server;
815 struct nfs4_change_info old_cinfo;
816 struct nfs_fattr * old_fattr;
817 struct nfs4_change_info new_cinfo;
818 struct nfs_fattr * new_fattr;
819 struct nfs4_sequence_res seq_res;
820};
821
822#define NFS4_SETCLIENTID_NAMELEN (127) 854#define NFS4_SETCLIENTID_NAMELEN (127)
823struct nfs4_setclientid { 855struct nfs4_setclientid {
824 const nfs4_verifier * sc_verifier; 856 const nfs4_verifier * sc_verifier;
@@ -1032,19 +1064,21 @@ struct nfs_rpc_ops {
1032 int (*readlink)(struct inode *, struct page *, unsigned int, 1064 int (*readlink)(struct inode *, struct page *, unsigned int,
1033 unsigned int); 1065 unsigned int);
1034 int (*create) (struct inode *, struct dentry *, 1066 int (*create) (struct inode *, struct dentry *,
1035 struct iattr *, int, struct nameidata *); 1067 struct iattr *, int, struct nfs_open_context *);
1036 int (*remove) (struct inode *, struct qstr *); 1068 int (*remove) (struct inode *, struct qstr *);
1037 void (*unlink_setup) (struct rpc_message *, struct inode *dir); 1069 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1038 int (*unlink_done) (struct rpc_task *, struct inode *); 1070 int (*unlink_done) (struct rpc_task *, struct inode *);
1039 int (*rename) (struct inode *, struct qstr *, 1071 int (*rename) (struct inode *, struct qstr *,
1040 struct inode *, struct qstr *); 1072 struct inode *, struct qstr *);
1073 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
1074 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
1041 int (*link) (struct inode *, struct inode *, struct qstr *); 1075 int (*link) (struct inode *, struct inode *, struct qstr *);
1042 int (*symlink) (struct inode *, struct dentry *, struct page *, 1076 int (*symlink) (struct inode *, struct dentry *, struct page *,
1043 unsigned int, struct iattr *); 1077 unsigned int, struct iattr *);
1044 int (*mkdir) (struct inode *, struct dentry *, struct iattr *); 1078 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1045 int (*rmdir) (struct inode *, struct qstr *); 1079 int (*rmdir) (struct inode *, struct qstr *);
1046 int (*readdir) (struct dentry *, struct rpc_cred *, 1080 int (*readdir) (struct dentry *, struct rpc_cred *,
1047 u64, struct page *, unsigned int, int); 1081 u64, struct page **, unsigned int, int);
1048 int (*mknod) (struct inode *, struct dentry *, struct iattr *, 1082 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1049 dev_t); 1083 dev_t);
1050 int (*statfs) (struct nfs_server *, struct nfs_fh *, 1084 int (*statfs) (struct nfs_server *, struct nfs_fh *,
@@ -1054,7 +1088,7 @@ struct nfs_rpc_ops {
1054 int (*pathconf) (struct nfs_server *, struct nfs_fh *, 1088 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1055 struct nfs_pathconf *); 1089 struct nfs_pathconf *);
1056 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); 1090 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
1057 __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus); 1091 __be32 *(*decode_dirent)(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int plus);
1058 void (*read_setup) (struct nfs_read_data *, struct rpc_message *); 1092 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
1059 int (*read_done) (struct rpc_task *, struct nfs_read_data *); 1093 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
1060 void (*write_setup) (struct nfs_write_data *, struct rpc_message *); 1094 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
@@ -1065,6 +1099,10 @@ struct nfs_rpc_ops {
1065 int (*lock_check_bounds)(const struct file_lock *); 1099 int (*lock_check_bounds)(const struct file_lock *);
1066 void (*clear_acl_cache)(struct inode *); 1100 void (*clear_acl_cache)(struct inode *);
1067 void (*close_context)(struct nfs_open_context *ctx, int); 1101 void (*close_context)(struct nfs_open_context *ctx, int);
1102 struct inode * (*open_context) (struct inode *dir,
1103 struct nfs_open_context *ctx,
1104 int open_flags,
1105 struct iattr *iattr);
1068}; 1106};
1069 1107
1070/* 1108/*
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h
index f5487b6f91ed..227e49dd5720 100644
--- a/include/linux/nilfs2_fs.h
+++ b/include/linux/nilfs2_fs.h
@@ -4,16 +4,16 @@
4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation. 4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU Lesser General Public License as published
8 * the Free Software Foundation; either version 2 of the License, or 8 * by the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version. 9 * (at your option) any later version.
10 * 10 *
11 * This program is distributed in the hope that it will be useful, 11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 * 19 *
@@ -147,7 +147,6 @@ struct nilfs_super_root {
147#define NILFS_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */ 147#define NILFS_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */
148#define NILFS_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */ 148#define NILFS_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */
149#define NILFS_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */ 149#define NILFS_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */
150#define NILFS_MOUNT_SNAPSHOT 0x0080 /* Snapshot flag */
151#define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */ 150#define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */
152#define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order 151#define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order
153 semantics also for data */ 152 semantics also for data */
@@ -229,6 +228,7 @@ struct nilfs_super_block {
229 */ 228 */
230#define NILFS_CURRENT_REV 2 /* current major revision */ 229#define NILFS_CURRENT_REV 2 /* current major revision */
231#define NILFS_MINOR_REV 0 /* minor revision */ 230#define NILFS_MINOR_REV 0 /* minor revision */
231#define NILFS_MIN_SUPP_REV 2 /* minimum supported revision */
232 232
233/* 233/*
234 * Feature set definitions 234 * Feature set definitions
@@ -270,6 +270,14 @@ struct nilfs_super_block {
270 segments */ 270 segments */
271 271
272/* 272/*
273 * We call DAT, cpfile, and sufile root metadata files. Inodes of
274 * these files are written in super root block instead of ifile, and
275 * garbage collector doesn't keep any past versions of these files.
276 */
277#define NILFS_ROOT_METADATA_FILE(ino) \
278 ((ino) >= NILFS_DAT_INO && (ino) <= NILFS_SUFILE_INO)
279
280/*
273 * bytes offset of secondary super block 281 * bytes offset of secondary super block
274 */ 282 */
275#define NILFS_SB2_OFFSET_BYTES(devsize) ((((devsize) >> 12) - 1) << 12) 283#define NILFS_SB2_OFFSET_BYTES(devsize) ((((devsize) >> 12) - 1) << 12)
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 2c8701687336..0edb2566c14c 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -40,6 +40,43 @@
40 */ 40 */
41 41
42/** 42/**
43 * DOC: Frame transmission/registration support
44 *
45 * Frame transmission and registration support exists to allow userspace
46 * management entities such as wpa_supplicant react to management frames
47 * that are not being handled by the kernel. This includes, for example,
48 * certain classes of action frames that cannot be handled in the kernel
49 * for various reasons.
50 *
51 * Frame registration is done on a per-interface basis and registrations
52 * cannot be removed other than by closing the socket. It is possible to
53 * specify a registration filter to register, for example, only for a
54 * certain type of action frame. In particular with action frames, those
55 * that userspace registers for will not be returned as unhandled by the
56 * driver, so that the registered application has to take responsibility
57 * for doing that.
58 *
59 * The type of frame that can be registered for is also dependent on the
60 * driver and interface type. The frame types are advertised in wiphy
61 * attributes so applications know what to expect.
62 *
63 * NOTE: When an interface changes type while registrations are active,
64 * these registrations are ignored until the interface type is
65 * changed again. This means that changing the interface type can
66 * lead to a situation that couldn't otherwise be produced, but
67 * any such registrations will be dormant in the sense that they
68 * will not be serviced, i.e. they will not receive any frames.
69 *
70 * Frame transmission allows userspace to send for example the required
71 * responses to action frames. It is subject to some sanity checking,
72 * but many frames can be transmitted. When a frame was transmitted, its
73 * status is indicated to the sending socket.
74 *
75 * For more technical details, see the corresponding command descriptions
76 * below.
77 */
78
79/**
43 * enum nl80211_commands - supported nl80211 commands 80 * enum nl80211_commands - supported nl80211 commands
44 * 81 *
45 * @NL80211_CMD_UNSPEC: unspecified command to catch errors 82 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
@@ -258,7 +295,9 @@
258 * auth and assoc steps. For this, you need to specify the SSID in a 295 * auth and assoc steps. For this, you need to specify the SSID in a
259 * %NL80211_ATTR_SSID attribute, and can optionally specify the association 296 * %NL80211_ATTR_SSID attribute, and can optionally specify the association
260 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC, 297 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC,
261 * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_CONTROL_PORT. 298 * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
299 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
300 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
262 * It is also sent as an event, with the BSSID and response IEs when the 301 * It is also sent as an event, with the BSSID and response IEs when the
263 * connection is established or failed to be established. This can be 302 * connection is established or failed to be established. This can be
264 * determined by the STATUS_CODE attribute. 303 * determined by the STATUS_CODE attribute.
@@ -276,8 +315,8 @@
276 * channel for the specified amount of time. This can be used to do 315 * channel for the specified amount of time. This can be used to do
277 * off-channel operations like transmit a Public Action frame and wait for 316 * off-channel operations like transmit a Public Action frame and wait for
278 * a response while being associated to an AP on another channel. 317 * a response while being associated to an AP on another channel.
279 * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify which 318 * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus
280 * radio is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the 319 * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
281 * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be 320 * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be
282 * optionally used to specify additional channel parameters. 321 * optionally used to specify additional channel parameters.
283 * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds 322 * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
@@ -301,16 +340,20 @@
301 * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface 340 * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
302 * and @NL80211_ATTR_TX_RATES the set of allowed rates. 341 * and @NL80211_ATTR_TX_RATES the set of allowed rates.
303 * 342 *
304 * @NL80211_CMD_REGISTER_ACTION: Register for receiving certain action frames 343 * @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames
305 * (via @NL80211_CMD_ACTION) for processing in userspace. This command 344 * (via @NL80211_CMD_FRAME) for processing in userspace. This command
306 * requires an interface index and a match attribute containing the first 345 * requires an interface index, a frame type attribute (optional for
307 * few bytes of the frame that should match, e.g. a single byte for only 346 * backward compatibility reasons, if not given assumes action frames)
308 * a category match or four bytes for vendor frames including the OUI. 347 * and a match attribute containing the first few bytes of the frame
309 * The registration cannot be dropped, but is removed automatically 348 * that should match, e.g. a single byte for only a category match or
310 * when the netlink socket is closed. Multiple registrations can be made. 349 * four bytes for vendor frames including the OUI. The registration
311 * @NL80211_CMD_ACTION: Action frame TX request and RX notification. This 350 * cannot be dropped, but is removed automatically when the netlink
312 * command is used both as a request to transmit an Action frame and as an 351 * socket is closed. Multiple registrations can be made.
313 * event indicating reception of an Action frame that was not processed in 352 * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for
353 * backward compatibility
354 * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This
355 * command is used both as a request to transmit a management frame and
356 * as an event indicating reception of a frame that was not processed in
314 * kernel code, but is for us (i.e., which may need to be processed in a 357 * kernel code, but is for us (i.e., which may need to be processed in a
315 * user space application). %NL80211_ATTR_FRAME is used to specify the 358 * user space application). %NL80211_ATTR_FRAME is used to specify the
316 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and 359 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and
@@ -320,11 +363,14 @@
320 * operational channel). When called, this operation returns a cookie 363 * operational channel). When called, this operation returns a cookie
321 * (%NL80211_ATTR_COOKIE) that will be included with the TX status event 364 * (%NL80211_ATTR_COOKIE) that will be included with the TX status event
322 * pertaining to the TX request. 365 * pertaining to the TX request.
323 * @NL80211_CMD_ACTION_TX_STATUS: Report TX status of an Action frame 366 * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility.
324 * transmitted with %NL80211_CMD_ACTION. %NL80211_ATTR_COOKIE identifies 367 * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
368 * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
325 * the TX command and %NL80211_ATTR_FRAME includes the contents of the 369 * the TX command and %NL80211_ATTR_FRAME includes the contents of the
326 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged 370 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
327 * the frame. 371 * the frame.
372 * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
373 * backward compatibility.
328 * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command 374 * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command
329 * is used to configure connection quality monitoring notification trigger 375 * is used to configure connection quality monitoring notification trigger
330 * levels. 376 * levels.
@@ -341,6 +387,8 @@
341 * of any other interfaces, and other interfaces will again take 387 * of any other interfaces, and other interfaces will again take
342 * precedence when they are used. 388 * precedence when they are used.
343 * 389 *
390 * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface.
391 *
344 * @NL80211_CMD_MAX: highest used command number 392 * @NL80211_CMD_MAX: highest used command number
345 * @__NL80211_CMD_AFTER_LAST: internal use 393 * @__NL80211_CMD_AFTER_LAST: internal use
346 */ 394 */
@@ -429,9 +477,12 @@ enum nl80211_commands {
429 477
430 NL80211_CMD_SET_TX_BITRATE_MASK, 478 NL80211_CMD_SET_TX_BITRATE_MASK,
431 479
432 NL80211_CMD_REGISTER_ACTION, 480 NL80211_CMD_REGISTER_FRAME,
433 NL80211_CMD_ACTION, 481 NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME,
434 NL80211_CMD_ACTION_TX_STATUS, 482 NL80211_CMD_FRAME,
483 NL80211_CMD_ACTION = NL80211_CMD_FRAME,
484 NL80211_CMD_FRAME_TX_STATUS,
485 NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS,
435 486
436 NL80211_CMD_SET_POWER_SAVE, 487 NL80211_CMD_SET_POWER_SAVE,
437 NL80211_CMD_GET_POWER_SAVE, 488 NL80211_CMD_GET_POWER_SAVE,
@@ -440,6 +491,7 @@ enum nl80211_commands {
440 NL80211_CMD_NOTIFY_CQM, 491 NL80211_CMD_NOTIFY_CQM,
441 492
442 NL80211_CMD_SET_CHANNEL, 493 NL80211_CMD_SET_CHANNEL,
494 NL80211_CMD_SET_WDS_PEER,
443 495
444 /* add new commands above here */ 496 /* add new commands above here */
445 497
@@ -639,6 +691,15 @@ enum nl80211_commands {
639 * request, the driver will assume that the port is unauthorized until 691 * request, the driver will assume that the port is unauthorized until
640 * authorized by user space. Otherwise, port is marked authorized by 692 * authorized by user space. Otherwise, port is marked authorized by
641 * default in station mode. 693 * default in station mode.
694 * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the
695 * ethertype that will be used for key negotiation. It can be
696 * specified with the associate and connect commands. If it is not
697 * specified, the value defaults to 0x888E (PAE, 802.1X). This
698 * attribute is also used as a flag in the wiphy information to
699 * indicate that protocols other than PAE are supported.
700 * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with
701 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom
702 * ethertype frames used for key negotiation must not be encrypted.
642 * 703 *
643 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. 704 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
644 * We recommend using nested, driver-specific attributes within this. 705 * We recommend using nested, driver-specific attributes within this.
@@ -708,7 +769,16 @@ enum nl80211_commands {
708 * is used with %NL80211_CMD_SET_TX_BITRATE_MASK. 769 * is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
709 * 770 *
710 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain 771 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
711 * at least one byte, currently used with @NL80211_CMD_REGISTER_ACTION. 772 * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
773 * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the
774 * @NL80211_CMD_REGISTER_FRAME command.
775 * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a
776 * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
777 * information about which frame types can be transmitted with
778 * %NL80211_CMD_FRAME.
779 * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a
780 * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
781 * information about which frame types can be registered for RX.
712 * 782 *
713 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was 783 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
714 * acknowledged by the recipient. 784 * acknowledged by the recipient.
@@ -731,6 +801,9 @@ enum nl80211_commands {
731 * This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING 801 * This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING
732 * for non-automatic settings. 802 * for non-automatic settings.
733 * 803 *
804 * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly
805 * means support for per-station GTKs.
806 *
734 * @NL80211_ATTR_MAX: highest attribute number currently defined 807 * @NL80211_ATTR_MAX: highest attribute number currently defined
735 * @__NL80211_ATTR_AFTER_LAST: internal use 808 * @__NL80211_ATTR_AFTER_LAST: internal use
736 */ 809 */
@@ -891,6 +964,15 @@ enum nl80211_attrs {
891 NL80211_ATTR_WIPHY_TX_POWER_SETTING, 964 NL80211_ATTR_WIPHY_TX_POWER_SETTING,
892 NL80211_ATTR_WIPHY_TX_POWER_LEVEL, 965 NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
893 966
967 NL80211_ATTR_TX_FRAME_TYPES,
968 NL80211_ATTR_RX_FRAME_TYPES,
969 NL80211_ATTR_FRAME_TYPE,
970
971 NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
972 NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
973
974 NL80211_ATTR_SUPPORT_IBSS_RSN,
975
894 /* add attributes here, update the policy in nl80211.c */ 976 /* add attributes here, update the policy in nl80211.c */
895 977
896 __NL80211_ATTR_AFTER_LAST, 978 __NL80211_ATTR_AFTER_LAST,
@@ -946,8 +1028,10 @@ enum nl80211_attrs {
946 * @NL80211_IFTYPE_WDS: wireless distribution interface 1028 * @NL80211_IFTYPE_WDS: wireless distribution interface
947 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames 1029 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
948 * @NL80211_IFTYPE_MESH_POINT: mesh point 1030 * @NL80211_IFTYPE_MESH_POINT: mesh point
1031 * @NL80211_IFTYPE_P2P_CLIENT: P2P client
1032 * @NL80211_IFTYPE_P2P_GO: P2P group owner
949 * @NL80211_IFTYPE_MAX: highest interface type number currently defined 1033 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
950 * @__NL80211_IFTYPE_AFTER_LAST: internal use 1034 * @NUM_NL80211_IFTYPES: number of defined interface types
951 * 1035 *
952 * These values are used with the %NL80211_ATTR_IFTYPE 1036 * These values are used with the %NL80211_ATTR_IFTYPE
953 * to set the type of an interface. 1037 * to set the type of an interface.
@@ -962,10 +1046,12 @@ enum nl80211_iftype {
962 NL80211_IFTYPE_WDS, 1046 NL80211_IFTYPE_WDS,
963 NL80211_IFTYPE_MONITOR, 1047 NL80211_IFTYPE_MONITOR,
964 NL80211_IFTYPE_MESH_POINT, 1048 NL80211_IFTYPE_MESH_POINT,
1049 NL80211_IFTYPE_P2P_CLIENT,
1050 NL80211_IFTYPE_P2P_GO,
965 1051
966 /* keep last */ 1052 /* keep last */
967 __NL80211_IFTYPE_AFTER_LAST, 1053 NUM_NL80211_IFTYPES,
968 NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1 1054 NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
969}; 1055};
970 1056
971/** 1057/**
@@ -974,11 +1060,14 @@ enum nl80211_iftype {
974 * Station flags. When a station is added to an AP interface, it is 1060 * Station flags. When a station is added to an AP interface, it is
975 * assumed to be already associated (and hence authenticated.) 1061 * assumed to be already associated (and hence authenticated.)
976 * 1062 *
1063 * @__NL80211_STA_FLAG_INVALID: attribute number 0 is reserved
977 * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X) 1064 * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
978 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames 1065 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
979 * with short barker preamble 1066 * with short barker preamble
980 * @NL80211_STA_FLAG_WME: station is WME/QoS capable 1067 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
981 * @NL80211_STA_FLAG_MFP: station uses management frame protection 1068 * @NL80211_STA_FLAG_MFP: station uses management frame protection
1069 * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
1070 * @__NL80211_STA_FLAG_AFTER_LAST: internal use
982 */ 1071 */
983enum nl80211_sta_flags { 1072enum nl80211_sta_flags {
984 __NL80211_STA_FLAG_INVALID, 1073 __NL80211_STA_FLAG_INVALID,
@@ -1048,6 +1137,8 @@ enum nl80211_rate_info {
1048 * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) 1137 * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station)
1049 * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this 1138 * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this
1050 * station) 1139 * station)
1140 * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station)
1141 * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station)
1051 */ 1142 */
1052enum nl80211_sta_info { 1143enum nl80211_sta_info {
1053 __NL80211_STA_INFO_INVALID, 1144 __NL80211_STA_INFO_INVALID,
@@ -1061,6 +1152,8 @@ enum nl80211_sta_info {
1061 NL80211_STA_INFO_TX_BITRATE, 1152 NL80211_STA_INFO_TX_BITRATE,
1062 NL80211_STA_INFO_RX_PACKETS, 1153 NL80211_STA_INFO_RX_PACKETS,
1063 NL80211_STA_INFO_TX_PACKETS, 1154 NL80211_STA_INFO_TX_PACKETS,
1155 NL80211_STA_INFO_TX_RETRIES,
1156 NL80211_STA_INFO_TX_FAILED,
1064 1157
1065 /* keep last */ 1158 /* keep last */
1066 __NL80211_STA_INFO_AFTER_LAST, 1159 __NL80211_STA_INFO_AFTER_LAST,
@@ -1091,14 +1184,17 @@ enum nl80211_mpath_flags {
1091 * information about a mesh path. 1184 * information about a mesh path.
1092 * 1185 *
1093 * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved 1186 * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
1094 * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination 1187 * @NL80211_MPATH_INFO_FRAME_QLEN: number of queued frames for this destination
1095 * @NL80211_ATTR_MPATH_SN: destination sequence number 1188 * @NL80211_MPATH_INFO_SN: destination sequence number
1096 * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path 1189 * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path
1097 * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now 1190 * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now
1098 * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in 1191 * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in
1099 * &enum nl80211_mpath_flags; 1192 * &enum nl80211_mpath_flags;
1100 * @NL80211_ATTR_MPATH_DISCOVERY_TIMEOUT: total path discovery timeout, in msec 1193 * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
1101 * @NL80211_ATTR_MPATH_DISCOVERY_RETRIES: mesh path discovery retries 1194 * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
1195 * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
1196 * currently defind
1197 * @__NL80211_MPATH_INFO_AFTER_LAST: internal use
1102 */ 1198 */
1103enum nl80211_mpath_info { 1199enum nl80211_mpath_info {
1104 __NL80211_MPATH_INFO_INVALID, 1200 __NL80211_MPATH_INFO_INVALID,
@@ -1127,6 +1223,8 @@ enum nl80211_mpath_info {
1127 * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE 1223 * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
1128 * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n 1224 * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
1129 * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n 1225 * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
1226 * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
1227 * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
1130 */ 1228 */
1131enum nl80211_band_attr { 1229enum nl80211_band_attr {
1132 __NL80211_BAND_ATTR_INVALID, 1230 __NL80211_BAND_ATTR_INVALID,
@@ -1147,6 +1245,7 @@ enum nl80211_band_attr {
1147 1245
1148/** 1246/**
1149 * enum nl80211_frequency_attr - frequency attributes 1247 * enum nl80211_frequency_attr - frequency attributes
1248 * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved
1150 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz 1249 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
1151 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current 1250 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
1152 * regulatory domain. 1251 * regulatory domain.
@@ -1158,6 +1257,9 @@ enum nl80211_band_attr {
1158 * on this channel in current regulatory domain. 1257 * on this channel in current regulatory domain.
1159 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm 1258 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
1160 * (100 * dBm). 1259 * (100 * dBm).
1260 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
1261 * currently defined
1262 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
1161 */ 1263 */
1162enum nl80211_frequency_attr { 1264enum nl80211_frequency_attr {
1163 __NL80211_FREQUENCY_ATTR_INVALID, 1265 __NL80211_FREQUENCY_ATTR_INVALID,
@@ -1177,9 +1279,13 @@ enum nl80211_frequency_attr {
1177 1279
1178/** 1280/**
1179 * enum nl80211_bitrate_attr - bitrate attributes 1281 * enum nl80211_bitrate_attr - bitrate attributes
1282 * @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved
1180 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps 1283 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
1181 * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported 1284 * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
1182 * in 2.4 GHz band. 1285 * in 2.4 GHz band.
1286 * @NL80211_BITRATE_ATTR_MAX: highest bitrate attribute number
1287 * currently defined
1288 * @__NL80211_BITRATE_ATTR_AFTER_LAST: internal use
1183 */ 1289 */
1184enum nl80211_bitrate_attr { 1290enum nl80211_bitrate_attr {
1185 __NL80211_BITRATE_ATTR_INVALID, 1291 __NL80211_BITRATE_ATTR_INVALID,
@@ -1235,6 +1341,7 @@ enum nl80211_reg_type {
1235 1341
1236/** 1342/**
1237 * enum nl80211_reg_rule_attr - regulatory rule attributes 1343 * enum nl80211_reg_rule_attr - regulatory rule attributes
1344 * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved
1238 * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional 1345 * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
1239 * considerations for a given frequency range. These are the 1346 * considerations for a given frequency range. These are the
1240 * &enum nl80211_reg_rule_flags. 1347 * &enum nl80211_reg_rule_flags.
@@ -1251,6 +1358,9 @@ enum nl80211_reg_type {
1251 * If you don't have one then don't send this. 1358 * If you don't have one then don't send this.
1252 * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for 1359 * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
1253 * a given frequency range. The value is in mBm (100 * dBm). 1360 * a given frequency range. The value is in mBm (100 * dBm).
1361 * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
1362 * currently defined
1363 * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
1254 */ 1364 */
1255enum nl80211_reg_rule_attr { 1365enum nl80211_reg_rule_attr {
1256 __NL80211_REG_RULE_ATTR_INVALID, 1366 __NL80211_REG_RULE_ATTR_INVALID,
@@ -1302,11 +1412,31 @@ enum nl80211_reg_rule_flags {
1302 * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved 1412 * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved
1303 * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel 1413 * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
1304 * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) 1414 * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
1415 * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used
1416 * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio
1417 * spent on this channel
1418 * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary
1419 * channel was sensed busy (either due to activity or energy detect)
1420 * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension
1421 * channel was sensed busy
1422 * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent
1423 * receiving data
1424 * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent
1425 * transmitting data
1426 * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
1427 * currently defined
1428 * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
1305 */ 1429 */
1306enum nl80211_survey_info { 1430enum nl80211_survey_info {
1307 __NL80211_SURVEY_INFO_INVALID, 1431 __NL80211_SURVEY_INFO_INVALID,
1308 NL80211_SURVEY_INFO_FREQUENCY, 1432 NL80211_SURVEY_INFO_FREQUENCY,
1309 NL80211_SURVEY_INFO_NOISE, 1433 NL80211_SURVEY_INFO_NOISE,
1434 NL80211_SURVEY_INFO_IN_USE,
1435 NL80211_SURVEY_INFO_CHANNEL_TIME,
1436 NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY,
1437 NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY,
1438 NL80211_SURVEY_INFO_CHANNEL_TIME_RX,
1439 NL80211_SURVEY_INFO_CHANNEL_TIME_TX,
1310 1440
1311 /* keep last */ 1441 /* keep last */
1312 __NL80211_SURVEY_INFO_AFTER_LAST, 1442 __NL80211_SURVEY_INFO_AFTER_LAST,
@@ -1466,6 +1596,7 @@ enum nl80211_channel_type {
1466 * enum nl80211_bss - netlink attributes for a BSS 1596 * enum nl80211_bss - netlink attributes for a BSS
1467 * 1597 *
1468 * @__NL80211_BSS_INVALID: invalid 1598 * @__NL80211_BSS_INVALID: invalid
1599 * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets)
1469 * @NL80211_BSS_FREQUENCY: frequency in MHz (u32) 1600 * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
1470 * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64) 1601 * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
1471 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) 1602 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
@@ -1509,6 +1640,12 @@ enum nl80211_bss {
1509 1640
1510/** 1641/**
1511 * enum nl80211_bss_status - BSS "status" 1642 * enum nl80211_bss_status - BSS "status"
1643 * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS.
1644 * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS.
1645 * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS.
1646 *
1647 * The BSS status is a BSS attribute in scan dumps, which
1648 * indicates the status the interface has wrt. this BSS.
1512 */ 1649 */
1513enum nl80211_bss_status { 1650enum nl80211_bss_status {
1514 NL80211_BSS_STATUS_AUTHENTICATED, 1651 NL80211_BSS_STATUS_AUTHENTICATED,
@@ -1546,11 +1683,14 @@ enum nl80211_auth_type {
1546 * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key 1683 * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key
1547 * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key 1684 * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key
1548 * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS) 1685 * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS)
1686 * @NUM_NL80211_KEYTYPES: number of defined key types
1549 */ 1687 */
1550enum nl80211_key_type { 1688enum nl80211_key_type {
1551 NL80211_KEYTYPE_GROUP, 1689 NL80211_KEYTYPE_GROUP,
1552 NL80211_KEYTYPE_PAIRWISE, 1690 NL80211_KEYTYPE_PAIRWISE,
1553 NL80211_KEYTYPE_PEERKEY, 1691 NL80211_KEYTYPE_PEERKEY,
1692
1693 NUM_NL80211_KEYTYPES
1554}; 1694};
1555 1695
1556/** 1696/**
@@ -1581,6 +1721,9 @@ enum nl80211_wpa_versions {
1581 * CCMP keys, each six bytes in little endian 1721 * CCMP keys, each six bytes in little endian
1582 * @NL80211_KEY_DEFAULT: flag indicating default key 1722 * @NL80211_KEY_DEFAULT: flag indicating default key
1583 * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key 1723 * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key
1724 * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not
1725 * specified the default depends on whether a MAC address was
1726 * given with the command using the key or not (u32)
1584 * @__NL80211_KEY_AFTER_LAST: internal 1727 * @__NL80211_KEY_AFTER_LAST: internal
1585 * @NL80211_KEY_MAX: highest key attribute 1728 * @NL80211_KEY_MAX: highest key attribute
1586 */ 1729 */
@@ -1592,6 +1735,7 @@ enum nl80211_key_attributes {
1592 NL80211_KEY_SEQ, 1735 NL80211_KEY_SEQ,
1593 NL80211_KEY_DEFAULT, 1736 NL80211_KEY_DEFAULT,
1594 NL80211_KEY_DEFAULT_MGMT, 1737 NL80211_KEY_DEFAULT_MGMT,
1738 NL80211_KEY_TYPE,
1595 1739
1596 /* keep last */ 1740 /* keep last */
1597 __NL80211_KEY_AFTER_LAST, 1741 __NL80211_KEY_AFTER_LAST,
@@ -1619,8 +1763,8 @@ enum nl80211_tx_rate_attributes {
1619 1763
1620/** 1764/**
1621 * enum nl80211_band - Frequency band 1765 * enum nl80211_band - Frequency band
1622 * @NL80211_BAND_2GHZ - 2.4 GHz ISM band 1766 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
1623 * @NL80211_BAND_5GHZ - around 5 GHz band (4.9 - 5.7 GHz) 1767 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
1624 */ 1768 */
1625enum nl80211_band { 1769enum nl80211_band {
1626 NL80211_BAND_2GHZ, 1770 NL80211_BAND_2GHZ,
@@ -1658,9 +1802,9 @@ enum nl80211_attr_cqm {
1658 1802
1659/** 1803/**
1660 * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event 1804 * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event
1661 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW - The RSSI level is lower than the 1805 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower than the
1662 * configured threshold 1806 * configured threshold
1663 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH - The RSSI is higher than the 1807 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the
1664 * configured threshold 1808 * configured threshold
1665 */ 1809 */
1666enum nl80211_cqm_rssi_threshold_event { 1810enum nl80211_cqm_rssi_threshold_event {
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 835f85ecd2de..975d347079d9 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -27,20 +27,19 @@ static inline int of_driver_match_device(const struct device *dev,
27extern struct platform_device *of_dev_get(struct platform_device *dev); 27extern struct platform_device *of_dev_get(struct platform_device *dev);
28extern void of_dev_put(struct platform_device *dev); 28extern void of_dev_put(struct platform_device *dev);
29 29
30extern int of_device_add(struct platform_device *pdev);
30extern int of_device_register(struct platform_device *ofdev); 31extern int of_device_register(struct platform_device *ofdev);
31extern void of_device_unregister(struct platform_device *ofdev); 32extern void of_device_unregister(struct platform_device *ofdev);
32extern void of_release_dev(struct device *dev);
33
34static inline void of_device_free(struct platform_device *dev)
35{
36 of_release_dev(&dev->dev);
37}
38 33
39extern ssize_t of_device_get_modalias(struct device *dev, 34extern ssize_t of_device_get_modalias(struct device *dev,
40 char *str, ssize_t len); 35 char *str, ssize_t len);
41 36
42extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env); 37extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env);
43 38
39static inline void of_device_node_put(struct device *dev)
40{
41 of_node_put(dev->of_node);
42}
44 43
45#else /* CONFIG_OF_DEVICE */ 44#else /* CONFIG_OF_DEVICE */
46 45
@@ -56,6 +55,8 @@ static inline int of_device_uevent(struct device *dev,
56 return -ENODEV; 55 return -ENODEV;
57} 56}
58 57
58static inline void of_device_node_put(struct device *dev) { }
59
59#endif /* CONFIG_OF_DEVICE */ 60#endif /* CONFIG_OF_DEVICE */
60 61
61#endif /* _LINUX_OF_DEVICE_H */ 62#endif /* _LINUX_OF_DEVICE_H */
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 71e1a916d3fa..7bbf5b328438 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -72,7 +72,7 @@ extern void *of_get_flat_dt_prop(unsigned long node, const char *name,
72 unsigned long *size); 72 unsigned long *size);
73extern int of_flat_dt_is_compatible(unsigned long node, const char *name); 73extern int of_flat_dt_is_compatible(unsigned long node, const char *name);
74extern unsigned long of_get_flat_dt_root(void); 74extern unsigned long of_get_flat_dt_root(void);
75extern void early_init_dt_scan_chosen_arch(unsigned long node); 75
76extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, 76extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
77 int depth, void *data); 77 int depth, void *data);
78extern void early_init_dt_check_for_initrd(unsigned long node); 78extern void early_init_dt_check_for_initrd(unsigned long node);
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index 5929781c104d..109e013b1772 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -5,6 +5,7 @@
5struct of_irq; 5struct of_irq;
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/errno.h> 7#include <linux/errno.h>
8#include <linux/irq.h>
8#include <linux/ioport.h> 9#include <linux/ioport.h>
9#include <linux/of.h> 10#include <linux/of.h>
10 11
@@ -64,6 +65,9 @@ extern unsigned int irq_create_of_mapping(struct device_node *controller,
64 unsigned int intsize); 65 unsigned int intsize);
65extern int of_irq_to_resource(struct device_node *dev, int index, 66extern int of_irq_to_resource(struct device_node *dev, int index,
66 struct resource *r); 67 struct resource *r);
68extern int of_irq_count(struct device_node *dev);
69extern int of_irq_to_resource_table(struct device_node *dev,
70 struct resource *res, int nr_irqs);
67 71
68#endif /* CONFIG_OF_IRQ */ 72#endif /* CONFIG_OF_IRQ */
69#endif /* CONFIG_OF */ 73#endif /* CONFIG_OF */
diff --git a/include/linux/of_pdt.h b/include/linux/of_pdt.h
new file mode 100644
index 000000000000..c65a18a0cfdf
--- /dev/null
+++ b/include/linux/of_pdt.h
@@ -0,0 +1,45 @@
1/*
2 * Definitions for building a device tree by calling into the
3 * Open Firmware PROM.
4 *
5 * Copyright (C) 2010 Andres Salomon <dilinger@queued.net>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#ifndef _LINUX_OF_PDT_H
14#define _LINUX_OF_PDT_H
15
16/* overridable operations for calling into the PROM */
17struct of_pdt_ops {
18 /*
19 * buf should be 32 bytes; return 0 on success.
20 * If prev is NULL, the first property will be returned.
21 */
22 int (*nextprop)(phandle node, char *prev, char *buf);
23
24 /* for both functions, return proplen on success; -1 on error */
25 int (*getproplen)(phandle node, const char *prop);
26 int (*getproperty)(phandle node, const char *prop, char *buf,
27 int bufsize);
28
29 /* phandles are 0 if no child or sibling exists */
30 phandle (*getchild)(phandle parent);
31 phandle (*getsibling)(phandle node);
32
33 /* return 0 on success; fill in 'len' with number of bytes in path */
34 int (*pkg2path)(phandle node, char *buf, const int buflen, int *len);
35};
36
37extern void *prom_early_alloc(unsigned long size);
38
39/* for building the device tree */
40extern void of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops);
41
42extern void (*of_pdt_build_more)(struct device_node *dp,
43 struct device_node ***nextp);
44
45#endif /* _LINUX_OF_PDT_H */
diff --git a/include/linux/padata.h b/include/linux/padata.h
index bdcd1e9eacea..4633b2f726b6 100644
--- a/include/linux/padata.h
+++ b/include/linux/padata.h
@@ -127,8 +127,8 @@ struct padata_cpumask {
127 */ 127 */
128struct parallel_data { 128struct parallel_data {
129 struct padata_instance *pinst; 129 struct padata_instance *pinst;
130 struct padata_parallel_queue *pqueue; 130 struct padata_parallel_queue __percpu *pqueue;
131 struct padata_serial_queue *squeue; 131 struct padata_serial_queue __percpu *squeue;
132 atomic_t seq_nr; 132 atomic_t seq_nr;
133 atomic_t reorder_objects; 133 atomic_t reorder_objects;
134 atomic_t refcnt; 134 atomic_t refcnt;
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 6fa317801e1c..5f38c460367e 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -310,7 +310,7 @@ static inline void SetPageUptodate(struct page *page)
310{ 310{
311#ifdef CONFIG_S390 311#ifdef CONFIG_S390
312 if (!test_and_set_bit(PG_uptodate, &page->flags)) 312 if (!test_and_set_bit(PG_uptodate, &page->flags))
313 page_clear_dirty(page); 313 page_clear_dirty(page, 0);
314#else 314#else
315 /* 315 /*
316 * Memory barrier must be issued before setting the PG_uptodate bit, 316 * Memory barrier must be issued before setting the PG_uptodate bit,
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
index e8c06122be36..19ef95d293ae 100644
--- a/include/linux/pageblock-flags.h
+++ b/include/linux/pageblock-flags.h
@@ -67,7 +67,8 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags,
67 67
68#define get_pageblock_flags(page) \ 68#define get_pageblock_flags(page) \
69 get_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) 69 get_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1)
70#define set_pageblock_flags(page) \ 70#define set_pageblock_flags(page, flags) \
71 set_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) 71 set_pageblock_flags_group(page, flags, \
72 0, NR_PAGEBLOCK_BITS-1)
72 73
73#endif /* PAGEBLOCK_FLAGS_H */ 74#endif /* PAGEBLOCK_FLAGS_H */
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index e12cdc6d79ee..2d1ffe3cf1ee 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -299,6 +299,8 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma,
299extern void __lock_page(struct page *page); 299extern void __lock_page(struct page *page);
300extern int __lock_page_killable(struct page *page); 300extern int __lock_page_killable(struct page *page);
301extern void __lock_page_nosync(struct page *page); 301extern void __lock_page_nosync(struct page *page);
302extern int __lock_page_or_retry(struct page *page, struct mm_struct *mm,
303 unsigned int flags);
302extern void unlock_page(struct page *page); 304extern void unlock_page(struct page *page);
303 305
304static inline void __set_page_locked(struct page *page) 306static inline void __set_page_locked(struct page *page)
@@ -351,6 +353,17 @@ static inline void lock_page_nosync(struct page *page)
351} 353}
352 354
353/* 355/*
356 * lock_page_or_retry - Lock the page, unless this would block and the
357 * caller indicated that it can handle a retry.
358 */
359static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm,
360 unsigned int flags)
361{
362 might_sleep();
363 return trylock_page(page) || __lock_page_or_retry(page, mm, flags);
364}
365
366/*
354 * This is exported only for wait_on_page_locked/wait_on_page_writeback. 367 * This is exported only for wait_on_page_locked/wait_on_page_writeback.
355 * Never use this directly! 368 * Never use this directly!
356 */ 369 */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index dad30734432a..b4c3d1b50037 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -743,6 +743,7 @@
743#define PCI_DEVICE_ID_HP_CISSC 0x3230 743#define PCI_DEVICE_ID_HP_CISSC 0x3230
744#define PCI_DEVICE_ID_HP_CISSD 0x3238 744#define PCI_DEVICE_ID_HP_CISSD 0x3238
745#define PCI_DEVICE_ID_HP_CISSE 0x323a 745#define PCI_DEVICE_ID_HP_CISSE 0x323a
746#define PCI_DEVICE_ID_HP_CISSF 0x323b
746#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031 747#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031
747 748
748#define PCI_VENDOR_ID_PCTECH 0x1042 749#define PCI_VENDOR_ID_PCTECH 0x1042
@@ -819,7 +820,7 @@
819 820
820#define PCI_VENDOR_ID_ANIGMA 0x1051 821#define PCI_VENDOR_ID_ANIGMA 0x1051
821#define PCI_DEVICE_ID_ANIGMA_MC145575 0x0100 822#define PCI_DEVICE_ID_ANIGMA_MC145575 0x0100
822 823
823#define PCI_VENDOR_ID_EFAR 0x1055 824#define PCI_VENDOR_ID_EFAR 0x1055
824#define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130 825#define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130
825#define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463 826#define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463
@@ -1450,7 +1451,7 @@
1450 1451
1451#define PCI_VENDOR_ID_ZIATECH 0x1138 1452#define PCI_VENDOR_ID_ZIATECH 0x1138
1452#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 1453#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550
1453 1454
1454 1455
1455#define PCI_VENDOR_ID_SYSKONNECT 0x1148 1456#define PCI_VENDOR_ID_SYSKONNECT 0x1148
1456#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200 1457#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200
@@ -1604,8 +1605,8 @@
1604#define PCI_DEVICE_ID_RP8OCTA 0x0005 1605#define PCI_DEVICE_ID_RP8OCTA 0x0005
1605#define PCI_DEVICE_ID_RP8J 0x0006 1606#define PCI_DEVICE_ID_RP8J 0x0006
1606#define PCI_DEVICE_ID_RP4J 0x0007 1607#define PCI_DEVICE_ID_RP4J 0x0007
1607#define PCI_DEVICE_ID_RP8SNI 0x0008 1608#define PCI_DEVICE_ID_RP8SNI 0x0008
1608#define PCI_DEVICE_ID_RP16SNI 0x0009 1609#define PCI_DEVICE_ID_RP16SNI 0x0009
1609#define PCI_DEVICE_ID_RPP4 0x000A 1610#define PCI_DEVICE_ID_RPP4 0x000A
1610#define PCI_DEVICE_ID_RPP8 0x000B 1611#define PCI_DEVICE_ID_RPP8 0x000B
1611#define PCI_DEVICE_ID_RP4M 0x000D 1612#define PCI_DEVICE_ID_RP4M 0x000D
@@ -1615,9 +1616,9 @@
1615#define PCI_DEVICE_ID_URP8INTF 0x0802 1616#define PCI_DEVICE_ID_URP8INTF 0x0802
1616#define PCI_DEVICE_ID_URP16INTF 0x0803 1617#define PCI_DEVICE_ID_URP16INTF 0x0803
1617#define PCI_DEVICE_ID_URP8OCTA 0x0805 1618#define PCI_DEVICE_ID_URP8OCTA 0x0805
1618#define PCI_DEVICE_ID_UPCI_RM3_8PORT 0x080C 1619#define PCI_DEVICE_ID_UPCI_RM3_8PORT 0x080C
1619#define PCI_DEVICE_ID_UPCI_RM3_4PORT 0x080D 1620#define PCI_DEVICE_ID_UPCI_RM3_4PORT 0x080D
1620#define PCI_DEVICE_ID_CRP16INTF 0x0903 1621#define PCI_DEVICE_ID_CRP16INTF 0x0903
1621 1622
1622#define PCI_VENDOR_ID_CYCLADES 0x120e 1623#define PCI_VENDOR_ID_CYCLADES 0x120e
1623#define PCI_DEVICE_ID_CYCLOM_Y_Lo 0x0100 1624#define PCI_DEVICE_ID_CYCLOM_Y_Lo 0x0100
@@ -2143,7 +2144,7 @@
2143#define PCI_DEVICE_ID_RASTEL_2PORT 0x2000 2144#define PCI_DEVICE_ID_RASTEL_2PORT 0x2000
2144 2145
2145#define PCI_VENDOR_ID_ZOLTRIX 0x15b0 2146#define PCI_VENDOR_ID_ZOLTRIX 0x15b0
2146#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2bd0 2147#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2bd0
2147 2148
2148#define PCI_VENDOR_ID_MELLANOX 0x15b3 2149#define PCI_VENDOR_ID_MELLANOX 0x15b3
2149#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 2150#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44
@@ -2193,6 +2194,9 @@
2193#define PCI_VENDOR_ID_ARIMA 0x161f 2194#define PCI_VENDOR_ID_ARIMA 0x161f
2194 2195
2195#define PCI_VENDOR_ID_BROCADE 0x1657 2196#define PCI_VENDOR_ID_BROCADE 0x1657
2197#define PCI_DEVICE_ID_BROCADE_CT 0x0014
2198#define PCI_DEVICE_ID_BROCADE_FC_8G1P 0x0017
2199#define PCI_DEVICE_ID_BROCADE_CT_FC 0x0021
2196 2200
2197#define PCI_VENDOR_ID_SIBYTE 0x166d 2201#define PCI_VENDOR_ID_SIBYTE 0x166d
2198#define PCI_DEVICE_ID_BCM1250_PCI 0x0001 2202#define PCI_DEVICE_ID_BCM1250_PCI 0x0001
@@ -2264,6 +2268,13 @@
2264 2268
2265#define PCI_VENDOR_ID_SILAN 0x1904 2269#define PCI_VENDOR_ID_SILAN 0x1904
2266 2270
2271#define PCI_VENDOR_ID_RENESAS 0x1912
2272#define PCI_DEVICE_ID_RENESAS_SH7781 0x0001
2273#define PCI_DEVICE_ID_RENESAS_SH7780 0x0002
2274#define PCI_DEVICE_ID_RENESAS_SH7763 0x0004
2275#define PCI_DEVICE_ID_RENESAS_SH7785 0x0007
2276#define PCI_DEVICE_ID_RENESAS_SH7786 0x0010
2277
2267#define PCI_VENDOR_ID_TDI 0x192E 2278#define PCI_VENDOR_ID_TDI 0x192E
2268#define PCI_DEVICE_ID_TDI_EHCI 0x0101 2279#define PCI_DEVICE_ID_TDI_EHCI 0x0101
2269 2280
@@ -2427,7 +2438,7 @@
2427#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130 2438#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130
2428#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132 2439#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132
2429#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221 2440#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221
2430#define PCI_DEVICE_ID_INTEL_7505_0 0x2550 2441#define PCI_DEVICE_ID_INTEL_7505_0 0x2550
2431#define PCI_DEVICE_ID_INTEL_7205_0 0x255d 2442#define PCI_DEVICE_ID_INTEL_7205_0 0x255d
2432#define PCI_DEVICE_ID_INTEL_82437 0x122d 2443#define PCI_DEVICE_ID_INTEL_82437 0x122d
2433#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e 2444#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e
@@ -2630,6 +2641,9 @@
2630#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 2641#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599
2631#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a 2642#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a
2632#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e 2643#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e
2644#define PCI_DEVICE_ID_INTEL_I7300_MCH_ERR 0x360c
2645#define PCI_DEVICE_ID_INTEL_I7300_MCH_FB0 0x360f
2646#define PCI_DEVICE_ID_INTEL_I7300_MCH_FB1 0x3610
2633#define PCI_DEVICE_ID_INTEL_IOAT_CNB 0x360b 2647#define PCI_DEVICE_ID_INTEL_IOAT_CNB 0x360b
2634#define PCI_DEVICE_ID_INTEL_FBD_CNB 0x360c 2648#define PCI_DEVICE_ID_INTEL_FBD_CNB 0x360c
2635#define PCI_DEVICE_ID_INTEL_IOAT_JSF0 0x3710 2649#define PCI_DEVICE_ID_INTEL_IOAT_JSF0 0x3710
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 0eb50832aa00..5095b834a6fb 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -48,10 +48,8 @@
48 preempt_enable(); \ 48 preempt_enable(); \
49} while (0) 49} while (0)
50 50
51#ifdef CONFIG_SMP
52
53/* minimum unit size, also is the maximum supported allocation size */ 51/* minimum unit size, also is the maximum supported allocation size */
54#define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10) 52#define PCPU_MIN_UNIT_SIZE PFN_ALIGN(32 << 10)
55 53
56/* 54/*
57 * Percpu allocator can serve percpu allocations before slab is 55 * Percpu allocator can serve percpu allocations before slab is
@@ -146,37 +144,20 @@ extern int __init pcpu_page_first_chunk(size_t reserved_size,
146 * dynamically allocated. Non-atomic access to the current CPU's 144 * dynamically allocated. Non-atomic access to the current CPU's
147 * version should probably be combined with get_cpu()/put_cpu(). 145 * version should probably be combined with get_cpu()/put_cpu().
148 */ 146 */
147#ifdef CONFIG_SMP
149#define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) 148#define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu)))
149#else
150#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR((ptr)); })
151#endif
150 152
151extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align); 153extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align);
152extern bool is_kernel_percpu_address(unsigned long addr); 154extern bool is_kernel_percpu_address(unsigned long addr);
153 155
154#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA 156#if !defined(CONFIG_SMP) || !defined(CONFIG_HAVE_SETUP_PER_CPU_AREA)
155extern void __init setup_per_cpu_areas(void); 157extern void __init setup_per_cpu_areas(void);
156#endif 158#endif
157extern void __init percpu_init_late(void); 159extern void __init percpu_init_late(void);
158 160
159#else /* CONFIG_SMP */
160
161#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR((ptr)); })
162
163/* can't distinguish from other static vars, always false */
164static inline bool is_kernel_percpu_address(unsigned long addr)
165{
166 return false;
167}
168
169static inline void __init setup_per_cpu_areas(void) { }
170
171static inline void __init percpu_init_late(void) { }
172
173static inline void *pcpu_lpage_remapped(void *kaddr)
174{
175 return NULL;
176}
177
178#endif /* CONFIG_SMP */
179
180extern void __percpu *__alloc_percpu(size_t size, size_t align); 161extern void __percpu *__alloc_percpu(size_t size, size_t align);
181extern void free_percpu(void __percpu *__pdata); 162extern void free_percpu(void __percpu *__pdata);
182extern phys_addr_t per_cpu_ptr_to_phys(void *addr); 163extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index 76edadf046d3..26c8df786918 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -36,6 +36,9 @@
36/* Socket options for SOL_PNPIPE level */ 36/* Socket options for SOL_PNPIPE level */
37#define PNPIPE_ENCAP 1 37#define PNPIPE_ENCAP 1
38#define PNPIPE_IFINDEX 2 38#define PNPIPE_IFINDEX 2
39#define PNPIPE_PIPE_HANDLE 3
40#define PNPIPE_ENABLE 4
41/* unused slot */
39 42
40#define PNADDR_ANY 0 43#define PNADDR_ANY 0
41#define PNADDR_BROADCAST 0xFC 44#define PNADDR_BROADCAST 0xFC
@@ -47,6 +50,8 @@
47 50
48/* ioctls */ 51/* ioctls */
49#define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0) 52#define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0)
53#define SIOCPNADDRESOURCE (SIOCPROTOPRIVATE + 14)
54#define SIOCPNDELRESOURCE (SIOCPROTOPRIVATE + 15)
50 55
51/* Phonet protocol header */ 56/* Phonet protocol header */
52struct phonethdr { 57struct phonethdr {
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 6b0a782c6224..7da5fa845959 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -116,7 +116,7 @@ struct mii_bus {
116 /* list of all PHYs on bus */ 116 /* list of all PHYs on bus */
117 struct phy_device *phy_map[PHY_MAX_ADDR]; 117 struct phy_device *phy_map[PHY_MAX_ADDR];
118 118
119 /* Phy addresses to be ignored when probing */ 119 /* PHY addresses to be ignored when probing */
120 u32 phy_mask; 120 u32 phy_mask;
121 121
122 /* 122 /*
@@ -283,7 +283,7 @@ struct phy_device {
283 283
284 phy_interface_t interface; 284 phy_interface_t interface;
285 285
286 /* Bus address of the PHY (0-32) */ 286 /* Bus address of the PHY (0-31) */
287 int addr; 287 int addr;
288 288
289 /* 289 /*
@@ -472,11 +472,7 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val)
472int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); 472int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id);
473struct phy_device* get_phy_device(struct mii_bus *bus, int addr); 473struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
474int phy_device_register(struct phy_device *phy); 474int phy_device_register(struct phy_device *phy);
475int phy_clear_interrupt(struct phy_device *phydev);
476int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
477int phy_init_hw(struct phy_device *phydev); 475int phy_init_hw(struct phy_device *phydev);
478int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
479 u32 flags, phy_interface_t interface);
480struct phy_device * phy_attach(struct net_device *dev, 476struct phy_device * phy_attach(struct net_device *dev,
481 const char *bus_id, u32 flags, phy_interface_t interface); 477 const char *bus_id, u32 flags, phy_interface_t interface);
482struct phy_device *phy_find_first(struct mii_bus *bus); 478struct phy_device *phy_find_first(struct mii_bus *bus);
@@ -492,17 +488,12 @@ void phy_start(struct phy_device *phydev);
492void phy_stop(struct phy_device *phydev); 488void phy_stop(struct phy_device *phydev);
493int phy_start_aneg(struct phy_device *phydev); 489int phy_start_aneg(struct phy_device *phydev);
494 490
495void phy_sanitize_settings(struct phy_device *phydev);
496int phy_stop_interrupts(struct phy_device *phydev); 491int phy_stop_interrupts(struct phy_device *phydev);
497int phy_enable_interrupts(struct phy_device *phydev);
498int phy_disable_interrupts(struct phy_device *phydev);
499 492
500static inline int phy_read_status(struct phy_device *phydev) { 493static inline int phy_read_status(struct phy_device *phydev) {
501 return phydev->drv->read_status(phydev); 494 return phydev->drv->read_status(phydev);
502} 495}
503 496
504int genphy_config_advert(struct phy_device *phydev);
505int genphy_setup_forced(struct phy_device *phydev);
506int genphy_restart_aneg(struct phy_device *phydev); 497int genphy_restart_aneg(struct phy_device *phydev);
507int genphy_config_aneg(struct phy_device *phydev); 498int genphy_config_aneg(struct phy_device *phydev);
508int genphy_update_link(struct phy_device *phydev); 499int genphy_update_link(struct phy_device *phydev);
@@ -511,8 +502,6 @@ int genphy_suspend(struct phy_device *phydev);
511int genphy_resume(struct phy_device *phydev); 502int genphy_resume(struct phy_device *phydev);
512void phy_driver_unregister(struct phy_driver *drv); 503void phy_driver_unregister(struct phy_driver *drv);
513int phy_driver_register(struct phy_driver *new_driver); 504int phy_driver_register(struct phy_driver *new_driver);
514void phy_prepare_link(struct phy_device *phydev,
515 void (*adjust_link)(struct net_device *));
516void phy_state_machine(struct work_struct *work); 505void phy_state_machine(struct work_struct *work);
517void phy_start_machine(struct phy_device *phydev, 506void phy_start_machine(struct phy_device *phydev,
518 void (*handler)(struct net_device *)); 507 void (*handler)(struct net_device *));
@@ -523,7 +512,6 @@ int phy_mii_ioctl(struct phy_device *phydev,
523 struct ifreq *ifr, int cmd); 512 struct ifreq *ifr, int cmd);
524int phy_start_interrupts(struct phy_device *phydev); 513int phy_start_interrupts(struct phy_device *phydev);
525void phy_print_status(struct phy_device *phydev); 514void phy_print_status(struct phy_device *phydev);
526struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id);
527void phy_device_free(struct phy_device *phydev); 515void phy_device_free(struct phy_device *phydev);
528 516
529int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, 517int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 7f6ba8658abe..defbde203d07 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -332,6 +332,7 @@ enum {
332 FLOW_KEY_SKUID, 332 FLOW_KEY_SKUID,
333 FLOW_KEY_SKGID, 333 FLOW_KEY_SKGID,
334 FLOW_KEY_VLAN_TAG, 334 FLOW_KEY_VLAN_TAG,
335 FLOW_KEY_RXHASH,
335 __FLOW_KEY_MAX, 336 __FLOW_KEY_MAX,
336}; 337};
337 338
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index d7ecad0093bb..2e700ec0601f 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -138,6 +138,9 @@ extern struct platform_device *platform_create_bundle(struct platform_driver *dr
138 struct resource *res, unsigned int n_res, 138 struct resource *res, unsigned int n_res,
139 const void *data, size_t size); 139 const void *data, size_t size);
140 140
141extern const struct dev_pm_ops * platform_bus_get_pm_ops(void);
142extern void platform_bus_set_pm_ops(const struct dev_pm_ops *pm);
143
141/* early platform driver interface */ 144/* early platform driver interface */
142struct early_platform_driver { 145struct early_platform_driver {
143 const char *class_str; 146 const char *class_str;
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 600cc1fde64d..56e76af78102 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -73,6 +73,8 @@ extern void poll_initwait(struct poll_wqueues *pwq);
73extern void poll_freewait(struct poll_wqueues *pwq); 73extern void poll_freewait(struct poll_wqueues *pwq);
74extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state, 74extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state,
75 ktime_t *expires, unsigned long slack); 75 ktime_t *expires, unsigned long slack);
76extern long select_estimate_accuracy(struct timespec *tv);
77
76 78
77static inline int poll_schedule(struct poll_wqueues *pwq, int state) 79static inline int poll_schedule(struct poll_wqueues *pwq, int state)
78{ 80{
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 30083a896f36..7d7325685c42 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -89,6 +89,7 @@ enum power_supply_property {
89 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, 89 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
90 POWER_SUPPLY_PROP_VOLTAGE_NOW, 90 POWER_SUPPLY_PROP_VOLTAGE_NOW,
91 POWER_SUPPLY_PROP_VOLTAGE_AVG, 91 POWER_SUPPLY_PROP_VOLTAGE_AVG,
92 POWER_SUPPLY_PROP_CURRENT_MAX,
92 POWER_SUPPLY_PROP_CURRENT_NOW, 93 POWER_SUPPLY_PROP_CURRENT_NOW,
93 POWER_SUPPLY_PROP_CURRENT_AVG, 94 POWER_SUPPLY_PROP_CURRENT_AVG,
94 POWER_SUPPLY_PROP_POWER_NOW, 95 POWER_SUPPLY_PROP_POWER_NOW,
@@ -125,7 +126,10 @@ enum power_supply_type {
125 POWER_SUPPLY_TYPE_BATTERY = 0, 126 POWER_SUPPLY_TYPE_BATTERY = 0,
126 POWER_SUPPLY_TYPE_UPS, 127 POWER_SUPPLY_TYPE_UPS,
127 POWER_SUPPLY_TYPE_MAINS, 128 POWER_SUPPLY_TYPE_MAINS,
128 POWER_SUPPLY_TYPE_USB, 129 POWER_SUPPLY_TYPE_USB, /* Standard Downstream Port */
130 POWER_SUPPLY_TYPE_USB_DCP, /* Dedicated Charging Port */
131 POWER_SUPPLY_TYPE_USB_CDP, /* Charging Downstream Port */
132 POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */
129}; 133};
130 134
131union power_supply_propval { 135union power_supply_propval {
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 4272521e29e9..092a04f874a8 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -100,7 +100,8 @@
100#include <linux/sched.h> /* For struct task_struct. */ 100#include <linux/sched.h> /* For struct task_struct. */
101 101
102 102
103extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); 103extern long arch_ptrace(struct task_struct *child, long request,
104 unsigned long addr, unsigned long data);
104extern int ptrace_traceme(void); 105extern int ptrace_traceme(void);
105extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); 106extern 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); 107extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);
@@ -108,7 +109,8 @@ extern int ptrace_attach(struct task_struct *tsk);
108extern int ptrace_detach(struct task_struct *, unsigned int); 109extern int ptrace_detach(struct task_struct *, unsigned int);
109extern void ptrace_disable(struct task_struct *); 110extern void ptrace_disable(struct task_struct *);
110extern int ptrace_check_attach(struct task_struct *task, int kill); 111extern int ptrace_check_attach(struct task_struct *task, int kill);
111extern int ptrace_request(struct task_struct *child, long request, long addr, long data); 112extern int ptrace_request(struct task_struct *child, long request,
113 unsigned long addr, unsigned long data);
112extern void ptrace_notify(int exit_code); 114extern void ptrace_notify(int exit_code);
113extern void __ptrace_link(struct task_struct *child, 115extern void __ptrace_link(struct task_struct *child,
114 struct task_struct *new_parent); 116 struct task_struct *new_parent);
@@ -132,8 +134,10 @@ static inline void ptrace_unlink(struct task_struct *child)
132 __ptrace_unlink(child); 134 __ptrace_unlink(child);
133} 135}
134 136
135int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data); 137int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr,
136int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data); 138 unsigned long data);
139int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
140 unsigned long data);
137 141
138/** 142/**
139 * task_ptrace - return %PT_* flags that apply to a task 143 * task_ptrace - return %PT_* flags that apply to a task
diff --git a/include/linux/ramoops.h b/include/linux/ramoops.h
new file mode 100644
index 000000000000..0ae68a2c1212
--- /dev/null
+++ b/include/linux/ramoops.h
@@ -0,0 +1,15 @@
1#ifndef __RAMOOPS_H
2#define __RAMOOPS_H
3
4/*
5 * Ramoops platform data
6 * @mem_size memory size for ramoops
7 * @mem_address physical memory address to contain ramoops
8 */
9
10struct ramoops_platform_data {
11 unsigned long mem_size;
12 unsigned long mem_address;
13};
14
15#endif
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index 8f69d09a41a5..03ff67b0cdf5 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -36,6 +36,8 @@ static inline void ratelimit_state_init(struct ratelimit_state *rs,
36 rs->begin = 0; 36 rs->begin = 0;
37} 37}
38 38
39extern struct ratelimit_state printk_ratelimit_state;
40
39extern int ___ratelimit(struct ratelimit_state *rs, const char *func); 41extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
40#define __ratelimit(state) ___ratelimit(state, __func__) 42#define __ratelimit(state) ___ratelimit(state, __func__)
41 43
diff --git a/include/linux/rds.h b/include/linux/rds.h
index 24bce3ded9ea..91950950aa59 100644
--- a/include/linux/rds.h
+++ b/include/linux/rds.h
@@ -36,15 +36,6 @@
36 36
37#include <linux/types.h> 37#include <linux/types.h>
38 38
39/* These sparse annotated types shouldn't be in any user
40 * visible header file. We should clean this up rather
41 * than kludging around them. */
42#ifndef __KERNEL__
43#define __be16 u_int16_t
44#define __be32 u_int32_t
45#define __be64 u_int64_t
46#endif
47
48#define RDS_IB_ABI_VERSION 0x301 39#define RDS_IB_ABI_VERSION 0x301
49 40
50/* 41/*
@@ -82,6 +73,10 @@
82#define RDS_CMSG_RDMA_MAP 3 73#define RDS_CMSG_RDMA_MAP 3
83#define RDS_CMSG_RDMA_STATUS 4 74#define RDS_CMSG_RDMA_STATUS 4
84#define RDS_CMSG_CONG_UPDATE 5 75#define RDS_CMSG_CONG_UPDATE 5
76#define RDS_CMSG_ATOMIC_FADD 6
77#define RDS_CMSG_ATOMIC_CSWP 7
78#define RDS_CMSG_MASKED_ATOMIC_FADD 8
79#define RDS_CMSG_MASKED_ATOMIC_CSWP 9
85 80
86#define RDS_INFO_FIRST 10000 81#define RDS_INFO_FIRST 10000
87#define RDS_INFO_COUNTERS 10000 82#define RDS_INFO_COUNTERS 10000
@@ -98,9 +93,9 @@
98#define RDS_INFO_LAST 10010 93#define RDS_INFO_LAST 10010
99 94
100struct rds_info_counter { 95struct rds_info_counter {
101 u_int8_t name[32]; 96 uint8_t name[32];
102 u_int64_t value; 97 uint64_t value;
103} __packed; 98} __attribute__((packed));
104 99
105#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 100#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01
106#define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02 101#define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02
@@ -109,56 +104,48 @@ struct rds_info_counter {
109#define TRANSNAMSIZ 16 104#define TRANSNAMSIZ 16
110 105
111struct rds_info_connection { 106struct rds_info_connection {
112 u_int64_t next_tx_seq; 107 uint64_t next_tx_seq;
113 u_int64_t next_rx_seq; 108 uint64_t next_rx_seq;
114 __be32 laddr;
115 __be32 faddr;
116 u_int8_t transport[TRANSNAMSIZ]; /* null term ascii */
117 u_int8_t flags;
118} __packed;
119
120struct rds_info_flow {
121 __be32 laddr; 109 __be32 laddr;
122 __be32 faddr; 110 __be32 faddr;
123 u_int32_t bytes; 111 uint8_t transport[TRANSNAMSIZ]; /* null term ascii */
124 __be16 lport; 112 uint8_t flags;
125 __be16 fport; 113} __attribute__((packed));
126} __packed;
127 114
128#define RDS_INFO_MESSAGE_FLAG_ACK 0x01 115#define RDS_INFO_MESSAGE_FLAG_ACK 0x01
129#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 116#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02
130 117
131struct rds_info_message { 118struct rds_info_message {
132 u_int64_t seq; 119 uint64_t seq;
133 u_int32_t len; 120 uint32_t len;
134 __be32 laddr; 121 __be32 laddr;
135 __be32 faddr; 122 __be32 faddr;
136 __be16 lport; 123 __be16 lport;
137 __be16 fport; 124 __be16 fport;
138 u_int8_t flags; 125 uint8_t flags;
139} __packed; 126} __attribute__((packed));
140 127
141struct rds_info_socket { 128struct rds_info_socket {
142 u_int32_t sndbuf; 129 uint32_t sndbuf;
143 __be32 bound_addr; 130 __be32 bound_addr;
144 __be32 connected_addr; 131 __be32 connected_addr;
145 __be16 bound_port; 132 __be16 bound_port;
146 __be16 connected_port; 133 __be16 connected_port;
147 u_int32_t rcvbuf; 134 uint32_t rcvbuf;
148 u_int64_t inum; 135 uint64_t inum;
149} __packed; 136} __attribute__((packed));
150 137
151struct rds_info_tcp_socket { 138struct rds_info_tcp_socket {
152 __be32 local_addr; 139 __be32 local_addr;
153 __be16 local_port; 140 __be16 local_port;
154 __be32 peer_addr; 141 __be32 peer_addr;
155 __be16 peer_port; 142 __be16 peer_port;
156 u_int64_t hdr_rem; 143 uint64_t hdr_rem;
157 u_int64_t data_rem; 144 uint64_t data_rem;
158 u_int32_t last_sent_nxt; 145 uint32_t last_sent_nxt;
159 u_int32_t last_expected_una; 146 uint32_t last_expected_una;
160 u_int32_t last_seen_una; 147 uint32_t last_seen_una;
161} __packed; 148} __attribute__((packed));
162 149
163#define RDS_IB_GID_LEN 16 150#define RDS_IB_GID_LEN 16
164struct rds_info_rdma_connection { 151struct rds_info_rdma_connection {
@@ -212,42 +199,69 @@ struct rds_info_rdma_connection {
212 * (so that the application does not have to worry about 199 * (so that the application does not have to worry about
213 * alignment). 200 * alignment).
214 */ 201 */
215typedef u_int64_t rds_rdma_cookie_t; 202typedef uint64_t rds_rdma_cookie_t;
216 203
217struct rds_iovec { 204struct rds_iovec {
218 u_int64_t addr; 205 uint64_t addr;
219 u_int64_t bytes; 206 uint64_t bytes;
220}; 207};
221 208
222struct rds_get_mr_args { 209struct rds_get_mr_args {
223 struct rds_iovec vec; 210 struct rds_iovec vec;
224 u_int64_t cookie_addr; 211 uint64_t cookie_addr;
225 uint64_t flags; 212 uint64_t flags;
226}; 213};
227 214
228struct rds_get_mr_for_dest_args { 215struct rds_get_mr_for_dest_args {
229 struct sockaddr_storage dest_addr; 216 struct sockaddr_storage dest_addr;
230 struct rds_iovec vec; 217 struct rds_iovec vec;
231 u_int64_t cookie_addr; 218 uint64_t cookie_addr;
232 uint64_t flags; 219 uint64_t flags;
233}; 220};
234 221
235struct rds_free_mr_args { 222struct rds_free_mr_args {
236 rds_rdma_cookie_t cookie; 223 rds_rdma_cookie_t cookie;
237 u_int64_t flags; 224 uint64_t flags;
238}; 225};
239 226
240struct rds_rdma_args { 227struct rds_rdma_args {
241 rds_rdma_cookie_t cookie; 228 rds_rdma_cookie_t cookie;
242 struct rds_iovec remote_vec; 229 struct rds_iovec remote_vec;
243 u_int64_t local_vec_addr; 230 uint64_t local_vec_addr;
244 u_int64_t nr_local; 231 uint64_t nr_local;
245 u_int64_t flags; 232 uint64_t flags;
246 u_int64_t user_token; 233 uint64_t user_token;
234};
235
236struct rds_atomic_args {
237 rds_rdma_cookie_t cookie;
238 uint64_t local_addr;
239 uint64_t remote_addr;
240 union {
241 struct {
242 uint64_t compare;
243 uint64_t swap;
244 } cswp;
245 struct {
246 uint64_t add;
247 } fadd;
248 struct {
249 uint64_t compare;
250 uint64_t swap;
251 uint64_t compare_mask;
252 uint64_t swap_mask;
253 } m_cswp;
254 struct {
255 uint64_t add;
256 uint64_t nocarry_mask;
257 } m_fadd;
258 };
259 uint64_t flags;
260 uint64_t user_token;
247}; 261};
248 262
249struct rds_rdma_notify { 263struct rds_rdma_notify {
250 u_int64_t user_token; 264 uint64_t user_token;
251 int32_t status; 265 int32_t status;
252}; 266};
253 267
@@ -266,5 +280,6 @@ struct rds_rdma_notify {
266#define RDS_RDMA_USE_ONCE 0x0008 /* free MR after use */ 280#define RDS_RDMA_USE_ONCE 0x0008 /* free MR after use */
267#define RDS_RDMA_DONTWAIT 0x0010 /* Don't wait in SET_BARRIER */ 281#define RDS_RDMA_DONTWAIT 0x0010 /* Don't wait in SET_BARRIER */
268#define RDS_RDMA_NOTIFY_ME 0x0020 /* Notify when operation completes */ 282#define RDS_RDMA_NOTIFY_ME 0x0020 /* Notify when operation completes */
283#define RDS_RDMA_SILENT 0x0040 /* Do not interrupt remote */
269 284
270#endif /* IB_RDS_H */ 285#endif /* IB_RDS_H */
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 91a4177e60ce..5ca47e59b727 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -2072,6 +2072,8 @@ void sd_attrs_to_i_attrs(__u16 sd_attrs, struct inode *inode);
2072void i_attrs_to_sd_attrs(struct inode *inode, __u16 * sd_attrs); 2072void i_attrs_to_sd_attrs(struct inode *inode, __u16 * sd_attrs);
2073int reiserfs_setattr(struct dentry *dentry, struct iattr *attr); 2073int reiserfs_setattr(struct dentry *dentry, struct iattr *attr);
2074 2074
2075int __reiserfs_write_begin(struct page *page, unsigned from, unsigned len);
2076
2075/* namei.c */ 2077/* namei.c */
2076void set_de_name_and_namelen(struct reiserfs_dir_entry *de); 2078void set_de_name_and_namelen(struct reiserfs_dir_entry *de);
2077int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, 2079int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 25b4f686d918..8d3a2486544d 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -62,18 +62,6 @@ enum ring_buffer_type {
62unsigned ring_buffer_event_length(struct ring_buffer_event *event); 62unsigned ring_buffer_event_length(struct ring_buffer_event *event);
63void *ring_buffer_event_data(struct ring_buffer_event *event); 63void *ring_buffer_event_data(struct ring_buffer_event *event);
64 64
65/**
66 * ring_buffer_event_time_delta - return the delta timestamp of the event
67 * @event: the event to get the delta timestamp of
68 *
69 * The delta timestamp is the 27 bit timestamp since the last event.
70 */
71static inline unsigned
72ring_buffer_event_time_delta(struct ring_buffer_event *event)
73{
74 return event->time_delta;
75}
76
77/* 65/*
78 * ring_buffer_discard_commit will remove an event that has not 66 * ring_buffer_discard_commit will remove an event that has not
79 * ben committed yet. If this is used, then ring_buffer_unlock_commit 67 * ben committed yet. If this is used, then ring_buffer_unlock_commit
diff --git a/include/linux/rio.h b/include/linux/rio.h
index bd6eb0ed34a7..0bed941f9b13 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -67,6 +67,7 @@
67#define RIO_PW_MSG_SIZE 64 67#define RIO_PW_MSG_SIZE 64
68 68
69extern struct bus_type rio_bus_type; 69extern struct bus_type rio_bus_type;
70extern struct device rio_bus;
70extern struct list_head rio_devices; /* list of all devices */ 71extern struct list_head rio_devices; /* list of all devices */
71 72
72struct rio_mport; 73struct rio_mport;
@@ -98,6 +99,7 @@ union rio_pw_msg;
98 * @riores: RIO resources this device owns 99 * @riores: RIO resources this device owns
99 * @pwcback: port-write callback function for this device 100 * @pwcback: port-write callback function for this device
100 * @destid: Network destination ID 101 * @destid: Network destination ID
102 * @prev: Previous RIO device connected to the current one
101 */ 103 */
102struct rio_dev { 104struct rio_dev {
103 struct list_head global_list; /* node in list of all RIO devices */ 105 struct list_head global_list; /* node in list of all RIO devices */
@@ -111,7 +113,7 @@ struct rio_dev {
111 u16 asm_rev; 113 u16 asm_rev;
112 u16 efptr; 114 u16 efptr;
113 u32 pef; 115 u32 pef;
114 u32 swpinfo; /* Only used for switches */ 116 u32 swpinfo;
115 u32 src_ops; 117 u32 src_ops;
116 u32 dst_ops; 118 u32 dst_ops;
117 u32 comp_tag; 119 u32 comp_tag;
@@ -124,6 +126,7 @@ struct rio_dev {
124 struct resource riores[RIO_MAX_DEV_RESOURCES]; 126 struct resource riores[RIO_MAX_DEV_RESOURCES];
125 int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); 127 int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step);
126 u16 destid; 128 u16 destid;
129 struct rio_dev *prev;
127}; 130};
128 131
129#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) 132#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list)
@@ -174,6 +177,7 @@ enum rio_phy_type {
174 * @index: Port index, unique among all port interfaces of the same type 177 * @index: Port index, unique among all port interfaces of the same type
175 * @sys_size: RapidIO common transport system size 178 * @sys_size: RapidIO common transport system size
176 * @phy_type: RapidIO phy type 179 * @phy_type: RapidIO phy type
180 * @phys_efptr: RIO port extended features pointer
177 * @name: Port name string 181 * @name: Port name string
178 * @priv: Master port private data 182 * @priv: Master port private data
179 */ 183 */
@@ -195,6 +199,7 @@ struct rio_mport {
195 * 1 - Large size, 65536 devices. 199 * 1 - Large size, 65536 devices.
196 */ 200 */
197 enum rio_phy_type phy_type; /* RapidIO phy type */ 201 enum rio_phy_type phy_type; /* RapidIO phy type */
202 u32 phys_efptr;
198 unsigned char name[40]; 203 unsigned char name[40];
199 void *priv; /* Master port private data */ 204 void *priv; /* Master port private data */
200}; 205};
@@ -215,9 +220,14 @@ struct rio_net {
215 unsigned char id; /* RIO network ID */ 220 unsigned char id; /* RIO network ID */
216}; 221};
217 222
223/* Definitions used by switch sysfs initialization callback */
224#define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */
225#define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */
226
218/** 227/**
219 * struct rio_switch - RIO switch info 228 * struct rio_switch - RIO switch info
220 * @node: Node in global list of switches 229 * @node: Node in global list of switches
230 * @rdev: Associated RIO device structure
221 * @switchid: Switch ID that is unique across a network 231 * @switchid: Switch ID that is unique across a network
222 * @hopcount: Hopcount to this switch 232 * @hopcount: Hopcount to this switch
223 * @destid: Associated destid in the path 233 * @destid: Associated destid in the path
@@ -230,9 +240,12 @@ struct rio_net {
230 * @get_domain: Callback for switch-specific domain get function 240 * @get_domain: Callback for switch-specific domain get function
231 * @em_init: Callback for switch-specific error management initialization function 241 * @em_init: Callback for switch-specific error management initialization function
232 * @em_handle: Callback for switch-specific error management handler function 242 * @em_handle: Callback for switch-specific error management handler function
243 * @sw_sysfs: Callback that initializes switch-specific sysfs attributes
244 * @nextdev: Array of per-port pointers to the next attached device
233 */ 245 */
234struct rio_switch { 246struct rio_switch {
235 struct list_head node; 247 struct list_head node;
248 struct rio_dev *rdev;
236 u16 switchid; 249 u16 switchid;
237 u16 hopcount; 250 u16 hopcount;
238 u16 destid; 251 u16 destid;
@@ -250,6 +263,8 @@ struct rio_switch {
250 u8 *sw_domain); 263 u8 *sw_domain);
251 int (*em_init) (struct rio_dev *dev); 264 int (*em_init) (struct rio_dev *dev);
252 int (*em_handle) (struct rio_dev *dev, u8 swport); 265 int (*em_handle) (struct rio_dev *dev, u8 swport);
266 int (*sw_sysfs) (struct rio_dev *dev, int create);
267 struct rio_dev *nextdev[0];
253}; 268};
254 269
255/* Low-level architecture-dependent routines */ 270/* Low-level architecture-dependent routines */
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h
index db50e1c288b7..ee7b6ada188f 100644
--- a/include/linux/rio_ids.h
+++ b/include/linux/rio_ids.h
@@ -34,5 +34,7 @@
34#define RIO_DID_IDTCPS16 0x035b 34#define RIO_DID_IDTCPS16 0x035b
35#define RIO_DID_IDTCPS6Q 0x035f 35#define RIO_DID_IDTCPS6Q 0x035f
36#define RIO_DID_IDTCPS10Q 0x035e 36#define RIO_DID_IDTCPS10Q 0x035e
37#define RIO_DID_IDTCPS1848 0x0374
38#define RIO_DID_IDTCPS1616 0x0379
37 39
38#endif /* LINUX_RIO_IDS_H */ 40#endif /* LINUX_RIO_IDS_H */
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h
index aedee0489fb4..d63dcbaea169 100644
--- a/include/linux/rio_regs.h
+++ b/include/linux/rio_regs.h
@@ -33,6 +33,7 @@
33#define RIO_PEF_MEMORY 0x40000000 /* [I] MMIO */ 33#define RIO_PEF_MEMORY 0x40000000 /* [I] MMIO */
34#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */ 34#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */
35#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */ 35#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */
36#define RIO_PEF_MULTIPORT 0x08000000 /* [VI, 2.1] Multiport */
36#define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */ 37#define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */
37#define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */ 38#define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */
38#define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */ 39#define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */
@@ -51,6 +52,7 @@
51#define RIO_SWP_INFO_PORT_TOTAL_MASK 0x0000ff00 /* [I] Total number of ports */ 52#define RIO_SWP_INFO_PORT_TOTAL_MASK 0x0000ff00 /* [I] Total number of ports */
52#define RIO_SWP_INFO_PORT_NUM_MASK 0x000000ff /* [I] Maintenance transaction port number */ 53#define RIO_SWP_INFO_PORT_NUM_MASK 0x000000ff /* [I] Maintenance transaction port number */
53#define RIO_GET_TOTAL_PORTS(x) ((x & RIO_SWP_INFO_PORT_TOTAL_MASK) >> 8) 54#define RIO_GET_TOTAL_PORTS(x) ((x & RIO_SWP_INFO_PORT_TOTAL_MASK) >> 8)
55#define RIO_GET_PORT_NUM(x) (x & RIO_SWP_INFO_PORT_NUM_MASK)
54 56
55#define RIO_SRC_OPS_CAR 0x18 /* [I] Source Operations CAR */ 57#define RIO_SRC_OPS_CAR 0x18 /* [I] Source Operations CAR */
56#define RIO_SRC_OPS_READ 0x00008000 /* [I] Read op */ 58#define RIO_SRC_OPS_READ 0x00008000 /* [I] Read op */
@@ -159,6 +161,7 @@
159#define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */ 161#define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */
160 162
161#define RIO_STD_RTE_CONF_DESTID_SEL_CSR 0x70 163#define RIO_STD_RTE_CONF_DESTID_SEL_CSR 0x70
164#define RIO_STD_RTE_CONF_EXTCFGEN 0x80000000
162#define RIO_STD_RTE_CONF_PORT_SEL_CSR 0x74 165#define RIO_STD_RTE_CONF_PORT_SEL_CSR 0x74
163#define RIO_STD_RTE_DEFAULT_PORT 0x78 166#define RIO_STD_RTE_DEFAULT_PORT 0x78
164 167
@@ -222,15 +225,17 @@
222#define RIO_PORT_GEN_MASTER 0x40000000 225#define RIO_PORT_GEN_MASTER 0x40000000
223#define RIO_PORT_GEN_DISCOVERED 0x20000000 226#define RIO_PORT_GEN_DISCOVERED 0x20000000
224#define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */ 227#define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */
228#define RIO_MNT_REQ_CMD_RD 0x03 /* Reset-device command */
229#define RIO_MNT_REQ_CMD_IS 0x04 /* Input-status command */
225#define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */ 230#define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */
226#define RIO_PORT_N_MNT_RSP_RVAL 0x80000000 /* Response Valid */ 231#define RIO_PORT_N_MNT_RSP_RVAL 0x80000000 /* Response Valid */
227#define RIO_PORT_N_MNT_RSP_ASTAT 0x000003e0 /* ackID Status */ 232#define RIO_PORT_N_MNT_RSP_ASTAT 0x000007e0 /* ackID Status */
228#define RIO_PORT_N_MNT_RSP_LSTAT 0x0000001f /* Link Status */ 233#define RIO_PORT_N_MNT_RSP_LSTAT 0x0000001f /* Link Status */
229#define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */ 234#define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */
230#define RIO_PORT_N_ACK_CLEAR 0x80000000 235#define RIO_PORT_N_ACK_CLEAR 0x80000000
231#define RIO_PORT_N_ACK_INBOUND 0x1f000000 236#define RIO_PORT_N_ACK_INBOUND 0x3f000000
232#define RIO_PORT_N_ACK_OUTSTAND 0x00001f00 237#define RIO_PORT_N_ACK_OUTSTAND 0x00003f00
233#define RIO_PORT_N_ACK_OUTBOUND 0x0000001f 238#define RIO_PORT_N_ACK_OUTBOUND 0x0000003f
234#define RIO_PORT_N_ERR_STS_CSR(x) (0x0058 + x*0x20) 239#define RIO_PORT_N_ERR_STS_CSR(x) (0x0058 + x*0x20)
235#define RIO_PORT_N_ERR_STS_PW_OUT_ES 0x00010000 /* Output Error-stopped */ 240#define RIO_PORT_N_ERR_STS_PW_OUT_ES 0x00010000 /* Output Error-stopped */
236#define RIO_PORT_N_ERR_STS_PW_INP_ES 0x00000100 /* Input Error-stopped */ 241#define RIO_PORT_N_ERR_STS_PW_INP_ES 0x00000100 /* Input Error-stopped */
@@ -238,7 +243,6 @@
238#define RIO_PORT_N_ERR_STS_PORT_ERR 0x00000004 243#define RIO_PORT_N_ERR_STS_PORT_ERR 0x00000004
239#define RIO_PORT_N_ERR_STS_PORT_OK 0x00000002 244#define RIO_PORT_N_ERR_STS_PORT_OK 0x00000002
240#define RIO_PORT_N_ERR_STS_PORT_UNINIT 0x00000001 245#define RIO_PORT_N_ERR_STS_PORT_UNINIT 0x00000001
241#define RIO_PORT_N_ERR_STS_CLR_MASK 0x07120204
242#define RIO_PORT_N_CTL_CSR(x) (0x005c + x*0x20) 246#define RIO_PORT_N_CTL_CSR(x) (0x005c + x*0x20)
243#define RIO_PORT_N_CTL_PWIDTH 0xc0000000 247#define RIO_PORT_N_CTL_PWIDTH 0xc0000000
244#define RIO_PORT_N_CTL_PWIDTH_1 0x00000000 248#define RIO_PORT_N_CTL_PWIDTH_1 0x00000000
@@ -261,6 +265,10 @@
261#define RIO_EM_EFB_HEADER 0x000 /* Error Management Extensions Block Header */ 265#define RIO_EM_EFB_HEADER 0x000 /* Error Management Extensions Block Header */
262#define RIO_EM_LTL_ERR_DETECT 0x008 /* Logical/Transport Layer Error Detect CSR */ 266#define RIO_EM_LTL_ERR_DETECT 0x008 /* Logical/Transport Layer Error Detect CSR */
263#define RIO_EM_LTL_ERR_EN 0x00c /* Logical/Transport Layer Error Enable CSR */ 267#define RIO_EM_LTL_ERR_EN 0x00c /* Logical/Transport Layer Error Enable CSR */
268#define REM_LTL_ERR_ILLTRAN 0x08000000 /* Illegal Transaction decode */
269#define REM_LTL_ERR_UNSOLR 0x00800000 /* Unsolicited Response */
270#define REM_LTL_ERR_UNSUPTR 0x00400000 /* Unsupported Transaction */
271#define REM_LTL_ERR_IMPSPEC 0x000000ff /* Implementation Specific */
264#define RIO_EM_LTL_HIADDR_CAP 0x010 /* Logical/Transport Layer High Address Capture CSR */ 272#define RIO_EM_LTL_HIADDR_CAP 0x010 /* Logical/Transport Layer High Address Capture CSR */
265#define RIO_EM_LTL_ADDR_CAP 0x014 /* Logical/Transport Layer Address Capture CSR */ 273#define RIO_EM_LTL_ADDR_CAP 0x014 /* Logical/Transport Layer Address Capture CSR */
266#define RIO_EM_LTL_DEVID_CAP 0x018 /* Logical/Transport Layer Device ID Capture CSR */ 274#define RIO_EM_LTL_DEVID_CAP 0x018 /* Logical/Transport Layer Device ID Capture CSR */
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 31b2fd75dcba..bb83c0da2071 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -25,8 +25,8 @@
25 * pointing to this anon_vma once its vma list is empty. 25 * pointing to this anon_vma once its vma list is empty.
26 */ 26 */
27struct anon_vma { 27struct anon_vma {
28 spinlock_t lock; /* Serialize access to vma list */
29 struct anon_vma *root; /* Root of this anon_vma tree */ 28 struct anon_vma *root; /* Root of this anon_vma tree */
29 spinlock_t lock; /* Serialize access to vma list */
30#if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION) 30#if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION)
31 31
32 /* 32 /*
@@ -205,9 +205,20 @@ int try_to_unmap_one(struct page *, struct vm_area_struct *,
205/* 205/*
206 * Called from mm/filemap_xip.c to unmap empty zero page 206 * Called from mm/filemap_xip.c to unmap empty zero page
207 */ 207 */
208pte_t *page_check_address(struct page *, struct mm_struct *, 208pte_t *__page_check_address(struct page *, struct mm_struct *,
209 unsigned long, spinlock_t **, int); 209 unsigned long, spinlock_t **, int);
210 210
211static inline pte_t *page_check_address(struct page *page, struct mm_struct *mm,
212 unsigned long address,
213 spinlock_t **ptlp, int sync)
214{
215 pte_t *ptep;
216
217 __cond_lock(*ptlp, ptep = __page_check_address(page, mm, address,
218 ptlp, sync));
219 return ptep;
220}
221
211/* 222/*
212 * Used by swapoff to help locate where page is expected in vma. 223 * Used by swapoff to help locate where page is expected in vma.
213 */ 224 */
@@ -230,7 +241,20 @@ int try_to_munlock(struct page *);
230/* 241/*
231 * Called by memory-failure.c to kill processes. 242 * Called by memory-failure.c to kill processes.
232 */ 243 */
233struct anon_vma *page_lock_anon_vma(struct page *page); 244struct anon_vma *__page_lock_anon_vma(struct page *page);
245
246static inline struct anon_vma *page_lock_anon_vma(struct page *page)
247{
248 struct anon_vma *anon_vma;
249
250 __cond_lock(RCU, anon_vma = __page_lock_anon_vma(page));
251
252 /* (void) is needed to make gcc happy */
253 (void) __cond_lock(&anon_vma->root->lock, anon_vma);
254
255 return anon_vma;
256}
257
234void page_unlock_anon_vma(struct anon_vma *anon_vma); 258void page_unlock_anon_vma(struct anon_vma *anon_vma);
235int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); 259int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma);
236 260
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 58d44491880f..d42f274418b8 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -6,6 +6,7 @@
6#include <linux/if_link.h> 6#include <linux/if_link.h>
7#include <linux/if_addr.h> 7#include <linux/if_addr.h>
8#include <linux/neighbour.h> 8#include <linux/neighbour.h>
9#include <linux/netdevice.h>
9 10
10/* rtnetlink families. Values up to 127 are reserved for real address 11/* rtnetlink families. Values up to 127 are reserved for real address
11 * families, values above 128 may be used arbitrarily. 12 * families, values above 128 may be used arbitrarily.
@@ -749,6 +750,35 @@ extern int rtnl_is_locked(void);
749extern int lockdep_rtnl_is_held(void); 750extern int lockdep_rtnl_is_held(void);
750#endif /* #ifdef CONFIG_PROVE_LOCKING */ 751#endif /* #ifdef CONFIG_PROVE_LOCKING */
751 752
753/**
754 * rcu_dereference_rtnl - rcu_dereference with debug checking
755 * @p: The pointer to read, prior to dereferencing
756 *
757 * Do an rcu_dereference(p), but check caller either holds rcu_read_lock()
758 * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference()
759 */
760#define rcu_dereference_rtnl(p) \
761 rcu_dereference_check(p, rcu_read_lock_held() || \
762 lockdep_rtnl_is_held())
763
764/**
765 * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL
766 * @p: The pointer to read, prior to dereferencing
767 *
768 * Return the value of the specified RCU-protected pointer, but omit
769 * both the smp_read_barrier_depends() and the ACCESS_ONCE(), because
770 * caller holds RTNL.
771 */
772#define rtnl_dereference(p) \
773 rcu_dereference_protected(p, lockdep_rtnl_is_held())
774
775static inline struct netdev_queue *dev_ingress_queue(struct net_device *dev)
776{
777 return rtnl_dereference(dev->ingress_queue);
778}
779
780extern struct netdev_queue *dev_ingress_queue_create(struct net_device *dev);
781
752extern void rtnetlink_init(void); 782extern void rtnetlink_init(void);
753extern void __rtnl_unlock(void); 783extern void __rtnl_unlock(void);
754 784
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 0383601a927c..be7adb7588e5 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -336,6 +336,9 @@ extern unsigned long sysctl_hung_task_warnings;
336extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, 336extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,
337 void __user *buffer, 337 void __user *buffer,
338 size_t *lenp, loff_t *ppos); 338 size_t *lenp, loff_t *ppos);
339#else
340/* Avoid need for ifdefs elsewhere in the code */
341enum { sysctl_hung_task_timeout_secs = 0 };
339#endif 342#endif
340 343
341/* Attach to any functions which should be ignored in wchan output. */ 344/* Attach to any functions which should be ignored in wchan output. */
@@ -623,6 +626,10 @@ struct signal_struct {
623 626
624 int oom_adj; /* OOM kill score adjustment (bit shift) */ 627 int oom_adj; /* OOM kill score adjustment (bit shift) */
625 int oom_score_adj; /* OOM kill score adjustment */ 628 int oom_score_adj; /* OOM kill score adjustment */
629
630 struct mutex cred_guard_mutex; /* guard against foreign influences on
631 * credential calculations
632 * (notably. ptrace) */
626}; 633};
627 634
628/* Context switch must be unlocked if interrupts are to be enabled */ 635/* Context switch must be unlocked if interrupts are to be enabled */
@@ -1302,9 +1309,6 @@ struct task_struct {
1302 * credentials (COW) */ 1309 * credentials (COW) */
1303 const struct cred __rcu *cred; /* effective (overridable) subjective task 1310 const struct cred __rcu *cred; /* effective (overridable) subjective task
1304 * credentials (COW) */ 1311 * credentials (COW) */
1305 struct mutex cred_guard_mutex; /* guard against foreign influences on
1306 * credential calculations
1307 * (notably. ptrace) */
1308 struct cred *replacement_session_keyring; /* for KEYCTL_SESSION_TO_PARENT */ 1312 struct cred *replacement_session_keyring; /* for KEYCTL_SESSION_TO_PARENT */
1309 1313
1310 char comm[TASK_COMM_LEN]; /* executable name excluding path 1314 char comm[TASK_COMM_LEN]; /* executable name excluding path
@@ -1703,7 +1707,6 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1703#define PF_DUMPCORE 0x00000200 /* dumped core */ 1707#define PF_DUMPCORE 0x00000200 /* dumped core */
1704#define PF_SIGNALED 0x00000400 /* killed by a signal */ 1708#define PF_SIGNALED 0x00000400 /* killed by a signal */
1705#define PF_MEMALLOC 0x00000800 /* Allocating memory */ 1709#define PF_MEMALLOC 0x00000800 /* Allocating memory */
1706#define PF_FLUSHER 0x00001000 /* responsible for disk writeback */
1707#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ 1710#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
1708#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ 1711#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */
1709#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ 1712#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
@@ -2234,9 +2237,16 @@ static inline void task_unlock(struct task_struct *p)
2234 spin_unlock(&p->alloc_lock); 2237 spin_unlock(&p->alloc_lock);
2235} 2238}
2236 2239
2237extern struct sighand_struct *lock_task_sighand(struct task_struct *tsk, 2240extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
2238 unsigned long *flags); 2241 unsigned long *flags);
2239 2242
2243#define lock_task_sighand(tsk, flags) \
2244({ struct sighand_struct *__ss; \
2245 __cond_lock(&(tsk)->sighand->siglock, \
2246 (__ss = __lock_task_sighand(tsk, flags))); \
2247 __ss; \
2248}) \
2249
2240static inline void unlock_task_sighand(struct task_struct *tsk, 2250static inline void unlock_task_sighand(struct task_struct *tsk,
2241 unsigned long *flags) 2251 unsigned long *flags)
2242{ 2252{
diff --git a/include/linux/selection.h b/include/linux/selection.h
index 8cdaa1151d2e..85193aa8c1e3 100644
--- a/include/linux/selection.h
+++ b/include/linux/selection.h
@@ -39,5 +39,6 @@ extern void putconsxy(struct vc_data *vc, unsigned char *p);
39 39
40extern u16 vcs_scr_readw(struct vc_data *vc, const u16 *org); 40extern u16 vcs_scr_readw(struct vc_data *vc, const u16 *org);
41extern void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org); 41extern void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org);
42extern void vcs_scr_updated(struct vc_data *vc);
42 43
43#endif 44#endif
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 7638deaaba65..97f5b45bbc07 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -35,6 +35,8 @@ struct plat_serial8250_port {
35 void (*set_termios)(struct uart_port *, 35 void (*set_termios)(struct uart_port *,
36 struct ktermios *new, 36 struct ktermios *new,
37 struct ktermios *old); 37 struct ktermios *old);
38 void (*pm)(struct uart_port *, unsigned int state,
39 unsigned old);
38}; 40};
39 41
40/* 42/*
@@ -76,5 +78,11 @@ extern int serial8250_find_port_for_earlycon(void);
76extern int setup_early_serial8250_console(char *cmdline); 78extern int setup_early_serial8250_console(char *cmdline);
77extern void serial8250_do_set_termios(struct uart_port *port, 79extern void serial8250_do_set_termios(struct uart_port *port,
78 struct ktermios *termios, struct ktermios *old); 80 struct ktermios *termios, struct ktermios *old);
81extern void serial8250_do_pm(struct uart_port *port, unsigned int state,
82 unsigned int oldstate);
83
84extern void serial8250_set_isa_configurator(void (*v)
85 (int port, struct uart_port *up,
86 unsigned short *capabilities));
79 87
80#endif 88#endif
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 563e23400913..212eb4c67797 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -196,6 +196,9 @@
196/* High Speed UART for Medfield */ 196/* High Speed UART for Medfield */
197#define PORT_MFD 95 197#define PORT_MFD 95
198 198
199/* TI OMAP-UART */
200#define PORT_OMAP 96
201
199#ifdef __KERNEL__ 202#ifdef __KERNEL__
200 203
201#include <linux/compiler.h> 204#include <linux/compiler.h>
@@ -289,6 +292,8 @@ struct uart_port {
289 void (*set_termios)(struct uart_port *, 292 void (*set_termios)(struct uart_port *,
290 struct ktermios *new, 293 struct ktermios *new,
291 struct ktermios *old); 294 struct ktermios *old);
295 void (*pm)(struct uart_port *, unsigned int state,
296 unsigned int old);
292 unsigned int irq; /* irq number */ 297 unsigned int irq; /* irq number */
293 unsigned long irqflags; /* irq flags */ 298 unsigned long irqflags; /* irq flags */
294 unsigned int uartclk; /* base uart clock */ 299 unsigned int uartclk; /* base uart clock */
@@ -411,6 +416,14 @@ unsigned int uart_get_baud_rate(struct uart_port *port, struct ktermios *termios
411 unsigned int max); 416 unsigned int max);
412unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud); 417unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud);
413 418
419/* Base timer interval for polling */
420static inline int uart_poll_timeout(struct uart_port *port)
421{
422 int timeout = port->timeout;
423
424 return timeout > 6 ? (timeout / 2 - 2) : 1;
425}
426
414/* 427/*
415 * Console helpers. 428 * Console helpers.
416 */ 429 */
diff --git a/include/linux/serio.h b/include/linux/serio.h
index b5552568178d..e26f4788845f 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -41,7 +41,9 @@ struct serio {
41 int (*start)(struct serio *); 41 int (*start)(struct serio *);
42 void (*stop)(struct serio *); 42 void (*stop)(struct serio *);
43 43
44 struct serio *parent, *child; 44 struct serio *parent;
45 struct list_head child_node; /* Entry in parent->children list */
46 struct list_head children;
45 unsigned int depth; /* level of nesting in serio hierarchy */ 47 unsigned int depth; /* level of nesting in serio hierarchy */
46 48
47 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ 49 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
@@ -54,10 +56,9 @@ struct serio {
54#define to_serio_port(d) container_of(d, struct serio, dev) 56#define to_serio_port(d) container_of(d, struct serio, dev)
55 57
56struct serio_driver { 58struct serio_driver {
57 void *private; 59 const char *description;
58 char *description;
59 60
60 struct serio_device_id *id_table; 61 const struct serio_device_id *id_table;
61 bool manual_bind; 62 bool manual_bind;
62 63
63 void (*write_wakeup)(struct serio *); 64 void (*write_wakeup)(struct serio *);
@@ -197,5 +198,6 @@ static inline void serio_continue_rx(struct serio *serio)
197#define SERIO_W8001 0x39 198#define SERIO_W8001 0x39
198#define SERIO_DYNAPRO 0x3a 199#define SERIO_DYNAPRO 0x3a
199#define SERIO_HAMPSHIRE 0x3b 200#define SERIO_HAMPSHIRE 0x3b
201#define SERIO_PS2MULT 0x3c
200 202
201#endif 203#endif
diff --git a/include/linux/sfi.h b/include/linux/sfi.h
index 0299b4ce63db..7f770c638e99 100644
--- a/include/linux/sfi.h
+++ b/include/linux/sfi.h
@@ -70,9 +70,6 @@
70#define SFI_SIG_APIC "APIC" 70#define SFI_SIG_APIC "APIC"
71#define SFI_SIG_XSDT "XSDT" 71#define SFI_SIG_XSDT "XSDT"
72#define SFI_SIG_WAKE "WAKE" 72#define SFI_SIG_WAKE "WAKE"
73#define SFI_SIG_SPIB "SPIB"
74#define SFI_SIG_I2CB "I2CB"
75#define SFI_SIG_GPEM "GPEM"
76#define SFI_SIG_DEVS "DEVS" 73#define SFI_SIG_DEVS "DEVS"
77#define SFI_SIG_GPIO "GPIO" 74#define SFI_SIG_GPIO "GPIO"
78 75
@@ -168,27 +165,6 @@ struct sfi_gpio_table_entry {
168 char pin_name[16]; 165 char pin_name[16];
169} __packed; 166} __packed;
170 167
171struct sfi_spi_table_entry {
172 u16 host_num; /* attached to host 0, 1...*/
173 u16 cs; /* chip select */
174 u16 irq_info;
175 char name[16];
176 u8 dev_info[10];
177} __packed;
178
179struct sfi_i2c_table_entry {
180 u16 host_num;
181 u16 addr; /* slave addr */
182 u16 irq_info;
183 char name[16];
184 u8 dev_info[10];
185} __packed;
186
187struct sfi_gpe_table_entry {
188 u16 logical_id; /* logical id */
189 u16 phys_id; /* physical GPE id */
190} __packed;
191
192typedef int (*sfi_table_handler) (struct sfi_table_header *table); 168typedef int (*sfi_table_handler) (struct sfi_table_header *table);
193 169
194#ifdef CONFIG_SFI 170#ifdef CONFIG_SFI
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
index 875ce50719a9..4dca992f3093 100644
--- a/include/linux/sh_clk.h
+++ b/include/linux/sh_clk.h
@@ -4,11 +4,20 @@
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/seq_file.h> 5#include <linux/seq_file.h>
6#include <linux/cpufreq.h> 6#include <linux/cpufreq.h>
7#include <linux/types.h>
8#include <linux/kref.h>
7#include <linux/clk.h> 9#include <linux/clk.h>
8#include <linux/err.h> 10#include <linux/err.h>
9 11
10struct clk; 12struct clk;
11 13
14struct clk_mapping {
15 phys_addr_t phys;
16 void __iomem *base;
17 unsigned long len;
18 struct kref ref;
19};
20
12struct clk_ops { 21struct clk_ops {
13 void (*init)(struct clk *clk); 22 void (*init)(struct clk *clk);
14 int (*enable)(struct clk *clk); 23 int (*enable)(struct clk *clk);
@@ -21,9 +30,6 @@ struct clk_ops {
21 30
22struct clk { 31struct clk {
23 struct list_head node; 32 struct list_head node;
24 const char *name;
25 int id;
26
27 struct clk *parent; 33 struct clk *parent;
28 struct clk **parent_table; /* list of parents to */ 34 struct clk **parent_table; /* list of parents to */
29 unsigned short parent_num; /* choose between */ 35 unsigned short parent_num; /* choose between */
@@ -45,7 +51,9 @@ struct clk {
45 unsigned long arch_flags; 51 unsigned long arch_flags;
46 void *priv; 52 void *priv;
47 struct dentry *dentry; 53 struct dentry *dentry;
54 struct clk_mapping *mapping;
48 struct cpufreq_frequency_table *freq_table; 55 struct cpufreq_frequency_table *freq_table;
56 unsigned int nr_freqs;
49}; 57};
50 58
51#define CLK_ENABLE_ON_INIT (1 << 0) 59#define CLK_ENABLE_ON_INIT (1 << 0)
@@ -111,6 +119,9 @@ int clk_rate_table_find(struct clk *clk,
111 struct cpufreq_frequency_table *freq_table, 119 struct cpufreq_frequency_table *freq_table,
112 unsigned long rate); 120 unsigned long rate);
113 121
122long clk_rate_div_range_round(struct clk *clk, unsigned int div_min,
123 unsigned int div_max, unsigned long rate);
124
114#define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \ 125#define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \
115{ \ 126{ \
116 .parent = _parent, \ 127 .parent = _parent, \
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h
index 0d6cd38e673d..b4f183a31f13 100644
--- a/include/linux/sh_intc.h
+++ b/include/linux/sh_intc.h
@@ -20,6 +20,12 @@ struct intc_group {
20 20
21#define INTC_GROUP(enum_id, ids...) { enum_id, { ids } } 21#define INTC_GROUP(enum_id, ids...) { enum_id, { ids } }
22 22
23struct intc_subgroup {
24 unsigned long reg, reg_width;
25 intc_enum parent_id;
26 intc_enum enum_ids[32];
27};
28
23struct intc_mask_reg { 29struct intc_mask_reg {
24 unsigned long set_reg, clr_reg, reg_width; 30 unsigned long set_reg, clr_reg, reg_width;
25 intc_enum enum_ids[32]; 31 intc_enum enum_ids[32];
@@ -69,9 +75,12 @@ struct intc_hw_desc {
69 unsigned int nr_sense_regs; 75 unsigned int nr_sense_regs;
70 struct intc_mask_reg *ack_regs; 76 struct intc_mask_reg *ack_regs;
71 unsigned int nr_ack_regs; 77 unsigned int nr_ack_regs;
78 struct intc_subgroup *subgroups;
79 unsigned int nr_subgroups;
72}; 80};
73 81
74#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) 82#define _INTC_ARRAY(a) a, a == NULL ? 0 : sizeof(a)/sizeof(*a)
83
75#define INTC_HW_DESC(vectors, groups, mask_regs, \ 84#define INTC_HW_DESC(vectors, groups, mask_regs, \
76 prio_regs, sense_regs, ack_regs) \ 85 prio_regs, sense_regs, ack_regs) \
77{ \ 86{ \
@@ -105,8 +114,11 @@ struct intc_desc symbol __initdata = { \
105 prio_regs, sense_regs, ack_regs), \ 114 prio_regs, sense_regs, ack_regs), \
106} 115}
107 116
108int __init register_intc_controller(struct intc_desc *desc); 117int register_intc_controller(struct intc_desc *desc);
118void reserve_intc_vectors(struct intc_vect *vectors, unsigned int nr_vecs);
109int intc_set_priority(unsigned int irq, unsigned int prio); 119int intc_set_priority(unsigned int irq, unsigned int prio);
120int intc_irq_lookup(const char *chipname, intc_enum enum_id);
121void intc_finalize(void);
110 122
111#ifdef CONFIG_INTC_USERIMASK 123#ifdef CONFIG_INTC_USERIMASK
112int register_intc_userimask(unsigned long addr); 124int register_intc_userimask(unsigned long addr);
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
index 07c08af9f8f6..30cae70874f4 100644
--- a/include/linux/sh_pfc.h
+++ b/include/linux/sh_pfc.h
@@ -92,5 +92,6 @@ struct pinmux_info {
92}; 92};
93 93
94int register_pinmux(struct pinmux_info *pip); 94int register_pinmux(struct pinmux_info *pip);
95int unregister_pinmux(struct pinmux_info *pip);
95 96
96#endif /* __SH_PFC_H */ 97#endif /* __SH_PFC_H */
diff --git a/include/linux/signalfd.h b/include/linux/signalfd.h
index b363b916c909..3ff4961da9b5 100644
--- a/include/linux/signalfd.h
+++ b/include/linux/signalfd.h
@@ -33,6 +33,7 @@ struct signalfd_siginfo {
33 __u64 ssi_utime; 33 __u64 ssi_utime;
34 __u64 ssi_stime; 34 __u64 ssi_stime;
35 __u64 ssi_addr; 35 __u64 ssi_addr;
36 __u16 ssi_addr_lsb;
36 37
37 /* 38 /*
38 * Pad strcture to 128 bytes. Remember to update the 39 * Pad strcture to 128 bytes. Remember to update the
@@ -43,7 +44,7 @@ struct signalfd_siginfo {
43 * comes out of a read(2) and we really don't want to have 44 * comes out of a read(2) and we really don't want to have
44 * a compat on read(2). 45 * a compat on read(2).
45 */ 46 */
46 __u8 __pad[48]; 47 __u8 __pad[46];
47}; 48};
48 49
49 50
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 77eb60d2b496..e6ba898de61c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -129,8 +129,13 @@ typedef struct skb_frag_struct skb_frag_t;
129 129
130struct skb_frag_struct { 130struct skb_frag_struct {
131 struct page *page; 131 struct page *page;
132#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
132 __u32 page_offset; 133 __u32 page_offset;
133 __u32 size; 134 __u32 size;
135#else
136 __u16 page_offset;
137 __u16 size;
138#endif
134}; 139};
135 140
136#define HAVE_HW_TIME_STAMP 141#define HAVE_HW_TIME_STAMP
@@ -163,26 +168,19 @@ struct skb_shared_hwtstamps {
163 ktime_t syststamp; 168 ktime_t syststamp;
164}; 169};
165 170
166/** 171/* Definitions for tx_flags in struct skb_shared_info */
167 * struct skb_shared_tx - instructions for time stamping of outgoing packets 172enum {
168 * @hardware: generate hardware time stamp 173 /* generate hardware time stamp */
169 * @software: generate software time stamp 174 SKBTX_HW_TSTAMP = 1 << 0,
170 * @in_progress: device driver is going to provide 175
171 * hardware time stamp 176 /* generate software time stamp */
172 * @prevent_sk_orphan: make sk reference available on driver level 177 SKBTX_SW_TSTAMP = 1 << 1,
173 * @flags: all shared_tx flags 178
174 * 179 /* device driver is going to provide hardware time stamp */
175 * These flags are attached to packets as part of the 180 SKBTX_IN_PROGRESS = 1 << 2,
176 * &skb_shared_info. Use skb_tx() to get a pointer. 181
177 */ 182 /* ensure the originating sk reference is available on driver level */
178union skb_shared_tx { 183 SKBTX_DRV_NEEDS_SK_REF = 1 << 3,
179 struct {
180 __u8 hardware:1,
181 software:1,
182 in_progress:1,
183 prevent_sk_orphan:1;
184 };
185 __u8 flags;
186}; 184};
187 185
188/* This data is invariant across clones and lives at 186/* This data is invariant across clones and lives at
@@ -195,7 +193,7 @@ struct skb_shared_info {
195 unsigned short gso_segs; 193 unsigned short gso_segs;
196 unsigned short gso_type; 194 unsigned short gso_type;
197 __be32 ip6_frag_id; 195 __be32 ip6_frag_id;
198 union skb_shared_tx tx_flags; 196 __u8 tx_flags;
199 struct sk_buff *frag_list; 197 struct sk_buff *frag_list;
200 struct skb_shared_hwtstamps hwtstamps; 198 struct skb_shared_hwtstamps hwtstamps;
201 199
@@ -462,19 +460,7 @@ static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
462 skb->_skb_refdst = (unsigned long)dst; 460 skb->_skb_refdst = (unsigned long)dst;
463} 461}
464 462
465/** 463extern void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst);
466 * skb_dst_set_noref - sets skb dst, without a reference
467 * @skb: buffer
468 * @dst: dst entry
469 *
470 * Sets skb dst, assuming a reference was not taken on dst
471 * skb_dst_drop() should not dst_release() this dst
472 */
473static inline void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst)
474{
475 WARN_ON(!rcu_read_lock_held() && !rcu_read_lock_bh_held());
476 skb->_skb_refdst = (unsigned long)dst | SKB_DST_NOREF;
477}
478 464
479/** 465/**
480 * skb_dst_is_noref - Test if skb dst isnt refcounted 466 * skb_dst_is_noref - Test if skb dst isnt refcounted
@@ -498,13 +484,13 @@ extern struct sk_buff *__alloc_skb(unsigned int size,
498static inline struct sk_buff *alloc_skb(unsigned int size, 484static inline struct sk_buff *alloc_skb(unsigned int size,
499 gfp_t priority) 485 gfp_t priority)
500{ 486{
501 return __alloc_skb(size, priority, 0, -1); 487 return __alloc_skb(size, priority, 0, NUMA_NO_NODE);
502} 488}
503 489
504static inline struct sk_buff *alloc_skb_fclone(unsigned int size, 490static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
505 gfp_t priority) 491 gfp_t priority)
506{ 492{
507 return __alloc_skb(size, priority, 1, -1); 493 return __alloc_skb(size, priority, 1, NUMA_NO_NODE);
508} 494}
509 495
510extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); 496extern bool skb_recycle_check(struct sk_buff *skb, int skb_size);
@@ -558,6 +544,15 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
558 unsigned int to, struct ts_config *config, 544 unsigned int to, struct ts_config *config,
559 struct ts_state *state); 545 struct ts_state *state);
560 546
547extern __u32 __skb_get_rxhash(struct sk_buff *skb);
548static inline __u32 skb_get_rxhash(struct sk_buff *skb)
549{
550 if (!skb->rxhash)
551 skb->rxhash = __skb_get_rxhash(skb);
552
553 return skb->rxhash;
554}
555
561#ifdef NET_SKBUFF_DATA_USES_OFFSET 556#ifdef NET_SKBUFF_DATA_USES_OFFSET
562static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) 557static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
563{ 558{
@@ -578,11 +573,6 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb)
578 return &skb_shinfo(skb)->hwtstamps; 573 return &skb_shinfo(skb)->hwtstamps;
579} 574}
580 575
581static inline union skb_shared_tx *skb_tx(struct sk_buff *skb)
582{
583 return &skb_shinfo(skb)->tx_flags;
584}
585
586/** 576/**
587 * skb_queue_empty - check if a queue is empty 577 * skb_queue_empty - check if a queue is empty
588 * @list: queue head 578 * @list: queue head
@@ -604,7 +594,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
604static inline bool skb_queue_is_last(const struct sk_buff_head *list, 594static inline bool skb_queue_is_last(const struct sk_buff_head *list,
605 const struct sk_buff *skb) 595 const struct sk_buff *skb)
606{ 596{
607 return (skb->next == (struct sk_buff *) list); 597 return skb->next == (struct sk_buff *)list;
608} 598}
609 599
610/** 600/**
@@ -617,7 +607,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
617static inline bool skb_queue_is_first(const struct sk_buff_head *list, 607static inline bool skb_queue_is_first(const struct sk_buff_head *list,
618 const struct sk_buff *skb) 608 const struct sk_buff *skb)
619{ 609{
620 return (skb->prev == (struct sk_buff *) list); 610 return skb->prev == (struct sk_buff *)list;
621} 611}
622 612
623/** 613/**
@@ -1123,7 +1113,7 @@ extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page,
1123 int off, int size); 1113 int off, int size);
1124 1114
1125#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) 1115#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags)
1126#define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frags(skb)) 1116#define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb))
1127#define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) 1117#define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb))
1128 1118
1129#ifdef NET_SKBUFF_DATA_USES_OFFSET 1119#ifdef NET_SKBUFF_DATA_USES_OFFSET
@@ -1561,13 +1551,25 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
1561 return skb; 1551 return skb;
1562} 1552}
1563 1553
1564extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask); 1554/**
1555 * __netdev_alloc_page - allocate a page for ps-rx on a specific device
1556 * @dev: network device to receive on
1557 * @gfp_mask: alloc_pages_node mask
1558 *
1559 * Allocate a new page. dev currently unused.
1560 *
1561 * %NULL is returned if there is no free memory.
1562 */
1563static inline struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask)
1564{
1565 return alloc_pages_node(NUMA_NO_NODE, gfp_mask, 0);
1566}
1565 1567
1566/** 1568/**
1567 * netdev_alloc_page - allocate a page for ps-rx on a specific device 1569 * netdev_alloc_page - allocate a page for ps-rx on a specific device
1568 * @dev: network device to receive on 1570 * @dev: network device to receive on
1569 * 1571 *
1570 * Allocate a new page node local to the specified device. 1572 * Allocate a new page. dev currently unused.
1571 * 1573 *
1572 * %NULL is returned if there is no free memory. 1574 * %NULL is returned if there is no free memory.
1573 */ 1575 */
@@ -1787,7 +1789,7 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
1787 skb = skb->prev) 1789 skb = skb->prev)
1788 1790
1789 1791
1790static inline bool skb_has_frags(const struct sk_buff *skb) 1792static inline bool skb_has_frag_list(const struct sk_buff *skb)
1791{ 1793{
1792 return skb_shinfo(skb)->frag_list != NULL; 1794 return skb_shinfo(skb)->frag_list != NULL;
1793} 1795}
@@ -1987,8 +1989,8 @@ extern void skb_tstamp_tx(struct sk_buff *orig_skb,
1987 1989
1988static inline void sw_tx_timestamp(struct sk_buff *skb) 1990static inline void sw_tx_timestamp(struct sk_buff *skb)
1989{ 1991{
1990 union skb_shared_tx *shtx = skb_tx(skb); 1992 if (skb_shinfo(skb)->tx_flags & SKBTX_SW_TSTAMP &&
1991 if (shtx->software && !shtx->in_progress) 1993 !(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS))
1992 skb_tstamp_tx(skb, NULL); 1994 skb_tstamp_tx(skb, NULL);
1993} 1995}
1994 1996
@@ -2159,7 +2161,7 @@ static inline u16 skb_get_rx_queue(const struct sk_buff *skb)
2159 2161
2160static inline bool skb_rx_queue_recorded(const struct sk_buff *skb) 2162static inline bool skb_rx_queue_recorded(const struct sk_buff *skb)
2161{ 2163{
2162 return (skb->queue_mapping != 0); 2164 return skb->queue_mapping != 0;
2163} 2165}
2164 2166
2165extern u16 skb_tx_hash(const struct net_device *dev, 2167extern u16 skb_tx_hash(const struct net_device *dev,
@@ -2209,6 +2211,21 @@ static inline void skb_forward_csum(struct sk_buff *skb)
2209 skb->ip_summed = CHECKSUM_NONE; 2211 skb->ip_summed = CHECKSUM_NONE;
2210} 2212}
2211 2213
2214/**
2215 * skb_checksum_none_assert - make sure skb ip_summed is CHECKSUM_NONE
2216 * @skb: skb to check
2217 *
2218 * fresh skbs have their ip_summed set to CHECKSUM_NONE.
2219 * Instead of forcing ip_summed to CHECKSUM_NONE, we can
2220 * use this helper, to document places where we make this assertion.
2221 */
2222static inline void skb_checksum_none_assert(struct sk_buff *skb)
2223{
2224#ifdef DEBUG
2225 BUG_ON(skb->ip_summed != CHECKSUM_NONE);
2226#endif
2227}
2228
2212bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2229bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2213#endif /* __KERNEL__ */ 2230#endif /* __KERNEL__ */
2214#endif /* _LINUX_SKBUFF_H */ 2231#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 9f63538928c0..e4f5ed180b9b 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -87,7 +87,7 @@ struct kmem_cache {
87 unsigned long min_partial; 87 unsigned long min_partial;
88 const char *name; /* Name (only for display!) */ 88 const char *name; /* Name (only for display!) */
89 struct list_head list; /* List of slab caches */ 89 struct list_head list; /* List of slab caches */
90#ifdef CONFIG_SLUB_DEBUG 90#ifdef CONFIG_SYSFS
91 struct kobject kobj; /* For sysfs */ 91 struct kobject kobj; /* For sysfs */
92#endif 92#endif
93 93
@@ -96,11 +96,8 @@ struct kmem_cache {
96 * Defragmentation by allocating from a remote node. 96 * Defragmentation by allocating from a remote node.
97 */ 97 */
98 int remote_node_defrag_ratio; 98 int remote_node_defrag_ratio;
99 struct kmem_cache_node *node[MAX_NUMNODES];
100#else
101 /* Avoid an extra cache line for UP */
102 struct kmem_cache_node local_node;
103#endif 99#endif
100 struct kmem_cache_node *node[MAX_NUMNODES];
104}; 101};
105 102
106/* 103/*
@@ -139,19 +136,16 @@ struct kmem_cache {
139 136
140#ifdef CONFIG_ZONE_DMA 137#ifdef CONFIG_ZONE_DMA
141#define SLUB_DMA __GFP_DMA 138#define SLUB_DMA __GFP_DMA
142/* Reserve extra caches for potential DMA use */
143#define KMALLOC_CACHES (2 * SLUB_PAGE_SHIFT)
144#else 139#else
145/* Disable DMA functionality */ 140/* Disable DMA functionality */
146#define SLUB_DMA (__force gfp_t)0 141#define SLUB_DMA (__force gfp_t)0
147#define KMALLOC_CACHES SLUB_PAGE_SHIFT
148#endif 142#endif
149 143
150/* 144/*
151 * We keep the general caches in an array of slab caches that are used for 145 * We keep the general caches in an array of slab caches that are used for
152 * 2^x bytes of allocations. 146 * 2^x bytes of allocations.
153 */ 147 */
154extern struct kmem_cache kmalloc_caches[KMALLOC_CACHES]; 148extern struct kmem_cache *kmalloc_caches[SLUB_PAGE_SHIFT];
155 149
156/* 150/*
157 * Sorry that the following has to be that ugly but some versions of GCC 151 * Sorry that the following has to be that ugly but some versions of GCC
@@ -216,7 +210,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
216 if (index == 0) 210 if (index == 0)
217 return NULL; 211 return NULL;
218 212
219 return &kmalloc_caches[index]; 213 return kmalloc_caches[index];
220} 214}
221 215
222void *kmem_cache_alloc(struct kmem_cache *, gfp_t); 216void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
diff --git a/include/linux/smp.h b/include/linux/smp.h
index cfa2d20e35f1..6dc95cac6b3d 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -13,9 +13,10 @@
13 13
14extern void cpu_idle(void); 14extern void cpu_idle(void);
15 15
16typedef void (*smp_call_func_t)(void *info);
16struct call_single_data { 17struct call_single_data {
17 struct list_head list; 18 struct list_head list;
18 void (*func) (void *info); 19 smp_call_func_t func;
19 void *info; 20 void *info;
20 u16 flags; 21 u16 flags;
21 u16 priv; 22 u16 priv;
@@ -24,8 +25,8 @@ struct call_single_data {
24/* total number of cpus in this system (may exceed NR_CPUS) */ 25/* total number of cpus in this system (may exceed NR_CPUS) */
25extern unsigned int total_cpus; 26extern unsigned int total_cpus;
26 27
27int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, 28int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
28 int wait); 29 int wait);
29 30
30#ifdef CONFIG_SMP 31#ifdef CONFIG_SMP
31 32
@@ -69,15 +70,15 @@ extern void smp_cpus_done(unsigned int max_cpus);
69/* 70/*
70 * Call a function on all other processors 71 * Call a function on all other processors
71 */ 72 */
72int smp_call_function(void(*func)(void *info), void *info, int wait); 73int smp_call_function(smp_call_func_t func, void *info, int wait);
73void smp_call_function_many(const struct cpumask *mask, 74void smp_call_function_many(const struct cpumask *mask,
74 void (*func)(void *info), void *info, bool wait); 75 smp_call_func_t func, void *info, bool wait);
75 76
76void __smp_call_function_single(int cpuid, struct call_single_data *data, 77void __smp_call_function_single(int cpuid, struct call_single_data *data,
77 int wait); 78 int wait);
78 79
79int smp_call_function_any(const struct cpumask *mask, 80int smp_call_function_any(const struct cpumask *mask,
80 void (*func)(void *info), void *info, int wait); 81 smp_call_func_t func, void *info, int wait);
81 82
82/* 83/*
83 * Generic and arch helpers 84 * Generic and arch helpers
@@ -94,7 +95,7 @@ void ipi_call_unlock_irq(void);
94/* 95/*
95 * Call a function on all processors 96 * Call a function on all processors
96 */ 97 */
97int on_each_cpu(void (*func) (void *info), void *info, int wait); 98int on_each_cpu(smp_call_func_t func, void *info, int wait);
98 99
99#define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ 100#define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */
100#define MSG_ALL 0x8001 101#define MSG_ALL 0x8001
@@ -122,7 +123,7 @@ static inline void smp_send_stop(void) { }
122 * These macros fold the SMP functionality into a single CPU system 123 * These macros fold the SMP functionality into a single CPU system
123 */ 124 */
124#define raw_smp_processor_id() 0 125#define raw_smp_processor_id() 0
125static inline int up_smp_call_function(void (*func)(void *), void *info) 126static inline int up_smp_call_function(smp_call_func_t func, void *info)
126{ 127{
127 return 0; 128 return 0;
128} 129}
@@ -143,7 +144,7 @@ static inline void smp_send_reschedule(int cpu) { }
143static inline void init_call_single_data(void) { } 144static inline void init_call_single_data(void) { }
144 145
145static inline int 146static inline int
146smp_call_function_any(const struct cpumask *mask, void (*func)(void *info), 147smp_call_function_any(const struct cpumask *mask, smp_call_func_t func,
147 void *info, int wait) 148 void *info, int wait)
148{ 149{
149 return smp_call_function_single(0, func, info, wait); 150 return smp_call_function_single(0, func, info, wait);
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h
index 2ea1dd1ba21c..291f721144c2 100644
--- a/include/linux/smp_lock.h
+++ b/include/linux/smp_lock.h
@@ -54,12 +54,15 @@ static inline void cycle_kernel_lock(void)
54 54
55#else 55#else
56 56
57#ifdef CONFIG_BKL /* provoke build bug if not set */
57#define lock_kernel() 58#define lock_kernel()
58#define unlock_kernel() 59#define unlock_kernel()
59#define release_kernel_lock(task) do { } while(0)
60#define cycle_kernel_lock() do { } while(0) 60#define cycle_kernel_lock() do { } while(0)
61#define reacquire_kernel_lock(task) 0
62#define kernel_locked() 1 61#define kernel_locked() 1
62#endif /* CONFIG_BKL */
63
64#define release_kernel_lock(task) do { } while(0)
65#define reacquire_kernel_lock(task) 0
63 66
64#endif /* CONFIG_LOCK_KERNEL */ 67#endif /* CONFIG_LOCK_KERNEL */
65#endif /* __LINUX_SMPLOCK_H */ 68#endif /* __LINUX_SMPLOCK_H */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index a8f56e1ec760..5146b50202ce 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -326,7 +326,6 @@ extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *a
326extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); 326extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
327extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, 327extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,
328 int offset, int len); 328 int offset, int len);
329extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uaddr, int __user *ulen);
330extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); 329extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr);
331extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); 330extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
332 331
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h
new file mode 100644
index 000000000000..d85c52f294a0
--- /dev/null
+++ b/include/linux/spi/74x164.h
@@ -0,0 +1,11 @@
1#ifndef LINUX_SPI_74X164_H
2#define LINUX_SPI_74X164_H
3
4#define GEN_74X164_DRIVER_NAME "74x164"
5
6struct gen_74x164_chip_platform_data {
7 /* number assigned to the first GPIO */
8 unsigned base;
9};
10
11#endif
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index a6d5225b9275..11daf9c140e7 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -97,6 +97,7 @@
97#define SSB_TMSLOW_RESET 0x00000001 /* Reset */ 97#define SSB_TMSLOW_RESET 0x00000001 /* Reset */
98#define SSB_TMSLOW_REJECT_22 0x00000002 /* Reject (Backplane rev 2.2) */ 98#define SSB_TMSLOW_REJECT_22 0x00000002 /* Reject (Backplane rev 2.2) */
99#define SSB_TMSLOW_REJECT_23 0x00000004 /* Reject (Backplane rev 2.3) */ 99#define SSB_TMSLOW_REJECT_23 0x00000004 /* Reject (Backplane rev 2.3) */
100#define SSB_TMSLOW_PHYCLK 0x00000010 /* MAC PHY Clock Control Enable */
100#define SSB_TMSLOW_CLOCK 0x00010000 /* Clock Enable */ 101#define SSB_TMSLOW_CLOCK 0x00010000 /* Clock Enable */
101#define SSB_TMSLOW_FGC 0x00020000 /* Force Gated Clocks On */ 102#define SSB_TMSLOW_FGC 0x00020000 /* Force Gated Clocks On */
102#define SSB_TMSLOW_PE 0x40000000 /* Power Management Enable */ 103#define SSB_TMSLOW_PE 0x40000000 /* Power Management Enable */
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 632ff7c03280..d66c61774d95 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -32,10 +32,14 @@
32struct plat_stmmacenet_data { 32struct plat_stmmacenet_data {
33 int bus_id; 33 int bus_id;
34 int pbl; 34 int pbl;
35 int clk_csr;
35 int has_gmac; 36 int has_gmac;
36 int enh_desc; 37 int enh_desc;
38 int tx_coe;
39 int bugged_jumbo;
40 int pmt;
37 void (*fix_mac_speed)(void *priv, unsigned int speed); 41 void (*fix_mac_speed)(void *priv, unsigned int speed);
38 void (*bus_setup)(unsigned long ioaddr); 42 void (*bus_setup)(void __iomem *ioaddr);
39#ifdef CONFIG_STM_DRIVERS 43#ifdef CONFIG_STM_DRIVERS
40 struct stm_pad_config *pad_config; 44 struct stm_pad_config *pad_config;
41#endif 45#endif
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 5bbc447175dc..b2024757edd5 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -122,8 +122,8 @@ extern const struct rpc_authops authnull_ops;
122int __init rpc_init_authunix(void); 122int __init rpc_init_authunix(void);
123int __init rpc_init_generic_auth(void); 123int __init rpc_init_generic_auth(void);
124int __init rpcauth_init_module(void); 124int __init rpcauth_init_module(void);
125void __exit rpcauth_remove_module(void); 125void rpcauth_remove_module(void);
126void __exit rpc_destroy_generic_auth(void); 126void rpc_destroy_generic_auth(void);
127void rpc_destroy_authunix(void); 127void rpc_destroy_authunix(void);
128 128
129struct rpc_cred * rpc_lookup_cred(void); 129struct rpc_cred * rpc_lookup_cred(void);
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 7bf3e84b92f4..6950c981882d 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -125,12 +125,15 @@ struct cache_detail {
125 */ 125 */
126struct cache_req { 126struct cache_req {
127 struct cache_deferred_req *(*defer)(struct cache_req *req); 127 struct cache_deferred_req *(*defer)(struct cache_req *req);
128 int thread_wait; /* How long (jiffies) we can block the
129 * current thread to wait for updates.
130 */
128}; 131};
129/* this must be embedded in a deferred_request that is being 132/* this must be embedded in a deferred_request that is being
130 * delayed awaiting cache-fill 133 * delayed awaiting cache-fill
131 */ 134 */
132struct cache_deferred_req { 135struct cache_deferred_req {
133 struct list_head hash; /* on hash chain */ 136 struct hlist_node hash; /* on hash chain */
134 struct list_head recent; /* on fifo */ 137 struct list_head recent; /* on fifo */
135 struct cache_head *item; /* cache item we wait on */ 138 struct cache_head *item; /* cache item we wait on */
136 void *owner; /* we might need to discard all defered requests 139 void *owner; /* we might need to discard all defered requests
@@ -194,7 +197,9 @@ extern void cache_purge(struct cache_detail *detail);
194#define NEVER (0x7FFFFFFF) 197#define NEVER (0x7FFFFFFF)
195extern void __init cache_initialize(void); 198extern void __init cache_initialize(void);
196extern int cache_register(struct cache_detail *cd); 199extern int cache_register(struct cache_detail *cd);
200extern int cache_register_net(struct cache_detail *cd, struct net *net);
197extern void cache_unregister(struct cache_detail *cd); 201extern void cache_unregister(struct cache_detail *cd);
202extern void cache_unregister_net(struct cache_detail *cd, struct net *net);
198 203
199extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *, 204extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *,
200 mode_t, struct cache_detail *); 205 mode_t, struct cache_detail *);
@@ -218,14 +223,42 @@ static inline int get_int(char **bpp, int *anint)
218 return 0; 223 return 0;
219} 224}
220 225
226/*
227 * timestamps kept in the cache are expressed in seconds
228 * since boot. This is the best for measuring differences in
229 * real time.
230 */
231static inline time_t seconds_since_boot(void)
232{
233 struct timespec boot;
234 getboottime(&boot);
235 return get_seconds() - boot.tv_sec;
236}
237
238static inline time_t convert_to_wallclock(time_t sinceboot)
239{
240 struct timespec boot;
241 getboottime(&boot);
242 return boot.tv_sec + sinceboot;
243}
244
221static inline time_t get_expiry(char **bpp) 245static inline time_t get_expiry(char **bpp)
222{ 246{
223 int rv; 247 int rv;
248 struct timespec boot;
249
224 if (get_int(bpp, &rv)) 250 if (get_int(bpp, &rv))
225 return 0; 251 return 0;
226 if (rv < 0) 252 if (rv < 0)
227 return 0; 253 return 0;
228 return rv; 254 getboottime(&boot);
255 return rv - boot.tv_sec;
229} 256}
230 257
258static inline void sunrpc_invalidate(struct cache_head *h,
259 struct cache_detail *detail)
260{
261 h->expiry_time = seconds_since_boot() - 1;
262 detail->nextcheck = seconds_since_boot();
263}
231#endif /* _LINUX_SUNRPC_CACHE_H_ */ 264#endif /* _LINUX_SUNRPC_CACHE_H_ */
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 85f38a63f098..a5a55f284b7d 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -102,6 +102,7 @@ struct rpc_procinfo {
102#ifdef __KERNEL__ 102#ifdef __KERNEL__
103 103
104struct rpc_create_args { 104struct rpc_create_args {
105 struct net *net;
105 int protocol; 106 int protocol;
106 struct sockaddr *address; 107 struct sockaddr *address;
107 size_t addrsize; 108 size_t addrsize;
@@ -137,7 +138,6 @@ int rpcb_register(u32, u32, int, unsigned short);
137int rpcb_v4_register(const u32 program, const u32 version, 138int rpcb_v4_register(const u32 program, const u32 version,
138 const struct sockaddr *address, 139 const struct sockaddr *address,
139 const char *netid); 140 const char *netid);
140int rpcb_getport_sync(struct sockaddr_in *, u32, u32, int);
141void rpcb_getport_async(struct rpc_task *); 141void rpcb_getport_async(struct rpc_task *);
142 142
143void rpc_call_start(struct rpc_task *); 143void rpc_call_start(struct rpc_task *);
diff --git a/include/linux/sunrpc/gss_spkm3.h b/include/linux/sunrpc/gss_spkm3.h
deleted file mode 100644
index e3e6a3437f8b..000000000000
--- a/include/linux/sunrpc/gss_spkm3.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * linux/include/linux/sunrpc/gss_spkm3.h
3 *
4 * Copyright (c) 2000 The Regents of the University of Michigan.
5 * All rights reserved.
6 *
7 * Andy Adamson <andros@umich.edu>
8 */
9
10#include <linux/sunrpc/auth_gss.h>
11#include <linux/sunrpc/gss_err.h>
12#include <linux/sunrpc/gss_asn1.h>
13
14struct spkm3_ctx {
15 struct xdr_netobj ctx_id; /* per message context id */
16 int endtime; /* endtime of the context */
17 struct xdr_netobj mech_used;
18 unsigned int ret_flags ;
19 struct xdr_netobj conf_alg;
20 struct xdr_netobj derived_conf_key;
21 struct xdr_netobj intg_alg;
22 struct xdr_netobj derived_integ_key;
23};
24
25/* OIDs declarations for K-ALG, I-ALG, C-ALG, and OWF-ALG */
26extern const struct xdr_netobj hmac_md5_oid;
27extern const struct xdr_netobj cast5_cbc_oid;
28
29/* SPKM InnerContext Token types */
30
31#define SPKM_ERROR_TOK 3
32#define SPKM_MIC_TOK 4
33#define SPKM_WRAP_TOK 5
34#define SPKM_DEL_TOK 6
35
36u32 spkm3_make_token(struct spkm3_ctx *ctx, struct xdr_buf * text, struct xdr_netobj * token, int toktype);
37
38u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int toktype);
39
40#define CKSUMTYPE_RSA_MD5 0x0007
41#define CKSUMTYPE_HMAC_MD5 0x0008
42
43s32 make_spkm3_checksum(s32 cksumtype, struct xdr_netobj *key, char *header,
44 unsigned int hdrlen, struct xdr_buf *body,
45 unsigned int body_offset, struct xdr_netobj *cksum);
46void asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits);
47int decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen,
48 int explen);
49void spkm3_mic_header(unsigned char **hdrbuf, unsigned int *hdrlen,
50 unsigned char *ctxhdr, int elen, int zbit);
51void spkm3_make_mic_token(unsigned char **tokp, int toklen,
52 struct xdr_netobj *mic_hdr,
53 struct xdr_netobj *md5cksum, int md5elen, int md5zbit);
54u32 spkm3_verify_mic_token(unsigned char **tokp, int *mic_hdrlen,
55 unsigned char **cksum);
diff --git a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h
index 5fa0f2084307..680471d1f28a 100644
--- a/include/linux/sunrpc/stats.h
+++ b/include/linux/sunrpc/stats.h
@@ -38,8 +38,21 @@ struct svc_stat {
38 rpcbadclnt; 38 rpcbadclnt;
39}; 39};
40 40
41void rpc_proc_init(void); 41struct net;
42void rpc_proc_exit(void); 42#ifdef CONFIG_PROC_FS
43int rpc_proc_init(struct net *);
44void rpc_proc_exit(struct net *);
45#else
46static inline int rpc_proc_init(struct net *net)
47{
48 return 0;
49}
50
51static inline void rpc_proc_exit(struct net *net)
52{
53}
54#endif
55
43#ifdef MODULE 56#ifdef MODULE
44void rpc_modcount(struct inode *, int); 57void rpc_modcount(struct inode *, int);
45#endif 58#endif
@@ -54,9 +67,6 @@ void svc_proc_unregister(const char *);
54 67
55void svc_seq_show(struct seq_file *, 68void svc_seq_show(struct seq_file *,
56 const struct svc_stat *); 69 const struct svc_stat *);
57
58extern struct proc_dir_entry *proc_net_rpc;
59
60#else 70#else
61 71
62static inline struct proc_dir_entry *rpc_proc_register(struct rpc_stat *s) { return NULL; } 72static inline struct proc_dir_entry *rpc_proc_register(struct rpc_stat *s) { return NULL; }
@@ -69,9 +79,6 @@ static inline void svc_proc_unregister(const char *p) {}
69 79
70static inline void svc_seq_show(struct seq_file *seq, 80static inline void svc_seq_show(struct seq_file *seq,
71 const struct svc_stat *st) {} 81 const struct svc_stat *st) {}
72
73#define proc_net_rpc NULL
74
75#endif 82#endif
76 83
77#endif /* _LINUX_SUNRPC_STATS_H */ 84#endif /* _LINUX_SUNRPC_STATS_H */
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 5f4e18b3ce73..bbdb680ffbe9 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -12,6 +12,7 @@
12 12
13struct svc_xprt_ops { 13struct svc_xprt_ops {
14 struct svc_xprt *(*xpo_create)(struct svc_serv *, 14 struct svc_xprt *(*xpo_create)(struct svc_serv *,
15 struct net *net,
15 struct sockaddr *, int, 16 struct sockaddr *, int,
16 int); 17 int);
17 struct svc_xprt *(*xpo_accept)(struct svc_xprt *); 18 struct svc_xprt *(*xpo_accept)(struct svc_xprt *);
@@ -32,6 +33,16 @@ struct svc_xprt_class {
32 u32 xcl_max_payload; 33 u32 xcl_max_payload;
33}; 34};
34 35
36/*
37 * This is embedded in an object that wants a callback before deleting
38 * an xprt; intended for use by NFSv4.1, which needs to know when a
39 * client's tcp connection (and hence possibly a backchannel) goes away.
40 */
41struct svc_xpt_user {
42 struct list_head list;
43 void (*callback)(struct svc_xpt_user *);
44};
45
35struct svc_xprt { 46struct svc_xprt {
36 struct svc_xprt_class *xpt_class; 47 struct svc_xprt_class *xpt_class;
37 struct svc_xprt_ops *xpt_ops; 48 struct svc_xprt_ops *xpt_ops;
@@ -66,14 +77,31 @@ struct svc_xprt {
66 struct sockaddr_storage xpt_remote; /* remote peer's address */ 77 struct sockaddr_storage xpt_remote; /* remote peer's address */
67 size_t xpt_remotelen; /* length of address */ 78 size_t xpt_remotelen; /* length of address */
68 struct rpc_wait_queue xpt_bc_pending; /* backchannel wait queue */ 79 struct rpc_wait_queue xpt_bc_pending; /* backchannel wait queue */
80 struct list_head xpt_users; /* callbacks on free */
81
82 struct net *xpt_net;
69}; 83};
70 84
85static inline void register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u)
86{
87 spin_lock(&xpt->xpt_lock);
88 list_add(&u->list, &xpt->xpt_users);
89 spin_unlock(&xpt->xpt_lock);
90}
91
92static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u)
93{
94 spin_lock(&xpt->xpt_lock);
95 list_del_init(&u->list);
96 spin_unlock(&xpt->xpt_lock);
97}
98
71int svc_reg_xprt_class(struct svc_xprt_class *); 99int svc_reg_xprt_class(struct svc_xprt_class *);
72void svc_unreg_xprt_class(struct svc_xprt_class *); 100void svc_unreg_xprt_class(struct svc_xprt_class *);
73void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *, 101void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *,
74 struct svc_serv *); 102 struct svc_serv *);
75int svc_create_xprt(struct svc_serv *, const char *, const int, 103int svc_create_xprt(struct svc_serv *, const char *, struct net *,
76 const unsigned short, int); 104 const int, const unsigned short, int);
77void svc_xprt_enqueue(struct svc_xprt *xprt); 105void svc_xprt_enqueue(struct svc_xprt *xprt);
78void svc_xprt_received(struct svc_xprt *); 106void svc_xprt_received(struct svc_xprt *);
79void svc_xprt_put(struct svc_xprt *xprt); 107void svc_xprt_put(struct svc_xprt *xprt);
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
index d39dbdc7b10f..25d333c1b571 100644
--- a/include/linux/sunrpc/svcauth.h
+++ b/include/linux/sunrpc/svcauth.h
@@ -108,10 +108,15 @@ struct auth_ops {
108#define SVC_NEGATIVE 4 108#define SVC_NEGATIVE 4
109#define SVC_OK 5 109#define SVC_OK 5
110#define SVC_DROP 6 110#define SVC_DROP 6
111#define SVC_DENIED 7 111#define SVC_CLOSE 7 /* Like SVC_DROP, but request is definitely
112#define SVC_PENDING 8 112 * lost so if there is a tcp connection, it
113#define SVC_COMPLETE 9 113 * should be closed
114 */
115#define SVC_DENIED 8
116#define SVC_PENDING 9
117#define SVC_COMPLETE 10
114 118
119struct svc_xprt;
115 120
116extern int svc_authenticate(struct svc_rqst *rqstp, __be32 *authp); 121extern int svc_authenticate(struct svc_rqst *rqstp, __be32 *authp);
117extern int svc_authorise(struct svc_rqst *rqstp); 122extern int svc_authorise(struct svc_rqst *rqstp);
@@ -121,13 +126,13 @@ extern void svc_auth_unregister(rpc_authflavor_t flavor);
121 126
122extern struct auth_domain *unix_domain_find(char *name); 127extern struct auth_domain *unix_domain_find(char *name);
123extern void auth_domain_put(struct auth_domain *item); 128extern void auth_domain_put(struct auth_domain *item);
124extern int auth_unix_add_addr(struct in6_addr *addr, struct auth_domain *dom); 129extern int auth_unix_add_addr(struct net *net, struct in6_addr *addr, struct auth_domain *dom);
125extern struct auth_domain *auth_domain_lookup(char *name, struct auth_domain *new); 130extern struct auth_domain *auth_domain_lookup(char *name, struct auth_domain *new);
126extern struct auth_domain *auth_domain_find(char *name); 131extern struct auth_domain *auth_domain_find(char *name);
127extern struct auth_domain *auth_unix_lookup(struct in6_addr *addr); 132extern struct auth_domain *auth_unix_lookup(struct net *net, struct in6_addr *addr);
128extern int auth_unix_forget_old(struct auth_domain *dom); 133extern int auth_unix_forget_old(struct auth_domain *dom);
129extern void svcauth_unix_purge(void); 134extern void svcauth_unix_purge(void);
130extern void svcauth_unix_info_release(void *); 135extern void svcauth_unix_info_release(struct svc_xprt *xpt);
131extern int svcauth_unix_set_client(struct svc_rqst *rqstp); 136extern int svcauth_unix_set_client(struct svc_rqst *rqstp);
132 137
133static inline unsigned long hash_str(char *name, int bits) 138static inline unsigned long hash_str(char *name, int bits)
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 35cf2e8cd7c6..498ab93a81e4 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -108,6 +108,7 @@ void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int,
108 unsigned int); 108 unsigned int);
109void xdr_inline_pages(struct xdr_buf *, unsigned int, 109void xdr_inline_pages(struct xdr_buf *, unsigned int,
110 struct page **, unsigned int, unsigned int); 110 struct page **, unsigned int, unsigned int);
111void xdr_terminate_string(struct xdr_buf *, const u32);
111 112
112static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int len) 113static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int len)
113{ 114{
@@ -131,6 +132,13 @@ xdr_decode_hyper(__be32 *p, __u64 *valp)
131 return p + 2; 132 return p + 2;
132} 133}
133 134
135static inline __be32 *
136xdr_decode_opaque_fixed(__be32 *p, void *ptr, unsigned int len)
137{
138 memcpy(ptr, p, len);
139 return p + XDR_QUADLEN(len);
140}
141
134/* 142/*
135 * Adjust kvec to reflect end of xdr'ed data (RPC client XDR) 143 * Adjust kvec to reflect end of xdr'ed data (RPC client XDR)
136 */ 144 */
@@ -200,6 +208,7 @@ extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes);
200extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, 208extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages,
201 unsigned int base, unsigned int len); 209 unsigned int base, unsigned int len);
202extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); 210extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
211extern __be32 *xdr_inline_peek(struct xdr_stream *xdr, size_t nbytes);
203extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); 212extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes);
204extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); 213extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
205extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); 214extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index ff5a77b28c50..89d10d279a20 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -224,6 +224,7 @@ struct rpc_xprt {
224 bklog_u; /* backlog queue utilization */ 224 bklog_u; /* backlog queue utilization */
225 } stat; 225 } stat;
226 226
227 struct net *xprt_net;
227 const char *address_strings[RPC_DISPLAY_MAX]; 228 const char *address_strings[RPC_DISPLAY_MAX];
228}; 229};
229 230
@@ -249,6 +250,7 @@ static inline int bc_prealloc(struct rpc_rqst *req)
249 250
250struct xprt_create { 251struct xprt_create {
251 int ident; /* XPRT_TRANSPORT identifier */ 252 int ident; /* XPRT_TRANSPORT identifier */
253 struct net * net;
252 struct sockaddr * srcaddr; /* optional local address */ 254 struct sockaddr * srcaddr; /* optional local address */
253 struct sockaddr * dstaddr; /* remote peer address */ 255 struct sockaddr * dstaddr; /* remote peer address */
254 size_t addrlen; 256 size_t addrlen;
@@ -280,6 +282,8 @@ void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
280void xprt_release(struct rpc_task *task); 282void xprt_release(struct rpc_task *task);
281struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); 283struct rpc_xprt * xprt_get(struct rpc_xprt *xprt);
282void xprt_put(struct rpc_xprt *xprt); 284void xprt_put(struct rpc_xprt *xprt);
285struct rpc_xprt * xprt_alloc(struct net *net, int size, int max_req);
286void xprt_free(struct rpc_xprt *);
283 287
284static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) 288static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p)
285{ 289{
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 7cdd63366f88..eba53e71d2cc 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -271,8 +271,18 @@ extern void scan_mapping_unevictable_pages(struct address_space *);
271extern unsigned long scan_unevictable_pages; 271extern unsigned long scan_unevictable_pages;
272extern int scan_unevictable_handler(struct ctl_table *, int, 272extern int scan_unevictable_handler(struct ctl_table *, int,
273 void __user *, size_t *, loff_t *); 273 void __user *, size_t *, loff_t *);
274#ifdef CONFIG_NUMA
274extern int scan_unevictable_register_node(struct node *node); 275extern int scan_unevictable_register_node(struct node *node);
275extern void scan_unevictable_unregister_node(struct node *node); 276extern void scan_unevictable_unregister_node(struct node *node);
277#else
278static inline int scan_unevictable_register_node(struct node *node)
279{
280 return 0;
281}
282static inline void scan_unevictable_unregister_node(struct node *node)
283{
284}
285#endif
276 286
277extern int kswapd_run(int nid); 287extern int kswapd_run(int nid);
278extern void kswapd_stop(int nid); 288extern void kswapd_stop(int nid);
diff --git a/include/linux/synclink.h b/include/linux/synclink.h
index 0ff2779c44d0..2e7d81c4e5ad 100644
--- a/include/linux/synclink.h
+++ b/include/linux/synclink.h
@@ -126,6 +126,7 @@
126#define MGSL_MODE_BISYNC 4 126#define MGSL_MODE_BISYNC 4
127#define MGSL_MODE_RAW 6 127#define MGSL_MODE_RAW 6
128#define MGSL_MODE_BASE_CLOCK 7 128#define MGSL_MODE_BASE_CLOCK 7
129#define MGSL_MODE_XSYNC 8
129 130
130#define MGSL_BUS_TYPE_ISA 1 131#define MGSL_BUS_TYPE_ISA 1
131#define MGSL_BUS_TYPE_EISA 2 132#define MGSL_BUS_TYPE_EISA 2
@@ -290,6 +291,10 @@ struct gpio_desc {
290#define MGSL_IOCSGPIO _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc) 291#define MGSL_IOCSGPIO _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc)
291#define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc) 292#define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc)
292#define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc) 293#define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc)
294#define MGSL_IOCSXSYNC _IO(MGSL_MAGIC_IOC, 19)
295#define MGSL_IOCGXSYNC _IO(MGSL_MAGIC_IOC, 20)
296#define MGSL_IOCSXCTRL _IO(MGSL_MAGIC_IOC, 21)
297#define MGSL_IOCGXCTRL _IO(MGSL_MAGIC_IOC, 22)
293 298
294#ifdef __KERNEL__ 299#ifdef __KERNEL__
295/* provide 32 bit ioctl compatibility on 64 bit systems */ 300/* provide 32 bit ioctl compatibility on 64 bit systems */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index e6319d18a55d..cacc27a0e285 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -701,7 +701,8 @@ asmlinkage long sys_nfsservctl(int cmd,
701asmlinkage long sys_syslog(int type, char __user *buf, int len); 701asmlinkage long sys_syslog(int type, char __user *buf, int len);
702asmlinkage long sys_uselib(const char __user *library); 702asmlinkage long sys_uselib(const char __user *library);
703asmlinkage long sys_ni_syscall(void); 703asmlinkage long sys_ni_syscall(void);
704asmlinkage long sys_ptrace(long request, long pid, long addr, long data); 704asmlinkage long sys_ptrace(long request, long pid, unsigned long addr,
705 unsigned long data);
705 706
706asmlinkage long sys_add_key(const char __user *_type, 707asmlinkage long sys_add_key(const char __user *_type,
707 const char __user *_description, 708 const char __user *_description,
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild
index 76990937f4c9..67b501c302b2 100644
--- a/include/linux/tc_act/Kbuild
+++ b/include/linux/tc_act/Kbuild
@@ -4,3 +4,4 @@ header-y += tc_mirred.h
4header-y += tc_pedit.h 4header-y += tc_pedit.h
5header-y += tc_nat.h 5header-y += tc_nat.h
6header-y += tc_skbedit.h 6header-y += tc_skbedit.h
7header-y += tc_csum.h
diff --git a/include/linux/tc_act/tc_csum.h b/include/linux/tc_act/tc_csum.h
new file mode 100644
index 000000000000..a047c49a3153
--- /dev/null
+++ b/include/linux/tc_act/tc_csum.h
@@ -0,0 +1,32 @@
1#ifndef __LINUX_TC_CSUM_H
2#define __LINUX_TC_CSUM_H
3
4#include <linux/types.h>
5#include <linux/pkt_cls.h>
6
7#define TCA_ACT_CSUM 16
8
9enum {
10 TCA_CSUM_UNSPEC,
11 TCA_CSUM_PARMS,
12 TCA_CSUM_TM,
13 __TCA_CSUM_MAX
14};
15#define TCA_CSUM_MAX (__TCA_CSUM_MAX - 1)
16
17enum {
18 TCA_CSUM_UPDATE_FLAG_IPV4HDR = 1,
19 TCA_CSUM_UPDATE_FLAG_ICMP = 2,
20 TCA_CSUM_UPDATE_FLAG_IGMP = 4,
21 TCA_CSUM_UPDATE_FLAG_TCP = 8,
22 TCA_CSUM_UPDATE_FLAG_UDP = 16,
23 TCA_CSUM_UPDATE_FLAG_UDPLITE = 32
24};
25
26struct tc_csum {
27 tc_gen;
28
29 __u32 update_flags;
30};
31
32#endif /* __LINUX_TC_CSUM_H */
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index 0864206ec1a3..7138962664f8 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -79,6 +79,7 @@ enum {
79 TCF_META_ID_SK_SENDMSG_OFF, 79 TCF_META_ID_SK_SENDMSG_OFF,
80 TCF_META_ID_SK_WRITE_PENDING, 80 TCF_META_ID_SK_WRITE_PENDING,
81 TCF_META_ID_VLAN_TAG, 81 TCF_META_ID_VLAN_TAG,
82 TCF_META_ID_RXHASH,
82 __TCF_META_ID_MAX 83 __TCF_META_ID_MAX
83}; 84};
84#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) 85#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index a778ee024590..e64f4c67d0ef 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -105,6 +105,7 @@ enum {
105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */ 105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/ 106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */ 107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */
108#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */
108 109
109/* for TCP_INFO socket option */ 110/* for TCP_INFO socket option */
110#define TCPI_OPT_TIMESTAMPS 1 111#define TCPI_OPT_TIMESTAMPS 1
diff --git a/include/linux/tipc.h b/include/linux/tipc.h
index 181c8d0e6f73..d10614b29d59 100644
--- a/include/linux/tipc.h
+++ b/include/linux/tipc.h
@@ -127,17 +127,23 @@ static inline unsigned int tipc_node(__u32 addr)
127 * TIPC topology subscription service definitions 127 * TIPC topology subscription service definitions
128 */ 128 */
129 129
130#define TIPC_SUB_SERVICE 0x00 /* Filter for service availability */ 130#define TIPC_SUB_PORTS 0x01 /* filter for port availability */
131#define TIPC_SUB_PORTS 0x01 /* Filter for port availability */ 131#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */
132#define TIPC_SUB_CANCEL 0x04 /* Cancel a subscription */ 132#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */
133#if 0
134/* The following filter options are not currently implemented */
135#define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */
136#define TIPC_SUB_NO_UNBIND_EVTS 0x08 /* filter out "withdraw" events */
137#define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */
138#endif
133 139
134#define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */ 140#define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */
135 141
136struct tipc_subscr { 142struct tipc_subscr {
137 struct tipc_name_seq seq; /* NBO. Name sequence of interest */ 143 struct tipc_name_seq seq; /* name sequence of interest */
138 __u32 timeout; /* NBO. Subscription duration (in ms) */ 144 __u32 timeout; /* subscription duration (in ms) */
139 __u32 filter; /* NBO. Bitmask of filter options */ 145 __u32 filter; /* bitmask of filter options */
140 char usr_handle[8]; /* Opaque. Available for subscriber use */ 146 char usr_handle[8]; /* available for subscriber use */
141}; 147};
142 148
143#define TIPC_PUBLISHED 1 /* publication event */ 149#define TIPC_PUBLISHED 1 /* publication event */
@@ -145,11 +151,11 @@ struct tipc_subscr {
145#define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */ 151#define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */
146 152
147struct tipc_event { 153struct tipc_event {
148 __u32 event; /* NBO. Event type, as defined above */ 154 __u32 event; /* event type */
149 __u32 found_lower; /* NBO. Matching name seq instances */ 155 __u32 found_lower; /* matching name seq instances */
150 __u32 found_upper; /* " " " " " */ 156 __u32 found_upper; /* " " " " */
151 struct tipc_portid port; /* NBO. Associated port */ 157 struct tipc_portid port; /* associated port */
152 struct tipc_subscr s; /* Original, associated subscription */ 158 struct tipc_subscr s; /* associated subscription */
153}; 159};
154 160
155/* 161/*
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index 10db0102a890..3a2e66d88a32 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -150,7 +150,7 @@ static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step)
150 * 150 *
151 * Return %LSM_UNSAFE_* bits applied to an exec because of tracing. 151 * Return %LSM_UNSAFE_* bits applied to an exec because of tracing.
152 * 152 *
153 * @task->cred_guard_mutex is held by the caller through the do_execve(). 153 * @task->signal->cred_guard_mutex is held by the caller through the do_execve().
154 */ 154 */
155static inline int tracehook_unsafe_exec(struct task_struct *task) 155static inline int tracehook_unsafe_exec(struct task_struct *task)
156{ 156{
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 67d64e6efe7a..86be0cdeb11b 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -256,6 +256,7 @@ struct tty_operations;
256struct tty_struct { 256struct tty_struct {
257 int magic; 257 int magic;
258 struct kref kref; 258 struct kref kref;
259 struct device *dev;
259 struct tty_driver *driver; 260 struct tty_driver *driver;
260 const struct tty_operations *ops; 261 const struct tty_operations *ops;
261 int index; 262 int index;
@@ -465,7 +466,7 @@ extern void proc_clear_tty(struct task_struct *p);
465extern struct tty_struct *get_current_tty(void); 466extern struct tty_struct *get_current_tty(void);
466extern void tty_default_fops(struct file_operations *fops); 467extern void tty_default_fops(struct file_operations *fops);
467extern struct tty_struct *alloc_tty_struct(void); 468extern struct tty_struct *alloc_tty_struct(void);
468extern void tty_add_file(struct tty_struct *tty, struct file *file); 469extern int tty_add_file(struct tty_struct *tty, struct file *file);
469extern void free_tty_struct(struct tty_struct *tty); 470extern void free_tty_struct(struct tty_struct *tty);
470extern void initialize_tty_struct(struct tty_struct *tty, 471extern void initialize_tty_struct(struct tty_struct *tty,
471 struct tty_driver *driver, int idx); 472 struct tty_driver *driver, int idx);
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index b08677982525..db2d227694da 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -224,6 +224,12 @@
224 * unless the tty also has a valid tty->termiox pointer. 224 * unless the tty also has a valid tty->termiox pointer.
225 * 225 *
226 * Optional: Called under the termios lock 226 * Optional: Called under the termios lock
227 *
228 * int (*get_icount)(struct tty_struct *tty, struct serial_icounter *icount);
229 *
230 * Called when the device receives a TIOCGICOUNT ioctl. Passed a kernel
231 * structure to complete. This method is optional and will only be called
232 * if provided (otherwise EINVAL will be returned).
227 */ 233 */
228 234
229#include <linux/fs.h> 235#include <linux/fs.h>
@@ -232,6 +238,7 @@
232 238
233struct tty_struct; 239struct tty_struct;
234struct tty_driver; 240struct tty_driver;
241struct serial_icounter_struct;
235 242
236struct tty_operations { 243struct tty_operations {
237 struct tty_struct * (*lookup)(struct tty_driver *driver, 244 struct tty_struct * (*lookup)(struct tty_driver *driver,
@@ -268,6 +275,8 @@ struct tty_operations {
268 unsigned int set, unsigned int clear); 275 unsigned int set, unsigned int clear);
269 int (*resize)(struct tty_struct *tty, struct winsize *ws); 276 int (*resize)(struct tty_struct *tty, struct winsize *ws);
270 int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew); 277 int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
278 int (*get_icount)(struct tty_struct *tty,
279 struct serial_icounter_struct *icount);
271#ifdef CONFIG_CONSOLE_POLL 280#ifdef CONFIG_CONSOLE_POLL
272 int (*poll_init)(struct tty_driver *driver, int line, char *options); 281 int (*poll_init)(struct tty_driver *driver, int line, char *options);
273 int (*poll_get_char)(struct tty_driver *driver, int line); 282 int (*poll_get_char)(struct tty_driver *driver, int line);
diff --git a/include/linux/types.h b/include/linux/types.h
index 357dbc19606f..c2a9eb44f2fa 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -121,15 +121,7 @@ typedef __u64 u_int64_t;
121typedef __s64 int64_t; 121typedef __s64 int64_t;
122#endif 122#endif
123 123
124/* 124/* this is a special 64bit data type that is 8-byte aligned */
125 * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
126 * common 32/64-bit compat problems.
127 * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
128 * architectures) and to 8-byte boundaries on 64-bit architetures. The new
129 * aligned_64 type enforces 8-byte alignment so that structs containing
130 * aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
131 * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
132 */
133#define aligned_u64 __u64 __attribute__((aligned(8))) 125#define aligned_u64 __u64 __attribute__((aligned(8)))
134#define aligned_be64 __be64 __attribute__((aligned(8))) 126#define aligned_be64 __be64 __attribute__((aligned(8)))
135#define aligned_le64 __le64 __attribute__((aligned(8))) 127#define aligned_le64 __le64 __attribute__((aligned(8)))
@@ -186,7 +178,15 @@ typedef __u64 __bitwise __be64;
186typedef __u16 __bitwise __sum16; 178typedef __u16 __bitwise __sum16;
187typedef __u32 __bitwise __wsum; 179typedef __u32 __bitwise __wsum;
188 180
189/* this is a special 64bit data type that is 8-byte aligned */ 181/*
182 * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
183 * common 32/64-bit compat problems.
184 * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
185 * architectures) and to 8-byte boundaries on 64-bit architetures. The new
186 * aligned_64 type enforces 8-byte alignment so that structs containing
187 * aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
188 * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
189 */
190#define __aligned_u64 __u64 __attribute__((aligned(8))) 190#define __aligned_u64 __u64 __attribute__((aligned(8)))
191#define __aligned_be64 __be64 __attribute__((aligned(8))) 191#define __aligned_be64 __be64 __attribute__((aligned(8)))
192#define __aligned_le64 __le64 __attribute__((aligned(8))) 192#define __aligned_le64 __le64 __attribute__((aligned(8)))
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 5dcc9ff72f69..d6188e5a52df 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -108,7 +108,7 @@ extern void uio_event_notify(struct uio_info *info);
108 108
109/* defines for uio_info->irq */ 109/* defines for uio_info->irq */
110#define UIO_IRQ_CUSTOM -1 110#define UIO_IRQ_CUSTOM -1
111#define UIO_IRQ_NONE -2 111#define UIO_IRQ_NONE 0
112 112
113/* defines for uio_mem->memtype */ 113/* defines for uio_mem->memtype */
114#define UIO_MEM_NONE 0 114#define UIO_MEM_NONE 0
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h
index c117a68d04a7..5e86dc771da4 100644
--- a/include/linux/usb/cdc.h
+++ b/include/linux/usb/cdc.h
@@ -32,6 +32,8 @@
32 32
33#define USB_CDC_PROTO_EEM 7 33#define USB_CDC_PROTO_EEM 7
34 34
35#define USB_CDC_NCM_PROTO_NTB 1
36
35/*-------------------------------------------------------------------------*/ 37/*-------------------------------------------------------------------------*/
36 38
37/* 39/*
@@ -274,13 +276,13 @@ struct usb_cdc_notification {
274/* 276/*
275 * Class Specific structures and constants 277 * Class Specific structures and constants
276 * 278 *
277 * CDC NCM parameter structure, CDC NCM subclass 6.2.1 279 * CDC NCM NTB parameters structure, CDC NCM subclass 6.2.1
278 * 280 *
279 */ 281 */
280 282
281struct usb_cdc_ncm_ntb_parameter { 283struct usb_cdc_ncm_ntb_parameters {
282 __le16 wLength; 284 __le16 wLength;
283 __le16 bmNtbFormatSupported; 285 __le16 bmNtbFormatsSupported;
284 __le32 dwNtbInMaxSize; 286 __le32 dwNtbInMaxSize;
285 __le16 wNdpInDivisor; 287 __le16 wNdpInDivisor;
286 __le16 wNdpInPayloadRemainder; 288 __le16 wNdpInPayloadRemainder;
@@ -297,8 +299,8 @@ struct usb_cdc_ncm_ntb_parameter {
297 * CDC NCM transfer headers, CDC NCM subclass 3.2 299 * CDC NCM transfer headers, CDC NCM subclass 3.2
298 */ 300 */
299 301
300#define NCM_NTH16_SIGN 0x484D434E /* NCMH */ 302#define USB_CDC_NCM_NTH16_SIGN 0x484D434E /* NCMH */
301#define NCM_NTH32_SIGN 0x686D636E /* ncmh */ 303#define USB_CDC_NCM_NTH32_SIGN 0x686D636E /* ncmh */
302 304
303struct usb_cdc_ncm_nth16 { 305struct usb_cdc_ncm_nth16 {
304 __le32 dwSignature; 306 __le32 dwSignature;
@@ -320,25 +322,78 @@ struct usb_cdc_ncm_nth32 {
320 * CDC NCM datagram pointers, CDC NCM subclass 3.3 322 * CDC NCM datagram pointers, CDC NCM subclass 3.3
321 */ 323 */
322 324
323#define NCM_NDP16_CRC_SIGN 0x314D434E /* NCM1 */ 325#define USB_CDC_NCM_NDP16_CRC_SIGN 0x314D434E /* NCM1 */
324#define NCM_NDP16_NOCRC_SIGN 0x304D434E /* NCM0 */ 326#define USB_CDC_NCM_NDP16_NOCRC_SIGN 0x304D434E /* NCM0 */
325#define NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */ 327#define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */
326#define NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */ 328#define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */
329
330/* 16-bit NCM Datagram Pointer Entry */
331struct usb_cdc_ncm_dpe16 {
332 __le16 wDatagramIndex;
333 __le16 wDatagramLength;
334} __attribute__((__packed__));
327 335
336/* 16-bit NCM Datagram Pointer Table */
328struct usb_cdc_ncm_ndp16 { 337struct usb_cdc_ncm_ndp16 {
329 __le32 dwSignature; 338 __le32 dwSignature;
330 __le16 wLength; 339 __le16 wLength;
331 __le16 wNextFpIndex; 340 __le16 wNextFpIndex;
332 __u8 data[0]; 341 struct usb_cdc_ncm_dpe16 dpe16[0];
333} __attribute__ ((packed)); 342} __attribute__ ((packed));
334 343
344/* 32-bit NCM Datagram Pointer Entry */
345struct usb_cdc_ncm_dpe32 {
346 __le32 dwDatagramIndex;
347 __le32 dwDatagramLength;
348} __attribute__((__packed__));
349
350/* 32-bit NCM Datagram Pointer Table */
335struct usb_cdc_ncm_ndp32 { 351struct usb_cdc_ncm_ndp32 {
336 __le32 dwSignature; 352 __le32 dwSignature;
337 __le16 wLength; 353 __le16 wLength;
338 __le16 wReserved6; 354 __le16 wReserved6;
339 __le32 dwNextFpIndex; 355 __le32 dwNextNdpIndex;
340 __le32 dwReserved12; 356 __le32 dwReserved12;
341 __u8 data[0]; 357 struct usb_cdc_ncm_dpe32 dpe32[0];
342} __attribute__ ((packed)); 358} __attribute__ ((packed));
343 359
360/* CDC NCM subclass 3.2.1 and 3.2.2 */
361#define USB_CDC_NCM_NDP16_INDEX_MIN 0x000C
362#define USB_CDC_NCM_NDP32_INDEX_MIN 0x0010
363
364/* CDC NCM subclass 3.3.3 Datagram Formatting */
365#define USB_CDC_NCM_DATAGRAM_FORMAT_CRC 0x30
366#define USB_CDC_NCM_DATAGRAM_FORMAT_NOCRC 0X31
367
368/* CDC NCM subclass 4.2 NCM Communications Interface Protocol Code */
369#define USB_CDC_NCM_PROTO_CODE_NO_ENCAP_COMMANDS 0x00
370#define USB_CDC_NCM_PROTO_CODE_EXTERN_PROTO 0xFE
371
372/* CDC NCM subclass 5.2.1 NCM Functional Descriptor, bmNetworkCapabilities */
373#define USB_CDC_NCM_NCAP_ETH_FILTER (1 << 0)
374#define USB_CDC_NCM_NCAP_NET_ADDRESS (1 << 1)
375#define USB_CDC_NCM_NCAP_ENCAP_COMMAND (1 << 2)
376#define USB_CDC_NCM_NCAP_MAX_DATAGRAM_SIZE (1 << 3)
377#define USB_CDC_NCM_NCAP_CRC_MODE (1 << 4)
378
379/* CDC NCM subclass Table 6-3: NTB Parameter Structure */
380#define USB_CDC_NCM_NTB16_SUPPORTED (1 << 0)
381#define USB_CDC_NCM_NTB32_SUPPORTED (1 << 1)
382
383/* CDC NCM subclass Table 6-3: NTB Parameter Structure */
384#define USB_CDC_NCM_NDP_ALIGN_MIN_SIZE 0x04
385#define USB_CDC_NCM_NTB_MAX_LENGTH 0x1C
386
387/* CDC NCM subclass 6.2.5 SetNtbFormat */
388#define USB_CDC_NCM_NTB16_FORMAT 0x00
389#define USB_CDC_NCM_NTB32_FORMAT 0x01
390
391/* CDC NCM subclass 6.2.7 SetNtbInputSize */
392#define USB_CDC_NCM_NTB_MIN_IN_SIZE 2048
393#define USB_CDC_NCM_NTB_MIN_OUT_SIZE 2048
394
395/* CDC NCM subclass 6.2.11 SetCrcMode */
396#define USB_CDC_NCM_CRC_NOT_APPENDED 0x00
397#define USB_CDC_NCM_CRC_APPENDED 0x01
398
344#endif /* __LINUX_USB_CDC_H */ 399#endif /* __LINUX_USB_CDC_H */
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index da2ed77d3e8d..f917bbbc8901 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -123,8 +123,23 @@
123#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */ 123#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */
124#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ 124#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */
125 125
126/*
127 * New Feature Selectors as added by USB 3.0
128 * See USB 3.0 spec Table 9-6
129 */
130#define USB_DEVICE_U1_ENABLE 48 /* dev may initiate U1 transition */
131#define USB_DEVICE_U2_ENABLE 49 /* dev may initiate U2 transition */
132#define USB_DEVICE_LTM_ENABLE 50 /* dev may send LTM */
133#define USB_INTRF_FUNC_SUSPEND 0 /* function suspend */
134
135#define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00
136
126#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ 137#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
127 138
139/* Bit array elements as returned by the USB_REQ_GET_STATUS request. */
140#define USB_DEV_STAT_U1_ENABLED 2 /* transition into U1 state */
141#define USB_DEV_STAT_U2_ENABLED 3 /* transition into U2 state */
142#define USB_DEV_STAT_LTM_ENABLED 4 /* Latency tolerance messages */
128 143
129/** 144/**
130 * struct usb_ctrlrequest - SETUP data for a USB device control request 145 * struct usb_ctrlrequest - SETUP data for a USB device control request
@@ -675,6 +690,7 @@ struct usb_bos_descriptor {
675 __u8 bNumDeviceCaps; 690 __u8 bNumDeviceCaps;
676} __attribute__((packed)); 691} __attribute__((packed));
677 692
693#define USB_DT_BOS_SIZE 5
678/*-------------------------------------------------------------------------*/ 694/*-------------------------------------------------------------------------*/
679 695
680/* USB_DT_DEVICE_CAPABILITY: grouped with BOS */ 696/* USB_DT_DEVICE_CAPABILITY: grouped with BOS */
@@ -712,16 +728,56 @@ struct usb_wireless_cap_descriptor { /* Ultra Wide Band */
712 __u8 bReserved; 728 __u8 bReserved;
713} __attribute__((packed)); 729} __attribute__((packed));
714 730
731/* USB 2.0 Extension descriptor */
715#define USB_CAP_TYPE_EXT 2 732#define USB_CAP_TYPE_EXT 2
716 733
717struct usb_ext_cap_descriptor { /* Link Power Management */ 734struct usb_ext_cap_descriptor { /* Link Power Management */
718 __u8 bLength; 735 __u8 bLength;
719 __u8 bDescriptorType; 736 __u8 bDescriptorType;
720 __u8 bDevCapabilityType; 737 __u8 bDevCapabilityType;
721 __u8 bmAttributes; 738 __le32 bmAttributes;
722#define USB_LPM_SUPPORT (1 << 1) /* supports LPM */ 739#define USB_LPM_SUPPORT (1 << 1) /* supports LPM */
723} __attribute__((packed)); 740} __attribute__((packed));
724 741
742#define USB_DT_USB_EXT_CAP_SIZE 7
743
744/*
745 * SuperSpeed USB Capability descriptor: Defines the set of SuperSpeed USB
746 * specific device level capabilities
747 */
748#define USB_SS_CAP_TYPE 3
749struct usb_ss_cap_descriptor { /* Link Power Management */
750 __u8 bLength;
751 __u8 bDescriptorType;
752 __u8 bDevCapabilityType;
753 __u8 bmAttributes;
754#define USB_LTM_SUPPORT (1 << 1) /* supports LTM */
755 __le16 wSpeedSupported;
756#define USB_LOW_SPEED_OPERATION (1) /* Low speed operation */
757#define USB_FULL_SPEED_OPERATION (1 << 1) /* Full speed operation */
758#define USB_HIGH_SPEED_OPERATION (1 << 2) /* High speed operation */
759#define USB_5GBPS_OPERATION (1 << 3) /* Operation at 5Gbps */
760 __u8 bFunctionalitySupport;
761 __u8 bU1devExitLat;
762 __le16 bU2DevExitLat;
763} __attribute__((packed));
764
765#define USB_DT_USB_SS_CAP_SIZE 10
766
767/*
768 * Container ID Capability descriptor: Defines the instance unique ID used to
769 * identify the instance across all operating modes
770 */
771#define CONTAINER_ID_TYPE 4
772struct usb_ss_container_id_descriptor {
773 __u8 bLength;
774 __u8 bDescriptorType;
775 __u8 bDevCapabilityType;
776 __u8 bReserved;
777 __u8 ContainerID[16]; /* 128-bit number */
778} __attribute__((packed));
779
780#define USB_DT_USB_SS_CONTN_ID_SIZE 20
725/*-------------------------------------------------------------------------*/ 781/*-------------------------------------------------------------------------*/
726 782
727/* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with 783/* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with
@@ -808,4 +864,14 @@ enum usb_device_state {
808 */ 864 */
809}; 865};
810 866
867/*-------------------------------------------------------------------------*/
868
869/*
870 * As per USB compliance update, a device that is actively drawing
871 * more than 100mA from USB must report itself as bus-powered in
872 * the GetStatus(DEVICE) call.
873 * http://compliance.usb.org/index.asp?UpdateFile=Electrical&Format=Standard#34
874 */
875#define USB_SELF_POWER_VBUS_MAX_DRAW 100
876
811#endif /* __LINUX_USB_CH9_H */ 877#endif /* __LINUX_USB_CH9_H */
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 617068134ae8..3d29a7dcac2d 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -161,8 +161,6 @@ ep_choose(struct usb_gadget *g, struct usb_endpoint_descriptor *hs,
161 * and by language IDs provided in control requests. 161 * and by language IDs provided in control requests.
162 * @descriptors: Table of descriptors preceding all function descriptors. 162 * @descriptors: Table of descriptors preceding all function descriptors.
163 * Examples include OTG and vendor-specific descriptors. 163 * Examples include OTG and vendor-specific descriptors.
164 * @bind: Called from @usb_add_config() to allocate resources unique to this
165 * configuration and to call @usb_add_function() for each function used.
166 * @unbind: Reverses @bind; called as a side effect of unregistering the 164 * @unbind: Reverses @bind; called as a side effect of unregistering the
167 * driver which added this configuration. 165 * driver which added this configuration.
168 * @setup: Used to delegate control requests that aren't handled by standard 166 * @setup: Used to delegate control requests that aren't handled by standard
@@ -207,8 +205,7 @@ struct usb_configuration {
207 * we can't restructure things to avoid mismatching... 205 * we can't restructure things to avoid mismatching...
208 */ 206 */
209 207
210 /* configuration management: bind/unbind */ 208 /* configuration management: unbind/setup */
211 int (*bind)(struct usb_configuration *);
212 void (*unbind)(struct usb_configuration *); 209 void (*unbind)(struct usb_configuration *);
213 int (*setup)(struct usb_configuration *, 210 int (*setup)(struct usb_configuration *,
214 const struct usb_ctrlrequest *); 211 const struct usb_ctrlrequest *);
@@ -232,20 +229,24 @@ struct usb_configuration {
232}; 229};
233 230
234int usb_add_config(struct usb_composite_dev *, 231int usb_add_config(struct usb_composite_dev *,
235 struct usb_configuration *); 232 struct usb_configuration *,
233 int (*)(struct usb_configuration *));
236 234
237/** 235/**
238 * struct usb_composite_driver - groups configurations into a gadget 236 * struct usb_composite_driver - groups configurations into a gadget
239 * @name: For diagnostics, identifies the driver. 237 * @name: For diagnostics, identifies the driver.
238 * @iProduct: Used as iProduct override if @dev->iProduct is not set.
239 * If NULL value of @name is taken.
240 * @iManufacturer: Used as iManufacturer override if @dev->iManufacturer is
241 * not set. If NULL a default "<system> <release> with <udc>" value
242 * will be used.
240 * @dev: Template descriptor for the device, including default device 243 * @dev: Template descriptor for the device, including default device
241 * identifiers. 244 * identifiers.
242 * @strings: tables of strings, keyed by identifiers assigned during bind() 245 * @strings: tables of strings, keyed by identifiers assigned during bind()
243 * and language IDs provided in control requests 246 * and language IDs provided in control requests
244 * @bind: (REQUIRED) Used to allocate resources that are shared across the 247 * @needs_serial: set to 1 if the gadget needs userspace to provide
245 * whole device, such as string IDs, and add its configurations using 248 * a serial number. If one is not provided, warning will be printed.
246 * @usb_add_config(). This may fail by returning a negative errno 249 * @unbind: Reverses bind; called as a side effect of unregistering
247 * value; it should return zero on successful initialization.
248 * @unbind: Reverses @bind(); called as a side effect of unregistering
249 * this driver. 250 * this driver.
250 * @disconnect: optional driver disconnect method 251 * @disconnect: optional driver disconnect method
251 * @suspend: Notifies when the host stops sending USB traffic, 252 * @suspend: Notifies when the host stops sending USB traffic,
@@ -256,7 +257,7 @@ int usb_add_config(struct usb_composite_dev *,
256 * Devices default to reporting self powered operation. Devices which rely 257 * Devices default to reporting self powered operation. Devices which rely
257 * on bus powered operation should report this in their @bind() method. 258 * on bus powered operation should report this in their @bind() method.
258 * 259 *
259 * Before returning from @bind, various fields in the template descriptor 260 * Before returning from bind, various fields in the template descriptor
260 * may be overridden. These include the idVendor/idProduct/bcdDevice values 261 * may be overridden. These include the idVendor/idProduct/bcdDevice values
261 * normally to bind the appropriate host side driver, and the three strings 262 * normally to bind the appropriate host side driver, and the three strings
262 * (iManufacturer, iProduct, iSerialNumber) normally used to provide user 263 * (iManufacturer, iProduct, iSerialNumber) normally used to provide user
@@ -266,15 +267,12 @@ int usb_add_config(struct usb_composite_dev *,
266 */ 267 */
267struct usb_composite_driver { 268struct usb_composite_driver {
268 const char *name; 269 const char *name;
270 const char *iProduct;
271 const char *iManufacturer;
269 const struct usb_device_descriptor *dev; 272 const struct usb_device_descriptor *dev;
270 struct usb_gadget_strings **strings; 273 struct usb_gadget_strings **strings;
274 unsigned needs_serial:1;
271 275
272 /* REVISIT: bind() functions can be marked __init, which
273 * makes trouble for section mismatch analysis. See if
274 * we can't restructure things to avoid mismatching...
275 */
276
277 int (*bind)(struct usb_composite_dev *);
278 int (*unbind)(struct usb_composite_dev *); 276 int (*unbind)(struct usb_composite_dev *);
279 277
280 void (*disconnect)(struct usb_composite_dev *); 278 void (*disconnect)(struct usb_composite_dev *);
@@ -284,8 +282,9 @@ struct usb_composite_driver {
284 void (*resume)(struct usb_composite_dev *); 282 void (*resume)(struct usb_composite_dev *);
285}; 283};
286 284
287extern int usb_composite_register(struct usb_composite_driver *); 285extern int usb_composite_probe(struct usb_composite_driver *driver,
288extern void usb_composite_unregister(struct usb_composite_driver *); 286 int (*bind)(struct usb_composite_dev *cdev));
287extern void usb_composite_unregister(struct usb_composite_driver *driver);
289 288
290 289
291/** 290/**
@@ -334,6 +333,9 @@ struct usb_composite_dev {
334 struct list_head configs; 333 struct list_head configs;
335 struct usb_composite_driver *driver; 334 struct usb_composite_driver *driver;
336 u8 next_string_id; 335 u8 next_string_id;
336 u8 manufacturer_override;
337 u8 product_override;
338 u8 serial_override;
337 339
338 /* the gadget driver won't enable the data pullup 340 /* the gadget driver won't enable the data pullup
339 * while the deactivation count is nonzero. 341 * while the deactivation count is nonzero.
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index d3ef42d7d2f0..006412ce2303 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -705,11 +705,6 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
705 * struct usb_gadget_driver - driver for usb 'slave' devices 705 * struct usb_gadget_driver - driver for usb 'slave' devices
706 * @function: String describing the gadget's function 706 * @function: String describing the gadget's function
707 * @speed: Highest speed the driver handles. 707 * @speed: Highest speed the driver handles.
708 * @bind: Invoked when the driver is bound to a gadget, usually
709 * after registering the driver.
710 * At that point, ep0 is fully initialized, and ep_list holds
711 * the currently-available endpoints.
712 * Called in a context that permits sleeping.
713 * @setup: Invoked for ep0 control requests that aren't handled by 708 * @setup: Invoked for ep0 control requests that aren't handled by
714 * the hardware level driver. Most calls must be handled by 709 * the hardware level driver. Most calls must be handled by
715 * the gadget driver, including descriptor and configuration 710 * the gadget driver, including descriptor and configuration
@@ -774,7 +769,6 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
774struct usb_gadget_driver { 769struct usb_gadget_driver {
775 char *function; 770 char *function;
776 enum usb_device_speed speed; 771 enum usb_device_speed speed;
777 int (*bind)(struct usb_gadget *);
778 void (*unbind)(struct usb_gadget *); 772 void (*unbind)(struct usb_gadget *);
779 int (*setup)(struct usb_gadget *, 773 int (*setup)(struct usb_gadget *,
780 const struct usb_ctrlrequest *); 774 const struct usb_ctrlrequest *);
@@ -798,17 +792,19 @@ struct usb_gadget_driver {
798 */ 792 */
799 793
800/** 794/**
801 * usb_gadget_register_driver - register a gadget driver 795 * usb_gadget_probe_driver - probe a gadget driver
802 * @driver:the driver being registered 796 * @driver: the driver being registered
797 * @bind: the driver's bind callback
803 * Context: can sleep 798 * Context: can sleep
804 * 799 *
805 * Call this in your gadget driver's module initialization function, 800 * Call this in your gadget driver's module initialization function,
806 * to tell the underlying usb controller driver about your driver. 801 * to tell the underlying usb controller driver about your driver.
807 * The driver's bind() function will be called to bind it to a 802 * The @bind() function will be called to bind it to a gadget before this
808 * gadget before this registration call returns. It's expected that 803 * registration call returns. It's expected that the @bind() function will
809 * the bind() functions will be in init sections. 804 * be in init sections.
810 */ 805 */
811int usb_gadget_register_driver(struct usb_gadget_driver *driver); 806int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
807 int (*bind)(struct usb_gadget *));
812 808
813/** 809/**
814 * usb_gadget_unregister_driver - unregister a gadget driver 810 * usb_gadget_unregister_driver - unregister a gadget driver
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 3b571f1ffbb3..0b6e751ea0b1 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -329,6 +329,8 @@ extern int usb_hcd_submit_urb(struct urb *urb, gfp_t mem_flags);
329extern int usb_hcd_unlink_urb(struct urb *urb, int status); 329extern int usb_hcd_unlink_urb(struct urb *urb, int status);
330extern void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, 330extern void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb,
331 int status); 331 int status);
332extern void unmap_urb_setup_for_dma(struct usb_hcd *, struct urb *);
333extern void unmap_urb_for_dma(struct usb_hcd *, struct urb *);
332extern void usb_hcd_flush_endpoint(struct usb_device *udev, 334extern void usb_hcd_flush_endpoint(struct usb_device *udev,
333 struct usb_host_endpoint *ep); 335 struct usb_host_endpoint *ep);
334extern void usb_hcd_disable_endpoint(struct usb_device *udev, 336extern void usb_hcd_disable_endpoint(struct usb_device *udev,
diff --git a/include/linux/usb/intel_mid_otg.h b/include/linux/usb/intel_mid_otg.h
new file mode 100644
index 000000000000..a0ccf795f362
--- /dev/null
+++ b/include/linux/usb/intel_mid_otg.h
@@ -0,0 +1,180 @@
1/*
2 * Intel MID (Langwell/Penwell) USB OTG Transceiver driver
3 * Copyright (C) 2008 - 2010, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 */
19
20#ifndef __INTEL_MID_OTG_H
21#define __INTEL_MID_OTG_H
22
23#include <linux/pm.h>
24#include <linux/usb/otg.h>
25#include <linux/notifier.h>
26
27struct intel_mid_otg_xceiv;
28
29/* This is a common data structure for Intel MID platform to
30 * save values of the OTG state machine */
31struct otg_hsm {
32 /* Input */
33 int a_bus_resume;
34 int a_bus_suspend;
35 int a_conn;
36 int a_sess_vld;
37 int a_srp_det;
38 int a_vbus_vld;
39 int b_bus_resume;
40 int b_bus_suspend;
41 int b_conn;
42 int b_se0_srp;
43 int b_ssend_srp;
44 int b_sess_end;
45 int b_sess_vld;
46 int id;
47/* id values */
48#define ID_B 0x05
49#define ID_A 0x04
50#define ID_ACA_C 0x03
51#define ID_ACA_B 0x02
52#define ID_ACA_A 0x01
53 int power_up;
54 int adp_change;
55 int test_device;
56
57 /* Internal variables */
58 int a_set_b_hnp_en;
59 int b_srp_done;
60 int b_hnp_enable;
61 int hnp_poll_enable;
62
63 /* Timeout indicator for timers */
64 int a_wait_vrise_tmout;
65 int a_wait_bcon_tmout;
66 int a_aidl_bdis_tmout;
67 int a_bidl_adis_tmout;
68 int a_bidl_adis_tmr;
69 int a_wait_vfall_tmout;
70 int b_ase0_brst_tmout;
71 int b_bus_suspend_tmout;
72 int b_srp_init_tmout;
73 int b_srp_fail_tmout;
74 int b_srp_fail_tmr;
75 int b_adp_sense_tmout;
76
77 /* Informative variables */
78 int a_bus_drop;
79 int a_bus_req;
80 int a_clr_err;
81 int b_bus_req;
82 int a_suspend_req;
83 int b_bus_suspend_vld;
84
85 /* Output */
86 int drv_vbus;
87 int loc_conn;
88 int loc_sof;
89
90 /* Others */
91 int vbus_srp_up;
92};
93
94/* must provide ULPI access function to read/write registers implemented in
95 * ULPI address space */
96struct iotg_ulpi_access_ops {
97 int (*read)(struct intel_mid_otg_xceiv *iotg, u8 reg, u8 *val);
98 int (*write)(struct intel_mid_otg_xceiv *iotg, u8 reg, u8 val);
99};
100
101#define OTG_A_DEVICE 0x0
102#define OTG_B_DEVICE 0x1
103
104/*
105 * the Intel MID (Langwell/Penwell) otg transceiver driver needs to interact
106 * with device and host drivers to implement the USB OTG related feature. More
107 * function members are added based on otg_transceiver data structure for this
108 * purpose.
109 */
110struct intel_mid_otg_xceiv {
111 struct otg_transceiver otg;
112 struct otg_hsm hsm;
113
114 /* base address */
115 void __iomem *base;
116
117 /* ops to access ulpi */
118 struct iotg_ulpi_access_ops ulpi_ops;
119
120 /* atomic notifier for interrupt context */
121 struct atomic_notifier_head iotg_notifier;
122
123 /* start/stop USB Host function */
124 int (*start_host)(struct intel_mid_otg_xceiv *iotg);
125 int (*stop_host)(struct intel_mid_otg_xceiv *iotg);
126
127 /* start/stop USB Peripheral function */
128 int (*start_peripheral)(struct intel_mid_otg_xceiv *iotg);
129 int (*stop_peripheral)(struct intel_mid_otg_xceiv *iotg);
130
131 /* start/stop ADP sense/probe function */
132 int (*set_adp_probe)(struct intel_mid_otg_xceiv *iotg,
133 bool enabled, int dev);
134 int (*set_adp_sense)(struct intel_mid_otg_xceiv *iotg,
135 bool enabled);
136
137#ifdef CONFIG_PM
138 /* suspend/resume USB host function */
139 int (*suspend_host)(struct intel_mid_otg_xceiv *iotg,
140 pm_message_t message);
141 int (*resume_host)(struct intel_mid_otg_xceiv *iotg);
142
143 int (*suspend_peripheral)(struct intel_mid_otg_xceiv *iotg,
144 pm_message_t message);
145 int (*resume_peripheral)(struct intel_mid_otg_xceiv *iotg);
146#endif
147
148};
149static inline
150struct intel_mid_otg_xceiv *otg_to_mid_xceiv(struct otg_transceiver *otg)
151{
152 return container_of(otg, struct intel_mid_otg_xceiv, otg);
153}
154
155#define MID_OTG_NOTIFY_CONNECT 0x0001
156#define MID_OTG_NOTIFY_DISCONN 0x0002
157#define MID_OTG_NOTIFY_HSUSPEND 0x0003
158#define MID_OTG_NOTIFY_HRESUME 0x0004
159#define MID_OTG_NOTIFY_CSUSPEND 0x0005
160#define MID_OTG_NOTIFY_CRESUME 0x0006
161#define MID_OTG_NOTIFY_HOSTADD 0x0007
162#define MID_OTG_NOTIFY_HOSTREMOVE 0x0008
163#define MID_OTG_NOTIFY_CLIENTADD 0x0009
164#define MID_OTG_NOTIFY_CLIENTREMOVE 0x000a
165
166static inline int
167intel_mid_otg_register_notifier(struct intel_mid_otg_xceiv *iotg,
168 struct notifier_block *nb)
169{
170 return atomic_notifier_chain_register(&iotg->iotg_notifier, nb);
171}
172
173static inline void
174intel_mid_otg_unregister_notifier(struct intel_mid_otg_xceiv *iotg,
175 struct notifier_block *nb)
176{
177 atomic_notifier_chain_unregister(&iotg->iotg_notifier, nb);
178}
179
180#endif /* __INTEL_MID_OTG_H */
diff --git a/include/linux/usb/langwell_otg.h b/include/linux/usb/langwell_otg.h
new file mode 100644
index 000000000000..51f17b16d312
--- /dev/null
+++ b/include/linux/usb/langwell_otg.h
@@ -0,0 +1,139 @@
1/*
2 * Intel Langwell USB OTG transceiver driver
3 * Copyright (C) 2008 - 2010, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 */
19
20#ifndef __LANGWELL_OTG_H
21#define __LANGWELL_OTG_H
22
23#include <linux/usb/intel_mid_otg.h>
24
25#define CI_USBCMD 0x30
26# define USBCMD_RST BIT(1)
27# define USBCMD_RS BIT(0)
28#define CI_USBSTS 0x34
29# define USBSTS_SLI BIT(8)
30# define USBSTS_URI BIT(6)
31# define USBSTS_PCI BIT(2)
32#define CI_PORTSC1 0x74
33# define PORTSC_PP BIT(12)
34# define PORTSC_LS (BIT(11) | BIT(10))
35# define PORTSC_SUSP BIT(7)
36# define PORTSC_CCS BIT(0)
37#define CI_HOSTPC1 0xb4
38# define HOSTPC1_PHCD BIT(22)
39#define CI_OTGSC 0xf4
40# define OTGSC_DPIE BIT(30)
41# define OTGSC_1MSE BIT(29)
42# define OTGSC_BSEIE BIT(28)
43# define OTGSC_BSVIE BIT(27)
44# define OTGSC_ASVIE BIT(26)
45# define OTGSC_AVVIE BIT(25)
46# define OTGSC_IDIE BIT(24)
47# define OTGSC_DPIS BIT(22)
48# define OTGSC_1MSS BIT(21)
49# define OTGSC_BSEIS BIT(20)
50# define OTGSC_BSVIS BIT(19)
51# define OTGSC_ASVIS BIT(18)
52# define OTGSC_AVVIS BIT(17)
53# define OTGSC_IDIS BIT(16)
54# define OTGSC_DPS BIT(14)
55# define OTGSC_1MST BIT(13)
56# define OTGSC_BSE BIT(12)
57# define OTGSC_BSV BIT(11)
58# define OTGSC_ASV BIT(10)
59# define OTGSC_AVV BIT(9)
60# define OTGSC_ID BIT(8)
61# define OTGSC_HABA BIT(7)
62# define OTGSC_HADP BIT(6)
63# define OTGSC_IDPU BIT(5)
64# define OTGSC_DP BIT(4)
65# define OTGSC_OT BIT(3)
66# define OTGSC_HAAR BIT(2)
67# define OTGSC_VC BIT(1)
68# define OTGSC_VD BIT(0)
69# define OTGSC_INTEN_MASK (0x7f << 24)
70# define OTGSC_INT_MASK (0x5f << 24)
71# define OTGSC_INTSTS_MASK (0x7f << 16)
72#define CI_USBMODE 0xf8
73# define USBMODE_CM (BIT(1) | BIT(0))
74# define USBMODE_IDLE 0
75# define USBMODE_DEVICE 0x2
76# define USBMODE_HOST 0x3
77#define USBCFG_ADDR 0xff10801c
78#define USBCFG_LEN 4
79# define USBCFG_VBUSVAL BIT(14)
80# define USBCFG_AVALID BIT(13)
81# define USBCFG_BVALID BIT(12)
82# define USBCFG_SESEND BIT(11)
83
84#define INTR_DUMMY_MASK (USBSTS_SLI | USBSTS_URI | USBSTS_PCI)
85
86enum langwell_otg_timer_type {
87 TA_WAIT_VRISE_TMR,
88 TA_WAIT_BCON_TMR,
89 TA_AIDL_BDIS_TMR,
90 TB_ASE0_BRST_TMR,
91 TB_SE0_SRP_TMR,
92 TB_SRP_INIT_TMR,
93 TB_SRP_FAIL_TMR,
94 TB_BUS_SUSPEND_TMR
95};
96
97#define TA_WAIT_VRISE 100
98#define TA_WAIT_BCON 30000
99#define TA_AIDL_BDIS 15000
100#define TB_ASE0_BRST 5000
101#define TB_SE0_SRP 2
102#define TB_SRP_INIT 100
103#define TB_SRP_FAIL 5500
104#define TB_BUS_SUSPEND 500
105
106struct langwell_otg_timer {
107 unsigned long expires; /* Number of count increase to timeout */
108 unsigned long count; /* Tick counter */
109 void (*function)(unsigned long); /* Timeout function */
110 unsigned long data; /* Data passed to function */
111 struct list_head list;
112};
113
114struct langwell_otg {
115 struct intel_mid_otg_xceiv iotg;
116 struct device *dev;
117
118 void __iomem *usbcfg; /* SCCBUSB config Reg */
119
120 unsigned region;
121 unsigned cfg_region;
122
123 struct work_struct work;
124 struct workqueue_struct *qwork;
125 struct timer_list hsm_timer;
126
127 spinlock_t lock;
128 spinlock_t wq_lock;
129
130 struct notifier_block iotg_notifier;
131};
132
133static inline
134struct langwell_otg *mid_xceiv_to_lnw(struct intel_mid_otg_xceiv *iotg)
135{
136 return container_of(iotg, struct langwell_otg, iotg);
137}
138
139#endif /* __LANGWELL_OTG_H__ */
diff --git a/include/linux/usb/ncm.h b/include/linux/usb/ncm.h
deleted file mode 100644
index 006d1064c8b2..000000000000
--- a/include/linux/usb/ncm.h
+++ /dev/null
@@ -1,114 +0,0 @@
1/*
2 * USB CDC NCM auxiliary definitions
3 */
4
5#ifndef __LINUX_USB_NCM_H
6#define __LINUX_USB_NCM_H
7
8#include <linux/types.h>
9#include <linux/usb/cdc.h>
10#include <asm/unaligned.h>
11
12#define NCM_NTB_MIN_IN_SIZE 2048
13#define NCM_NTB_MIN_OUT_SIZE 2048
14
15#define NCM_CONTROL_TIMEOUT (5 * 1000)
16
17/* bmNetworkCapabilities */
18
19#define NCM_NCAP_ETH_FILTER (1 << 0)
20#define NCM_NCAP_NET_ADDRESS (1 << 1)
21#define NCM_NCAP_ENCAP_COMM (1 << 2)
22#define NCM_NCAP_MAX_DGRAM (1 << 3)
23#define NCM_NCAP_CRC_MODE (1 << 4)
24
25/*
26 * Here are options for NCM Datagram Pointer table (NDP) parser.
27 * There are 2 different formats: NDP16 and NDP32 in the spec (ch. 3),
28 * in NDP16 offsets and sizes fields are 1 16bit word wide,
29 * in NDP32 -- 2 16bit words wide. Also signatures are different.
30 * To make the parser code the same, put the differences in the structure,
31 * and switch pointers to the structures when the format is changed.
32 */
33
34struct ndp_parser_opts {
35 u32 nth_sign;
36 u32 ndp_sign;
37 unsigned nth_size;
38 unsigned ndp_size;
39 unsigned ndplen_align;
40 /* sizes in u16 units */
41 unsigned dgram_item_len; /* index or length */
42 unsigned block_length;
43 unsigned fp_index;
44 unsigned reserved1;
45 unsigned reserved2;
46 unsigned next_fp_index;
47};
48
49#define INIT_NDP16_OPTS { \
50 .nth_sign = NCM_NTH16_SIGN, \
51 .ndp_sign = NCM_NDP16_NOCRC_SIGN, \
52 .nth_size = sizeof(struct usb_cdc_ncm_nth16), \
53 .ndp_size = sizeof(struct usb_cdc_ncm_ndp16), \
54 .ndplen_align = 4, \
55 .dgram_item_len = 1, \
56 .block_length = 1, \
57 .fp_index = 1, \
58 .reserved1 = 0, \
59 .reserved2 = 0, \
60 .next_fp_index = 1, \
61 }
62
63
64#define INIT_NDP32_OPTS { \
65 .nth_sign = NCM_NTH32_SIGN, \
66 .ndp_sign = NCM_NDP32_NOCRC_SIGN, \
67 .nth_size = sizeof(struct usb_cdc_ncm_nth32), \
68 .ndp_size = sizeof(struct usb_cdc_ncm_ndp32), \
69 .ndplen_align = 8, \
70 .dgram_item_len = 2, \
71 .block_length = 2, \
72 .fp_index = 2, \
73 .reserved1 = 1, \
74 .reserved2 = 2, \
75 .next_fp_index = 2, \
76 }
77
78static inline void put_ncm(__le16 **p, unsigned size, unsigned val)
79{
80 switch (size) {
81 case 1:
82 put_unaligned_le16((u16)val, *p);
83 break;
84 case 2:
85 put_unaligned_le32((u32)val, *p);
86
87 break;
88 default:
89 BUG();
90 }
91
92 *p += size;
93}
94
95static inline unsigned get_ncm(__le16 **p, unsigned size)
96{
97 unsigned tmp;
98
99 switch (size) {
100 case 1:
101 tmp = get_unaligned_le16(*p);
102 break;
103 case 2:
104 tmp = get_unaligned_le32(*p);
105 break;
106 default:
107 BUG();
108 }
109
110 *p += size;
111 return tmp;
112}
113
114#endif /* __LINUX_USB_NCM_H */
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 545cba73ccaf..0a5b3711e502 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -164,8 +164,19 @@ otg_shutdown(struct otg_transceiver *otg)
164} 164}
165 165
166/* for usb host and peripheral controller drivers */ 166/* for usb host and peripheral controller drivers */
167#ifdef CONFIG_USB_OTG_UTILS
167extern struct otg_transceiver *otg_get_transceiver(void); 168extern struct otg_transceiver *otg_get_transceiver(void);
168extern void otg_put_transceiver(struct otg_transceiver *); 169extern void otg_put_transceiver(struct otg_transceiver *);
170#else
171static inline struct otg_transceiver *otg_get_transceiver(void)
172{
173 return NULL;
174}
175
176static inline void otg_put_transceiver(struct otg_transceiver *x)
177{
178}
179#endif
169 180
170/* Context: can sleep */ 181/* Context: can sleep */
171static inline int 182static inline int
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 55675b1efb28..16d682f4f7c3 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -271,6 +271,8 @@ struct usb_serial_driver {
271 int (*tiocmget)(struct tty_struct *tty, struct file *file); 271 int (*tiocmget)(struct tty_struct *tty, struct file *file);
272 int (*tiocmset)(struct tty_struct *tty, struct file *file, 272 int (*tiocmset)(struct tty_struct *tty, struct file *file,
273 unsigned int set, unsigned int clear); 273 unsigned int set, unsigned int clear);
274 int (*get_icount)(struct tty_struct *tty,
275 struct serial_icounter_struct *icount);
274 /* Called by the tty layer for port level work. There may or may not 276 /* Called by the tty layer for port level work. There may or may not
275 be an attached tty at this point */ 277 be an attached tty at this point */
276 void (*dtr_rts)(struct usb_serial_port *port, int on); 278 void (*dtr_rts)(struct usb_serial_port *port, int on);
diff --git a/include/linux/usb/storage.h b/include/linux/usb/storage.h
new file mode 100644
index 000000000000..d7fc910f1dc4
--- /dev/null
+++ b/include/linux/usb/storage.h
@@ -0,0 +1,48 @@
1#ifndef __LINUX_USB_STORAGE_H
2#define __LINUX_USB_STORAGE_H
3
4/*
5 * linux/usb/storage.h
6 *
7 * Copyright Matthew Wilcox for Intel Corp, 2010
8 *
9 * This file contains definitions taken from the
10 * USB Mass Storage Class Specification Overview
11 *
12 * Distributed under the terms of the GNU GPL, version two.
13 */
14
15/* Storage subclass codes */
16
17#define USB_SC_RBC 0x01 /* Typically, flash devices */
18#define USB_SC_8020 0x02 /* CD-ROM */
19#define USB_SC_QIC 0x03 /* QIC-157 Tapes */
20#define USB_SC_UFI 0x04 /* Floppy */
21#define USB_SC_8070 0x05 /* Removable media */
22#define USB_SC_SCSI 0x06 /* Transparent */
23#define USB_SC_LOCKABLE 0x07 /* Password-protected */
24
25#define USB_SC_ISD200 0xf0 /* ISD200 ATA */
26#define USB_SC_CYP_ATACB 0xf1 /* Cypress ATACB */
27#define USB_SC_DEVICE 0xff /* Use device's value */
28
29/* Storage protocol codes */
30
31#define USB_PR_CBI 0x00 /* Control/Bulk/Interrupt */
32#define USB_PR_CB 0x01 /* Control/Bulk w/o interrupt */
33#define USB_PR_BULK 0x50 /* bulk only */
34#define USB_PR_UAS 0x62 /* USB Attached SCSI */
35
36#define USB_PR_USBAT 0x80 /* SCM-ATAPI bridge */
37#define USB_PR_EUSB_SDDR09 0x81 /* SCM-SCSI bridge for SDDR-09 */
38#define USB_PR_SDDR55 0x82 /* SDDR-55 (made up) */
39#define USB_PR_DPCM_USB 0xf0 /* Combination CB/SDDR09 */
40#define USB_PR_FREECOM 0xf1 /* Freecom */
41#define USB_PR_DATAFAB 0xf2 /* Datafab chipsets */
42#define USB_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */
43#define USB_PR_ALAUDA 0xf4 /* Alauda chipsets */
44#define USB_PR_KARMA 0xf5 /* Rio Karma */
45
46#define USB_PR_DEVICE 0xff /* Use device's value */
47
48#endif
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index a4b947e470a5..71693d4a4fe1 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -58,7 +58,11 @@
58 US_FLAG(CAPACITY_OK, 0x00010000) \ 58 US_FLAG(CAPACITY_OK, 0x00010000) \
59 /* READ CAPACITY response is correct */ \ 59 /* READ CAPACITY response is correct */ \
60 US_FLAG(BAD_SENSE, 0x00020000) \ 60 US_FLAG(BAD_SENSE, 0x00020000) \
61 /* Bad Sense (never more than 18 bytes) */ 61 /* Bad Sense (never more than 18 bytes) */ \
62 US_FLAG(NO_READ_DISC_INFO, 0x00040000) \
63 /* cannot handle READ_DISC_INFO */ \
64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \
65 /* cannot handle READ_CAPACITY_16 */
62 66
63#define US_FLAG(name, value) US_FL_##name = value , 67#define US_FLAG(name, value) US_FL_##name = value ,
64enum { US_DO_ALL_FLAGS }; 68enum { US_DO_ALL_FLAGS };
@@ -74,42 +78,7 @@ enum { US_DO_ALL_FLAGS };
74#define USB_US_TYPE(flags) (((flags) >> 24) & 0xFF) 78#define USB_US_TYPE(flags) (((flags) >> 24) & 0xFF)
75#define USB_US_ORIG_FLAGS(flags) ((flags) & 0x00FFFFFF) 79#define USB_US_ORIG_FLAGS(flags) ((flags) & 0x00FFFFFF)
76 80
77/* 81#include <linux/usb/storage.h>
78 * This is probably not the best place to keep these constants, conceptually.
79 * But it's the only header included into all places which need them.
80 */
81
82/* Sub Classes */
83
84#define US_SC_RBC 0x01 /* Typically, flash devices */
85#define US_SC_8020 0x02 /* CD-ROM */
86#define US_SC_QIC 0x03 /* QIC-157 Tapes */
87#define US_SC_UFI 0x04 /* Floppy */
88#define US_SC_8070 0x05 /* Removable media */
89#define US_SC_SCSI 0x06 /* Transparent */
90#define US_SC_LOCKABLE 0x07 /* Password-protected */
91
92#define US_SC_ISD200 0xf0 /* ISD200 ATA */
93#define US_SC_CYP_ATACB 0xf1 /* Cypress ATACB */
94#define US_SC_DEVICE 0xff /* Use device's value */
95
96/* Protocols */
97
98#define US_PR_CBI 0x00 /* Control/Bulk/Interrupt */
99#define US_PR_CB 0x01 /* Control/Bulk w/o interrupt */
100#define US_PR_BULK 0x50 /* bulk only */
101
102#define US_PR_USBAT 0x80 /* SCM-ATAPI bridge */
103#define US_PR_EUSB_SDDR09 0x81 /* SCM-SCSI bridge for SDDR-09 */
104#define US_PR_SDDR55 0x82 /* SDDR-55 (made up) */
105#define US_PR_DPCM_USB 0xf0 /* Combination CB/SDDR09 */
106#define US_PR_FREECOM 0xf1 /* Freecom */
107#define US_PR_DATAFAB 0xf2 /* Datafab chipsets */
108#define US_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */
109#define US_PR_ALAUDA 0xf4 /* Alauda chipsets */
110#define US_PR_KARMA 0xf5 /* Rio Karma */
111
112#define US_PR_DEVICE 0xff /* Use device's value */
113 82
114/* 83/*
115 */ 84 */
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h
index 1faa80d92f05..e68b439b2860 100644
--- a/include/linux/virtio_9p.h
+++ b/include/linux/virtio_9p.h
@@ -5,7 +5,6 @@
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/virtio_ids.h> 6#include <linux/virtio_ids.h>
7#include <linux/virtio_config.h> 7#include <linux/virtio_config.h>
8#include <linux/types.h>
9 8
10/* The feature bitmap for virtio 9P */ 9/* The feature bitmap for virtio 9P */
11 10
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 01c2145118dc..a03dcf62ca9d 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -53,8 +53,10 @@ static inline void vmalloc_init(void)
53#endif 53#endif
54 54
55extern void *vmalloc(unsigned long size); 55extern void *vmalloc(unsigned long size);
56extern void *vzalloc(unsigned long size);
56extern void *vmalloc_user(unsigned long size); 57extern void *vmalloc_user(unsigned long size);
57extern void *vmalloc_node(unsigned long size, int node); 58extern void *vmalloc_node(unsigned long size, int node);
59extern void *vzalloc_node(unsigned long size, int node);
58extern void *vmalloc_exec(unsigned long size); 60extern void *vmalloc_exec(unsigned long size);
59extern void *vmalloc_32(unsigned long size); 61extern void *vmalloc_32(unsigned long size);
60extern void *vmalloc_32_user(unsigned long size); 62extern void *vmalloc_32_user(unsigned long size);
@@ -117,10 +119,12 @@ extern rwlock_t vmlist_lock;
117extern struct vm_struct *vmlist; 119extern struct vm_struct *vmlist;
118extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); 120extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
119 121
122#ifdef CONFIG_SMP
120struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, 123struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
121 const size_t *sizes, int nr_vms, 124 const size_t *sizes, int nr_vms,
122 size_t align, gfp_t gfp_mask); 125 size_t align, gfp_t gfp_mask);
123 126
124void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); 127void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms);
128#endif
125 129
126#endif /* _LINUX_VMALLOC_H */ 130#endif /* _LINUX_VMALLOC_H */
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index e6827eedf18b..4395b28bb86c 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -1157,6 +1157,6 @@ struct __compat_iw_event {
1157#define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param)) 1157#define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param))
1158#define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr)) 1158#define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr))
1159#define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality)) 1159#define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality))
1160#define IW_EV_POINT_PK_LEN (IW_EV_LCP_LEN + 4) 1160#define IW_EV_POINT_PK_LEN (IW_EV_LCP_PK_LEN + 4)
1161 1161
1162#endif /* _LINUX_WIRELESS_H */ 1162#endif /* _LINUX_WIRELESS_H */
diff --git a/include/linux/spi/wl12xx.h b/include/linux/wl12xx.h
index a223ecbc71ef..4f902e1908aa 100644
--- a/include/linux/spi/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2009 Nokia Corporation 4 * Copyright (C) 2009 Nokia Corporation
5 * 5 *
6 * Contact: Kalle Valo <kalle.valo@nokia.com> 6 * Contact: Luciano Coelho <luciano.coelho@nokia.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 9 * modify it under the terms of the GNU General Public License
@@ -21,14 +21,31 @@
21 * 21 *
22 */ 22 */
23 23
24#ifndef _LINUX_SPI_WL12XX_H 24#ifndef _LINUX_WL12XX_H
25#define _LINUX_SPI_WL12XX_H 25#define _LINUX_WL12XX_H
26 26
27struct wl12xx_platform_data { 27struct wl12xx_platform_data {
28 void (*set_power)(bool enable); 28 void (*set_power)(bool enable);
29 /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ 29 /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
30 int irq; 30 int irq;
31 bool use_eeprom; 31 bool use_eeprom;
32 int board_ref_clock;
32}; 33};
33 34
35#ifdef CONFIG_WL12XX_PLATFORM_DATA
36
37int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
38
39#else
40
41static inline
42int wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
43{
44 return -ENOSYS;
45}
46
47#endif
48
49const struct wl12xx_platform_data *wl12xx_get_platform_data(void);
50
34#endif 51#endif
diff --git a/include/linux/wlp.h b/include/linux/wlp.h
deleted file mode 100644
index c76fe2392506..000000000000
--- a/include/linux/wlp.h
+++ /dev/null
@@ -1,736 +0,0 @@
1/*
2 * WiMedia Logical Link Control Protocol (WLP)
3 *
4 * Copyright (C) 2005-2006 Intel Corporation
5 * Reinette Chatre <reinette.chatre@intel.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version
9 * 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02110-1301, USA.
20 *
21 *
22 * FIXME: docs
23 *
24 * - Does not (yet) include support for WLP control frames
25 * WLP Draft 0.99 [6.5].
26 *
27 * A visual representation of the data structures.
28 *
29 * wssidB wssidB
30 * ^ ^
31 * | |
32 * wssidA wssidA
33 * wlp interface { ^ ^
34 * ... | |
35 * ... ... wssid wssid ...
36 * wlp --- ... | |
37 * }; neighbors --> neighbA --> neighbB
38 * ...
39 * wss
40 * ...
41 * eda cache --> neighborA --> neighborB --> neighborC ...
42 */
43
44#ifndef __LINUX__WLP_H_
45#define __LINUX__WLP_H_
46
47#include <linux/netdevice.h>
48#include <linux/skbuff.h>
49#include <linux/list.h>
50#include <linux/uwb.h>
51
52/**
53 * WLP Protocol ID
54 * WLP Draft 0.99 [6.2]
55 *
56 * The MUX header for all WLP frames
57 */
58#define WLP_PROTOCOL_ID 0x0100
59
60/**
61 * WLP Version
62 * WLP version placed in the association frames (WLP 0.99 [6.6])
63 */
64#define WLP_VERSION 0x10
65
66/**
67 * Bytes needed to print UUID as string
68 */
69#define WLP_WSS_UUID_STRSIZE 48
70
71/**
72 * Bytes needed to print nonce as string
73 */
74#define WLP_WSS_NONCE_STRSIZE 48
75
76
77/**
78 * Size used for WLP name size
79 *
80 * The WSS name is set to 65 bytes, 1 byte larger than the maximum
81 * allowed by the WLP spec. This is to have a null terminated string
82 * for display to the user. A maximum of 64 bytes will still be used
83 * when placing the WSS name field in association frames.
84 */
85#define WLP_WSS_NAME_SIZE 65
86
87/**
88 * Number of bytes added by WLP to data frame
89 *
90 * A data frame transmitted from a host will be placed in a Standard or
91 * Abbreviated WLP frame. These have an extra 4 bytes of header (struct
92 * wlp_frame_std_abbrv_hdr).
93 * When the stack sends this data frame for transmission it needs to ensure
94 * there is enough headroom for this header.
95 */
96#define WLP_DATA_HLEN 4
97
98/**
99 * State of device regarding WLP Service Set
100 *
101 * WLP_WSS_STATE_NONE: the host does not participate in any WSS
102 * WLP_WSS_STATE_PART_ENROLLED: used as part of the enrollment sequence
103 * ("Partial Enroll"). This state is used to
104 * indicate the first part of enrollment that is
105 * unsecure. If the WSS is unsecure then the
106 * state will promptly go to WLP_WSS_STATE_ENROLLED,
107 * if the WSS is not secure then the enrollment
108 * procedure is a few more steps before we are
109 * enrolled.
110 * WLP_WSS_STATE_ENROLLED: the host is enrolled in a WSS
111 * WLP_WSS_STATE_ACTIVE: WSS is activated
112 * WLP_WSS_STATE_CONNECTED: host is connected to neighbor in WSS
113 *
114 */
115enum wlp_wss_state {
116 WLP_WSS_STATE_NONE = 0,
117 WLP_WSS_STATE_PART_ENROLLED,
118 WLP_WSS_STATE_ENROLLED,
119 WLP_WSS_STATE_ACTIVE,
120 WLP_WSS_STATE_CONNECTED,
121};
122
123/**
124 * WSS Secure status
125 * WLP 0.99 Table 6
126 *
127 * Set to one if the WSS is secure, zero if it is not secure
128 */
129enum wlp_wss_sec_status {
130 WLP_WSS_UNSECURE = 0,
131 WLP_WSS_SECURE,
132};
133
134/**
135 * WLP frame type
136 * WLP Draft 0.99 [6.2 Table 1]
137 */
138enum wlp_frame_type {
139 WLP_FRAME_STANDARD = 0,
140 WLP_FRAME_ABBREVIATED,
141 WLP_FRAME_CONTROL,
142 WLP_FRAME_ASSOCIATION,
143};
144
145/**
146 * WLP Association Message Type
147 * WLP Draft 0.99 [6.6.1.2 Table 8]
148 */
149enum wlp_assoc_type {
150 WLP_ASSOC_D1 = 2,
151 WLP_ASSOC_D2 = 3,
152 WLP_ASSOC_M1 = 4,
153 WLP_ASSOC_M2 = 5,
154 WLP_ASSOC_M3 = 7,
155 WLP_ASSOC_M4 = 8,
156 WLP_ASSOC_M5 = 9,
157 WLP_ASSOC_M6 = 10,
158 WLP_ASSOC_M7 = 11,
159 WLP_ASSOC_M8 = 12,
160 WLP_ASSOC_F0 = 14,
161 WLP_ASSOC_E1 = 32,
162 WLP_ASSOC_E2 = 33,
163 WLP_ASSOC_C1 = 34,
164 WLP_ASSOC_C2 = 35,
165 WLP_ASSOC_C3 = 36,
166 WLP_ASSOC_C4 = 37,
167};
168
169/**
170 * WLP Attribute Type
171 * WLP Draft 0.99 [6.6.1 Table 6]
172 */
173enum wlp_attr_type {
174 WLP_ATTR_AUTH = 0x1005, /* Authenticator */
175 WLP_ATTR_DEV_NAME = 0x1011, /* Device Name */
176 WLP_ATTR_DEV_PWD_ID = 0x1012, /* Device Password ID */
177 WLP_ATTR_E_HASH1 = 0x1014, /* E-Hash1 */
178 WLP_ATTR_E_HASH2 = 0x1015, /* E-Hash2 */
179 WLP_ATTR_E_SNONCE1 = 0x1016, /* E-SNonce1 */
180 WLP_ATTR_E_SNONCE2 = 0x1017, /* E-SNonce2 */
181 WLP_ATTR_ENCR_SET = 0x1018, /* Encrypted Settings */
182 WLP_ATTR_ENRL_NONCE = 0x101A, /* Enrollee Nonce */
183 WLP_ATTR_KEYWRAP_AUTH = 0x101E, /* Key Wrap Authenticator */
184 WLP_ATTR_MANUF = 0x1021, /* Manufacturer */
185 WLP_ATTR_MSG_TYPE = 0x1022, /* Message Type */
186 WLP_ATTR_MODEL_NAME = 0x1023, /* Model Name */
187 WLP_ATTR_MODEL_NR = 0x1024, /* Model Number */
188 WLP_ATTR_PUB_KEY = 0x1032, /* Public Key */
189 WLP_ATTR_REG_NONCE = 0x1039, /* Registrar Nonce */
190 WLP_ATTR_R_HASH1 = 0x103D, /* R-Hash1 */
191 WLP_ATTR_R_HASH2 = 0x103E, /* R-Hash2 */
192 WLP_ATTR_R_SNONCE1 = 0x103F, /* R-SNonce1 */
193 WLP_ATTR_R_SNONCE2 = 0x1040, /* R-SNonce2 */
194 WLP_ATTR_SERIAL = 0x1042, /* Serial number */
195 WLP_ATTR_UUID_E = 0x1047, /* UUID-E */
196 WLP_ATTR_UUID_R = 0x1048, /* UUID-R */
197 WLP_ATTR_PRI_DEV_TYPE = 0x1054, /* Primary Device Type */
198 WLP_ATTR_SEC_DEV_TYPE = 0x1055, /* Secondary Device Type */
199 WLP_ATTR_PORT_DEV = 0x1056, /* Portable Device */
200 WLP_ATTR_APP_EXT = 0x1058, /* Application Extension */
201 WLP_ATTR_WLP_VER = 0x2000, /* WLP Version */
202 WLP_ATTR_WSSID = 0x2001, /* WSSID */
203 WLP_ATTR_WSS_NAME = 0x2002, /* WSS Name */
204 WLP_ATTR_WSS_SEC_STAT = 0x2003, /* WSS Secure Status */
205 WLP_ATTR_WSS_BCAST = 0x2004, /* WSS Broadcast Address */
206 WLP_ATTR_WSS_M_KEY = 0x2005, /* WSS Master Key */
207 WLP_ATTR_ACC_ENRL = 0x2006, /* Accepting Enrollment */
208 WLP_ATTR_WSS_INFO = 0x2007, /* WSS Information */
209 WLP_ATTR_WSS_SEL_MTHD = 0x2008, /* WSS Selection Method */
210 WLP_ATTR_ASSC_MTHD_LIST = 0x2009, /* Association Methods List */
211 WLP_ATTR_SEL_ASSC_MTHD = 0x200A, /* Selected Association Method */
212 WLP_ATTR_ENRL_HASH_COMM = 0x200B, /* Enrollee Hash Commitment */
213 WLP_ATTR_WSS_TAG = 0x200C, /* WSS Tag */
214 WLP_ATTR_WSS_VIRT = 0x200D, /* WSS Virtual EUI-48 */
215 WLP_ATTR_WLP_ASSC_ERR = 0x200E, /* WLP Association Error */
216 WLP_ATTR_VNDR_EXT = 0x200F, /* Vendor Extension */
217};
218
219/**
220 * WLP Category ID of primary/secondary device
221 * WLP Draft 0.99 [6.6.1.8 Table 12]
222 */
223enum wlp_dev_category_id {
224 WLP_DEV_CAT_COMPUTER = 1,
225 WLP_DEV_CAT_INPUT,
226 WLP_DEV_CAT_PRINT_SCAN_FAX_COPIER,
227 WLP_DEV_CAT_CAMERA,
228 WLP_DEV_CAT_STORAGE,
229 WLP_DEV_CAT_INFRASTRUCTURE,
230 WLP_DEV_CAT_DISPLAY,
231 WLP_DEV_CAT_MULTIM,
232 WLP_DEV_CAT_GAMING,
233 WLP_DEV_CAT_TELEPHONE,
234 WLP_DEV_CAT_OTHER = 65535,
235};
236
237/**
238 * WLP WSS selection method
239 * WLP Draft 0.99 [6.6.1.6 Table 10]
240 */
241enum wlp_wss_sel_mthd {
242 WLP_WSS_ENRL_SELECT = 1, /* Enrollee selects */
243 WLP_WSS_REG_SELECT, /* Registrar selects */
244};
245
246/**
247 * WLP association error values
248 * WLP Draft 0.99 [6.6.1.5 Table 9]
249 */
250enum wlp_assc_error {
251 WLP_ASSOC_ERROR_NONE,
252 WLP_ASSOC_ERROR_AUTH, /* Authenticator Failure */
253 WLP_ASSOC_ERROR_ROGUE, /* Rogue activity suspected */
254 WLP_ASSOC_ERROR_BUSY, /* Device busy */
255 WLP_ASSOC_ERROR_LOCK, /* Setup Locked */
256 WLP_ASSOC_ERROR_NOT_READY, /* Registrar not ready */
257 WLP_ASSOC_ERROR_INV, /* Invalid WSS selection */
258 WLP_ASSOC_ERROR_MSG_TIME, /* Message timeout */
259 WLP_ASSOC_ERROR_ENR_TIME, /* Enrollment session timeout */
260 WLP_ASSOC_ERROR_PW, /* Device password invalid */
261 WLP_ASSOC_ERROR_VER, /* Unsupported version */
262 WLP_ASSOC_ERROR_INT, /* Internal error */
263 WLP_ASSOC_ERROR_UNDEF, /* Undefined error */
264 WLP_ASSOC_ERROR_NUM, /* Numeric comparison failure */
265 WLP_ASSOC_ERROR_WAIT, /* Waiting for user input */
266};
267
268/**
269 * WLP Parameters
270 * WLP 0.99 [7.7]
271 */
272enum wlp_parameters {
273 WLP_PER_MSG_TIMEOUT = 15, /* Seconds to wait for response to
274 association message. */
275};
276
277/**
278 * WLP IE
279 *
280 * The WLP IE should be included in beacons by all devices.
281 *
282 * The driver can set only a few of the fields in this information element,
283 * most fields are managed by the device self. When the driver needs to set
284 * a field it will only provide values for the fields of interest, the rest
285 * will be filled with zeroes. The fields of interest are:
286 *
287 * Element ID
288 * Length
289 * Capabilities (only to include WSSID Hash list length)
290 * WSSID Hash List fields
291 *
292 * WLP 0.99 [6.7]
293 *
294 * Only the fields that will be used are detailed in this structure, rest
295 * are not detailed or marked as "notused".
296 */
297struct wlp_ie {
298 struct uwb_ie_hdr hdr;
299 __le16 capabilities;
300 __le16 cycle_param;
301 __le16 acw_anchor_addr;
302 u8 wssid_hash_list[];
303} __packed;
304
305static inline int wlp_ie_hash_length(struct wlp_ie *ie)
306{
307 return (le16_to_cpu(ie->capabilities) >> 12) & 0xf;
308}
309
310static inline void wlp_ie_set_hash_length(struct wlp_ie *ie, int hash_length)
311{
312 u16 caps = le16_to_cpu(ie->capabilities);
313 caps = (caps & ~(0xf << 12)) | (hash_length << 12);
314 ie->capabilities = cpu_to_le16(caps);
315}
316
317/**
318 * WLP nonce
319 * WLP Draft 0.99 [6.6.1 Table 6]
320 *
321 * A 128-bit random number often used (E-SNonce1, E-SNonce2, Enrollee
322 * Nonce, Registrar Nonce, R-SNonce1, R-SNonce2). It is passed to HW so
323 * it is packed.
324 */
325struct wlp_nonce {
326 u8 data[16];
327} __packed;
328
329/**
330 * WLP UUID
331 * WLP Draft 0.99 [6.6.1 Table 6]
332 *
333 * Universally Unique Identifier (UUID) encoded as an octet string in the
334 * order the octets are shown in string representation in RFC4122. A UUID
335 * is often used (UUID-E, UUID-R, WSSID). It is passed to HW so it is packed.
336 */
337struct wlp_uuid {
338 u8 data[16];
339} __packed;
340
341
342/**
343 * Primary and secondary device type attributes
344 * WLP Draft 0.99 [6.6.1.8]
345 */
346struct wlp_dev_type {
347 enum wlp_dev_category_id category:16;
348 u8 OUI[3];
349 u8 OUIsubdiv;
350 __le16 subID;
351} __packed;
352
353/**
354 * WLP frame header
355 * WLP Draft 0.99 [6.2]
356 */
357struct wlp_frame_hdr {
358 __le16 mux_hdr; /* WLP_PROTOCOL_ID */
359 enum wlp_frame_type type:8;
360} __packed;
361
362/**
363 * WLP attribute field header
364 * WLP Draft 0.99 [6.6.1]
365 *
366 * Header of each attribute found in an association frame
367 */
368struct wlp_attr_hdr {
369 __le16 type;
370 __le16 length;
371} __packed;
372
373/**
374 * Device information commonly used together
375 *
376 * Each of these device information elements has a specified range in which it
377 * should fit (WLP 0.99 [Table 6]). This range provided in the spec does not
378 * include the termination null '\0' character (when used in the
379 * association protocol the attribute fields are accompanied
380 * with a "length" field so the full range from the spec can be used for
381 * the value). We thus allocate an extra byte to be able to store a string
382 * of max length with a terminating '\0'.
383 */
384struct wlp_device_info {
385 char name[33];
386 char model_name[33];
387 char manufacturer[65];
388 char model_nr[33];
389 char serial[33];
390 struct wlp_dev_type prim_dev_type;
391};
392
393/**
394 * Macros for the WLP attributes
395 *
396 * There are quite a few attributes (total is 43). The attribute layout can be
397 * in one of three categories: one value, an array, an enum forced to 8 bits.
398 * These macros help with their definitions.
399 */
400#define wlp_attr(type, name) \
401struct wlp_attr_##name { \
402 struct wlp_attr_hdr hdr; \
403 type name; \
404} __packed;
405
406#define wlp_attr_array(type, name) \
407struct wlp_attr_##name { \
408 struct wlp_attr_hdr hdr; \
409 type name[]; \
410} __packed;
411
412/**
413 * WLP association attribute fields
414 * WLP Draft 0.99 [6.6.1 Table 6]
415 *
416 * Attributes appear in same order as the Table in the spec
417 * FIXME Does not define all attributes yet
418 */
419
420/* Device name: Friendly name of sending device */
421wlp_attr_array(u8, dev_name)
422
423/* Enrollee Nonce: Random number generated by enrollee for an enrollment
424 * session */
425wlp_attr(struct wlp_nonce, enonce)
426
427/* Manufacturer name: Name of manufacturer of the sending device */
428wlp_attr_array(u8, manufacturer)
429
430/* WLP Message Type */
431wlp_attr(u8, msg_type)
432
433/* WLP Model name: Model name of sending device */
434wlp_attr_array(u8, model_name)
435
436/* WLP Model number: Model number of sending device */
437wlp_attr_array(u8, model_nr)
438
439/* Registrar Nonce: Random number generated by registrar for an enrollment
440 * session */
441wlp_attr(struct wlp_nonce, rnonce)
442
443/* Serial number of device */
444wlp_attr_array(u8, serial)
445
446/* UUID of enrollee */
447wlp_attr(struct wlp_uuid, uuid_e)
448
449/* UUID of registrar */
450wlp_attr(struct wlp_uuid, uuid_r)
451
452/* WLP Primary device type */
453wlp_attr(struct wlp_dev_type, prim_dev_type)
454
455/* WLP Secondary device type */
456wlp_attr(struct wlp_dev_type, sec_dev_type)
457
458/* WLP protocol version */
459wlp_attr(u8, version)
460
461/* WLP service set identifier */
462wlp_attr(struct wlp_uuid, wssid)
463
464/* WLP WSS name */
465wlp_attr_array(u8, wss_name)
466
467/* WLP WSS Secure Status */
468wlp_attr(u8, wss_sec_status)
469
470/* WSS Broadcast Address */
471wlp_attr(struct uwb_mac_addr, wss_bcast)
472
473/* WLP Accepting Enrollment */
474wlp_attr(u8, accept_enrl)
475
476/**
477 * WSS information attributes
478 * WLP Draft 0.99 [6.6.3 Table 15]
479 */
480struct wlp_wss_info {
481 struct wlp_attr_wssid wssid;
482 struct wlp_attr_wss_name name;
483 struct wlp_attr_accept_enrl accept;
484 struct wlp_attr_wss_sec_status sec_stat;
485 struct wlp_attr_wss_bcast bcast;
486} __packed;
487
488/* WLP WSS Information */
489wlp_attr_array(struct wlp_wss_info, wss_info)
490
491/* WLP WSS Selection method */
492wlp_attr(u8, wss_sel_mthd)
493
494/* WLP WSS tag */
495wlp_attr(u8, wss_tag)
496
497/* WSS Virtual Address */
498wlp_attr(struct uwb_mac_addr, wss_virt)
499
500/* WLP association error */
501wlp_attr(u8, wlp_assc_err)
502
503/**
504 * WLP standard and abbreviated frames
505 *
506 * WLP Draft 0.99 [6.3] and [6.4]
507 *
508 * The difference between the WLP standard frame and the WLP
509 * abbreviated frame is that the standard frame includes the src
510 * and dest addresses from the Ethernet header, the abbreviated frame does
511 * not.
512 * The src/dest (as well as the type/length and client data) are already
513 * defined as part of the Ethernet header, we do not do this here.
514 * From this perspective the standard and abbreviated frames appear the
515 * same - they will be treated differently though.
516 *
517 * The size of this header is also captured in WLP_DATA_HLEN to enable
518 * interfaces to prepare their headroom.
519 */
520struct wlp_frame_std_abbrv_hdr {
521 struct wlp_frame_hdr hdr;
522 u8 tag;
523} __packed;
524
525/**
526 * WLP association frames
527 *
528 * WLP Draft 0.99 [6.6]
529 */
530struct wlp_frame_assoc {
531 struct wlp_frame_hdr hdr;
532 enum wlp_assoc_type type:8;
533 struct wlp_attr_version version;
534 struct wlp_attr_msg_type msg_type;
535 u8 attr[];
536} __packed;
537
538/* Ethernet to dev address mapping */
539struct wlp_eda {
540 spinlock_t lock;
541 struct list_head cache; /* Eth<->Dev Addr cache */
542};
543
544/**
545 * WSS information temporary storage
546 *
547 * This information is only stored temporarily during discovery. It should
548 * not be stored unless the device is enrolled in the advertised WSS. This
549 * is done mainly because we follow the letter of the spec in this regard.
550 * See WLP 0.99 [7.2.3].
551 * When the device does become enrolled in a WSS the WSS information will
552 * be stored as part of the more comprehensive struct wlp_wss.
553 */
554struct wlp_wss_tmp_info {
555 char name[WLP_WSS_NAME_SIZE];
556 u8 accept_enroll;
557 u8 sec_status;
558 struct uwb_mac_addr bcast;
559};
560
561struct wlp_wssid_e {
562 struct list_head node;
563 struct wlp_uuid wssid;
564 struct wlp_wss_tmp_info *info;
565};
566
567/**
568 * A cache entry of WLP neighborhood
569 *
570 * @node: head of list is wlp->neighbors
571 * @wssid: list of wssids of this neighbor, element is wlp_wssid_e
572 * @info: temporary storage for information learned during discovery. This
573 * storage is used together with the wssid_e temporary storage
574 * during discovery.
575 */
576struct wlp_neighbor_e {
577 struct list_head node;
578 struct wlp_uuid uuid;
579 struct uwb_dev *uwb_dev;
580 struct list_head wssid; /* Elements are wlp_wssid_e */
581 struct wlp_device_info *info;
582};
583
584struct wlp;
585/**
586 * Information for an association session in progress.
587 *
588 * @exp_message: The type of the expected message. Both this message and a
589 * F0 message (which can be sent in response to any
590 * association frame) will be accepted as a valid message for
591 * this session.
592 * @cb: The function that will be called upon receipt of this
593 * message.
594 * @cb_priv: Private data of callback
595 * @data: Data used in association process (always a sk_buff?)
596 * @neighbor: Address of neighbor with which association session is in
597 * progress.
598 */
599struct wlp_session {
600 enum wlp_assoc_type exp_message;
601 void (*cb)(struct wlp *);
602 void *cb_priv;
603 void *data;
604 struct uwb_dev_addr neighbor_addr;
605};
606
607/**
608 * WLP Service Set
609 *
610 * @mutex: used to protect entire WSS structure.
611 *
612 * @name: The WSS name is set to 65 bytes, 1 byte larger than the maximum
613 * allowed by the WLP spec. This is to have a null terminated string
614 * for display to the user. A maximum of 64 bytes will still be used
615 * when placing the WSS name field in association frames.
616 *
617 * @accept_enroll: Accepting enrollment: Set to one if registrar is
618 * accepting enrollment in WSS, or zero otherwise.
619 *
620 * Global and local information for each WSS in which we are enrolled.
621 * WLP 0.99 Section 7.2.1 and Section 7.2.2
622 */
623struct wlp_wss {
624 struct mutex mutex;
625 struct kobject kobj;
626 /* Global properties. */
627 struct wlp_uuid wssid;
628 u8 hash;
629 char name[WLP_WSS_NAME_SIZE];
630 struct uwb_mac_addr bcast;
631 u8 secure_status:1;
632 u8 master_key[16];
633 /* Local properties. */
634 u8 tag;
635 struct uwb_mac_addr virtual_addr;
636 /* Extra */
637 u8 accept_enroll:1;
638 enum wlp_wss_state state;
639};
640
641/**
642 * WLP main structure
643 * @mutex: protect changes to WLP structure. We only allow changes to the
644 * uuid, so currently this mutex only protects this field.
645 */
646struct wlp {
647 struct mutex mutex;
648 struct uwb_rc *rc; /* UWB radio controller */
649 struct net_device *ndev;
650 struct uwb_pal pal;
651 struct wlp_eda eda;
652 struct wlp_uuid uuid;
653 struct wlp_session *session;
654 struct wlp_wss wss;
655 struct mutex nbmutex; /* Neighbor mutex protects neighbors list */
656 struct list_head neighbors; /* Elements are wlp_neighbor_e */
657 struct uwb_notifs_handler uwb_notifs_handler;
658 struct wlp_device_info *dev_info;
659 void (*fill_device_info)(struct wlp *wlp, struct wlp_device_info *info);
660 int (*xmit_frame)(struct wlp *, struct sk_buff *,
661 struct uwb_dev_addr *);
662 void (*stop_queue)(struct wlp *);
663 void (*start_queue)(struct wlp *);
664};
665
666/* sysfs */
667
668
669struct wlp_wss_attribute {
670 struct attribute attr;
671 ssize_t (*show)(struct wlp_wss *wss, char *buf);
672 ssize_t (*store)(struct wlp_wss *wss, const char *buf, size_t count);
673};
674
675#define WSS_ATTR(_name, _mode, _show, _store) \
676static struct wlp_wss_attribute wss_attr_##_name = __ATTR(_name, _mode, \
677 _show, _store)
678
679extern int wlp_setup(struct wlp *, struct uwb_rc *, struct net_device *ndev);
680extern void wlp_remove(struct wlp *);
681extern ssize_t wlp_neighborhood_show(struct wlp *, char *);
682extern int wlp_wss_setup(struct net_device *, struct wlp_wss *);
683extern void wlp_wss_remove(struct wlp_wss *);
684extern ssize_t wlp_wss_activate_show(struct wlp_wss *, char *);
685extern ssize_t wlp_wss_activate_store(struct wlp_wss *, const char *, size_t);
686extern ssize_t wlp_eda_show(struct wlp *, char *);
687extern ssize_t wlp_eda_store(struct wlp *, const char *, size_t);
688extern ssize_t wlp_uuid_show(struct wlp *, char *);
689extern ssize_t wlp_uuid_store(struct wlp *, const char *, size_t);
690extern ssize_t wlp_dev_name_show(struct wlp *, char *);
691extern ssize_t wlp_dev_name_store(struct wlp *, const char *, size_t);
692extern ssize_t wlp_dev_manufacturer_show(struct wlp *, char *);
693extern ssize_t wlp_dev_manufacturer_store(struct wlp *, const char *, size_t);
694extern ssize_t wlp_dev_model_name_show(struct wlp *, char *);
695extern ssize_t wlp_dev_model_name_store(struct wlp *, const char *, size_t);
696extern ssize_t wlp_dev_model_nr_show(struct wlp *, char *);
697extern ssize_t wlp_dev_model_nr_store(struct wlp *, const char *, size_t);
698extern ssize_t wlp_dev_serial_show(struct wlp *, char *);
699extern ssize_t wlp_dev_serial_store(struct wlp *, const char *, size_t);
700extern ssize_t wlp_dev_prim_category_show(struct wlp *, char *);
701extern ssize_t wlp_dev_prim_category_store(struct wlp *, const char *,
702 size_t);
703extern ssize_t wlp_dev_prim_OUI_show(struct wlp *, char *);
704extern ssize_t wlp_dev_prim_OUI_store(struct wlp *, const char *, size_t);
705extern ssize_t wlp_dev_prim_OUI_sub_show(struct wlp *, char *);
706extern ssize_t wlp_dev_prim_OUI_sub_store(struct wlp *, const char *,
707 size_t);
708extern ssize_t wlp_dev_prim_subcat_show(struct wlp *, char *);
709extern ssize_t wlp_dev_prim_subcat_store(struct wlp *, const char *,
710 size_t);
711extern int wlp_receive_frame(struct device *, struct wlp *, struct sk_buff *,
712 struct uwb_dev_addr *);
713extern int wlp_prepare_tx_frame(struct device *, struct wlp *,
714 struct sk_buff *, struct uwb_dev_addr *);
715void wlp_reset_all(struct wlp *wlp);
716
717/**
718 * Initialize WSS
719 */
720static inline
721void wlp_wss_init(struct wlp_wss *wss)
722{
723 mutex_init(&wss->mutex);
724}
725
726static inline
727void wlp_init(struct wlp *wlp)
728{
729 INIT_LIST_HEAD(&wlp->neighbors);
730 mutex_init(&wlp->mutex);
731 mutex_init(&wlp->nbmutex);
732 wlp_wss_init(&wlp->wss);
733}
734
735
736#endif /* #ifndef __LINUX__WLP_H_ */
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 25e02c941bac..0c0771f06bfa 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -190,7 +190,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
190 __INIT_WORK((_work), (_func), 0); \ 190 __INIT_WORK((_work), (_func), 0); \
191 } while (0) 191 } while (0)
192 192
193#define INIT_WORK_ON_STACK(_work, _func) \ 193#define INIT_WORK_ONSTACK(_work, _func) \
194 do { \ 194 do { \
195 __INIT_WORK((_work), (_func), 1); \ 195 __INIT_WORK((_work), (_func), 1); \
196 } while (0) 196 } while (0)
@@ -201,9 +201,9 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
201 init_timer(&(_work)->timer); \ 201 init_timer(&(_work)->timer); \
202 } while (0) 202 } while (0)
203 203
204#define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ 204#define INIT_DELAYED_WORK_ONSTACK(_work, _func) \
205 do { \ 205 do { \
206 INIT_WORK_ON_STACK(&(_work)->work, (_func)); \ 206 INIT_WORK_ONSTACK(&(_work)->work, (_func)); \
207 init_timer_on_stack(&(_work)->timer); \ 207 init_timer_on_stack(&(_work)->timer); \
208 } while (0) 208 } while (0)
209 209
@@ -243,11 +243,12 @@ enum {
243 WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ 243 WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */
244 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ 244 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */
245 WQ_FREEZEABLE = 1 << 2, /* freeze during suspend */ 245 WQ_FREEZEABLE = 1 << 2, /* freeze during suspend */
246 WQ_RESCUER = 1 << 3, /* has an rescue worker */ 246 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */
247 WQ_HIGHPRI = 1 << 4, /* high priority */ 247 WQ_HIGHPRI = 1 << 4, /* high priority */
248 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ 248 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */
249 249
250 WQ_DYING = 1 << 6, /* internal: workqueue is dying */ 250 WQ_DYING = 1 << 6, /* internal: workqueue is dying */
251 WQ_RESCUER = 1 << 7, /* internal: workqueue has rescuer */
251 252
252 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ 253 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */
253 WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */ 254 WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */
@@ -306,12 +307,30 @@ __alloc_workqueue_key(const char *name, unsigned int flags, int max_active,
306 __alloc_workqueue_key((name), (flags), (max_active), NULL, NULL) 307 __alloc_workqueue_key((name), (flags), (max_active), NULL, NULL)
307#endif 308#endif
308 309
310/**
311 * alloc_ordered_workqueue - allocate an ordered workqueue
312 * @name: name of the workqueue
313 * @flags: WQ_* flags (only WQ_FREEZEABLE and WQ_MEM_RECLAIM are meaningful)
314 *
315 * Allocate an ordered workqueue. An ordered workqueue executes at
316 * most one work item at any given time in the queued order. They are
317 * implemented as unbound workqueues with @max_active of one.
318 *
319 * RETURNS:
320 * Pointer to the allocated workqueue on success, %NULL on failure.
321 */
322static inline struct workqueue_struct *
323alloc_ordered_workqueue(const char *name, unsigned int flags)
324{
325 return alloc_workqueue(name, WQ_UNBOUND | flags, 1);
326}
327
309#define create_workqueue(name) \ 328#define create_workqueue(name) \
310 alloc_workqueue((name), WQ_RESCUER, 1) 329 alloc_workqueue((name), WQ_MEM_RECLAIM, 1)
311#define create_freezeable_workqueue(name) \ 330#define create_freezeable_workqueue(name) \
312 alloc_workqueue((name), WQ_FREEZEABLE | WQ_UNBOUND | WQ_RESCUER, 1) 331 alloc_workqueue((name), WQ_FREEZEABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1)
313#define create_singlethread_workqueue(name) \ 332#define create_singlethread_workqueue(name) \
314 alloc_workqueue((name), WQ_UNBOUND | WQ_RESCUER, 1) 333 alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1)
315 334
316extern void destroy_workqueue(struct workqueue_struct *wq); 335extern void destroy_workqueue(struct workqueue_struct *wq);
317 336
@@ -325,7 +344,6 @@ extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
325 344
326extern void flush_workqueue(struct workqueue_struct *wq); 345extern void flush_workqueue(struct workqueue_struct *wq);
327extern void flush_scheduled_work(void); 346extern void flush_scheduled_work(void);
328extern void flush_delayed_work(struct delayed_work *work);
329 347
330extern int schedule_work(struct work_struct *work); 348extern int schedule_work(struct work_struct *work);
331extern int schedule_work_on(int cpu, struct work_struct *work); 349extern int schedule_work_on(int cpu, struct work_struct *work);
@@ -337,8 +355,13 @@ extern int keventd_up(void);
337 355
338int execute_in_process_context(work_func_t fn, struct execute_work *); 356int execute_in_process_context(work_func_t fn, struct execute_work *);
339 357
340extern int flush_work(struct work_struct *work); 358extern bool flush_work(struct work_struct *work);
341extern int cancel_work_sync(struct work_struct *work); 359extern bool flush_work_sync(struct work_struct *work);
360extern bool cancel_work_sync(struct work_struct *work);
361
362extern bool flush_delayed_work(struct delayed_work *dwork);
363extern bool flush_delayed_work_sync(struct delayed_work *work);
364extern bool cancel_delayed_work_sync(struct delayed_work *dwork);
342 365
343extern void workqueue_set_max_active(struct workqueue_struct *wq, 366extern void workqueue_set_max_active(struct workqueue_struct *wq,
344 int max_active); 367 int max_active);
@@ -352,9 +375,9 @@ extern unsigned int work_busy(struct work_struct *work);
352 * it returns 1 and the work doesn't re-arm itself. Run flush_workqueue() or 375 * it returns 1 and the work doesn't re-arm itself. Run flush_workqueue() or
353 * cancel_work_sync() to wait on it. 376 * cancel_work_sync() to wait on it.
354 */ 377 */
355static inline int cancel_delayed_work(struct delayed_work *work) 378static inline bool cancel_delayed_work(struct delayed_work *work)
356{ 379{
357 int ret; 380 bool ret;
358 381
359 ret = del_timer_sync(&work->timer); 382 ret = del_timer_sync(&work->timer);
360 if (ret) 383 if (ret)
@@ -367,9 +390,9 @@ static inline int cancel_delayed_work(struct delayed_work *work)
367 * if it returns 0 the timer function may be running and the queueing is in 390 * if it returns 0 the timer function may be running and the queueing is in
368 * progress. 391 * progress.
369 */ 392 */
370static inline int __cancel_delayed_work(struct delayed_work *work) 393static inline bool __cancel_delayed_work(struct delayed_work *work)
371{ 394{
372 int ret; 395 bool ret;
373 396
374 ret = del_timer(&work->timer); 397 ret = del_timer(&work->timer);
375 if (ret) 398 if (ret)
@@ -377,8 +400,6 @@ static inline int __cancel_delayed_work(struct delayed_work *work)
377 return ret; 400 return ret;
378} 401}
379 402
380extern int cancel_delayed_work_sync(struct delayed_work *work);
381
382/* Obsolete. use cancel_delayed_work_sync() */ 403/* Obsolete. use cancel_delayed_work_sync() */
383static inline 404static inline
384void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, 405void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq,
@@ -409,8 +430,4 @@ extern bool freeze_workqueues_busy(void);
409extern void thaw_workqueues(void); 430extern void thaw_workqueues(void);
410#endif /* CONFIG_FREEZER */ 431#endif /* CONFIG_FREEZER */
411 432
412#ifdef CONFIG_LOCKDEP
413int in_workqueue_context(struct workqueue_struct *wq);
414#endif
415
416#endif 433#endif
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 72a5d647a5f2..d5c7aaadda59 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -10,8 +10,6 @@
10struct backing_dev_info; 10struct backing_dev_info;
11 11
12extern spinlock_t inode_lock; 12extern spinlock_t inode_lock;
13extern struct list_head inode_in_use;
14extern struct list_head inode_unused;
15 13
16/* 14/*
17 * fs/fs-writeback.c 15 * fs/fs-writeback.c
@@ -149,6 +147,8 @@ int write_cache_pages(struct address_space *mapping,
149int do_writepages(struct address_space *mapping, struct writeback_control *wbc); 147int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
150void set_page_dirty_balance(struct page *page, int page_mkwrite); 148void set_page_dirty_balance(struct page *page, int page_mkwrite);
151void writeback_set_ratelimit(void); 149void writeback_set_ratelimit(void);
150void tag_pages_for_writeback(struct address_space *mapping,
151 pgoff_t start, pgoff_t end);
152 152
153/* pdflush.c */ 153/* pdflush.c */
154extern int nr_pdflush_threads; /* Global so it can be exported to sysctl 154extern int nr_pdflush_threads; /* Global so it can be exported to sysctl