aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/audit.h22
-rw-r--r--include/linux/console.h4
-rw-r--r--include/linux/debugfs.h5
-rw-r--r--include/linux/device.h2
-rw-r--r--include/linux/dma-mapping.h1
-rw-r--r--include/linux/dmaengine.h359
-rw-r--r--include/linux/elevator.h2
-rw-r--r--include/linux/firmware.h1
-rw-r--r--include/linux/fs.h7
-rw-r--r--include/linux/fs_uart_pd.h60
-rw-r--r--include/linux/fsl_devices.h11
-rw-r--r--include/linux/i2o.h5
-rw-r--r--include/linux/igmp.h2
-rw-r--r--include/linux/input.h106
-rw-r--r--include/linux/jffs2.h56
-rw-r--r--include/linux/jffs2_fs_i.h50
-rw-r--r--include/linux/jffs2_fs_sb.h122
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/kobject.h3
-rw-r--r--include/linux/list.h2
-rw-r--r--include/linux/m48t86.h4
-rw-r--r--include/linux/mempolicy.h1
-rw-r--r--include/linux/mmc/card.h1
-rw-r--r--include/linux/mmc/mmc.h1
-rw-r--r--include/linux/mmzone.h2
-rw-r--r--include/linux/mod_devicetable.h48
-rw-r--r--include/linux/module.h9
-rw-r--r--include/linux/mtd/inftl.h2
-rw-r--r--include/linux/mtd/mtd.h97
-rw-r--r--include/linux/mtd/nand.h354
-rw-r--r--include/linux/mtd/ndfc.h67
-rw-r--r--include/linux/mtd/nftl.h2
-rw-r--r--include/linux/mtd/onenand.h11
-rw-r--r--include/linux/mtd/onenand_regs.h8
-rw-r--r--include/linux/mtd/partitions.h2
-rw-r--r--include/linux/mtd/physmap.h29
-rw-r--r--include/linux/netdevice.h50
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h4
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h4
-rw-r--r--include/linux/netfilter/x_tables.h12
-rw-r--r--include/linux/netfilter/xt_CONNSECMARK.h13
-rw-r--r--include/linux/netfilter/xt_SECMARK.h26
-rw-r--r--include/linux/netfilter/xt_quota.h16
-rw-r--r--include/linux/netfilter/xt_statistic.h32
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h6
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_h323.h7
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h3
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_sip.h44
-rw-r--r--include/linux/netlink.h1
-rw-r--r--include/linux/pagemap.h2
-rw-r--r--include/linux/pci-acpi.h2
-rw-r--r--include/linux/pci.h2
-rw-r--r--include/linux/pci_ids.h13
-rw-r--r--include/linux/pfkeyv2.h2
-rw-r--r--include/linux/pipe_fs_i.h47
-rw-r--r--include/linux/rcupdate.h1
-rw-r--r--include/linux/security.h56
-rw-r--r--include/linux/selinux.h209
-rw-r--r--include/linux/serial_core.h1
-rw-r--r--include/linux/signal.h4
-rw-r--r--include/linux/skbuff.h74
-rw-r--r--include/linux/slab.h1
-rw-r--r--include/linux/spi/ads7846.h7
-rw-r--r--include/linux/spi/spi.h45
-rw-r--r--include/linux/spi/spi_bitbang.h8
-rw-r--r--include/linux/swap.h2
-rw-r--r--include/linux/syscalls.h9
-rw-r--r--include/linux/sysctl.h4
-rw-r--r--include/linux/tcp.h8
-rw-r--r--include/linux/videodev2.h5
-rw-r--r--include/linux/vt_kern.h5
-rw-r--r--include/linux/xfrm.h4
73 files changed, 1648 insertions, 542 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 1c47c59058c1..b74c148f14e3 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -83,6 +83,7 @@
83#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */ 83#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */
84#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */ 84#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */
85#define AUDIT_CWD 1307 /* Current working directory */ 85#define AUDIT_CWD 1307 /* Current working directory */
86#define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */
86 87
87#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 88#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
88#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ 89#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
@@ -145,6 +146,11 @@
145#define AUDIT_PERS 10 146#define AUDIT_PERS 10
146#define AUDIT_ARCH 11 147#define AUDIT_ARCH 11
147#define AUDIT_MSGTYPE 12 148#define AUDIT_MSGTYPE 12
149#define AUDIT_SE_USER 13 /* security label user */
150#define AUDIT_SE_ROLE 14 /* security label role */
151#define AUDIT_SE_TYPE 15 /* security label type */
152#define AUDIT_SE_SEN 16 /* security label sensitivity label */
153#define AUDIT_SE_CLR 17 /* security label clearance label */
148 154
149 /* These are ONLY useful when checking 155 /* These are ONLY useful when checking
150 * at syscall exit time (AUDIT_AT_EXIT). */ 156 * at syscall exit time (AUDIT_AT_EXIT). */
@@ -287,10 +293,10 @@ struct netlink_skb_parms;
287 /* Public API */ 293 /* Public API */
288extern int audit_alloc(struct task_struct *task); 294extern int audit_alloc(struct task_struct *task);
289extern void audit_free(struct task_struct *task); 295extern void audit_free(struct task_struct *task);
290extern void audit_syscall_entry(struct task_struct *task, int arch, 296extern void audit_syscall_entry(int arch,
291 int major, unsigned long a0, unsigned long a1, 297 int major, unsigned long a0, unsigned long a1,
292 unsigned long a2, unsigned long a3); 298 unsigned long a2, unsigned long a3);
293extern void audit_syscall_exit(struct task_struct *task, int failed, long return_code); 299extern void audit_syscall_exit(int failed, long return_code);
294extern void audit_getname(const char *name); 300extern void audit_getname(const char *name);
295extern void audit_putname(const char *name); 301extern void audit_putname(const char *name);
296extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags); 302extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags);
@@ -314,7 +320,8 @@ extern void auditsc_get_stamp(struct audit_context *ctx,
314 struct timespec *t, unsigned int *serial); 320 struct timespec *t, unsigned int *serial);
315extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); 321extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid);
316extern uid_t audit_get_loginuid(struct audit_context *ctx); 322extern uid_t audit_get_loginuid(struct audit_context *ctx);
317extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp); 323extern int audit_ipc_obj(struct kern_ipc_perm *ipcp);
324extern int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp);
318extern int audit_socketcall(int nargs, unsigned long *args); 325extern int audit_socketcall(int nargs, unsigned long *args);
319extern int audit_sockaddr(int len, void *addr); 326extern int audit_sockaddr(int len, void *addr);
320extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); 327extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt);
@@ -323,8 +330,8 @@ extern int audit_set_macxattr(const char *name);
323#else 330#else
324#define audit_alloc(t) ({ 0; }) 331#define audit_alloc(t) ({ 0; })
325#define audit_free(t) do { ; } while (0) 332#define audit_free(t) do { ; } while (0)
326#define audit_syscall_entry(t,ta,a,b,c,d,e) do { ; } while (0) 333#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0)
327#define audit_syscall_exit(t,f,r) do { ; } while (0) 334#define audit_syscall_exit(f,r) do { ; } while (0)
328#define audit_getname(n) do { ; } while (0) 335#define audit_getname(n) do { ; } while (0)
329#define audit_putname(n) do { ; } while (0) 336#define audit_putname(n) do { ; } while (0)
330#define __audit_inode(n,i,f) do { ; } while (0) 337#define __audit_inode(n,i,f) do { ; } while (0)
@@ -333,7 +340,8 @@ extern int audit_set_macxattr(const char *name);
333#define audit_inode_child(d,i,p) do { ; } while (0) 340#define audit_inode_child(d,i,p) do { ; } while (0)
334#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) 341#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)
335#define audit_get_loginuid(c) ({ -1; }) 342#define audit_get_loginuid(c) ({ -1; })
336#define audit_ipc_perms(q,u,g,m,i) ({ 0; }) 343#define audit_ipc_obj(i) ({ 0; })
344#define audit_ipc_set_perm(q,u,g,m,i) ({ 0; })
337#define audit_socketcall(n,a) ({ 0; }) 345#define audit_socketcall(n,a) ({ 0; })
338#define audit_sockaddr(len, addr) ({ 0; }) 346#define audit_sockaddr(len, addr) ({ 0; })
339#define audit_avc_path(dentry, mnt) ({ 0; }) 347#define audit_avc_path(dentry, mnt) ({ 0; })
@@ -366,7 +374,7 @@ extern void audit_log_d_path(struct audit_buffer *ab,
366extern int audit_filter_user(struct netlink_skb_parms *cb, int type); 374extern int audit_filter_user(struct netlink_skb_parms *cb, int type);
367extern int audit_filter_type(int type); 375extern int audit_filter_type(int type);
368extern int audit_receive_filter(int type, int pid, int uid, int seq, 376extern int audit_receive_filter(int type, int pid, int uid, int seq,
369 void *data, size_t datasz, uid_t loginuid); 377 void *data, size_t datasz, uid_t loginuid, u32 sid);
370#else 378#else
371#define audit_log(c,g,t,f,...) do { ; } while (0) 379#define audit_log(c,g,t,f,...) do { ; } while (0)
372#define audit_log_start(c,g,t) ({ NULL; }) 380#define audit_log_start(c,g,t) ({ NULL; })
diff --git a/include/linux/console.h b/include/linux/console.h
index 721371382ae5..08734e660d41 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -117,6 +117,10 @@ extern void console_stop(struct console *);
117extern void console_start(struct console *); 117extern void console_start(struct console *);
118extern int is_console_locked(void); 118extern int is_console_locked(void);
119 119
120/* Suspend and resume console messages over PM events */
121extern void suspend_console(void);
122extern void resume_console(void);
123
120/* Some debug stub to catch some of the obvious races in the VT code */ 124/* Some debug stub to catch some of the obvious races in the VT code */
121#if 1 125#if 1
122#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) 126#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress)
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index 176e2d371577..047567d34ca7 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -58,9 +58,8 @@ struct dentry *debugfs_create_blob(const char *name, mode_t mode,
58 */ 58 */
59 59
60static inline struct dentry *debugfs_create_file(const char *name, mode_t mode, 60static inline struct dentry *debugfs_create_file(const char *name, mode_t mode,
61 struct dentry *parent, 61 struct dentry *parent, void *data,
62 void *data, 62 const struct file_operations *fops)
63 struct file_operations *fops)
64{ 63{
65 return ERR_PTR(-ENODEV); 64 return ERR_PTR(-ENODEV);
66} 65}
diff --git a/include/linux/device.h b/include/linux/device.h
index f6e72a65a3f2..e8e53b9accc6 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -200,6 +200,7 @@ extern int class_device_create_file(struct class_device *,
200 * @node: for internal use by the driver core only. 200 * @node: for internal use by the driver core only.
201 * @kobj: for internal use by the driver core only. 201 * @kobj: for internal use by the driver core only.
202 * @devt_attr: for internal use by the driver core only. 202 * @devt_attr: for internal use by the driver core only.
203 * @groups: optional additional groups to be created
203 * @dev: if set, a symlink to the struct device is created in the sysfs 204 * @dev: if set, a symlink to the struct device is created in the sysfs
204 * directory for this struct class device. 205 * directory for this struct class device.
205 * @class_data: pointer to whatever you want to store here for this struct 206 * @class_data: pointer to whatever you want to store here for this struct
@@ -228,6 +229,7 @@ struct class_device {
228 struct device * dev; /* not necessary, but nice to have */ 229 struct device * dev; /* not necessary, but nice to have */
229 void * class_data; /* class-specific data */ 230 void * class_data; /* class-specific data */
230 struct class_device *parent; /* parent of this child device, if there is one */ 231 struct class_device *parent; /* parent of this child device, if there is one */
232 struct attribute_group ** groups; /* optional groups */
231 233
232 void (*release)(struct class_device *dev); 234 void (*release)(struct class_device *dev);
233 int (*uevent)(struct class_device *dev, char **envp, 235 int (*uevent)(struct class_device *dev, char **envp,
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ff61817082fa..635690cf3e3d 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -14,6 +14,7 @@ enum dma_data_direction {
14}; 14};
15 15
16#define DMA_64BIT_MASK 0xffffffffffffffffULL 16#define DMA_64BIT_MASK 0xffffffffffffffffULL
17#define DMA_48BIT_MASK 0x0000ffffffffffffULL
17#define DMA_40BIT_MASK 0x000000ffffffffffULL 18#define DMA_40BIT_MASK 0x000000ffffffffffULL
18#define DMA_39BIT_MASK 0x0000007fffffffffULL 19#define DMA_39BIT_MASK 0x0000007fffffffffULL
19#define DMA_32BIT_MASK 0x00000000ffffffffULL 20#define DMA_32BIT_MASK 0x00000000ffffffffULL
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
new file mode 100644
index 000000000000..78b236ca04f8
--- /dev/null
+++ b/include/linux/dmaengine.h
@@ -0,0 +1,359 @@
1/*
2 * Copyright(c) 2004 - 2006 Intel Corporation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
7 * any later version.
8 *
9 * This program is distributed in the hope that 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., 59
16 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called COPYING.
20 */
21#ifndef DMAENGINE_H
22#define DMAENGINE_H
23#include <linux/config.h>
24#ifdef CONFIG_DMA_ENGINE
25
26#include <linux/device.h>
27#include <linux/uio.h>
28#include <linux/kref.h>
29#include <linux/completion.h>
30#include <linux/rcupdate.h>
31
32/**
33 * enum dma_event - resource PNP/power managment events
34 * @DMA_RESOURCE_SUSPEND: DMA device going into low power state
35 * @DMA_RESOURCE_RESUME: DMA device returning to full power
36 * @DMA_RESOURCE_ADDED: DMA device added to the system
37 * @DMA_RESOURCE_REMOVED: DMA device removed from the system
38 */
39enum dma_event {
40 DMA_RESOURCE_SUSPEND,
41 DMA_RESOURCE_RESUME,
42 DMA_RESOURCE_ADDED,
43 DMA_RESOURCE_REMOVED,
44};
45
46/**
47 * typedef dma_cookie_t
48 *
49 * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code
50 */
51typedef s32 dma_cookie_t;
52
53#define dma_submit_error(cookie) ((cookie) < 0 ? 1 : 0)
54
55/**
56 * enum dma_status - DMA transaction status
57 * @DMA_SUCCESS: transaction completed successfully
58 * @DMA_IN_PROGRESS: transaction not yet processed
59 * @DMA_ERROR: transaction failed
60 */
61enum dma_status {
62 DMA_SUCCESS,
63 DMA_IN_PROGRESS,
64 DMA_ERROR,
65};
66
67/**
68 * struct dma_chan_percpu - the per-CPU part of struct dma_chan
69 * @refcount: local_t used for open-coded "bigref" counting
70 * @memcpy_count: transaction counter
71 * @bytes_transferred: byte counter
72 */
73
74struct dma_chan_percpu {
75 local_t refcount;
76 /* stats */
77 unsigned long memcpy_count;
78 unsigned long bytes_transferred;
79};
80
81/**
82 * struct dma_chan - devices supply DMA channels, clients use them
83 * @client: ptr to the client user of this chan, will be NULL when unused
84 * @device: ptr to the dma device who supplies this channel, always !NULL
85 * @cookie: last cookie value returned to client
86 * @chan_id:
87 * @class_dev:
88 * @refcount: kref, used in "bigref" slow-mode
89 * @slow_ref:
90 * @rcu:
91 * @client_node: used to add this to the client chan list
92 * @device_node: used to add this to the device chan list
93 * @local: per-cpu pointer to a struct dma_chan_percpu
94 */
95struct dma_chan {
96 struct dma_client *client;
97 struct dma_device *device;
98 dma_cookie_t cookie;
99
100 /* sysfs */
101 int chan_id;
102 struct class_device class_dev;
103
104 struct kref refcount;
105 int slow_ref;
106 struct rcu_head rcu;
107
108 struct list_head client_node;
109 struct list_head device_node;
110 struct dma_chan_percpu *local;
111};
112
113void dma_chan_cleanup(struct kref *kref);
114
115static inline void dma_chan_get(struct dma_chan *chan)
116{
117 if (unlikely(chan->slow_ref))
118 kref_get(&chan->refcount);
119 else {
120 local_inc(&(per_cpu_ptr(chan->local, get_cpu())->refcount));
121 put_cpu();
122 }
123}
124
125static inline void dma_chan_put(struct dma_chan *chan)
126{
127 if (unlikely(chan->slow_ref))
128 kref_put(&chan->refcount, dma_chan_cleanup);
129 else {
130 local_dec(&(per_cpu_ptr(chan->local, get_cpu())->refcount));
131 put_cpu();
132 }
133}
134
135/*
136 * typedef dma_event_callback - function pointer to a DMA event callback
137 */
138typedef void (*dma_event_callback) (struct dma_client *client,
139 struct dma_chan *chan, enum dma_event event);
140
141/**
142 * struct dma_client - info on the entity making use of DMA services
143 * @event_callback: func ptr to call when something happens
144 * @chan_count: number of chans allocated
145 * @chans_desired: number of chans requested. Can be +/- chan_count
146 * @lock: protects access to the channels list
147 * @channels: the list of DMA channels allocated
148 * @global_node: list_head for global dma_client_list
149 */
150struct dma_client {
151 dma_event_callback event_callback;
152 unsigned int chan_count;
153 unsigned int chans_desired;
154
155 spinlock_t lock;
156 struct list_head channels;
157 struct list_head global_node;
158};
159
160/**
161 * struct dma_device - info on the entity supplying DMA services
162 * @chancnt: how many DMA channels are supported
163 * @channels: the list of struct dma_chan
164 * @global_node: list_head for global dma_device_list
165 * @refcount:
166 * @done:
167 * @dev_id:
168 * Other func ptrs: used to make use of this device's capabilities
169 */
170struct dma_device {
171
172 unsigned int chancnt;
173 struct list_head channels;
174 struct list_head global_node;
175
176 struct kref refcount;
177 struct completion done;
178
179 int dev_id;
180
181 int (*device_alloc_chan_resources)(struct dma_chan *chan);
182 void (*device_free_chan_resources)(struct dma_chan *chan);
183 dma_cookie_t (*device_memcpy_buf_to_buf)(struct dma_chan *chan,
184 void *dest, void *src, size_t len);
185 dma_cookie_t (*device_memcpy_buf_to_pg)(struct dma_chan *chan,
186 struct page *page, unsigned int offset, void *kdata,
187 size_t len);
188 dma_cookie_t (*device_memcpy_pg_to_pg)(struct dma_chan *chan,
189 struct page *dest_pg, unsigned int dest_off,
190 struct page *src_pg, unsigned int src_off, size_t len);
191 enum dma_status (*device_memcpy_complete)(struct dma_chan *chan,
192 dma_cookie_t cookie, dma_cookie_t *last,
193 dma_cookie_t *used);
194 void (*device_memcpy_issue_pending)(struct dma_chan *chan);
195};
196
197/* --- public DMA engine API --- */
198
199struct dma_client *dma_async_client_register(dma_event_callback event_callback);
200void dma_async_client_unregister(struct dma_client *client);
201void dma_async_client_chan_request(struct dma_client *client,
202 unsigned int number);
203
204/**
205 * dma_async_memcpy_buf_to_buf - offloaded copy between virtual addresses
206 * @chan: DMA channel to offload copy to
207 * @dest: destination address (virtual)
208 * @src: source address (virtual)
209 * @len: length
210 *
211 * Both @dest and @src must be mappable to a bus address according to the
212 * DMA mapping API rules for streaming mappings.
213 * Both @dest and @src must stay memory resident (kernel memory or locked
214 * user space pages)
215 */
216static inline dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
217 void *dest, void *src, size_t len)
218{
219 int cpu = get_cpu();
220 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len;
221 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
222 put_cpu();
223
224 return chan->device->device_memcpy_buf_to_buf(chan, dest, src, len);
225}
226
227/**
228 * dma_async_memcpy_buf_to_pg - offloaded copy
229 * @chan: DMA channel to offload copy to
230 * @page: destination page
231 * @offset: offset in page to copy to
232 * @kdata: source address (virtual)
233 * @len: length
234 *
235 * Both @page/@offset and @kdata must be mappable to a bus address according
236 * to the DMA mapping API rules for streaming mappings.
237 * Both @page/@offset and @kdata must stay memory resident (kernel memory or
238 * locked user space pages)
239 */
240static inline dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
241 struct page *page, unsigned int offset, void *kdata, size_t len)
242{
243 int cpu = get_cpu();
244 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len;
245 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
246 put_cpu();
247
248 return chan->device->device_memcpy_buf_to_pg(chan, page, offset,
249 kdata, len);
250}
251
252/**
253 * dma_async_memcpy_buf_to_pg - offloaded copy
254 * @chan: DMA channel to offload copy to
255 * @dest_page: destination page
256 * @dest_off: offset in page to copy to
257 * @src_page: source page
258 * @src_off: offset in page to copy from
259 * @len: length
260 *
261 * Both @dest_page/@dest_off and @src_page/@src_off must be mappable to a bus
262 * address according to the DMA mapping API rules for streaming mappings.
263 * Both @dest_page/@dest_off and @src_page/@src_off must stay memory resident
264 * (kernel memory or locked user space pages)
265 */
266static inline dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan,
267 struct page *dest_pg, unsigned int dest_off, struct page *src_pg,
268 unsigned int src_off, size_t len)
269{
270 int cpu = get_cpu();
271 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len;
272 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
273 put_cpu();
274
275 return chan->device->device_memcpy_pg_to_pg(chan, dest_pg, dest_off,
276 src_pg, src_off, len);
277}
278
279/**
280 * dma_async_memcpy_issue_pending - flush pending copies to HW
281 * @chan:
282 *
283 * This allows drivers to push copies to HW in batches,
284 * reducing MMIO writes where possible.
285 */
286static inline void dma_async_memcpy_issue_pending(struct dma_chan *chan)
287{
288 return chan->device->device_memcpy_issue_pending(chan);
289}
290
291/**
292 * dma_async_memcpy_complete - poll for transaction completion
293 * @chan: DMA channel
294 * @cookie: transaction identifier to check status of
295 * @last: returns last completed cookie, can be NULL
296 * @used: returns last issued cookie, can be NULL
297 *
298 * If @last and @used are passed in, upon return they reflect the driver
299 * internal state and can be used with dma_async_is_complete() to check
300 * the status of multiple cookies without re-checking hardware state.
301 */
302static inline enum dma_status dma_async_memcpy_complete(struct dma_chan *chan,
303 dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used)
304{
305 return chan->device->device_memcpy_complete(chan, cookie, last, used);
306}
307
308/**
309 * dma_async_is_complete - test a cookie against chan state
310 * @cookie: transaction identifier to test status of
311 * @last_complete: last know completed transaction
312 * @last_used: last cookie value handed out
313 *
314 * dma_async_is_complete() is used in dma_async_memcpy_complete()
315 * the test logic is seperated for lightweight testing of multiple cookies
316 */
317static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
318 dma_cookie_t last_complete, dma_cookie_t last_used)
319{
320 if (last_complete <= last_used) {
321 if ((cookie <= last_complete) || (cookie > last_used))
322 return DMA_SUCCESS;
323 } else {
324 if ((cookie <= last_complete) && (cookie > last_used))
325 return DMA_SUCCESS;
326 }
327 return DMA_IN_PROGRESS;
328}
329
330
331/* --- DMA device --- */
332
333int dma_async_device_register(struct dma_device *device);
334void dma_async_device_unregister(struct dma_device *device);
335
336/* --- Helper iov-locking functions --- */
337
338struct dma_page_list {
339 char *base_address;
340 int nr_pages;
341 struct page **pages;
342};
343
344struct dma_pinned_list {
345 int nr_iovecs;
346 struct dma_page_list page_list[0];
347};
348
349struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len);
350void dma_unpin_iovec_pages(struct dma_pinned_list* pinned_list);
351
352dma_cookie_t dma_memcpy_to_iovec(struct dma_chan *chan, struct iovec *iov,
353 struct dma_pinned_list *pinned_list, unsigned char *kdata, size_t len);
354dma_cookie_t dma_memcpy_pg_to_iovec(struct dma_chan *chan, struct iovec *iov,
355 struct dma_pinned_list *pinned_list, struct page *page,
356 unsigned int offset, size_t len);
357
358#endif /* CONFIG_DMA_ENGINE */
359#endif /* DMAENGINE_H */
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index ad133fcfb239..1713ace808bf 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -21,7 +21,7 @@ typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
21typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); 21typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *);
22typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 22typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
23 23
24typedef int (elevator_init_fn) (request_queue_t *, elevator_t *); 24typedef void *(elevator_init_fn) (request_queue_t *, elevator_t *);
25typedef void (elevator_exit_fn) (elevator_t *); 25typedef void (elevator_exit_fn) (elevator_t *);
26 26
27struct elevator_ops 27struct elevator_ops
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 2d716080be4a..33d8f2087b6e 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -19,5 +19,4 @@ int request_firmware_nowait(
19 void (*cont)(const struct firmware *fw, void *context)); 19 void (*cont)(const struct firmware *fw, void *context));
20 20
21void release_firmware(const struct firmware *fw); 21void release_firmware(const struct firmware *fw);
22void register_firmware(const char *name, const u8 *data, size_t size);
23#endif 22#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3de2bfb2410f..f813bc8266aa 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -213,6 +213,10 @@ extern int dir_notify_enable;
213#define FIBMAP _IO(0x00,1) /* bmap access */ 213#define FIBMAP _IO(0x00,1) /* bmap access */
214#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ 214#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
215 215
216#define SYNC_FILE_RANGE_WAIT_BEFORE 1
217#define SYNC_FILE_RANGE_WRITE 2
218#define SYNC_FILE_RANGE_WAIT_AFTER 4
219
216#ifdef __KERNEL__ 220#ifdef __KERNEL__
217 221
218#include <linux/linkage.h> 222#include <linux/linkage.h>
@@ -758,9 +762,6 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
758extern int fcntl_getlease(struct file *filp); 762extern int fcntl_getlease(struct file *filp);
759 763
760/* fs/sync.c */ 764/* fs/sync.c */
761#define SYNC_FILE_RANGE_WAIT_BEFORE 1
762#define SYNC_FILE_RANGE_WRITE 2
763#define SYNC_FILE_RANGE_WAIT_AFTER 4
764extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte, 765extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte,
765 unsigned int flags); 766 unsigned int flags);
766 767
diff --git a/include/linux/fs_uart_pd.h b/include/linux/fs_uart_pd.h
new file mode 100644
index 000000000000..f5975126b712
--- /dev/null
+++ b/include/linux/fs_uart_pd.h
@@ -0,0 +1,60 @@
1/*
2 * Platform information definitions for the CPM Uart driver.
3 *
4 * 2006 (c) MontaVista Software, Inc.
5 * Vitaly Bordug <vbordug@ru.mvista.com>
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12#ifndef FS_UART_PD_H
13#define FS_UART_PD_H
14
15#include <linux/version.h>
16#include <asm/types.h>
17
18enum fs_uart_id {
19 fsid_smc1_uart,
20 fsid_smc2_uart,
21 fsid_scc1_uart,
22 fsid_scc2_uart,
23 fsid_scc3_uart,
24 fsid_scc4_uart,
25 fs_uart_nr,
26};
27
28static inline int fs_uart_id_scc2fsid(int id)
29{
30 return fsid_scc1_uart + id - 1;
31}
32
33static inline int fs_uart_id_fsid2scc(int id)
34{
35 return id - fsid_scc1_uart + 1;
36}
37
38static inline int fs_uart_id_smc2fsid(int id)
39{
40 return fsid_smc1_uart + id - 1;
41}
42
43static inline int fs_uart_id_fsid2smc(int id)
44{
45 return id - fsid_smc1_uart + 1;
46}
47
48struct fs_uart_platform_info {
49 void(*init_ioports)(void);
50 /* device specific information */
51 int fs_no; /* controller index */
52 u32 uart_clk;
53 u8 tx_num_fifo;
54 u8 tx_buf_size;
55 u8 rx_num_fifo;
56 u8 rx_buf_size;
57 u8 brg;
58};
59
60#endif
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index a3a0e078f79d..16fbe59edeb1 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -110,5 +110,16 @@ struct fsl_usb2_platform_data {
110#define FSL_USB2_PORT0_ENABLED 0x00000001 110#define FSL_USB2_PORT0_ENABLED 0x00000001
111#define FSL_USB2_PORT1_ENABLED 0x00000002 111#define FSL_USB2_PORT1_ENABLED 0x00000002
112 112
113struct fsl_spi_platform_data {
114 u32 initial_spmode; /* initial SPMODE value */
115 u16 bus_num;
116
117 /* board specific information */
118 u16 max_chipselect;
119 void (*activate_cs)(u8 cs, u8 polarity);
120 void (*deactivate_cs)(u8 cs, u8 polarity);
121 u32 sysclk;
122};
123
113#endif /* _FSL_DEVICE_H_ */ 124#endif /* _FSL_DEVICE_H_ */
114#endif /* __KERNEL__ */ 125#endif /* __KERNEL__ */
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index dd7d627bf66f..c115e9e840b4 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -1114,8 +1114,11 @@ static inline struct i2o_message *i2o_msg_get(struct i2o_controller *c)
1114 1114
1115 mmsg->mfa = readl(c->in_port); 1115 mmsg->mfa = readl(c->in_port);
1116 if (unlikely(mmsg->mfa >= c->in_queue.len)) { 1116 if (unlikely(mmsg->mfa >= c->in_queue.len)) {
1117 u32 mfa = mmsg->mfa;
1118
1117 mempool_free(mmsg, c->in_msg.mempool); 1119 mempool_free(mmsg, c->in_msg.mempool);
1118 if(mmsg->mfa == I2O_QUEUE_EMPTY) 1120
1121 if (mfa == I2O_QUEUE_EMPTY)
1119 return ERR_PTR(-EBUSY); 1122 return ERR_PTR(-EBUSY);
1120 return ERR_PTR(-EFAULT); 1123 return ERR_PTR(-EFAULT);
1121 } 1124 }
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 28f4f3b36950..899c3d4776f3 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -169,7 +169,7 @@ struct ip_sf_list
169struct ip_mc_list 169struct ip_mc_list
170{ 170{
171 struct in_device *interface; 171 struct in_device *interface;
172 unsigned long multiaddr; 172 __be32 multiaddr;
173 struct ip_sf_list *sources; 173 struct ip_sf_list *sources;
174 struct ip_sf_list *tomb; 174 struct ip_sf_list *tomb;
175 unsigned int sfmode; 175 unsigned int sfmode;
diff --git a/include/linux/input.h b/include/linux/input.h
index b0e612dda0cf..ce1a756c4c30 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -12,8 +12,6 @@
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/device.h>
16#include <linux/mod_devicetable.h>
17#else 15#else
18#include <sys/time.h> 16#include <sys/time.h>
19#include <sys/ioctl.h> 17#include <sys/ioctl.h>
@@ -58,6 +56,8 @@ struct input_absinfo {
58 56
59#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ 57#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
60#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ 58#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
59#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */
60#define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */
61#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ 61#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */
62#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */ 62#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */
63 63
@@ -345,6 +345,8 @@ struct input_absinfo {
345#define KEY_SAVE 234 345#define KEY_SAVE 234
346#define KEY_DOCUMENTS 235 346#define KEY_DOCUMENTS 235
347 347
348#define KEY_BATTERY 236
349
348#define KEY_UNKNOWN 240 350#define KEY_UNKNOWN 240
349 351
350#define BTN_MISC 0x100 352#define BTN_MISC 0x100
@@ -577,15 +579,10 @@ struct input_absinfo {
577 * Switch events 579 * Switch events
578 */ 580 */
579 581
580#define SW_0 0x00 582#define SW_LID 0x00 /* set = lid shut */
581#define SW_1 0x01 583#define SW_TABLET_MODE 0x01 /* set = tablet mode */
582#define SW_2 0x02 584#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */
583#define SW_3 0x03 585#define SW_MAX 0x0f
584#define SW_4 0x04
585#define SW_5 0x05
586#define SW_6 0x06
587#define SW_7 0x07
588#define SW_MAX 0x0f
589 586
590/* 587/*
591 * Misc events 588 * Misc events
@@ -805,52 +802,16 @@ struct ff_effect {
805 802
806#define FF_MAX 0x7f 803#define FF_MAX 0x7f
807 804
808struct input_device_id {
809
810 kernel_ulong_t flags;
811
812 struct input_id id;
813
814 kernel_ulong_t evbit[EV_MAX/BITS_PER_LONG+1];
815 kernel_ulong_t keybit[KEY_MAX/BITS_PER_LONG+1];
816 kernel_ulong_t relbit[REL_MAX/BITS_PER_LONG+1];
817 kernel_ulong_t absbit[ABS_MAX/BITS_PER_LONG+1];
818 kernel_ulong_t mscbit[MSC_MAX/BITS_PER_LONG+1];
819 kernel_ulong_t ledbit[LED_MAX/BITS_PER_LONG+1];
820 kernel_ulong_t sndbit[SND_MAX/BITS_PER_LONG+1];
821 kernel_ulong_t ffbit[FF_MAX/BITS_PER_LONG+1];
822 kernel_ulong_t swbit[SW_MAX/BITS_PER_LONG+1];
823
824 kernel_ulong_t driver_info;
825};
826
827/*
828 * Structure for hotplug & device<->driver matching.
829 */
830
831#define INPUT_DEVICE_ID_MATCH_BUS 1
832#define INPUT_DEVICE_ID_MATCH_VENDOR 2
833#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
834#define INPUT_DEVICE_ID_MATCH_VERSION 8
835
836#define INPUT_DEVICE_ID_MATCH_EVBIT 0x010
837#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x020
838#define INPUT_DEVICE_ID_MATCH_RELBIT 0x040
839#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x080
840#define INPUT_DEVICE_ID_MATCH_MSCIT 0x100
841#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200
842#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400
843#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800
844#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
845
846#ifdef __KERNEL__ 805#ifdef __KERNEL__
847 806
848/* 807/*
849 * In-kernel definitions. 808 * In-kernel definitions.
850 */ 809 */
851 810
811#include <linux/device.h>
852#include <linux/fs.h> 812#include <linux/fs.h>
853#include <linux/timer.h> 813#include <linux/timer.h>
814#include <linux/mod_devicetable.h>
854 815
855#define NBITS(x) (((x)/BITS_PER_LONG)+1) 816#define NBITS(x) (((x)/BITS_PER_LONG)+1)
856#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) 817#define BIT(x) (1UL<<((x)%BITS_PER_LONG))
@@ -951,9 +912,49 @@ struct input_dev {
951}; 912};
952#define to_input_dev(d) container_of(d, struct input_dev, cdev) 913#define to_input_dev(d) container_of(d, struct input_dev, cdev)
953 914
954#define INPUT_DEVICE_ID_MATCH_DEVICE\ 915/*
916 * Verify that we are in sync with input_device_id mod_devicetable.h #defines
917 */
918
919#if EV_MAX != INPUT_DEVICE_ID_EV_MAX
920#error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match"
921#endif
922
923#if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX
924#error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match"
925#endif
926
927#if REL_MAX != INPUT_DEVICE_ID_REL_MAX
928#error "REL_MAX and INPUT_DEVICE_ID_REL_MAX do not match"
929#endif
930
931#if ABS_MAX != INPUT_DEVICE_ID_ABS_MAX
932#error "ABS_MAX and INPUT_DEVICE_ID_ABS_MAX do not match"
933#endif
934
935#if MSC_MAX != INPUT_DEVICE_ID_MSC_MAX
936#error "MSC_MAX and INPUT_DEVICE_ID_MSC_MAX do not match"
937#endif
938
939#if LED_MAX != INPUT_DEVICE_ID_LED_MAX
940#error "LED_MAX and INPUT_DEVICE_ID_LED_MAX do not match"
941#endif
942
943#if SND_MAX != INPUT_DEVICE_ID_SND_MAX
944#error "SND_MAX and INPUT_DEVICE_ID_SND_MAX do not match"
945#endif
946
947#if FF_MAX != INPUT_DEVICE_ID_FF_MAX
948#error "FF_MAX and INPUT_DEVICE_ID_FF_MAX do not match"
949#endif
950
951#if SW_MAX != INPUT_DEVICE_ID_SW_MAX
952#error "SW_MAX and INPUT_DEVICE_ID_SW_MAX do not match"
953#endif
954
955#define INPUT_DEVICE_ID_MATCH_DEVICE \
955 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) 956 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT)
956#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\ 957#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION \
957 (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION) 958 (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION)
958 959
959struct input_handle; 960struct input_handle;
@@ -1016,7 +1017,8 @@ static inline void input_put_device(struct input_dev *dev)
1016 1017
1017static inline void input_free_device(struct input_dev *dev) 1018static inline void input_free_device(struct input_dev *dev)
1018{ 1019{
1019 input_put_device(dev); 1020 if (dev)
1021 input_put_device(dev);
1020} 1022}
1021 1023
1022int input_register_device(struct input_dev *); 1024int input_register_device(struct input_dev *);
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
index cf792bb3c726..c6f70660b371 100644
--- a/include/linux/jffs2.h
+++ b/include/linux/jffs2.h
@@ -65,6 +65,18 @@
65 65
66#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6) 66#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
67 67
68#define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8)
69#define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9)
70
71/* XATTR Related */
72#define JFFS2_XPREFIX_USER 1 /* for "user." */
73#define JFFS2_XPREFIX_SECURITY 2 /* for "security." */
74#define JFFS2_XPREFIX_ACL_ACCESS 3 /* for "system.posix_acl_access" */
75#define JFFS2_XPREFIX_ACL_DEFAULT 4 /* for "system.posix_acl_default" */
76#define JFFS2_XPREFIX_TRUSTED 5 /* for "trusted.*" */
77
78#define JFFS2_ACL_VERSION 0x0001
79
68// Maybe later... 80// Maybe later...
69//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) 81//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
70//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) 82//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
@@ -82,11 +94,11 @@
82 94
83typedef struct { 95typedef struct {
84 uint32_t v32; 96 uint32_t v32;
85} __attribute__((packed)) jint32_t; 97} __attribute__((packed)) jint32_t;
86 98
87typedef struct { 99typedef struct {
88 uint32_t m; 100 uint32_t m;
89} __attribute__((packed)) jmode_t; 101} __attribute__((packed)) jmode_t;
90 102
91typedef struct { 103typedef struct {
92 uint16_t v16; 104 uint16_t v16;
@@ -99,7 +111,7 @@ struct jffs2_unknown_node
99 jint16_t nodetype; 111 jint16_t nodetype;
100 jint32_t totlen; /* So we can skip over nodes we don't grok */ 112 jint32_t totlen; /* So we can skip over nodes we don't grok */
101 jint32_t hdr_crc; 113 jint32_t hdr_crc;
102} __attribute__((packed)); 114};
103 115
104struct jffs2_raw_dirent 116struct jffs2_raw_dirent
105{ 117{
@@ -117,7 +129,7 @@ struct jffs2_raw_dirent
117 jint32_t node_crc; 129 jint32_t node_crc;
118 jint32_t name_crc; 130 jint32_t name_crc;
119 uint8_t name[0]; 131 uint8_t name[0];
120} __attribute__((packed)); 132};
121 133
122/* The JFFS2 raw inode structure: Used for storage on physical media. */ 134/* The JFFS2 raw inode structure: Used for storage on physical media. */
123/* The uid, gid, atime, mtime and ctime members could be longer, but 135/* The uid, gid, atime, mtime and ctime members could be longer, but
@@ -149,6 +161,32 @@ struct jffs2_raw_inode
149 jint32_t data_crc; /* CRC for the (compressed) data. */ 161 jint32_t data_crc; /* CRC for the (compressed) data. */
150 jint32_t node_crc; /* CRC for the raw inode (excluding data) */ 162 jint32_t node_crc; /* CRC for the raw inode (excluding data) */
151 uint8_t data[0]; 163 uint8_t data[0];
164};
165
166struct jffs2_raw_xattr {
167 jint16_t magic;
168 jint16_t nodetype; /* = JFFS2_NODETYPE_XATTR */
169 jint32_t totlen;
170 jint32_t hdr_crc;
171 jint32_t xid; /* XATTR identifier number */
172 jint32_t version;
173 uint8_t xprefix;
174 uint8_t name_len;
175 jint16_t value_len;
176 jint32_t data_crc;
177 jint32_t node_crc;
178 uint8_t data[0];
179} __attribute__((packed));
180
181struct jffs2_raw_xref
182{
183 jint16_t magic;
184 jint16_t nodetype; /* = JFFS2_NODETYPE_XREF */
185 jint32_t totlen;
186 jint32_t hdr_crc;
187 jint32_t ino; /* inode number */
188 jint32_t xid; /* XATTR identifier number */
189 jint32_t node_crc;
152} __attribute__((packed)); 190} __attribute__((packed));
153 191
154struct jffs2_raw_summary 192struct jffs2_raw_summary
@@ -163,14 +201,22 @@ struct jffs2_raw_summary
163 jint32_t sum_crc; /* summary information crc */ 201 jint32_t sum_crc; /* summary information crc */
164 jint32_t node_crc; /* node crc */ 202 jint32_t node_crc; /* node crc */
165 jint32_t sum[0]; /* inode summary info */ 203 jint32_t sum[0]; /* inode summary info */
166} __attribute__((packed)); 204};
167 205
168union jffs2_node_union 206union jffs2_node_union
169{ 207{
170 struct jffs2_raw_inode i; 208 struct jffs2_raw_inode i;
171 struct jffs2_raw_dirent d; 209 struct jffs2_raw_dirent d;
210 struct jffs2_raw_xattr x;
211 struct jffs2_raw_xref r;
172 struct jffs2_raw_summary s; 212 struct jffs2_raw_summary s;
173 struct jffs2_unknown_node u; 213 struct jffs2_unknown_node u;
174}; 214};
175 215
216/* Data payload for device nodes. */
217union jffs2_device_node {
218 jint16_t old;
219 jint32_t new;
220};
221
176#endif /* __LINUX_JFFS2_H__ */ 222#endif /* __LINUX_JFFS2_H__ */
diff --git a/include/linux/jffs2_fs_i.h b/include/linux/jffs2_fs_i.h
deleted file mode 100644
index ad565bf9dcc1..000000000000
--- a/include/linux/jffs2_fs_i.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/* $Id: jffs2_fs_i.h,v 1.19 2005/11/07 11:14:52 gleixner Exp $ */
2
3#ifndef _JFFS2_FS_I
4#define _JFFS2_FS_I
5
6#include <linux/version.h>
7#include <linux/rbtree.h>
8#include <asm/semaphore.h>
9
10struct jffs2_inode_info {
11 /* We need an internal mutex similar to inode->i_mutex.
12 Unfortunately, we can't used the existing one, because
13 either the GC would deadlock, or we'd have to release it
14 before letting GC proceed. Or we'd have to put ugliness
15 into the GC code so it didn't attempt to obtain the i_mutex
16 for the inode(s) which are already locked */
17 struct semaphore sem;
18
19 /* The highest (datanode) version number used for this ino */
20 uint32_t highest_version;
21
22 /* List of data fragments which make up the file */
23 struct rb_root fragtree;
24
25 /* There may be one datanode which isn't referenced by any of the
26 above fragments, if it contains a metadata update but no actual
27 data - or if this is a directory inode */
28 /* This also holds the _only_ dnode for symlinks/device nodes,
29 etc. */
30 struct jffs2_full_dnode *metadata;
31
32 /* Directory entries */
33 struct jffs2_full_dirent *dents;
34
35 /* The target path if this is the inode of a symlink */
36 unsigned char *target;
37
38 /* Some stuff we just have to keep in-core at all times, for each inode. */
39 struct jffs2_inode_cache *inocache;
40
41 uint16_t flags;
42 uint8_t usercompr;
43#if !defined (__ECOS)
44#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)
45 struct inode vfs_inode;
46#endif
47#endif
48};
49
50#endif /* _JFFS2_FS_I */
diff --git a/include/linux/jffs2_fs_sb.h b/include/linux/jffs2_fs_sb.h
deleted file mode 100644
index 4bcfb5570221..000000000000
--- a/include/linux/jffs2_fs_sb.h
+++ /dev/null
@@ -1,122 +0,0 @@
1/* $Id: jffs2_fs_sb.h,v 1.54 2005/09/21 13:37:34 dedekind Exp $ */
2
3#ifndef _JFFS2_FS_SB
4#define _JFFS2_FS_SB
5
6#include <linux/types.h>
7#include <linux/spinlock.h>
8#include <linux/workqueue.h>
9#include <linux/completion.h>
10#include <asm/semaphore.h>
11#include <linux/timer.h>
12#include <linux/wait.h>
13#include <linux/list.h>
14#include <linux/rwsem.h>
15
16#define JFFS2_SB_FLAG_RO 1
17#define JFFS2_SB_FLAG_SCANNING 2 /* Flash scanning is in progress */
18#define JFFS2_SB_FLAG_BUILDING 4 /* File system building is in progress */
19
20struct jffs2_inodirty;
21
22/* A struct for the overall file system control. Pointers to
23 jffs2_sb_info structs are named `c' in the source code.
24 Nee jffs_control
25*/
26struct jffs2_sb_info {
27 struct mtd_info *mtd;
28
29 uint32_t highest_ino;
30 uint32_t checked_ino;
31
32 unsigned int flags;
33
34 struct task_struct *gc_task; /* GC task struct */
35 struct completion gc_thread_start; /* GC thread start completion */
36 struct completion gc_thread_exit; /* GC thread exit completion port */
37
38 struct semaphore alloc_sem; /* Used to protect all the following
39 fields, and also to protect against
40 out-of-order writing of nodes. And GC. */
41 uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER
42 (i.e. zero for OOB CLEANMARKER */
43
44 uint32_t flash_size;
45 uint32_t used_size;
46 uint32_t dirty_size;
47 uint32_t wasted_size;
48 uint32_t free_size;
49 uint32_t erasing_size;
50 uint32_t bad_size;
51 uint32_t sector_size;
52 uint32_t unchecked_size;
53
54 uint32_t nr_free_blocks;
55 uint32_t nr_erasing_blocks;
56
57 /* Number of free blocks there must be before we... */
58 uint8_t resv_blocks_write; /* ... allow a normal filesystem write */
59 uint8_t resv_blocks_deletion; /* ... allow a normal filesystem deletion */
60 uint8_t resv_blocks_gctrigger; /* ... wake up the GC thread */
61 uint8_t resv_blocks_gcbad; /* ... pick a block from the bad_list to GC */
62 uint8_t resv_blocks_gcmerge; /* ... merge pages when garbage collecting */
63
64 uint32_t nospc_dirty_size;
65
66 uint32_t nr_blocks;
67 struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks
68 * from the offset (blocks[ofs / sector_size]) */
69 struct jffs2_eraseblock *nextblock; /* The block we're currently filling */
70
71 struct jffs2_eraseblock *gcblock; /* The block we're currently garbage-collecting */
72
73 struct list_head clean_list; /* Blocks 100% full of clean data */
74 struct list_head very_dirty_list; /* Blocks with lots of dirty space */
75 struct list_head dirty_list; /* Blocks with some dirty space */
76 struct list_head erasable_list; /* Blocks which are completely dirty, and need erasing */
77 struct list_head erasable_pending_wbuf_list; /* Blocks which need erasing but only after the current wbuf is flushed */
78 struct list_head erasing_list; /* Blocks which are currently erasing */
79 struct list_head erase_pending_list; /* Blocks which need erasing now */
80 struct list_head erase_complete_list; /* Blocks which are erased and need the clean marker written to them */
81 struct list_head free_list; /* Blocks which are free and ready to be used */
82 struct list_head bad_list; /* Bad blocks. */
83 struct list_head bad_used_list; /* Bad blocks with valid data in. */
84
85 spinlock_t erase_completion_lock; /* Protect free_list and erasing_list
86 against erase completion handler */
87 wait_queue_head_t erase_wait; /* For waiting for erases to complete */
88
89 wait_queue_head_t inocache_wq;
90 struct jffs2_inode_cache **inocache_list;
91 spinlock_t inocache_lock;
92
93 /* Sem to allow jffs2_garbage_collect_deletion_dirent to
94 drop the erase_completion_lock while it's holding a pointer
95 to an obsoleted node. I don't like this. Alternatives welcomed. */
96 struct semaphore erase_free_sem;
97
98 uint32_t wbuf_pagesize; /* 0 for NOR and other flashes with no wbuf */
99
100#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
101 /* Write-behind buffer for NAND flash */
102 unsigned char *wbuf;
103 uint32_t wbuf_ofs;
104 uint32_t wbuf_len;
105 struct jffs2_inodirty *wbuf_inodes;
106
107 struct rw_semaphore wbuf_sem; /* Protects the write buffer */
108
109 /* Information about out-of-band area usage... */
110 struct nand_oobinfo *oobinfo;
111 uint32_t badblock_pos;
112 uint32_t fsdata_pos;
113 uint32_t fsdata_len;
114#endif
115
116 struct jffs2_summary *summary; /* Summary information */
117
118 /* OS-private pointer for getting back to master superblock info */
119 void *os_priv;
120};
121
122#endif /* _JFFS2_FB_SB */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index e1bd0842f6a1..f4fc576ed4c4 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -124,6 +124,7 @@ extern int get_option(char **str, int *pint);
124extern char *get_options(const char *str, int nints, int *ints); 124extern char *get_options(const char *str, int nints, int *ints);
125extern unsigned long long memparse(char *ptr, char **retptr); 125extern unsigned long long memparse(char *ptr, char **retptr);
126 126
127extern int core_kernel_text(unsigned long addr);
127extern int __kernel_text_address(unsigned long addr); 128extern int __kernel_text_address(unsigned long addr);
128extern int kernel_text_address(unsigned long addr); 129extern int kernel_text_address(unsigned long addr);
129extern int session_of_pgrp(int pgrp); 130extern int session_of_pgrp(int pgrp);
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index dcd0623be892..c187c53cecd0 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -257,9 +257,8 @@ struct subsys_attribute {
257}; 257};
258 258
259extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); 259extern int subsys_create_file(struct subsystem * , struct subsys_attribute *);
260extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *);
261 260
262#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) 261#if defined(CONFIG_HOTPLUG)
263void kobject_uevent(struct kobject *kobj, enum kobject_action action); 262void kobject_uevent(struct kobject *kobj, enum kobject_action action);
264 263
265int add_uevent_var(char **envp, int num_envp, int *cur_index, 264int add_uevent_var(char **envp, int num_envp, int *cur_index,
diff --git a/include/linux/list.h b/include/linux/list.h
index 67258b47e9ca..76f05718342c 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -619,7 +619,7 @@ static inline void hlist_del_rcu(struct hlist_node *n)
619 619
620static inline void hlist_del_init(struct hlist_node *n) 620static inline void hlist_del_init(struct hlist_node *n)
621{ 621{
622 if (n->pprev) { 622 if (!hlist_unhashed(n)) {
623 __hlist_del(n); 623 __hlist_del(n);
624 INIT_HLIST_NODE(n); 624 INIT_HLIST_NODE(n);
625 } 625 }
diff --git a/include/linux/m48t86.h b/include/linux/m48t86.h
index 9065199319d0..915d6b4f0f89 100644
--- a/include/linux/m48t86.h
+++ b/include/linux/m48t86.h
@@ -11,6 +11,6 @@
11 11
12struct m48t86_ops 12struct m48t86_ops
13{ 13{
14 void (*writeb)(unsigned char value, unsigned long addr); 14 void (*writebyte)(unsigned char value, unsigned long addr);
15 unsigned char (*readb)(unsigned long addr); 15 unsigned char (*readbyte)(unsigned long addr);
16}; 16};
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 6a7621b2b12b..f5fdca1d67e6 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -36,6 +36,7 @@
36#include <linux/nodemask.h> 36#include <linux/nodemask.h>
37 37
38struct vm_area_struct; 38struct vm_area_struct;
39struct mm_struct;
39 40
40#ifdef CONFIG_NUMA 41#ifdef CONFIG_NUMA
41 42
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 30dd978c1ec8..991a37382a22 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -28,6 +28,7 @@ struct mmc_csd {
28 unsigned short cmdclass; 28 unsigned short cmdclass;
29 unsigned short tacc_clks; 29 unsigned short tacc_clks;
30 unsigned int tacc_ns; 30 unsigned int tacc_ns;
31 unsigned int r2w_factor;
31 unsigned int max_dtr; 32 unsigned int max_dtr;
32 unsigned int read_blkbits; 33 unsigned int read_blkbits;
33 unsigned int write_blkbits; 34 unsigned int write_blkbits;
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index bdc556d88498..03a14a30c46a 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -69,6 +69,7 @@ struct mmc_data {
69 unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ 69 unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */
70 unsigned int timeout_clks; /* data timeout (in clocks) */ 70 unsigned int timeout_clks; /* data timeout (in clocks) */
71 unsigned int blksz_bits; /* data block size */ 71 unsigned int blksz_bits; /* data block size */
72 unsigned int blksz; /* data block size */
72 unsigned int blocks; /* number of blocks */ 73 unsigned int blocks; /* number of blocks */
73 unsigned int error; /* data error */ 74 unsigned int error; /* data error */
74 unsigned int flags; 75 unsigned int flags;
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index b5c21122c299..2d8337150493 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -15,6 +15,7 @@
15#include <linux/seqlock.h> 15#include <linux/seqlock.h>
16#include <linux/nodemask.h> 16#include <linux/nodemask.h>
17#include <asm/atomic.h> 17#include <asm/atomic.h>
18#include <asm/page.h>
18 19
19/* Free memory management - zoned buddy allocator. */ 20/* Free memory management - zoned buddy allocator. */
20#ifndef CONFIG_FORCE_MAX_ZONEORDER 21#ifndef CONFIG_FORCE_MAX_ZONEORDER
@@ -22,6 +23,7 @@
22#else 23#else
23#define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER 24#define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER
24#endif 25#endif
26#define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1))
25 27
26struct free_area { 28struct free_area {
27 struct list_head free_list; 29 struct list_head free_list;
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 7b08c11ec4cc..f6977708585c 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -249,4 +249,52 @@ struct i2c_device_id {
249 __u16 id; 249 __u16 id;
250}; 250};
251 251
252/* Input */
253#define INPUT_DEVICE_ID_EV_MAX 0x1f
254#define INPUT_DEVICE_ID_KEY_MAX 0x1ff
255#define INPUT_DEVICE_ID_REL_MAX 0x0f
256#define INPUT_DEVICE_ID_ABS_MAX 0x3f
257#define INPUT_DEVICE_ID_MSC_MAX 0x07
258#define INPUT_DEVICE_ID_LED_MAX 0x0f
259#define INPUT_DEVICE_ID_SND_MAX 0x07
260#define INPUT_DEVICE_ID_FF_MAX 0x7f
261#define INPUT_DEVICE_ID_SW_MAX 0x0f
262
263#define INPUT_DEVICE_ID_MATCH_BUS 1
264#define INPUT_DEVICE_ID_MATCH_VENDOR 2
265#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
266#define INPUT_DEVICE_ID_MATCH_VERSION 8
267
268#define INPUT_DEVICE_ID_MATCH_EVBIT 0x0010
269#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x0020
270#define INPUT_DEVICE_ID_MATCH_RELBIT 0x0040
271#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x0080
272#define INPUT_DEVICE_ID_MATCH_MSCIT 0x0100
273#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x0200
274#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x0400
275#define INPUT_DEVICE_ID_MATCH_FFBIT 0x0800
276#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
277
278struct input_device_id {
279
280 kernel_ulong_t flags;
281
282 __u16 bustype;
283 __u16 vendor;
284 __u16 product;
285 __u16 version;
286
287 kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1];
288 kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1];
289 kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1];
290 kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1];
291 kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1];
292 kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1];
293 kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1];
294 kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1];
295 kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1];
296
297 kernel_ulong_t driver_info;
298};
299
252#endif /* LINUX_MOD_DEVICETABLE_H */ 300#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/module.h b/include/linux/module.h
index eaec13ddd667..b0d44134f3c4 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -557,13 +557,4 @@ static inline void module_remove_driver(struct device_driver *driver)
557 557
558#define __MODULE_STRING(x) __stringify(x) 558#define __MODULE_STRING(x) __stringify(x)
559 559
560/* Use symbol_get and symbol_put instead. You'll thank me. */
561#define HAVE_INTER_MODULE
562extern void __deprecated inter_module_register(const char *,
563 struct module *, const void *);
564extern void __deprecated inter_module_unregister(const char *);
565extern const void * __deprecated inter_module_get_request(const char *,
566 const char *);
567extern void __deprecated inter_module_put(const char *);
568
569#endif /* _LINUX_MODULE_H */ 560#endif /* _LINUX_MODULE_H */
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h
index d7eaa40e5ab0..6977780e548f 100644
--- a/include/linux/mtd/inftl.h
+++ b/include/linux/mtd/inftl.h
@@ -46,7 +46,7 @@ struct INFTLrecord {
46 unsigned int nb_blocks; /* number of physical blocks */ 46 unsigned int nb_blocks; /* number of physical blocks */
47 unsigned int nb_boot_blocks; /* number of blocks used by the bios */ 47 unsigned int nb_boot_blocks; /* number of blocks used by the bios */
48 struct erase_info instr; 48 struct erase_info instr;
49 struct nand_oobinfo oobinfo; 49 struct nand_ecclayout oobinfo;
50}; 50};
51 51
52int INFTL_mount(struct INFTLrecord *s); 52int INFTL_mount(struct INFTLrecord *s);
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index b6f2fdae65c6..e1d2a3d56546 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -56,18 +56,69 @@ struct mtd_erase_region_info {
56 u_int32_t numblocks; /* Number of blocks of erasesize in this region */ 56 u_int32_t numblocks; /* Number of blocks of erasesize in this region */
57}; 57};
58 58
59/*
60 * oob operation modes
61 *
62 * MTD_OOB_PLACE: oob data are placed at the given offset
63 * MTD_OOB_AUTO: oob data are automatically placed at the free areas
64 * which are defined by the ecclayout
65 * MTD_OOB_RAW: mode to read raw data+oob in one chunk. The oob data
66 * is inserted into the data. Thats a raw image of the
67 * flash contents.
68 */
69typedef enum {
70 MTD_OOB_PLACE,
71 MTD_OOB_AUTO,
72 MTD_OOB_RAW,
73} mtd_oob_mode_t;
74
75/**
76 * struct mtd_oob_ops - oob operation operands
77 * @mode: operation mode
78 *
79 * @len: number of bytes to write/read. When a data buffer is given
80 * (datbuf != NULL) this is the number of data bytes. When
81 + no data buffer is available this is the number of oob bytes.
82 *
83 * @retlen: number of bytes written/read. When a data buffer is given
84 * (datbuf != NULL) this is the number of data bytes. When
85 + no data buffer is available this is the number of oob bytes.
86 *
87 * @ooblen: number of oob bytes per page
88 * @ooboffs: offset of oob data in the oob area (only relevant when
89 * mode = MTD_OOB_PLACE)
90 * @datbuf: data buffer - if NULL only oob data are read/written
91 * @oobbuf: oob data buffer
92 */
93struct mtd_oob_ops {
94 mtd_oob_mode_t mode;
95 size_t len;
96 size_t retlen;
97 size_t ooblen;
98 uint32_t ooboffs;
99 uint8_t *datbuf;
100 uint8_t *oobbuf;
101};
102
59struct mtd_info { 103struct mtd_info {
60 u_char type; 104 u_char type;
61 u_int32_t flags; 105 u_int32_t flags;
62 u_int32_t size; // Total size of the MTD 106 u_int32_t size; // Total size of the MTD
63 107
64 /* "Major" erase size for the device. Naïve users may take this 108 /* "Major" erase size for the device. Naïve users may take this
65 * to be the only erase size available, or may use the more detailed 109 * to be the only erase size available, or may use the more detailed
66 * information below if they desire 110 * information below if they desire
67 */ 111 */
68 u_int32_t erasesize; 112 u_int32_t erasesize;
113 /* Minimal writable flash unit size. In case of NOR flash it is 1 (even
114 * though individual bits can be cleared), in case of NAND flash it is
115 * one NAND page (or half, or one-fourths of it), in case of ECC-ed NOR
116 * it is of ECC block size, etc. It is illegal to have writesize = 0.
117 * Any driver registering a struct mtd_info must ensure a writesize of
118 * 1 or larger.
119 */
120 u_int32_t writesize;
69 121
70 u_int32_t oobblock; // Size of OOB blocks (e.g. 512)
71 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) 122 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16)
72 u_int32_t ecctype; 123 u_int32_t ecctype;
73 u_int32_t eccsize; 124 u_int32_t eccsize;
@@ -79,7 +130,6 @@ struct mtd_info {
79 * MTD_PROGRAM_REGIONS flag is set. 130 * MTD_PROGRAM_REGIONS flag is set.
80 * (Maybe we should have an union for those?) 131 * (Maybe we should have an union for those?)
81 */ 132 */
82#define MTD_PROGREGION_SIZE(mtd) (mtd)->oobblock
83#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize 133#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize
84#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype 134#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype
85 135
@@ -87,9 +137,8 @@ struct mtd_info {
87 char *name; 137 char *name;
88 int index; 138 int index;
89 139
90 // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) 140 /* ecc layout structure pointer - read only ! */
91 struct nand_oobinfo oobinfo; 141 struct nand_ecclayout *ecclayout;
92 u_int32_t oobavail; // Number of bytes in OOB area available for fs
93 142
94 /* Data for variable erase regions. If numeraseregions is zero, 143 /* Data for variable erase regions. If numeraseregions is zero,
95 * it means that the whole device has erasesize as given above. 144 * it means that the whole device has erasesize as given above.
@@ -112,11 +161,10 @@ struct mtd_info {
112 int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 161 int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
113 int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); 162 int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
114 163
115 int (*read_ecc) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); 164 int (*read_oob) (struct mtd_info *mtd, loff_t from,
116 int (*write_ecc) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); 165 struct mtd_oob_ops *ops);
117 166 int (*write_oob) (struct mtd_info *mtd, loff_t to,
118 int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 167 struct mtd_oob_ops *ops);
119 int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
120 168
121 /* 169 /*
122 * Methods to access the protection register area, present in some 170 * Methods to access the protection register area, present in some
@@ -130,17 +178,11 @@ struct mtd_info {
130 int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 178 int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
131 int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len); 179 int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len);
132 180
133 /* kvec-based read/write methods. We need these especially for NAND flash, 181 /* kvec-based read/write methods.
134 with its limited number of write cycles per erase.
135 NB: The 'count' parameter is the number of _vectors_, each of 182 NB: The 'count' parameter is the number of _vectors_, each of
136 which contains an (ofs, len) tuple. 183 which contains an (ofs, len) tuple.
137 */ 184 */
138 int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen);
139 int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from,
140 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
141 int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); 185 int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen);
142 int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to,
143 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
144 186
145 /* Sync */ 187 /* Sync */
146 void (*sync) (struct mtd_info *mtd); 188 void (*sync) (struct mtd_info *mtd);
@@ -159,6 +201,9 @@ struct mtd_info {
159 201
160 struct notifier_block reboot_notifier; /* default mode before reboot */ 202 struct notifier_block reboot_notifier; /* default mode before reboot */
161 203
204 /* ECC status information */
205 struct mtd_ecc_stats ecc_stats;
206
162 void *priv; 207 void *priv;
163 208
164 struct module *owner; 209 struct module *owner;
@@ -192,20 +237,6 @@ int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
192int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, 237int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs,
193 unsigned long count, loff_t from, size_t *retlen); 238 unsigned long count, loff_t from, size_t *retlen);
194 239
195#define MTD_ERASE(mtd, args...) (*(mtd->erase))(mtd, args)
196#define MTD_POINT(mtd, a,b,c,d) (*(mtd->point))(mtd, a,b,c, (u_char **)(d))
197#define MTD_UNPOINT(mtd, arg) (*(mtd->unpoint))(mtd, (u_char *)arg)
198#define MTD_READ(mtd, args...) (*(mtd->read))(mtd, args)
199#define MTD_WRITE(mtd, args...) (*(mtd->write))(mtd, args)
200#define MTD_READV(mtd, args...) (*(mtd->readv))(mtd, args)
201#define MTD_WRITEV(mtd, args...) (*(mtd->writev))(mtd, args)
202#define MTD_READECC(mtd, args...) (*(mtd->read_ecc))(mtd, args)
203#define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args)
204#define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args)
205#define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args)
206#define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0)
207
208
209#ifdef CONFIG_MTD_PARTITIONS 240#ifdef CONFIG_MTD_PARTITIONS
210void mtd_erase_callback(struct erase_info *instr); 241void mtd_erase_callback(struct erase_info *instr);
211#else 242#else
@@ -226,7 +257,7 @@ static inline void mtd_erase_callback(struct erase_info *instr)
226 257
227#ifdef CONFIG_MTD_DEBUG 258#ifdef CONFIG_MTD_DEBUG
228#define DEBUG(n, args...) \ 259#define DEBUG(n, args...) \
229 do { \ 260 do { \
230 if (n <= CONFIG_MTD_DEBUG_VERBOSE) \ 261 if (n <= CONFIG_MTD_DEBUG_VERBOSE) \
231 printk(KERN_INFO args); \ 262 printk(KERN_INFO args); \
232 } while(0) 263 } while(0)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index da5e67b3fc70..a30969eb9afe 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -11,47 +11,11 @@
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 * 13 *
14 * Info: 14 * Info:
15 * Contains standard defines and IDs for NAND flash devices 15 * Contains standard defines and IDs for NAND flash devices
16 * 16 *
17 * Changelog: 17 * Changelog:
18 * 01-31-2000 DMW Created 18 * See git changelog.
19 * 09-18-2000 SJH Moved structure out of the Disk-On-Chip drivers
20 * so it can be used by other NAND flash device
21 * drivers. I also changed the copyright since none
22 * of the original contents of this file are specific
23 * to DoC devices. David can whack me with a baseball
24 * bat later if I did something naughty.
25 * 10-11-2000 SJH Added private NAND flash structure for driver
26 * 10-24-2000 SJH Added prototype for 'nand_scan' function
27 * 10-29-2001 TG changed nand_chip structure to support
28 * hardwarespecific function for accessing control lines
29 * 02-21-2002 TG added support for different read/write adress and
30 * ready/busy line access function
31 * 02-26-2002 TG added chip_delay to nand_chip structure to optimize
32 * command delay times for different chips
33 * 04-28-2002 TG OOB config defines moved from nand.c to avoid duplicate
34 * defines in jffs2/wbuf.c
35 * 08-07-2002 TG forced bad block location to byte 5 of OOB, even if
36 * CONFIG_MTD_NAND_ECC_JFFS2 is not set
37 * 08-10-2002 TG extensions to nand_chip structure to support HW-ECC
38 *
39 * 08-29-2002 tglx nand_chip structure: data_poi for selecting
40 * internal / fs-driver buffer
41 * support for 6byte/512byte hardware ECC
42 * read_ecc, write_ecc extended for different oob-layout
43 * oob layout selections: NAND_NONE_OOB, NAND_JFFS2_OOB,
44 * NAND_YAFFS_OOB
45 * 11-25-2002 tglx Added Manufacturer code FUJITSU, NATIONAL
46 * Split manufacturer and device ID structures
47 *
48 * 02-08-2004 tglx added option field to nand structure for chip anomalities
49 * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id
50 * update of nand_chip structure description
51 * 01-17-2005 dmarlin added extended commands for AG-AND device and added option
52 * for BBT_AUTO_REFRESH.
53 * 01-20-2005 dmarlin added optional pointer to hardware specific callback for
54 * extra error status checks.
55 */ 19 */
56#ifndef __LINUX_MTD_NAND_H 20#ifndef __LINUX_MTD_NAND_H
57#define __LINUX_MTD_NAND_H 21#define __LINUX_MTD_NAND_H
@@ -67,10 +31,6 @@ extern int nand_scan (struct mtd_info *mtd, int max_chips);
67/* Free resources held by the NAND device */ 31/* Free resources held by the NAND device */
68extern void nand_release (struct mtd_info *mtd); 32extern void nand_release (struct mtd_info *mtd);
69 33
70/* Read raw data from the device without ECC */
71extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_t len, size_t ooblen);
72
73
74/* The maximum number of NAND chips in an array */ 34/* The maximum number of NAND chips in an array */
75#define NAND_MAX_CHIPS 8 35#define NAND_MAX_CHIPS 8
76 36
@@ -79,44 +39,45 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
79 * adjust this accordingly. 39 * adjust this accordingly.
80 */ 40 */
81#define NAND_MAX_OOBSIZE 64 41#define NAND_MAX_OOBSIZE 64
42#define NAND_MAX_PAGESIZE 2048
82 43
83/* 44/*
84 * Constants for hardware specific CLE/ALE/NCE function 45 * Constants for hardware specific CLE/ALE/NCE function
85*/ 46 *
47 * These are bits which can be or'ed to set/clear multiple
48 * bits in one go.
49 */
86/* Select the chip by setting nCE to low */ 50/* Select the chip by setting nCE to low */
87#define NAND_CTL_SETNCE 1 51#define NAND_NCE 0x01
88/* Deselect the chip by setting nCE to high */
89#define NAND_CTL_CLRNCE 2
90/* Select the command latch by setting CLE to high */ 52/* Select the command latch by setting CLE to high */
91#define NAND_CTL_SETCLE 3 53#define NAND_CLE 0x02
92/* Deselect the command latch by setting CLE to low */
93#define NAND_CTL_CLRCLE 4
94/* Select the address latch by setting ALE to high */ 54/* Select the address latch by setting ALE to high */
95#define NAND_CTL_SETALE 5 55#define NAND_ALE 0x04
96/* Deselect the address latch by setting ALE to low */ 56
97#define NAND_CTL_CLRALE 6 57#define NAND_CTRL_CLE (NAND_NCE | NAND_CLE)
98/* Set write protection by setting WP to high. Not used! */ 58#define NAND_CTRL_ALE (NAND_NCE | NAND_ALE)
99#define NAND_CTL_SETWP 7 59#define NAND_CTRL_CHANGE 0x80
100/* Clear write protection by setting WP to low. Not used! */
101#define NAND_CTL_CLRWP 8
102 60
103/* 61/*
104 * Standard NAND flash commands 62 * Standard NAND flash commands
105 */ 63 */
106#define NAND_CMD_READ0 0 64#define NAND_CMD_READ0 0
107#define NAND_CMD_READ1 1 65#define NAND_CMD_READ1 1
66#define NAND_CMD_RNDOUT 5
108#define NAND_CMD_PAGEPROG 0x10 67#define NAND_CMD_PAGEPROG 0x10
109#define NAND_CMD_READOOB 0x50 68#define NAND_CMD_READOOB 0x50
110#define NAND_CMD_ERASE1 0x60 69#define NAND_CMD_ERASE1 0x60
111#define NAND_CMD_STATUS 0x70 70#define NAND_CMD_STATUS 0x70
112#define NAND_CMD_STATUS_MULTI 0x71 71#define NAND_CMD_STATUS_MULTI 0x71
113#define NAND_CMD_SEQIN 0x80 72#define NAND_CMD_SEQIN 0x80
73#define NAND_CMD_RNDIN 0x85
114#define NAND_CMD_READID 0x90 74#define NAND_CMD_READID 0x90
115#define NAND_CMD_ERASE2 0xd0 75#define NAND_CMD_ERASE2 0xd0
116#define NAND_CMD_RESET 0xff 76#define NAND_CMD_RESET 0xff
117 77
118/* Extended commands for large page devices */ 78/* Extended commands for large page devices */
119#define NAND_CMD_READSTART 0x30 79#define NAND_CMD_READSTART 0x30
80#define NAND_CMD_RNDOUTSTART 0xE0
120#define NAND_CMD_CACHEDPROG 0x15 81#define NAND_CMD_CACHEDPROG 0x15
121 82
122/* Extended commands for AG-AND device */ 83/* Extended commands for AG-AND device */
@@ -138,6 +99,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
138#define NAND_CMD_STATUS_RESET 0x7f 99#define NAND_CMD_STATUS_RESET 0x7f
139#define NAND_CMD_STATUS_CLEAR 0xff 100#define NAND_CMD_STATUS_CLEAR 0xff
140 101
102#define NAND_CMD_NONE -1
103
141/* Status bits */ 104/* Status bits */
142#define NAND_STATUS_FAIL 0x01 105#define NAND_STATUS_FAIL 0x01
143#define NAND_STATUS_FAIL_N1 0x02 106#define NAND_STATUS_FAIL_N1 0x02
@@ -148,21 +111,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
148/* 111/*
149 * Constants for ECC_MODES 112 * Constants for ECC_MODES
150 */ 113 */
151 114typedef enum {
152/* No ECC. Usage is not recommended ! */ 115 NAND_ECC_NONE,
153#define NAND_ECC_NONE 0 116 NAND_ECC_SOFT,
154/* Software ECC 3 byte ECC per 256 Byte data */ 117 NAND_ECC_HW,
155#define NAND_ECC_SOFT 1 118 NAND_ECC_HW_SYNDROME,
156/* Hardware ECC 3 byte ECC per 256 Byte data */ 119} nand_ecc_modes_t;
157#define NAND_ECC_HW3_256 2
158/* Hardware ECC 3 byte ECC per 512 Byte data */
159#define NAND_ECC_HW3_512 3
160/* Hardware ECC 3 byte ECC per 512 Byte data */
161#define NAND_ECC_HW6_512 4
162/* Hardware ECC 8 byte ECC per 512 Byte data */
163#define NAND_ECC_HW8_512 6
164/* Hardware ECC 12 byte ECC per 2048 Byte data */
165#define NAND_ECC_HW12_2048 7
166 120
167/* 121/*
168 * Constants for Hardware ECC 122 * Constants for Hardware ECC
@@ -201,6 +155,10 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
201 * bits from adjacent blocks from 'leaking' in altering data. 155 * bits from adjacent blocks from 'leaking' in altering data.
202 * This happens with the Renesas AG-AND chips, possibly others. */ 156 * This happens with the Renesas AG-AND chips, possibly others. */
203#define BBT_AUTO_REFRESH 0x00000080 157#define BBT_AUTO_REFRESH 0x00000080
158/* Chip does not require ready check on read. True
159 * for all large page devices, as they do not support
160 * autoincrement.*/
161#define NAND_NO_READRDY 0x00000100
204 162
205/* Options valid for Samsung large page devices */ 163/* Options valid for Samsung large page devices */
206#define NAND_SAMSUNG_LP_OPTIONS \ 164#define NAND_SAMSUNG_LP_OPTIONS \
@@ -219,18 +177,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
219/* Use a flash based bad block table. This option is passed to the 177/* Use a flash based bad block table. This option is passed to the
220 * default bad block table function. */ 178 * default bad block table function. */
221#define NAND_USE_FLASH_BBT 0x00010000 179#define NAND_USE_FLASH_BBT 0x00010000
222/* The hw ecc generator provides a syndrome instead a ecc value on read
223 * This can only work if we have the ecc bytes directly behind the
224 * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */
225#define NAND_HWECC_SYNDROME 0x00020000
226/* This option skips the bbt scan during initialization. */ 180/* This option skips the bbt scan during initialization. */
227#define NAND_SKIP_BBTSCAN 0x00040000 181#define NAND_SKIP_BBTSCAN 0x00020000
228 182
229/* Options set by nand scan */ 183/* Options set by nand scan */
230/* Nand scan has allocated oob_buf */ 184/* Nand scan has allocated controller struct */
231#define NAND_OOBBUF_ALLOC 0x40000000 185#define NAND_CONTROLLER_ALLOC 0x80000000
232/* Nand scan has allocated data_buf */
233#define NAND_DATABUF_ALLOC 0x80000000
234 186
235 187
236/* 188/*
@@ -264,45 +216,102 @@ struct nand_hw_control {
264}; 216};
265 217
266/** 218/**
219 * struct nand_ecc_ctrl - Control structure for ecc
220 * @mode: ecc mode
221 * @steps: number of ecc steps per page
222 * @size: data bytes per ecc step
223 * @bytes: ecc bytes per step
224 * @total: total number of ecc bytes per page
225 * @prepad: padding information for syndrome based ecc generators
226 * @postpad: padding information for syndrome based ecc generators
227 * @hwctl: function to control hardware ecc generator. Must only
228 * be provided if an hardware ECC is available
229 * @calculate: function for ecc calculation or readback from ecc hardware
230 * @correct: function for ecc correction, matching to ecc generator (sw/hw)
231 * @read_page: function to read a page according to the ecc generator requirements
232 * @write_page: function to write a page according to the ecc generator requirements
233 */
234struct nand_ecc_ctrl {
235 nand_ecc_modes_t mode;
236 int steps;
237 int size;
238 int bytes;
239 int total;
240 int prepad;
241 int postpad;
242 struct nand_ecclayout *layout;
243 void (*hwctl)(struct mtd_info *mtd, int mode);
244 int (*calculate)(struct mtd_info *mtd,
245 const uint8_t *dat,
246 uint8_t *ecc_code);
247 int (*correct)(struct mtd_info *mtd, uint8_t *dat,
248 uint8_t *read_ecc,
249 uint8_t *calc_ecc);
250 int (*read_page)(struct mtd_info *mtd,
251 struct nand_chip *chip,
252 uint8_t *buf);
253 void (*write_page)(struct mtd_info *mtd,
254 struct nand_chip *chip,
255 const uint8_t *buf);
256 int (*read_oob)(struct mtd_info *mtd,
257 struct nand_chip *chip,
258 int page,
259 int sndcmd);
260 int (*write_oob)(struct mtd_info *mtd,
261 struct nand_chip *chip,
262 int page);
263};
264
265/**
266 * struct nand_buffers - buffer structure for read/write
267 * @ecccalc: buffer for calculated ecc
268 * @ecccode: buffer for ecc read from flash
269 * @oobwbuf: buffer for write oob data
270 * @databuf: buffer for data - dynamically sized
271 * @oobrbuf: buffer to read oob data
272 *
273 * Do not change the order of buffers. databuf and oobrbuf must be in
274 * consecutive order.
275 */
276struct nand_buffers {
277 uint8_t ecccalc[NAND_MAX_OOBSIZE];
278 uint8_t ecccode[NAND_MAX_OOBSIZE];
279 uint8_t oobwbuf[NAND_MAX_OOBSIZE];
280 uint8_t databuf[NAND_MAX_PAGESIZE];
281 uint8_t oobrbuf[NAND_MAX_OOBSIZE];
282};
283
284/**
267 * struct nand_chip - NAND Private Flash Chip Data 285 * struct nand_chip - NAND Private Flash Chip Data
268 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device 286 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device
269 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device 287 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device
270 * @read_byte: [REPLACEABLE] read one byte from the chip 288 * @read_byte: [REPLACEABLE] read one byte from the chip
271 * @write_byte: [REPLACEABLE] write one byte to the chip
272 * @read_word: [REPLACEABLE] read one word from the chip 289 * @read_word: [REPLACEABLE] read one word from the chip
273 * @write_word: [REPLACEABLE] write one word to the chip
274 * @write_buf: [REPLACEABLE] write data from the buffer to the chip 290 * @write_buf: [REPLACEABLE] write data from the buffer to the chip
275 * @read_buf: [REPLACEABLE] read data from the chip into the buffer 291 * @read_buf: [REPLACEABLE] read data from the chip into the buffer
276 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data 292 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data
277 * @select_chip: [REPLACEABLE] select chip nr 293 * @select_chip: [REPLACEABLE] select chip nr
278 * @block_bad: [REPLACEABLE] check, if the block is bad 294 * @block_bad: [REPLACEABLE] check, if the block is bad
279 * @block_markbad: [REPLACEABLE] mark the block bad 295 * @block_markbad: [REPLACEABLE] mark the block bad
280 * @hwcontrol: [BOARDSPECIFIC] hardwarespecific function for accesing control-lines 296 * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling
297 * ALE/CLE/nCE. Also used to write command and address
281 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line 298 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line
282 * If set to NULL no access to ready/busy is available and the ready/busy information 299 * If set to NULL no access to ready/busy is available and the ready/busy information
283 * is read from the chip status register 300 * is read from the chip status register
284 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip 301 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip
285 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready 302 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready
286 * @calculate_ecc: [REPLACEABLE] function for ecc calculation or readback from ecc hardware 303 * @ecc: [BOARDSPECIFIC] ecc control ctructure
287 * @correct_data: [REPLACEABLE] function for ecc correction, matching to ecc generator (sw/hw)
288 * @enable_hwecc: [BOARDSPECIFIC] function to enable (reset) hardware ecc generator. Must only
289 * be provided if a hardware ECC is available
290 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support 304 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support
291 * @scan_bbt: [REPLACEABLE] function to scan bad block table 305 * @scan_bbt: [REPLACEABLE] function to scan bad block table
292 * @eccmode: [BOARDSPECIFIC] mode of ecc, see defines
293 * @eccsize: [INTERN] databytes used per ecc-calculation
294 * @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step
295 * @eccsteps: [INTERN] number of ecc calculation steps per page
296 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) 306 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR)
297 * @chip_lock: [INTERN] spinlock used to protect access to this structure and the chip
298 * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress 307 * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress
299 * @state: [INTERN] the current state of the NAND device 308 * @state: [INTERN] the current state of the NAND device
300 * @page_shift: [INTERN] number of address bits in a page (column address bits) 309 * @page_shift: [INTERN] number of address bits in a page (column address bits)
301 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock 310 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock
302 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry 311 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry
303 * @chip_shift: [INTERN] number of address bits in one chip 312 * @chip_shift: [INTERN] number of address bits in one chip
304 * @data_buf: [INTERN] internal buffer for one page + oob 313 * @datbuf: [INTERN] internal buffer for one page + oob
305 * @oob_buf: [INTERN] oob buffer for one eraseblock 314 * @oobbuf: [INTERN] oob buffer for one eraseblock
306 * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized 315 * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized
307 * @data_poi: [INTERN] pointer to a data buffer 316 * @data_poi: [INTERN] pointer to a data buffer
308 * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about 317 * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about
@@ -312,12 +321,13 @@ struct nand_hw_control {
312 * @chipsize: [INTERN] the size of one chip for multichip arrays 321 * @chipsize: [INTERN] the size of one chip for multichip arrays
313 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 322 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
314 * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf 323 * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf
315 * @autooob: [REPLACEABLE] the default (auto)placement scheme 324 * @ecclayout: [REPLACEABLE] the default ecc placement scheme
316 * @bbt: [INTERN] bad block table pointer 325 * @bbt: [INTERN] bad block table pointer
317 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup 326 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup
318 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor 327 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor
319 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan 328 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan
320 * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices 329 * @controller: [REPLACEABLE] a pointer to a hardware controller structure
330 * which is shared among multiple independend devices
321 * @priv: [OPTIONAL] pointer to private chip date 331 * @priv: [OPTIONAL] pointer to private chip date
322 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks 332 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
323 * (determine if errors are correctable) 333 * (determine if errors are correctable)
@@ -325,58 +335,57 @@ struct nand_hw_control {
325 335
326struct nand_chip { 336struct nand_chip {
327 void __iomem *IO_ADDR_R; 337 void __iomem *IO_ADDR_R;
328 void __iomem *IO_ADDR_W; 338 void __iomem *IO_ADDR_W;
329 339
330 u_char (*read_byte)(struct mtd_info *mtd); 340 uint8_t (*read_byte)(struct mtd_info *mtd);
331 void (*write_byte)(struct mtd_info *mtd, u_char byte);
332 u16 (*read_word)(struct mtd_info *mtd); 341 u16 (*read_word)(struct mtd_info *mtd);
333 void (*write_word)(struct mtd_info *mtd, u16 word); 342 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
334 343 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
335 void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len); 344 int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
336 void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len);
337 int (*verify_buf)(struct mtd_info *mtd, const u_char *buf, int len);
338 void (*select_chip)(struct mtd_info *mtd, int chip); 345 void (*select_chip)(struct mtd_info *mtd, int chip);
339 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); 346 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
340 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); 347 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
341 void (*hwcontrol)(struct mtd_info *mtd, int cmd); 348 void (*cmd_ctrl)(struct mtd_info *mtd, int dat,
342 int (*dev_ready)(struct mtd_info *mtd); 349 unsigned int ctrl);
343 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); 350 int (*dev_ready)(struct mtd_info *mtd);
344 int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this, int state); 351 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr);
345 int (*calculate_ecc)(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); 352 int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
346 int (*correct_data)(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc);
347 void (*enable_hwecc)(struct mtd_info *mtd, int mode);
348 void (*erase_cmd)(struct mtd_info *mtd, int page); 353 void (*erase_cmd)(struct mtd_info *mtd, int page);
349 int (*scan_bbt)(struct mtd_info *mtd); 354 int (*scan_bbt)(struct mtd_info *mtd);
350 int eccmode; 355 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
351 int eccsize; 356
352 int eccbytes; 357 int chip_delay;
353 int eccsteps; 358 unsigned int options;
354 int chip_delay; 359
355 spinlock_t chip_lock; 360 int page_shift;
356 wait_queue_head_t wq;
357 nand_state_t state;
358 int page_shift;
359 int phys_erase_shift; 361 int phys_erase_shift;
360 int bbt_erase_shift; 362 int bbt_erase_shift;
361 int chip_shift; 363 int chip_shift;
362 u_char *data_buf;
363 u_char *oob_buf;
364 int oobdirty;
365 u_char *data_poi;
366 unsigned int options;
367 int badblockpos;
368 int numchips; 364 int numchips;
369 unsigned long chipsize; 365 unsigned long chipsize;
370 int pagemask; 366 int pagemask;
371 int pagebuf; 367 int pagebuf;
372 struct nand_oobinfo *autooob; 368 int badblockpos;
369
370 nand_state_t state;
371
372 uint8_t *oob_poi;
373 struct nand_hw_control *controller;
374 struct nand_ecclayout *ecclayout;
375
376 struct nand_ecc_ctrl ecc;
377 struct nand_buffers buffers;
378 struct nand_hw_control hwcontrol;
379
380 struct mtd_oob_ops ops;
381
373 uint8_t *bbt; 382 uint8_t *bbt;
374 struct nand_bbt_descr *bbt_td; 383 struct nand_bbt_descr *bbt_td;
375 struct nand_bbt_descr *bbt_md; 384 struct nand_bbt_descr *bbt_md;
385
376 struct nand_bbt_descr *badblock_pattern; 386 struct nand_bbt_descr *badblock_pattern;
377 struct nand_hw_control *controller; 387
378 void *priv; 388 void *priv;
379 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
380}; 389};
381 390
382/* 391/*
@@ -388,19 +397,19 @@ struct nand_chip {
388#define NAND_MFR_NATIONAL 0x8f 397#define NAND_MFR_NATIONAL 0x8f
389#define NAND_MFR_RENESAS 0x07 398#define NAND_MFR_RENESAS 0x07
390#define NAND_MFR_STMICRO 0x20 399#define NAND_MFR_STMICRO 0x20
391#define NAND_MFR_HYNIX 0xad 400#define NAND_MFR_HYNIX 0xad
392 401
393/** 402/**
394 * struct nand_flash_dev - NAND Flash Device ID Structure 403 * struct nand_flash_dev - NAND Flash Device ID Structure
395 * 404 *
396 * @name: Identify the device type 405 * @name: Identify the device type
397 * @id: device ID code 406 * @id: device ID code
398 * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 407 * @pagesize: Pagesize in bytes. Either 256 or 512 or 0
399 * If the pagesize is 0, then the real pagesize 408 * If the pagesize is 0, then the real pagesize
400 * and the eraseize are determined from the 409 * and the eraseize are determined from the
401 * extended id bytes in the chip 410 * extended id bytes in the chip
402 * @erasesize: Size of an erase block in the flash device. 411 * @erasesize: Size of an erase block in the flash device.
403 * @chipsize: Total chipsize in Mega Bytes 412 * @chipsize: Total chipsize in Mega Bytes
404 * @options: Bitfield to store chip relevant options 413 * @options: Bitfield to store chip relevant options
405 */ 414 */
406struct nand_flash_dev { 415struct nand_flash_dev {
@@ -415,7 +424,7 @@ struct nand_flash_dev {
415/** 424/**
416 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure 425 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure
417 * @name: Manufacturer name 426 * @name: Manufacturer name
418 * @id: manufacturer ID code of device. 427 * @id: manufacturer ID code of device.
419*/ 428*/
420struct nand_manufacturers { 429struct nand_manufacturers {
421 int id; 430 int id;
@@ -455,7 +464,7 @@ struct nand_bbt_descr {
455 int veroffs; 464 int veroffs;
456 uint8_t version[NAND_MAX_CHIPS]; 465 uint8_t version[NAND_MAX_CHIPS];
457 int len; 466 int len;
458 int maxblocks; 467 int maxblocks;
459 int reserved_block_code; 468 int reserved_block_code;
460 uint8_t *pattern; 469 uint8_t *pattern;
461}; 470};
@@ -494,14 +503,14 @@ struct nand_bbt_descr {
494/* The maximum number of blocks to scan for a bbt */ 503/* The maximum number of blocks to scan for a bbt */
495#define NAND_BBT_SCAN_MAXBLOCKS 4 504#define NAND_BBT_SCAN_MAXBLOCKS 4
496 505
497extern int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd); 506extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
498extern int nand_update_bbt (struct mtd_info *mtd, loff_t offs); 507extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs);
499extern int nand_default_bbt (struct mtd_info *mtd); 508extern int nand_default_bbt(struct mtd_info *mtd);
500extern int nand_isbad_bbt (struct mtd_info *mtd, loff_t offs, int allowbbt); 509extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt);
501extern int nand_erase_nand (struct mtd_info *mtd, struct erase_info *instr, int allowbbt); 510extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
502extern int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, 511 int allowbbt);
503 size_t * retlen, u_char * buf, u_char * oob_buf, 512extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
504 struct nand_oobinfo *oobsel, int flags); 513 size_t * retlen, uint8_t * buf);
505 514
506/* 515/*
507* Constants for oob configuration 516* Constants for oob configuration
@@ -509,4 +518,53 @@ extern int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
509#define NAND_SMALL_BADBLOCK_POS 5 518#define NAND_SMALL_BADBLOCK_POS 5
510#define NAND_LARGE_BADBLOCK_POS 0 519#define NAND_LARGE_BADBLOCK_POS 0
511 520
521/**
522 * struct platform_nand_chip - chip level device structure
523 *
524 * @nr_chips: max. number of chips to scan for
525 * @chip_offs: chip number offset
526 * @nr_partitions: number of partitions pointed to by partitions (or zero)
527 * @partitions: mtd partition list
528 * @chip_delay: R/B delay value in us
529 * @options: Option flags, e.g. 16bit buswidth
530 * @ecclayout: ecc layout info structure
531 * @priv: hardware controller specific settings
532 */
533struct platform_nand_chip {
534 int nr_chips;
535 int chip_offset;
536 int nr_partitions;
537 struct mtd_partition *partitions;
538 struct nand_ecclayout *ecclayout;
539 int chip_delay;
540 unsigned int options;
541 void *priv;
542};
543
544/**
545 * struct platform_nand_ctrl - controller level device structure
546 *
547 * @hwcontrol: platform specific hardware control structure
548 * @dev_ready: platform specific function to read ready/busy pin
549 * @select_chip: platform specific chip select function
550 * @priv_data: private data to transport driver specific settings
551 *
552 * All fields are optional and depend on the hardware driver requirements
553 */
554struct platform_nand_ctrl {
555 void (*hwcontrol)(struct mtd_info *mtd, int cmd);
556 int (*dev_ready)(struct mtd_info *mtd);
557 void (*select_chip)(struct mtd_info *mtd, int chip);
558 void *priv;
559};
560
561/* Some helpers to access the data structures */
562static inline
563struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd)
564{
565 struct nand_chip *chip = mtd->priv;
566
567 return chip->priv;
568}
569
512#endif /* __LINUX_MTD_NAND_H */ 570#endif /* __LINUX_MTD_NAND_H */
diff --git a/include/linux/mtd/ndfc.h b/include/linux/mtd/ndfc.h
new file mode 100644
index 000000000000..d0558a982628
--- /dev/null
+++ b/include/linux/mtd/ndfc.h
@@ -0,0 +1,67 @@
1/*
2 * linux/include/linux/mtd/ndfc.h
3 *
4 * Copyright (c) 2006 Thomas Gleixner <tglx@linutronix.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Info:
11 * Contains defines, datastructures for ndfc nand controller
12 *
13 */
14#ifndef __LINUX_MTD_NDFC_H
15#define __LINUX_MTD_NDFC_H
16
17/* NDFC Register definitions */
18#define NDFC_CMD 0x00
19#define NDFC_ALE 0x04
20#define NDFC_DATA 0x08
21#define NDFC_ECC 0x10
22#define NDFC_BCFG0 0x30
23#define NDFC_BCFG1 0x34
24#define NDFC_BCFG2 0x38
25#define NDFC_BCFG3 0x3c
26#define NDFC_CCR 0x40
27#define NDFC_STAT 0x44
28#define NDFC_HWCTL 0x48
29#define NDFC_REVID 0x50
30
31#define NDFC_STAT_IS_READY 0x01000000
32
33#define NDFC_CCR_RESET_CE 0x80000000 /* CE Reset */
34#define NDFC_CCR_RESET_ECC 0x40000000 /* ECC Reset */
35#define NDFC_CCR_RIE 0x20000000 /* Interrupt Enable on Device Rdy */
36#define NDFC_CCR_REN 0x10000000 /* Enable wait for Rdy in LinearR */
37#define NDFC_CCR_ROMEN 0x08000000 /* Enable ROM In LinearR */
38#define NDFC_CCR_ARE 0x04000000 /* Auto-Read Enable */
39#define NDFC_CCR_BS(x) (((x) & 0x3) << 24) /* Select Bank on CE[x] */
40#define NDFC_CCR_BS_MASK 0x03000000 /* Select Bank */
41#define NDFC_CCR_ARAC0 0x00000000 /* 3 Addr, 1 Col 2 Row 512b page */
42#define NDFC_CCR_ARAC1 0x00001000 /* 4 Addr, 1 Col 3 Row 512b page */
43#define NDFC_CCR_ARAC2 0x00002000 /* 4 Addr, 2 Col 2 Row 2K page */
44#define NDFC_CCR_ARAC3 0x00003000 /* 5 Addr, 2 Col 3 Row 2K page */
45#define NDFC_CCR_ARAC_MASK 0x00003000 /* Auto-Read mode Addr Cycles */
46#define NDFC_CCR_RPG 0x0000C000 /* Auto-Read Page */
47#define NDFC_CCR_EBCC 0x00000004 /* EBC Configuration Completed */
48#define NDFC_CCR_DHC 0x00000002 /* Direct Hardware Control Enable */
49
50#define NDFC_BxCFG_EN 0x80000000 /* Bank Enable */
51#define NDFC_BxCFG_CED 0x40000000 /* nCE Style */
52#define NDFC_BxCFG_SZ_MASK 0x08000000 /* Bank Size */
53#define NDFC_BxCFG_SZ_8BIT 0x00000000 /* 8bit */
54#define NDFC_BxCFG_SZ_16BIT 0x08000000 /* 16bit */
55
56#define NDFC_MAX_BANKS 4
57
58struct ndfc_controller_settings {
59 uint32_t ccr_settings;
60 uint64_t ndfc_erpn;
61};
62
63struct ndfc_chip_settings {
64 uint32_t bank_settings;
65};
66
67#endif
diff --git a/include/linux/mtd/nftl.h b/include/linux/mtd/nftl.h
index d35d2c21ff3e..bcf2fb3fa4a7 100644
--- a/include/linux/mtd/nftl.h
+++ b/include/linux/mtd/nftl.h
@@ -37,7 +37,7 @@ struct NFTLrecord {
37 unsigned int nb_blocks; /* number of physical blocks */ 37 unsigned int nb_blocks; /* number of physical blocks */
38 unsigned int nb_boot_blocks; /* number of blocks used by the bios */ 38 unsigned int nb_boot_blocks; /* number of blocks used by the bios */
39 struct erase_info instr; 39 struct erase_info instr;
40 struct nand_oobinfo oobinfo; 40 struct nand_ecclayout oobinfo;
41}; 41};
42 42
43int NFTL_mount(struct NFTLrecord *s); 43int NFTL_mount(struct NFTLrecord *s);
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 7419b5fab133..9ce9a48db444 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -35,6 +35,8 @@ typedef enum {
35 FL_SYNCING, 35 FL_SYNCING,
36 FL_UNLOCKING, 36 FL_UNLOCKING,
37 FL_LOCKING, 37 FL_LOCKING,
38 FL_RESETING,
39 FL_OTPING,
38 FL_PM_SUSPENDED, 40 FL_PM_SUSPENDED,
39} onenand_state_t; 41} onenand_state_t;
40 42
@@ -75,7 +77,7 @@ struct onenand_bufferram {
75 * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip 77 * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip
76 * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress 78 * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress
77 * @param state [INTERN] the current state of the OneNAND device 79 * @param state [INTERN] the current state of the OneNAND device
78 * @param autooob [REPLACEABLE] the default (auto)placement scheme 80 * @param ecclayout [REPLACEABLE] the default ecc placement scheme
79 * @param bbm [REPLACEABLE] pointer to Bad Block Management 81 * @param bbm [REPLACEABLE] pointer to Bad Block Management
80 * @param priv [OPTIONAL] pointer to private chip date 82 * @param priv [OPTIONAL] pointer to private chip date
81 */ 83 */
@@ -111,9 +113,9 @@ struct onenand_chip {
111 onenand_state_t state; 113 onenand_state_t state;
112 unsigned char *page_buf; 114 unsigned char *page_buf;
113 115
114 struct nand_oobinfo *autooob; 116 struct nand_ecclayout *ecclayout;
115 117
116 void *bbm; 118 void *bbm;
117 119
118 void *priv; 120 void *priv;
119}; 121};
@@ -130,6 +132,9 @@ struct onenand_chip {
130#define ONENAND_SET_SYS_CFG1(v, this) \ 132#define ONENAND_SET_SYS_CFG1(v, this) \
131 (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1)) 133 (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1))
132 134
135/* Check byte access in OneNAND */
136#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
137
133/* 138/*
134 * Options bits 139 * Options bits
135 */ 140 */
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index d7832ef8ed63..4a72818d2545 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -112,6 +112,7 @@
112#define ONENAND_CMD_LOCK_TIGHT (0x2C) 112#define ONENAND_CMD_LOCK_TIGHT (0x2C)
113#define ONENAND_CMD_ERASE (0x94) 113#define ONENAND_CMD_ERASE (0x94)
114#define ONENAND_CMD_RESET (0xF0) 114#define ONENAND_CMD_RESET (0xF0)
115#define ONENAND_CMD_OTP_ACCESS (0x65)
115#define ONENAND_CMD_READID (0x90) 116#define ONENAND_CMD_READID (0x90)
116 117
117/* NOTE: Those are not *REAL* commands */ 118/* NOTE: Those are not *REAL* commands */
@@ -152,6 +153,8 @@
152#define ONENAND_CTRL_ERASE (1 << 11) 153#define ONENAND_CTRL_ERASE (1 << 11)
153#define ONENAND_CTRL_ERROR (1 << 10) 154#define ONENAND_CTRL_ERROR (1 << 10)
154#define ONENAND_CTRL_RSTB (1 << 7) 155#define ONENAND_CTRL_RSTB (1 << 7)
156#define ONENAND_CTRL_OTP_L (1 << 6)
157#define ONENAND_CTRL_OTP_BL (1 << 5)
155 158
156/* 159/*
157 * Interrupt Status Register F241h (R) 160 * Interrupt Status Register F241h (R)
@@ -177,4 +180,9 @@
177#define ONENAND_ECC_2BIT (1 << 1) 180#define ONENAND_ECC_2BIT (1 << 1)
178#define ONENAND_ECC_2BIT_ALL (0xAAAA) 181#define ONENAND_ECC_2BIT_ALL (0xAAAA)
179 182
183/*
184 * One-Time Programmable (OTP)
185 */
186#define ONENAND_OTP_LOCK_OFFSET (14)
187
180#endif /* __ONENAND_REG_H */ 188#endif /* __ONENAND_REG_H */
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index b03f512d51b9..da6b3d6f12a7 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -41,7 +41,7 @@ struct mtd_partition {
41 u_int32_t size; /* partition size */ 41 u_int32_t size; /* partition size */
42 u_int32_t offset; /* offset within the master MTD space */ 42 u_int32_t offset; /* offset within the master MTD space */
43 u_int32_t mask_flags; /* master MTD flags to mask out for this partition */ 43 u_int32_t mask_flags; /* master MTD flags to mask out for this partition */
44 struct nand_oobinfo *oobsel; /* out of band layout for this partition (NAND only)*/ 44 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/
45 struct mtd_info **mtdp; /* pointer to store the MTD object */ 45 struct mtd_info **mtdp; /* pointer to store the MTD object */
46}; 46};
47 47
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index c7b8bcdef013..86831e3594f6 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -15,33 +15,26 @@
15 */ 15 */
16 16
17#ifndef __LINUX_MTD_PHYSMAP__ 17#ifndef __LINUX_MTD_PHYSMAP__
18 18#define __LINUX_MTD_PHYSMAP__
19#include <linux/config.h>
20
21#if defined(CONFIG_MTD_PHYSMAP)
22 19
23#include <linux/mtd/mtd.h> 20#include <linux/mtd/mtd.h>
24#include <linux/mtd/map.h> 21#include <linux/mtd/map.h>
25#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
26 23
27/* 24struct physmap_flash_data {
28 * The map_info for physmap. Board can override size, buswidth, phys, 25 unsigned int width;
29 * (*set_vpp)(), etc in their initial setup routine. 26 void (*set_vpp)(struct map_info *, int);
30 */ 27 unsigned int nr_parts;
31extern struct map_info physmap_map; 28 struct mtd_partition *parts;
29};
32 30
33/* 31/*
34 * Board needs to specify the exact mapping during their setup time. 32 * Board needs to specify the exact mapping during their setup time.
35 */ 33 */
36static inline void physmap_configure(unsigned long addr, unsigned long size, int bankwidth, void (*set_vpp)(struct map_info *, int) ) 34void physmap_configure(unsigned long addr, unsigned long size,
37{ 35 int bankwidth, void (*set_vpp)(struct map_info *, int) );
38 physmap_map.phys = addr;
39 physmap_map.size = size;
40 physmap_map.bankwidth = bankwidth;
41 physmap_map.set_vpp = set_vpp;
42}
43 36
44#if defined(CONFIG_MTD_PARTITIONS) 37#ifdef CONFIG_MTD_PARTITIONS
45 38
46/* 39/*
47 * Machines that wish to do flash partition may want to call this function in 40 * Machines that wish to do flash partition may want to call this function in
@@ -55,7 +48,5 @@ static inline void physmap_configure(unsigned long addr, unsigned long size, int
55void physmap_set_partitions(struct mtd_partition *parts, int num_parts); 48void physmap_set_partitions(struct mtd_partition *parts, int num_parts);
56 49
57#endif /* defined(CONFIG_MTD_PARTITIONS) */ 50#endif /* defined(CONFIG_MTD_PARTITIONS) */
58#endif /* defined(CONFIG_MTD) */
59 51
60#endif /* __LINUX_MTD_PHYSMAP__ */ 52#endif /* __LINUX_MTD_PHYSMAP__ */
61
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 40ccf8cc4239..e432b743dda2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -37,6 +37,7 @@
37#include <linux/config.h> 37#include <linux/config.h>
38#include <linux/device.h> 38#include <linux/device.h>
39#include <linux/percpu.h> 39#include <linux/percpu.h>
40#include <linux/dmaengine.h>
40 41
41struct divert_blk; 42struct divert_blk;
42struct vlan_group; 43struct vlan_group;
@@ -311,6 +312,9 @@ struct net_device
311#define NETIF_F_LLTX 4096 /* LockLess TX */ 312#define NETIF_F_LLTX 4096 /* LockLess TX */
312#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ 313#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/
313 314
315#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
316#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
317
314 struct net_device *next_sched; 318 struct net_device *next_sched;
315 319
316 /* Interface index. Unique device identifier */ 320 /* Interface index. Unique device identifier */
@@ -406,7 +410,7 @@ struct net_device
406 * One part is mostly used on xmit path (device) 410 * One part is mostly used on xmit path (device)
407 */ 411 */
408 /* hard_start_xmit synchronizer */ 412 /* hard_start_xmit synchronizer */
409 spinlock_t xmit_lock ____cacheline_aligned_in_smp; 413 spinlock_t _xmit_lock ____cacheline_aligned_in_smp;
410 /* cpu id of processor entered to hard_start_xmit or -1, 414 /* cpu id of processor entered to hard_start_xmit or -1,
411 if nobody entered there. 415 if nobody entered there.
412 */ 416 */
@@ -433,8 +437,7 @@ struct net_device
433 437
434 /* register/unregister state machine */ 438 /* register/unregister state machine */
435 enum { NETREG_UNINITIALIZED=0, 439 enum { NETREG_UNINITIALIZED=0,
436 NETREG_REGISTERING, /* called register_netdevice */ 440 NETREG_REGISTERED, /* completed register_netdevice */
437 NETREG_REGISTERED, /* completed register todo */
438 NETREG_UNREGISTERING, /* called unregister_netdevice */ 441 NETREG_UNREGISTERING, /* called unregister_netdevice */
439 NETREG_UNREGISTERED, /* completed unregister todo */ 442 NETREG_UNREGISTERED, /* completed unregister todo */
440 NETREG_RELEASED, /* called free_netdev */ 443 NETREG_RELEASED, /* called free_netdev */
@@ -506,6 +509,8 @@ struct net_device
506 509
507 /* class/net/name entry */ 510 /* class/net/name entry */
508 struct class_device class_dev; 511 struct class_device class_dev;
512 /* space for optional statistics and wireless sysfs groups */
513 struct attribute_group *sysfs_groups[3];
509}; 514};
510 515
511#define NETDEV_ALIGN 32 516#define NETDEV_ALIGN 32
@@ -592,6 +597,9 @@ struct softnet_data
592 struct sk_buff *completion_queue; 597 struct sk_buff *completion_queue;
593 598
594 struct net_device backlog_dev; /* Sorry. 8) */ 599 struct net_device backlog_dev; /* Sorry. 8) */
600#ifdef CONFIG_NET_DMA
601 struct dma_chan *net_dma;
602#endif
595}; 603};
596 604
597DECLARE_PER_CPU(struct softnet_data,softnet_data); 605DECLARE_PER_CPU(struct softnet_data,softnet_data);
@@ -888,11 +896,43 @@ static inline void __netif_rx_complete(struct net_device *dev)
888 clear_bit(__LINK_STATE_RX_SCHED, &dev->state); 896 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
889} 897}
890 898
899static inline void netif_tx_lock(struct net_device *dev)
900{
901 spin_lock(&dev->_xmit_lock);
902 dev->xmit_lock_owner = smp_processor_id();
903}
904
905static inline void netif_tx_lock_bh(struct net_device *dev)
906{
907 spin_lock_bh(&dev->_xmit_lock);
908 dev->xmit_lock_owner = smp_processor_id();
909}
910
911static inline int netif_tx_trylock(struct net_device *dev)
912{
913 int err = spin_trylock(&dev->_xmit_lock);
914 if (!err)
915 dev->xmit_lock_owner = smp_processor_id();
916 return err;
917}
918
919static inline void netif_tx_unlock(struct net_device *dev)
920{
921 dev->xmit_lock_owner = -1;
922 spin_unlock(&dev->_xmit_lock);
923}
924
925static inline void netif_tx_unlock_bh(struct net_device *dev)
926{
927 dev->xmit_lock_owner = -1;
928 spin_unlock_bh(&dev->_xmit_lock);
929}
930
891static inline void netif_tx_disable(struct net_device *dev) 931static inline void netif_tx_disable(struct net_device *dev)
892{ 932{
893 spin_lock_bh(&dev->xmit_lock); 933 netif_tx_lock_bh(dev);
894 netif_stop_queue(dev); 934 netif_stop_queue(dev);
895 spin_unlock_bh(&dev->xmit_lock); 935 netif_tx_unlock_bh(dev);
896} 936}
897 937
898/* These functions live elsewhere (drivers/net/net_init.c, but related) */ 938/* These functions live elsewhere (drivers/net/net_init.c, but related) */
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index 3ff88c878308..d2e4bd7a7a14 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -69,6 +69,10 @@ enum ip_conntrack_status {
69 /* Connection is dying (removed from lists), can not be unset. */ 69 /* Connection is dying (removed from lists), can not be unset. */
70 IPS_DYING_BIT = 9, 70 IPS_DYING_BIT = 9,
71 IPS_DYING = (1 << IPS_DYING_BIT), 71 IPS_DYING = (1 << IPS_DYING_BIT),
72
73 /* Connection has fixed timeout. */
74 IPS_FIXED_TIMEOUT_BIT = 10,
75 IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
72}; 76};
73 77
74/* Connection tracking event bits */ 78/* Connection tracking event bits */
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index 668ec946c8e2..b5883ccee295 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -27,13 +27,15 @@ enum ctattr_type {
27 CTA_STATUS, 27 CTA_STATUS,
28 CTA_PROTOINFO, 28 CTA_PROTOINFO,
29 CTA_HELP, 29 CTA_HELP,
30 CTA_NAT, 30 CTA_NAT_SRC,
31#define CTA_NAT CTA_NAT_SRC /* backwards compatibility */
31 CTA_TIMEOUT, 32 CTA_TIMEOUT,
32 CTA_MARK, 33 CTA_MARK,
33 CTA_COUNTERS_ORIG, 34 CTA_COUNTERS_ORIG,
34 CTA_COUNTERS_REPLY, 35 CTA_COUNTERS_REPLY,
35 CTA_USE, 36 CTA_USE,
36 CTA_ID, 37 CTA_ID,
38 CTA_NAT_DST,
37 __CTA_MAX 39 __CTA_MAX
38}; 40};
39#define CTA_MAX (__CTA_MAX - 1) 41#define CTA_MAX (__CTA_MAX - 1)
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index f6bdef82a322..48cc32d83f77 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -337,6 +337,10 @@ struct compat_xt_entry_match
337 char name[XT_FUNCTION_MAXNAMELEN - 1]; 337 char name[XT_FUNCTION_MAXNAMELEN - 1];
338 u_int8_t revision; 338 u_int8_t revision;
339 } user; 339 } user;
340 struct {
341 u_int16_t match_size;
342 compat_uptr_t match;
343 } kernel;
340 u_int16_t match_size; 344 u_int16_t match_size;
341 } u; 345 } u;
342 unsigned char data[0]; 346 unsigned char data[0];
@@ -350,6 +354,10 @@ struct compat_xt_entry_target
350 char name[XT_FUNCTION_MAXNAMELEN - 1]; 354 char name[XT_FUNCTION_MAXNAMELEN - 1];
351 u_int8_t revision; 355 u_int8_t revision;
352 } user; 356 } user;
357 struct {
358 u_int16_t target_size;
359 compat_uptr_t target;
360 } kernel;
353 u_int16_t target_size; 361 u_int16_t target_size;
354 } u; 362 } u;
355 unsigned char data[0]; 363 unsigned char data[0];
@@ -361,7 +369,11 @@ struct compat_xt_entry_target
361 369
362struct compat_xt_counters 370struct compat_xt_counters
363{ 371{
372#if defined(CONFIG_X86_64) || defined(CONFIG_IA64)
364 u_int32_t cnt[4]; 373 u_int32_t cnt[4];
374#else
375 u_int64_t cnt[2];
376#endif
365}; 377};
366 378
367struct compat_xt_counters_info 379struct compat_xt_counters_info
diff --git a/include/linux/netfilter/xt_CONNSECMARK.h b/include/linux/netfilter/xt_CONNSECMARK.h
new file mode 100644
index 000000000000..c6bd75469ba2
--- /dev/null
+++ b/include/linux/netfilter/xt_CONNSECMARK.h
@@ -0,0 +1,13 @@
1#ifndef _XT_CONNSECMARK_H_target
2#define _XT_CONNSECMARK_H_target
3
4enum {
5 CONNSECMARK_SAVE = 1,
6 CONNSECMARK_RESTORE,
7};
8
9struct xt_connsecmark_target_info {
10 u_int8_t mode;
11};
12
13#endif /*_XT_CONNSECMARK_H_target */
diff --git a/include/linux/netfilter/xt_SECMARK.h b/include/linux/netfilter/xt_SECMARK.h
new file mode 100644
index 000000000000..c53fbffa997d
--- /dev/null
+++ b/include/linux/netfilter/xt_SECMARK.h
@@ -0,0 +1,26 @@
1#ifndef _XT_SECMARK_H_target
2#define _XT_SECMARK_H_target
3
4/*
5 * This is intended for use by various security subsystems (but not
6 * at the same time).
7 *
8 * 'mode' refers to the specific security subsystem which the
9 * packets are being marked for.
10 */
11#define SECMARK_MODE_SEL 0x01 /* SELinux */
12#define SECMARK_SELCTX_MAX 256
13
14struct xt_secmark_target_selinux_info {
15 u_int32_t selsid;
16 char selctx[SECMARK_SELCTX_MAX];
17};
18
19struct xt_secmark_target_info {
20 u_int8_t mode;
21 union {
22 struct xt_secmark_target_selinux_info sel;
23 } u;
24};
25
26#endif /*_XT_SECMARK_H_target */
diff --git a/include/linux/netfilter/xt_quota.h b/include/linux/netfilter/xt_quota.h
new file mode 100644
index 000000000000..acd7fd77bbee
--- /dev/null
+++ b/include/linux/netfilter/xt_quota.h
@@ -0,0 +1,16 @@
1#ifndef _XT_QUOTA_H
2#define _XT_QUOTA_H
3
4enum xt_quota_flags {
5 XT_QUOTA_INVERT = 0x1,
6};
7#define XT_QUOTA_MASK 0x1
8
9struct xt_quota_info {
10 u_int32_t flags;
11 u_int32_t pad;
12 aligned_u64 quota;
13 struct xt_quota_info *master;
14};
15
16#endif /* _XT_QUOTA_H */
diff --git a/include/linux/netfilter/xt_statistic.h b/include/linux/netfilter/xt_statistic.h
new file mode 100644
index 000000000000..c344e9916e23
--- /dev/null
+++ b/include/linux/netfilter/xt_statistic.h
@@ -0,0 +1,32 @@
1#ifndef _XT_STATISTIC_H
2#define _XT_STATISTIC_H
3
4enum xt_statistic_mode {
5 XT_STATISTIC_MODE_RANDOM,
6 XT_STATISTIC_MODE_NTH,
7 __XT_STATISTIC_MODE_MAX
8};
9#define XT_STATISTIC_MODE_MAX (__XT_STATISTIC_MODE_MAX - 1)
10
11enum xt_statistic_flags {
12 XT_STATISTIC_INVERT = 0x1,
13};
14#define XT_STATISTIC_MASK 0x1
15
16struct xt_statistic_info {
17 u_int16_t mode;
18 u_int16_t flags;
19 union {
20 struct {
21 u_int32_t probability;
22 } random;
23 struct {
24 u_int32_t every;
25 u_int32_t packet;
26 u_int32_t count;
27 } nth;
28 } u;
29 struct xt_statistic_info *master __attribute__((aligned(8)));
30};
31
32#endif /* _XT_STATISTIC_H */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index d54d7b278e96..e0e9951eb8c3 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -121,6 +121,10 @@ struct ip_conntrack
121 u_int32_t mark; 121 u_int32_t mark;
122#endif 122#endif
123 123
124#ifdef CONFIG_IP_NF_CONNTRACK_SECMARK
125 u_int32_t secmark;
126#endif
127
124 /* Traversed often, so hopefully in different cacheline to top */ 128 /* Traversed often, so hopefully in different cacheline to top */
125 /* These are my tuples; original and reply */ 129 /* These are my tuples; original and reply */
126 struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX]; 130 struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX];
@@ -154,6 +158,7 @@ struct ip_conntrack_expect
154 unsigned int flags; 158 unsigned int flags;
155 159
156#ifdef CONFIG_IP_NF_NAT_NEEDED 160#ifdef CONFIG_IP_NF_NAT_NEEDED
161 u_int32_t saved_ip;
157 /* This is the original per-proto part, used to map the 162 /* This is the original per-proto part, used to map the
158 * expected connection the way the recipient expects. */ 163 * expected connection the way the recipient expects. */
159 union ip_conntrack_manip_proto saved_proto; 164 union ip_conntrack_manip_proto saved_proto;
@@ -293,6 +298,7 @@ static inline int is_dying(struct ip_conntrack *ct)
293} 298}
294 299
295extern unsigned int ip_conntrack_htable_size; 300extern unsigned int ip_conntrack_htable_size;
301extern int ip_conntrack_checksum;
296 302
297#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) 303#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++)
298 304
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
index eace86bd2adb..3cbff7379002 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
@@ -71,6 +71,13 @@ extern int (*nat_h245_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct,
71 unsigned char **data, int dataoff, 71 unsigned char **data, int dataoff,
72 TransportAddress * addr, u_int16_t port, 72 TransportAddress * addr, u_int16_t port,
73 struct ip_conntrack_expect * exp); 73 struct ip_conntrack_expect * exp);
74extern int (*nat_callforwarding_hook) (struct sk_buff ** pskb,
75 struct ip_conntrack * ct,
76 enum ip_conntrack_info ctinfo,
77 unsigned char **data, int dataoff,
78 TransportAddress * addr,
79 u_int16_t port,
80 struct ip_conntrack_expect * exp);
74extern int (*nat_q931_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct, 81extern int (*nat_q931_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct,
75 enum ip_conntrack_info ctinfo, 82 enum ip_conntrack_info ctinfo,
76 unsigned char **data, TransportAddress * addr, 83 unsigned char **data, TransportAddress * addr,
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h
index 0bd828081c0c..c6e9a0b6d30b 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h
@@ -2,7 +2,7 @@
2 * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323 2 * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323
3 * conntrack/NAT module. 3 * conntrack/NAT module.
4 * 4 *
5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@hotmail.com> 5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net>
6 * 6 *
7 * This source code is licensed under General Public License version 2. 7 * This source code is licensed under General Public License version 2.
8 * 8 *
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h
index cc98f7aa5abe..3d4a773799fc 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h
@@ -1,4 +1,4 @@
1/* Generated by Jing Min Zhao's ASN.1 parser, Mar 15 2006 1/* Generated by Jing Min Zhao's ASN.1 parser, Apr 20 2006
2 * 2 *
3 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net> 3 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net>
4 * 4 *
@@ -412,6 +412,7 @@ typedef struct Facility_UUIE { /* SEQUENCE */
412 eFacility_UUIE_destinationInfo = (1 << 14), 412 eFacility_UUIE_destinationInfo = (1 << 14),
413 eFacility_UUIE_h245SecurityMode = (1 << 13), 413 eFacility_UUIE_h245SecurityMode = (1 << 13),
414 } options; 414 } options;
415 TransportAddress alternativeAddress;
415 FacilityReason reason; 416 FacilityReason reason;
416 TransportAddress h245Address; 417 TransportAddress h245Address;
417 Facility_UUIE_fastStart fastStart; 418 Facility_UUIE_fastStart fastStart;
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_sip.h b/include/linux/netfilter_ipv4/ip_conntrack_sip.h
new file mode 100644
index 000000000000..913dad66c0fb
--- /dev/null
+++ b/include/linux/netfilter_ipv4/ip_conntrack_sip.h
@@ -0,0 +1,44 @@
1#ifndef __IP_CONNTRACK_SIP_H__
2#define __IP_CONNTRACK_SIP_H__
3#ifdef __KERNEL__
4
5#define SIP_PORT 5060
6#define SIP_TIMEOUT 3600
7
8#define POS_VIA 0
9#define POS_CONTACT 1
10#define POS_CONTENT 2
11#define POS_MEDIA 3
12#define POS_OWNER 4
13#define POS_CONNECTION 5
14#define POS_REQ_HEADER 6
15#define POS_SDP_HEADER 7
16
17struct sip_header_nfo {
18 const char *lname;
19 const char *sname;
20 const char *ln_str;
21 size_t lnlen;
22 size_t snlen;
23 size_t ln_strlen;
24 int (*match_len)(const char *, const char *, int *);
25};
26
27extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb,
28 enum ip_conntrack_info ctinfo,
29 struct ip_conntrack *ct,
30 const char **dptr);
31extern unsigned int (*ip_nat_sdp_hook)(struct sk_buff **pskb,
32 enum ip_conntrack_info ctinfo,
33 struct ip_conntrack_expect *exp,
34 const char *dptr);
35
36extern int ct_sip_get_info(const char *dptr, size_t dlen,
37 unsigned int *matchoff,
38 unsigned int *matchlen,
39 struct sip_header_nfo *hnfo);
40extern int ct_sip_lnlen(const char *line, const char *limit);
41extern const char *ct_sip_search(const char *needle, const char *haystack,
42 size_t needle_len, size_t haystack_len);
43#endif /* __KERNEL__ */
44#endif /* __IP_CONNTRACK_SIP_H__ */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index f8f3d1c927f8..87b8a5703ebc 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -143,6 +143,7 @@ struct netlink_skb_parms
143 __u32 dst_group; 143 __u32 dst_group;
144 kernel_cap_t eff_cap; 144 kernel_cap_t eff_cap;
145 __u32 loginuid; /* Login (audit) uid */ 145 __u32 loginuid; /* Login (audit) uid */
146 __u32 sid; /* SELinux security id */
146}; 147};
147 148
148#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb)) 149#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb))
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 9539efd4f7e6..7a1af574dedf 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -78,6 +78,8 @@ extern struct page * find_or_create_page(struct address_space *mapping,
78 unsigned long index, gfp_t gfp_mask); 78 unsigned long index, gfp_t gfp_mask);
79unsigned find_get_pages(struct address_space *mapping, pgoff_t start, 79unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
80 unsigned int nr_pages, struct page **pages); 80 unsigned int nr_pages, struct page **pages);
81unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start,
82 unsigned int nr_pages, struct page **pages);
81unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, 83unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index,
82 int tag, unsigned int nr_pages, struct page **pages); 84 int tag, unsigned int nr_pages, struct page **pages);
83 85
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 4877e35ae202..936ef82ed76a 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -50,7 +50,7 @@
50extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags); 50extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags);
51extern acpi_status pci_osc_support_set(u32 flags); 51extern acpi_status pci_osc_support_set(u32 flags);
52#else 52#else
53#if !defined(acpi_status) 53#if !defined(AE_ERROR)
54typedef u32 acpi_status; 54typedef u32 acpi_status;
55#define AE_ERROR (acpi_status) (0x0001) 55#define AE_ERROR (acpi_status) (0x0001)
56#endif 56#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 3a6a4e37a482..6fd36cb09160 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -442,6 +442,7 @@ struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int devic
442struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); 442struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
443int pci_find_capability (struct pci_dev *dev, int cap); 443int pci_find_capability (struct pci_dev *dev, int cap);
444int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 444int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
445int pci_find_ext_capability (struct pci_dev *dev, int cap);
445struct pci_bus * pci_find_next_bus(const struct pci_bus *from); 446struct pci_bus * pci_find_next_bus(const struct pci_bus *from);
446 447
447struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from); 448struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from);
@@ -662,6 +663,7 @@ static inline int pci_register_driver(struct pci_driver *drv) { return 0;}
662static inline void pci_unregister_driver(struct pci_driver *drv) { } 663static inline void pci_unregister_driver(struct pci_driver *drv) { }
663static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } 664static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
664static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; } 665static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; }
666static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; }
665static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; } 667static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; }
666 668
667/* Power management related routines */ 669/* Power management related routines */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index d6fe048376ab..bcfe9d4f56ae 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -935,6 +935,7 @@
935#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151 935#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151
936#define PCI_DEVICE_ID_PLX_R753 0x1152 936#define PCI_DEVICE_ID_PLX_R753 0x1152
937#define PCI_DEVICE_ID_PLX_OLITEC 0x1187 937#define PCI_DEVICE_ID_PLX_OLITEC 0x1187
938#define PCI_DEVICE_ID_PLX_PCI200SYN 0x3196
938#define PCI_DEVICE_ID_PLX_9050 0x9050 939#define PCI_DEVICE_ID_PLX_9050 0x9050
939#define PCI_DEVICE_ID_PLX_9080 0x9080 940#define PCI_DEVICE_ID_PLX_9080 0x9080
940#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 941#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001
@@ -1182,6 +1183,14 @@
1182#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E 1183#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E
1183#define PCI_DEVICE_ID_NVIDIA_NVENET_14 0x0372 1184#define PCI_DEVICE_ID_NVIDIA_NVENET_14 0x0372
1184#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 1185#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
1186#define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5
1187#define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6
1188#define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE
1189#define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF
1190#define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450
1191#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451
1192#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452
1193#define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453
1185 1194
1186#define PCI_VENDOR_ID_IMS 0x10e0 1195#define PCI_VENDOR_ID_IMS 0x10e0
1187#define PCI_DEVICE_ID_IMS_TT128 0x9128 1196#define PCI_DEVICE_ID_IMS_TT128 0x9128
@@ -1231,6 +1240,7 @@
1231#define PCI_DEVICE_ID_VIA_8380_0 0x0204 1240#define PCI_DEVICE_ID_VIA_8380_0 0x0204
1232#define PCI_DEVICE_ID_VIA_3238_0 0x0238 1241#define PCI_DEVICE_ID_VIA_3238_0 0x0238
1233#define PCI_DEVICE_ID_VIA_PT880 0x0258 1242#define PCI_DEVICE_ID_VIA_PT880 0x0258
1243#define PCI_DEVICE_ID_VIA_PT880ULTRA 0x0308
1234#define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 1244#define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259
1235#define PCI_DEVICE_ID_VIA_3269_0 0x0269 1245#define PCI_DEVICE_ID_VIA_3269_0 0x0269
1236#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 1246#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282
@@ -1826,6 +1836,7 @@
1826 1836
1827#define PCI_VENDOR_ID_SAMSUNG 0x144d 1837#define PCI_VENDOR_ID_SAMSUNG 0x144d
1828 1838
1839#define PCI_VENDOR_ID_MYRICOM 0x14c1
1829 1840
1830#define PCI_VENDOR_ID_TITAN 0x14D2 1841#define PCI_VENDOR_ID_TITAN 0x14D2
1831#define PCI_DEVICE_ID_TITAN_010L 0x8001 1842#define PCI_DEVICE_ID_TITAN_010L 0x8001
@@ -1886,6 +1897,7 @@
1886#define PCI_DEVICE_ID_TIGON3_5751F 0x167e 1897#define PCI_DEVICE_ID_TIGON3_5751F 0x167e
1887#define PCI_DEVICE_ID_TIGON3_5787M 0x1693 1898#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
1888#define PCI_DEVICE_ID_TIGON3_5782 0x1696 1899#define PCI_DEVICE_ID_TIGON3_5782 0x1696
1900#define PCI_DEVICE_ID_TIGON3_5786 0x169a
1889#define PCI_DEVICE_ID_TIGON3_5787 0x169b 1901#define PCI_DEVICE_ID_TIGON3_5787 0x169b
1890#define PCI_DEVICE_ID_TIGON3_5788 0x169c 1902#define PCI_DEVICE_ID_TIGON3_5788 0x169c
1891#define PCI_DEVICE_ID_TIGON3_5789 0x169d 1903#define PCI_DEVICE_ID_TIGON3_5789 0x169d
@@ -2042,6 +2054,7 @@
2042#define PCI_DEVICE_ID_INTEL_80960_RP 0x1960 2054#define PCI_DEVICE_ID_INTEL_80960_RP 0x1960
2043#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 2055#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21
2044#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 2056#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30
2057#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38
2045#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 2058#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410
2046#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 2059#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411
2047#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 2060#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index bac0fb389cf1..d5dd471da225 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -159,7 +159,7 @@ struct sadb_spirange {
159struct sadb_x_kmprivate { 159struct sadb_x_kmprivate {
160 uint16_t sadb_x_kmprivate_len; 160 uint16_t sadb_x_kmprivate_len;
161 uint16_t sadb_x_kmprivate_exttype; 161 uint16_t sadb_x_kmprivate_exttype;
162 u_int32_t sadb_x_kmprivate_reserved; 162 uint32_t sadb_x_kmprivate_reserved;
163} __attribute__((packed)); 163} __attribute__((packed));
164/* sizeof(struct sadb_x_kmprivate) == 8 */ 164/* sizeof(struct sadb_x_kmprivate) == 8 */
165 165
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index ef7f33c0be19..ea4f7cd7bfd8 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -5,8 +5,9 @@
5 5
6#define PIPE_BUFFERS (16) 6#define PIPE_BUFFERS (16)
7 7
8#define PIPE_BUF_FLAG_STOLEN 0x01 8#define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */
9#define PIPE_BUF_FLAG_LRU 0x02 9#define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */
10#define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */
10 11
11struct pipe_buffer { 12struct pipe_buffer {
12 struct page *page; 13 struct page *page;
@@ -15,10 +16,23 @@ struct pipe_buffer {
15 unsigned int flags; 16 unsigned int flags;
16}; 17};
17 18
19/*
20 * Note on the nesting of these functions:
21 *
22 * ->pin()
23 * ->steal()
24 * ...
25 * ->map()
26 * ...
27 * ->unmap()
28 *
29 * That is, ->map() must be called on a pinned buffer, same goes for ->steal().
30 */
18struct pipe_buf_operations { 31struct pipe_buf_operations {
19 int can_merge; 32 int can_merge;
20 void * (*map)(struct file *, struct pipe_inode_info *, struct pipe_buffer *); 33 void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int);
21 void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *); 34 void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *);
35 int (*pin)(struct pipe_inode_info *, struct pipe_buffer *);
22 void (*release)(struct pipe_inode_info *, struct pipe_buffer *); 36 void (*release)(struct pipe_inode_info *, struct pipe_buffer *);
23 int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); 37 int (*steal)(struct pipe_inode_info *, struct pipe_buffer *);
24 void (*get)(struct pipe_inode_info *, struct pipe_buffer *); 38 void (*get)(struct pipe_inode_info *, struct pipe_buffer *);
@@ -51,6 +65,13 @@ struct pipe_inode_info * alloc_pipe_info(struct inode * inode);
51void free_pipe_info(struct inode * inode); 65void free_pipe_info(struct inode * inode);
52void __free_pipe_info(struct pipe_inode_info *); 66void __free_pipe_info(struct pipe_inode_info *);
53 67
68/* Generic pipe buffer ops functions */
69void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int);
70void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *);
71void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
72int generic_pipe_buf_pin(struct pipe_inode_info *, struct pipe_buffer *);
73int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
74
54/* 75/*
55 * splice is tied to pipes as a transport (at least for now), so we'll just 76 * splice is tied to pipes as a transport (at least for now), so we'll just
56 * add the splice flags here. 77 * add the splice flags here.
@@ -60,5 +81,23 @@ void __free_pipe_info(struct pipe_inode_info *);
60 /* we may still block on the fd we splice */ 81 /* we may still block on the fd we splice */
61 /* from/to, of course */ 82 /* from/to, of course */
62#define SPLICE_F_MORE (0x04) /* expect more data */ 83#define SPLICE_F_MORE (0x04) /* expect more data */
84#define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */
85
86/*
87 * Passed to the actors
88 */
89struct splice_desc {
90 unsigned int len, total_len; /* current and remaining length */
91 unsigned int flags; /* splice flags */
92 struct file *file; /* file to read/write */
93 loff_t pos; /* file position */
94};
95
96typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,
97 struct splice_desc *);
98
99extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *,
100 loff_t *, size_t, unsigned int,
101 splice_actor *);
63 102
64#endif 103#endif
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 5673008b61e1..970284f571a6 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -132,6 +132,7 @@ static inline void rcu_bh_qsctr_inc(int cpu)
132} 132}
133 133
134extern int rcu_pending(int cpu); 134extern int rcu_pending(int cpu);
135extern int rcu_needs_cpu(int cpu);
135 136
136/** 137/**
137 * rcu_read_lock - mark the beginning of an RCU read-side critical section. 138 * rcu_read_lock - mark the beginning of an RCU read-side critical section.
diff --git a/include/linux/security.h b/include/linux/security.h
index aaa0a5cdbf75..4dfb1b84a9b3 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -805,31 +805,37 @@ struct swap_info_struct;
805 * used by the XFRM system. 805 * used by the XFRM system.
806 * @sec_ctx contains the security context information being provided by 806 * @sec_ctx contains the security context information being provided by
807 * the user-level policy update program (e.g., setkey). 807 * the user-level policy update program (e.g., setkey).
808 * Allocate a security structure to the xp->selector.security field. 808 * Allocate a security structure to the xp->security field.
809 * The security field is initialized to NULL when the xfrm_policy is 809 * The security field is initialized to NULL when the xfrm_policy is
810 * allocated. 810 * allocated.
811 * Return 0 if operation was successful (memory to allocate, legal context) 811 * Return 0 if operation was successful (memory to allocate, legal context)
812 * @xfrm_policy_clone_security: 812 * @xfrm_policy_clone_security:
813 * @old contains an existing xfrm_policy in the SPD. 813 * @old contains an existing xfrm_policy in the SPD.
814 * @new contains a new xfrm_policy being cloned from old. 814 * @new contains a new xfrm_policy being cloned from old.
815 * Allocate a security structure to the new->selector.security field 815 * Allocate a security structure to the new->security field
816 * that contains the information from the old->selector.security field. 816 * that contains the information from the old->security field.
817 * Return 0 if operation was successful (memory to allocate). 817 * Return 0 if operation was successful (memory to allocate).
818 * @xfrm_policy_free_security: 818 * @xfrm_policy_free_security:
819 * @xp contains the xfrm_policy 819 * @xp contains the xfrm_policy
820 * Deallocate xp->selector.security. 820 * Deallocate xp->security.
821 * @xfrm_policy_delete_security:
822 * @xp contains the xfrm_policy.
823 * Authorize deletion of xp->security.
821 * @xfrm_state_alloc_security: 824 * @xfrm_state_alloc_security:
822 * @x contains the xfrm_state being added to the Security Association 825 * @x contains the xfrm_state being added to the Security Association
823 * Database by the XFRM system. 826 * Database by the XFRM system.
824 * @sec_ctx contains the security context information being provided by 827 * @sec_ctx contains the security context information being provided by
825 * the user-level SA generation program (e.g., setkey or racoon). 828 * the user-level SA generation program (e.g., setkey or racoon).
826 * Allocate a security structure to the x->sel.security field. The 829 * Allocate a security structure to the x->security field. The
827 * security field is initialized to NULL when the xfrm_state is 830 * security field is initialized to NULL when the xfrm_state is
828 * allocated. 831 * allocated.
829 * Return 0 if operation was successful (memory to allocate, legal context). 832 * Return 0 if operation was successful (memory to allocate, legal context).
830 * @xfrm_state_free_security: 833 * @xfrm_state_free_security:
831 * @x contains the xfrm_state. 834 * @x contains the xfrm_state.
832 * Deallocate x>sel.security. 835 * Deallocate x->security.
836 * @xfrm_state_delete_security:
837 * @x contains the xfrm_state.
838 * Authorize deletion of x->security.
833 * @xfrm_policy_lookup: 839 * @xfrm_policy_lookup:
834 * @xp contains the xfrm_policy for which the access control is being 840 * @xp contains the xfrm_policy for which the access control is being
835 * checked. 841 * checked.
@@ -869,11 +875,6 @@ struct swap_info_struct;
869 * @ipcp contains the kernel IPC permission structure 875 * @ipcp contains the kernel IPC permission structure
870 * @flag contains the desired (requested) permission set 876 * @flag contains the desired (requested) permission set
871 * Return 0 if permission is granted. 877 * Return 0 if permission is granted.
872 * @ipc_getsecurity:
873 * Copy the security label associated with the ipc object into
874 * @buffer. @buffer may be NULL to request the size of the buffer
875 * required. @size indicates the size of @buffer in bytes. Return
876 * number of bytes used/required on success.
877 * 878 *
878 * Security hooks for individual messages held in System V IPC message queues 879 * Security hooks for individual messages held in System V IPC message queues
879 * @msg_msg_alloc_security: 880 * @msg_msg_alloc_security:
@@ -1223,7 +1224,6 @@ struct security_operations {
1223 void (*task_to_inode)(struct task_struct *p, struct inode *inode); 1224 void (*task_to_inode)(struct task_struct *p, struct inode *inode);
1224 1225
1225 int (*ipc_permission) (struct kern_ipc_perm * ipcp, short flag); 1226 int (*ipc_permission) (struct kern_ipc_perm * ipcp, short flag);
1226 int (*ipc_getsecurity)(struct kern_ipc_perm *ipcp, void *buffer, size_t size);
1227 1227
1228 int (*msg_msg_alloc_security) (struct msg_msg * msg); 1228 int (*msg_msg_alloc_security) (struct msg_msg * msg);
1229 void (*msg_msg_free_security) (struct msg_msg * msg); 1229 void (*msg_msg_free_security) (struct msg_msg * msg);
@@ -1304,8 +1304,10 @@ struct security_operations {
1304 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx); 1304 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx);
1305 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); 1305 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new);
1306 void (*xfrm_policy_free_security) (struct xfrm_policy *xp); 1306 void (*xfrm_policy_free_security) (struct xfrm_policy *xp);
1307 int (*xfrm_policy_delete_security) (struct xfrm_policy *xp);
1307 int (*xfrm_state_alloc_security) (struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx); 1308 int (*xfrm_state_alloc_security) (struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx);
1308 void (*xfrm_state_free_security) (struct xfrm_state *x); 1309 void (*xfrm_state_free_security) (struct xfrm_state *x);
1310 int (*xfrm_state_delete_security) (struct xfrm_state *x);
1309 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 sk_sid, u8 dir); 1311 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 sk_sid, u8 dir);
1310#endif /* CONFIG_SECURITY_NETWORK_XFRM */ 1312#endif /* CONFIG_SECURITY_NETWORK_XFRM */
1311 1313
@@ -1887,11 +1889,6 @@ static inline int security_ipc_permission (struct kern_ipc_perm *ipcp,
1887 return security_ops->ipc_permission (ipcp, flag); 1889 return security_ops->ipc_permission (ipcp, flag);
1888} 1890}
1889 1891
1890static inline int security_ipc_getsecurity(struct kern_ipc_perm *ipcp, void *buffer, size_t size)
1891{
1892 return security_ops->ipc_getsecurity(ipcp, buffer, size);
1893}
1894
1895static inline int security_msg_msg_alloc (struct msg_msg * msg) 1892static inline int security_msg_msg_alloc (struct msg_msg * msg)
1896{ 1893{
1897 return security_ops->msg_msg_alloc_security (msg); 1894 return security_ops->msg_msg_alloc_security (msg);
@@ -2532,11 +2529,6 @@ static inline int security_ipc_permission (struct kern_ipc_perm *ipcp,
2532 return 0; 2529 return 0;
2533} 2530}
2534 2531
2535static inline int security_ipc_getsecurity(struct kern_ipc_perm *ipcp, void *buffer, size_t size)
2536{
2537 return -EOPNOTSUPP;
2538}
2539
2540static inline int security_msg_msg_alloc (struct msg_msg * msg) 2532static inline int security_msg_msg_alloc (struct msg_msg * msg)
2541{ 2533{
2542 return 0; 2534 return 0;
@@ -2950,11 +2942,21 @@ static inline void security_xfrm_policy_free(struct xfrm_policy *xp)
2950 security_ops->xfrm_policy_free_security(xp); 2942 security_ops->xfrm_policy_free_security(xp);
2951} 2943}
2952 2944
2945static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
2946{
2947 return security_ops->xfrm_policy_delete_security(xp);
2948}
2949
2953static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) 2950static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx)
2954{ 2951{
2955 return security_ops->xfrm_state_alloc_security(x, sec_ctx); 2952 return security_ops->xfrm_state_alloc_security(x, sec_ctx);
2956} 2953}
2957 2954
2955static inline int security_xfrm_state_delete(struct xfrm_state *x)
2956{
2957 return security_ops->xfrm_state_delete_security(x);
2958}
2959
2958static inline void security_xfrm_state_free(struct xfrm_state *x) 2960static inline void security_xfrm_state_free(struct xfrm_state *x)
2959{ 2961{
2960 security_ops->xfrm_state_free_security(x); 2962 security_ops->xfrm_state_free_security(x);
@@ -2979,6 +2981,11 @@ static inline void security_xfrm_policy_free(struct xfrm_policy *xp)
2979{ 2981{
2980} 2982}
2981 2983
2984static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
2985{
2986 return 0;
2987}
2988
2982static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) 2989static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx)
2983{ 2990{
2984 return 0; 2991 return 0;
@@ -2988,6 +2995,11 @@ static inline void security_xfrm_state_free(struct xfrm_state *x)
2988{ 2995{
2989} 2996}
2990 2997
2998static inline int security_xfrm_state_delete(struct xfrm_state *x)
2999{
3000 return 0;
3001}
3002
2991static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir) 3003static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir)
2992{ 3004{
2993 return 0; 3005 return 0;
diff --git a/include/linux/selinux.h b/include/linux/selinux.h
new file mode 100644
index 000000000000..aad4e390d6a5
--- /dev/null
+++ b/include/linux/selinux.h
@@ -0,0 +1,209 @@
1/*
2 * SELinux services exported to the rest of the kernel.
3 *
4 * Author: James Morris <jmorris@redhat.com>
5 *
6 * Copyright (C) 2005 Red Hat, Inc., James Morris <jmorris@redhat.com>
7 * Copyright (C) 2006 Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com>
8 * Copyright (C) 2006 IBM Corporation, Timothy R. Chavez <tinytim@us.ibm.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2,
12 * as published by the Free Software Foundation.
13 */
14#ifndef _LINUX_SELINUX_H
15#define _LINUX_SELINUX_H
16
17struct selinux_audit_rule;
18struct audit_context;
19struct inode;
20struct kern_ipc_perm;
21
22#ifdef CONFIG_SECURITY_SELINUX
23
24/**
25 * selinux_audit_rule_init - alloc/init an selinux audit rule structure.
26 * @field: the field this rule refers to
27 * @op: the operater the rule uses
28 * @rulestr: the text "target" of the rule
29 * @rule: pointer to the new rule structure returned via this
30 *
31 * Returns 0 if successful, -errno if not. On success, the rule structure
32 * will be allocated internally. The caller must free this structure with
33 * selinux_audit_rule_free() after use.
34 */
35int selinux_audit_rule_init(u32 field, u32 op, char *rulestr,
36 struct selinux_audit_rule **rule);
37
38/**
39 * selinux_audit_rule_free - free an selinux audit rule structure.
40 * @rule: pointer to the audit rule to be freed
41 *
42 * This will free all memory associated with the given rule.
43 * If @rule is NULL, no operation is performed.
44 */
45void selinux_audit_rule_free(struct selinux_audit_rule *rule);
46
47/**
48 * selinux_audit_rule_match - determine if a context ID matches a rule.
49 * @ctxid: the context ID to check
50 * @field: the field this rule refers to
51 * @op: the operater the rule uses
52 * @rule: pointer to the audit rule to check against
53 * @actx: the audit context (can be NULL) associated with the check
54 *
55 * Returns 1 if the context id matches the rule, 0 if it does not, and
56 * -errno on failure.
57 */
58int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
59 struct selinux_audit_rule *rule,
60 struct audit_context *actx);
61
62/**
63 * selinux_audit_set_callback - set the callback for policy reloads.
64 * @callback: the function to call when the policy is reloaded
65 *
66 * This sets the function callback function that will update the rules
67 * upon policy reloads. This callback should rebuild all existing rules
68 * using selinux_audit_rule_init().
69 */
70void selinux_audit_set_callback(int (*callback)(void));
71
72/**
73 * selinux_task_ctxid - determine a context ID for a process.
74 * @tsk: the task object
75 * @ctxid: ID value returned via this
76 *
77 * On return, ctxid will contain an ID for the context. This value
78 * should only be used opaquely.
79 */
80void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid);
81
82/**
83 * selinux_ctxid_to_string - map a security context ID to a string
84 * @ctxid: security context ID to be converted.
85 * @ctx: address of context string to be returned
86 * @ctxlen: length of returned context string.
87 *
88 * Returns 0 if successful, -errno if not. On success, the context
89 * string will be allocated internally, and the caller must call
90 * kfree() on it after use.
91 */
92int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen);
93
94/**
95 * selinux_get_inode_sid - get the inode's security context ID
96 * @inode: inode structure to get the sid from.
97 * @sid: pointer to security context ID to be filled in.
98 *
99 * Returns nothing
100 */
101void selinux_get_inode_sid(const struct inode *inode, u32 *sid);
102
103/**
104 * selinux_get_ipc_sid - get the ipc security context ID
105 * @ipcp: ipc structure to get the sid from.
106 * @sid: pointer to security context ID to be filled in.
107 *
108 * Returns nothing
109 */
110void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid);
111
112/**
113 * selinux_get_task_sid - return the SID of task
114 * @tsk: the task whose SID will be returned
115 * @sid: pointer to security context ID to be filled in.
116 *
117 * Returns nothing
118 */
119void selinux_get_task_sid(struct task_struct *tsk, u32 *sid);
120
121/**
122 * selinux_string_to_sid - map a security context string to a security ID
123 * @str: the security context string to be mapped
124 * @sid: ID value returned via this.
125 *
126 * Returns 0 if successful, with the SID stored in sid. A value
127 * of zero for sid indicates no SID could be determined (but no error
128 * occurred).
129 */
130int selinux_string_to_sid(char *str, u32 *sid);
131
132/**
133 * selinux_relabel_packet_permission - check permission to relabel a packet
134 * @sid: ID value to be applied to network packet (via SECMARK, most likely)
135 *
136 * Returns 0 if the current task is allowed to label packets with the
137 * supplied security ID. Note that it is implicit that the packet is always
138 * being relabeled from the default unlabled value, and that the access
139 * control decision is made in the AVC.
140 */
141int selinux_relabel_packet_permission(u32 sid);
142
143#else
144
145static inline int selinux_audit_rule_init(u32 field, u32 op,
146 char *rulestr,
147 struct selinux_audit_rule **rule)
148{
149 return -ENOTSUPP;
150}
151
152static inline void selinux_audit_rule_free(struct selinux_audit_rule *rule)
153{
154 return;
155}
156
157static inline int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
158 struct selinux_audit_rule *rule,
159 struct audit_context *actx)
160{
161 return 0;
162}
163
164static inline void selinux_audit_set_callback(int (*callback)(void))
165{
166 return;
167}
168
169static inline void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid)
170{
171 *ctxid = 0;
172}
173
174static inline int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen)
175{
176 *ctx = NULL;
177 *ctxlen = 0;
178 return 0;
179}
180
181static inline void selinux_get_inode_sid(const struct inode *inode, u32 *sid)
182{
183 *sid = 0;
184}
185
186static inline void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid)
187{
188 *sid = 0;
189}
190
191static inline void selinux_get_task_sid(struct task_struct *tsk, u32 *sid)
192{
193 *sid = 0;
194}
195
196static inline int selinux_string_to_sid(const char *str, u32 *sid)
197{
198 *sid = 0;
199 return 0;
200}
201
202static inline int selinux_relabel_packet_permission(u32 sid)
203{
204 return 0;
205}
206
207#endif /* CONFIG_SECURITY_SELINUX */
208
209#endif /* _LINUX_SELINUX_H */
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index c32e60e79dea..bd14858121ea 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -254,6 +254,7 @@ struct uart_port {
254#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 254#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
255#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) 255#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
256#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) 256#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
257#define UPF_DEAD ((__force upf_t) (1 << 30))
257#define UPF_IOREMAP ((__force upf_t) (1 << 31)) 258#define UPF_IOREMAP ((__force upf_t) (1 << 31))
258 259
259#define UPF_CHANGE_MASK ((__force upf_t) (0x17fff)) 260#define UPF_CHANGE_MASK ((__force upf_t) (0x17fff))
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 162a8fd10b29..70739f51a09f 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -14,10 +14,12 @@
14 * 14 *
15 * SA_INTERRUPT is also used by the irq handling routines. 15 * SA_INTERRUPT is also used by the irq handling routines.
16 * SA_SHIRQ is for shared interrupt support on PCI and EISA. 16 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
17 * SA_PROBEIRQ is set by callers when they expect sharing mismatches to occur
17 */ 18 */
18#define SA_PROBE SA_ONESHOT
19#define SA_SAMPLE_RANDOM SA_RESTART 19#define SA_SAMPLE_RANDOM SA_RESTART
20#define SA_SHIRQ 0x04000000 20#define SA_SHIRQ 0x04000000
21#define SA_PROBEIRQ 0x08000000
22
21/* 23/*
22 * As above, these correspond to the IORESOURCE_IRQ_* defines in 24 * As above, these correspond to the IORESOURCE_IRQ_* defines in
23 * linux/ioport.h to select the interrupt line behaviour. When 25 * linux/ioport.h to select the interrupt line behaviour. When
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f8f234708b98..93e4db221585 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -29,6 +29,7 @@
29#include <linux/net.h> 29#include <linux/net.h>
30#include <linux/textsearch.h> 30#include <linux/textsearch.h>
31#include <net/checksum.h> 31#include <net/checksum.h>
32#include <linux/dmaengine.h>
32 33
33#define HAVE_ALLOC_SKB /* For the drivers to know */ 34#define HAVE_ALLOC_SKB /* For the drivers to know */
34#define HAVE_ALIGNABLE_SKB /* Ditto 8) */ 35#define HAVE_ALIGNABLE_SKB /* Ditto 8) */
@@ -209,6 +210,7 @@ enum {
209 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 210 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
210 * @tc_index: Traffic control index 211 * @tc_index: Traffic control index
211 * @tc_verd: traffic control verdict 212 * @tc_verd: traffic control verdict
213 * @secmark: security marking
212 */ 214 */
213 215
214struct sk_buff { 216struct sk_buff {
@@ -285,6 +287,12 @@ struct sk_buff {
285 __u16 tc_verd; /* traffic control verdict */ 287 __u16 tc_verd; /* traffic control verdict */
286#endif 288#endif
287#endif 289#endif
290#ifdef CONFIG_NET_DMA
291 dma_cookie_t dma_cookie;
292#endif
293#ifdef CONFIG_NETWORK_SECMARK
294 __u32 secmark;
295#endif
288 296
289 297
290 /* These elements must be at the end, see alloc_skb() for details. */ 298 /* These elements must be at the end, see alloc_skb() for details. */
@@ -967,15 +975,16 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
967#define NET_SKB_PAD 16 975#define NET_SKB_PAD 16
968#endif 976#endif
969 977
970extern int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc); 978extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
971 979
972static inline void __skb_trim(struct sk_buff *skb, unsigned int len) 980static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
973{ 981{
974 if (!skb->data_len) { 982 if (unlikely(skb->data_len)) {
975 skb->len = len; 983 WARN_ON(1);
976 skb->tail = skb->data + len; 984 return;
977 } else 985 }
978 ___pskb_trim(skb, len, 0); 986 skb->len = len;
987 skb->tail = skb->data + len;
979} 988}
980 989
981/** 990/**
@@ -985,6 +994,7 @@ static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
985 * 994 *
986 * Cut the length of a buffer down by removing data from the tail. If 995 * Cut the length of a buffer down by removing data from the tail. If
987 * the buffer is already under the length specified it is not modified. 996 * the buffer is already under the length specified it is not modified.
997 * The skb must be linear.
988 */ 998 */
989static inline void skb_trim(struct sk_buff *skb, unsigned int len) 999static inline void skb_trim(struct sk_buff *skb, unsigned int len)
990{ 1000{
@@ -995,12 +1005,10 @@ static inline void skb_trim(struct sk_buff *skb, unsigned int len)
995 1005
996static inline int __pskb_trim(struct sk_buff *skb, unsigned int len) 1006static inline int __pskb_trim(struct sk_buff *skb, unsigned int len)
997{ 1007{
998 if (!skb->data_len) { 1008 if (skb->data_len)
999 skb->len = len; 1009 return ___pskb_trim(skb, len);
1000 skb->tail = skb->data+len; 1010 __skb_trim(skb, len);
1001 return 0; 1011 return 0;
1002 }
1003 return ___pskb_trim(skb, len, 1);
1004} 1012}
1005 1013
1006static inline int pskb_trim(struct sk_buff *skb, unsigned int len) 1014static inline int pskb_trim(struct sk_buff *skb, unsigned int len)
@@ -1161,18 +1169,34 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i,
1161 return 0; 1169 return 0;
1162} 1170}
1163 1171
1172static inline int __skb_linearize(struct sk_buff *skb)
1173{
1174 return __pskb_pull_tail(skb, skb->data_len) ? 0 : -ENOMEM;
1175}
1176
1164/** 1177/**
1165 * skb_linearize - convert paged skb to linear one 1178 * skb_linearize - convert paged skb to linear one
1166 * @skb: buffer to linarize 1179 * @skb: buffer to linarize
1167 * @gfp: allocation mode
1168 * 1180 *
1169 * If there is no free memory -ENOMEM is returned, otherwise zero 1181 * If there is no free memory -ENOMEM is returned, otherwise zero
1170 * is returned and the old skb data released. 1182 * is returned and the old skb data released.
1171 */ 1183 */
1172extern int __skb_linearize(struct sk_buff *skb, gfp_t gfp); 1184static inline int skb_linearize(struct sk_buff *skb)
1173static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp) 1185{
1186 return skb_is_nonlinear(skb) ? __skb_linearize(skb) : 0;
1187}
1188
1189/**
1190 * skb_linearize_cow - make sure skb is linear and writable
1191 * @skb: buffer to process
1192 *
1193 * If there is no free memory -ENOMEM is returned, otherwise zero
1194 * is returned and the old skb data released.
1195 */
1196static inline int skb_linearize_cow(struct sk_buff *skb)
1174{ 1197{
1175 return __skb_linearize(skb, gfp); 1198 return skb_is_nonlinear(skb) || skb_cloned(skb) ?
1199 __skb_linearize(skb) : 0;
1176} 1200}
1177 1201
1178/** 1202/**
@@ -1396,5 +1420,23 @@ static inline void nf_reset(struct sk_buff *skb)
1396static inline void nf_reset(struct sk_buff *skb) {} 1420static inline void nf_reset(struct sk_buff *skb) {}
1397#endif /* CONFIG_NETFILTER */ 1421#endif /* CONFIG_NETFILTER */
1398 1422
1423#ifdef CONFIG_NETWORK_SECMARK
1424static inline void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from)
1425{
1426 to->secmark = from->secmark;
1427}
1428
1429static inline void skb_init_secmark(struct sk_buff *skb)
1430{
1431 skb->secmark = 0;
1432}
1433#else
1434static inline void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from)
1435{ }
1436
1437static inline void skb_init_secmark(struct sk_buff *skb)
1438{ }
1439#endif
1440
1399#endif /* __KERNEL__ */ 1441#endif /* __KERNEL__ */
1400#endif /* _LINUX_SKBUFF_H */ 1442#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 3af03b19c983..2d985d59c7b8 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -150,6 +150,7 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
150 150
151extern void kfree(const void *); 151extern void kfree(const void *);
152extern unsigned int ksize(const void *); 152extern unsigned int ksize(const void *);
153extern int slab_is_available(void);
153 154
154#ifdef CONFIG_NUMA 155#ifdef CONFIG_NUMA
155extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); 156extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node);
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index 72261e0f2ac1..adb3dafd33e9 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -14,5 +14,12 @@ struct ads7846_platform_data {
14 u16 x_min, x_max; 14 u16 x_min, x_max;
15 u16 y_min, y_max; 15 u16 y_min, y_max;
16 u16 pressure_min, pressure_max; 16 u16 pressure_min, pressure_max;
17
18 u16 debounce_max; /* max number of additional readings
19 * per sample */
20 u16 debounce_tol; /* tolerance used for filtering */
21 u16 debounce_rep; /* additional consecutive good readings
22 * required after the first two */
23 int (*get_pendown_state)(void);
17}; 24};
18 25
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index b05f1463a267..e928c0dcc297 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -31,18 +31,23 @@ extern struct bus_type spi_bus_type;
31 * @master: SPI controller used with the device. 31 * @master: SPI controller used with the device.
32 * @max_speed_hz: Maximum clock rate to be used with this chip 32 * @max_speed_hz: Maximum clock rate to be used with this chip
33 * (on this board); may be changed by the device's driver. 33 * (on this board); may be changed by the device's driver.
34 * The spi_transfer.speed_hz can override this for each transfer.
34 * @chip-select: Chipselect, distinguishing chips handled by "master". 35 * @chip-select: Chipselect, distinguishing chips handled by "master".
35 * @mode: The spi mode defines how data is clocked out and in. 36 * @mode: The spi mode defines how data is clocked out and in.
36 * This may be changed by the device's driver. 37 * This may be changed by the device's driver.
38 * The "active low" default for chipselect mode can be overridden,
39 * as can the "MSB first" default for each word in a transfer.
37 * @bits_per_word: Data transfers involve one or more words; word sizes 40 * @bits_per_word: Data transfers involve one or more words; word sizes
38 * like eight or 12 bits are common. In-memory wordsizes are 41 * like eight or 12 bits are common. In-memory wordsizes are
39 * powers of two bytes (e.g. 20 bit samples use 32 bits). 42 * powers of two bytes (e.g. 20 bit samples use 32 bits).
40 * This may be changed by the device's driver. 43 * This may be changed by the device's driver, or left at the
44 * default (0) indicating protocol words are eight bit bytes.
45 * The spi_transfer.bits_per_word can override this for each transfer.
41 * @irq: Negative, or the number passed to request_irq() to receive 46 * @irq: Negative, or the number passed to request_irq() to receive
42 * interrupts from this device. 47 * interrupts from this device.
43 * @controller_state: Controller's runtime state 48 * @controller_state: Controller's runtime state
44 * @controller_data: Board-specific definitions for controller, such as 49 * @controller_data: Board-specific definitions for controller, such as
45 * FIFO initialization parameters; from board_info.controller_data 50 * FIFO initialization parameters; from board_info.controller_data
46 * 51 *
47 * An spi_device is used to interchange data between an SPI slave 52 * An spi_device is used to interchange data between an SPI slave
48 * (usually a discrete chip) and CPU memory. 53 * (usually a discrete chip) and CPU memory.
@@ -65,6 +70,7 @@ struct spi_device {
65#define SPI_MODE_2 (SPI_CPOL|0) 70#define SPI_MODE_2 (SPI_CPOL|0)
66#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) 71#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
67#define SPI_CS_HIGH 0x04 /* chipselect active high? */ 72#define SPI_CS_HIGH 0x04 /* chipselect active high? */
73#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */
68 u8 bits_per_word; 74 u8 bits_per_word;
69 int irq; 75 int irq;
70 void *controller_state; 76 void *controller_state;
@@ -73,7 +79,6 @@ struct spi_device {
73 79
74 // likely need more hooks for more protocol options affecting how 80 // likely need more hooks for more protocol options affecting how
75 // the controller talks to each chip, like: 81 // the controller talks to each chip, like:
76 // - bit order (default is wordwise msb-first)
77 // - memory packing (12 bit samples into low bits, others zeroed) 82 // - memory packing (12 bit samples into low bits, others zeroed)
78 // - priority 83 // - priority
79 // - drop chipselect after each word 84 // - drop chipselect after each word
@@ -143,13 +148,13 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
143 * struct spi_master - interface to SPI master controller 148 * struct spi_master - interface to SPI master controller
144 * @cdev: class interface to this driver 149 * @cdev: class interface to this driver
145 * @bus_num: board-specific (and often SOC-specific) identifier for a 150 * @bus_num: board-specific (and often SOC-specific) identifier for a
146 * given SPI controller. 151 * given SPI controller.
147 * @num_chipselect: chipselects are used to distinguish individual 152 * @num_chipselect: chipselects are used to distinguish individual
148 * SPI slaves, and are numbered from zero to num_chipselects. 153 * SPI slaves, and are numbered from zero to num_chipselects.
149 * each slave has a chipselect signal, but it's common that not 154 * each slave has a chipselect signal, but it's common that not
150 * every chipselect is connected to a slave. 155 * every chipselect is connected to a slave.
151 * @setup: updates the device mode and clocking records used by a 156 * @setup: updates the device mode and clocking records used by a
152 * device's SPI controller; protocol code may call this. 157 * device's SPI controller; protocol code may call this.
153 * @transfer: adds a message to the controller's transfer queue. 158 * @transfer: adds a message to the controller's transfer queue.
154 * @cleanup: frees controller-specific state 159 * @cleanup: frees controller-specific state
155 * 160 *
@@ -167,13 +172,13 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
167struct spi_master { 172struct spi_master {
168 struct class_device cdev; 173 struct class_device cdev;
169 174
170 /* other than zero (== assign one dynamically), bus_num is fully 175 /* other than negative (== assign one dynamically), bus_num is fully
171 * board-specific. usually that simplifies to being SOC-specific. 176 * board-specific. usually that simplifies to being SOC-specific.
172 * example: one SOC has three SPI controllers, numbered 1..3, 177 * example: one SOC has three SPI controllers, numbered 0..2,
173 * and one board's schematics might show it using SPI-2. software 178 * and one board's schematics might show it using SPI-2. software
174 * would normally use bus_num=2 for that controller. 179 * would normally use bus_num=2 for that controller.
175 */ 180 */
176 u16 bus_num; 181 s16 bus_num;
177 182
178 /* chipselects will be integral to many controllers; some others 183 /* chipselects will be integral to many controllers; some others
179 * might use board-specific GPIOs. 184 * might use board-specific GPIOs.
@@ -268,10 +273,14 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
268 * @tx_dma: DMA address of tx_buf, if spi_message.is_dma_mapped 273 * @tx_dma: DMA address of tx_buf, if spi_message.is_dma_mapped
269 * @rx_dma: DMA address of rx_buf, if spi_message.is_dma_mapped 274 * @rx_dma: DMA address of rx_buf, if spi_message.is_dma_mapped
270 * @len: size of rx and tx buffers (in bytes) 275 * @len: size of rx and tx buffers (in bytes)
276 * @speed_hz: Select a speed other then the device default for this
277 * transfer. If 0 the default (from spi_device) is used.
278 * @bits_per_word: select a bits_per_word other then the device default
279 * for this transfer. If 0 the default (from spi_device) is used.
271 * @cs_change: affects chipselect after this transfer completes 280 * @cs_change: affects chipselect after this transfer completes
272 * @delay_usecs: microseconds to delay after this transfer before 281 * @delay_usecs: microseconds to delay after this transfer before
273 * (optionally) changing the chipselect status, then starting 282 * (optionally) changing the chipselect status, then starting
274 * the next transfer or completing this spi_message. 283 * the next transfer or completing this spi_message.
275 * @transfer_list: transfers are sequenced through spi_message.transfers 284 * @transfer_list: transfers are sequenced through spi_message.transfers
276 * 285 *
277 * SPI transfers always write the same number of bytes as they read. 286 * SPI transfers always write the same number of bytes as they read.
@@ -322,7 +331,9 @@ struct spi_transfer {
322 dma_addr_t rx_dma; 331 dma_addr_t rx_dma;
323 332
324 unsigned cs_change:1; 333 unsigned cs_change:1;
334 u8 bits_per_word;
325 u16 delay_usecs; 335 u16 delay_usecs;
336 u32 speed_hz;
326 337
327 struct list_head transfer_list; 338 struct list_head transfer_list;
328}; 339};
@@ -356,7 +367,7 @@ struct spi_transfer {
356 * and its transfers, ignore them until its completion callback. 367 * and its transfers, ignore them until its completion callback.
357 */ 368 */
358struct spi_message { 369struct spi_message {
359 struct list_head transfers; 370 struct list_head transfers;
360 371
361 struct spi_device *spi; 372 struct spi_device *spi;
362 373
@@ -374,7 +385,7 @@ struct spi_message {
374 */ 385 */
375 386
376 /* completion is reported through a callback */ 387 /* completion is reported through a callback */
377 void (*complete)(void *context); 388 void (*complete)(void *context);
378 void *context; 389 void *context;
379 unsigned actual_length; 390 unsigned actual_length;
380 int status; 391 int status;
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h
index c961fe9bf3eb..16ce178f54d7 100644
--- a/include/linux/spi/spi_bitbang.h
+++ b/include/linux/spi/spi_bitbang.h
@@ -30,6 +30,12 @@ struct spi_bitbang {
30 30
31 struct spi_master *master; 31 struct spi_master *master;
32 32
33 /* setup_transfer() changes clock and/or wordsize to match settings
34 * for this transfer; zeroes restore defaults from spi_device.
35 */
36 int (*setup_transfer)(struct spi_device *spi,
37 struct spi_transfer *t);
38
33 void (*chipselect)(struct spi_device *spi, int is_on); 39 void (*chipselect)(struct spi_device *spi, int is_on);
34#define BITBANG_CS_ACTIVE 1 /* normally nCS, active low */ 40#define BITBANG_CS_ACTIVE 1 /* normally nCS, active low */
35#define BITBANG_CS_INACTIVE 0 41#define BITBANG_CS_INACTIVE 0
@@ -51,6 +57,8 @@ struct spi_bitbang {
51extern int spi_bitbang_setup(struct spi_device *spi); 57extern int spi_bitbang_setup(struct spi_device *spi);
52extern void spi_bitbang_cleanup(const struct spi_device *spi); 58extern void spi_bitbang_cleanup(const struct spi_device *spi);
53extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m); 59extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m);
60extern int spi_bitbang_setup_transfer(struct spi_device *spi,
61 struct spi_transfer *t);
54 62
55/* start or stop queue processing */ 63/* start or stop queue processing */
56extern int spi_bitbang_start(struct spi_bitbang *spi); 64extern int spi_bitbang_start(struct spi_bitbang *spi);
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 5b1fdf1cff4f..f03c24719302 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -296,7 +296,7 @@ static inline void disable_swap_token(void)
296#define read_swap_cache_async(swp,vma,addr) NULL 296#define read_swap_cache_async(swp,vma,addr) NULL
297#define lookup_swap_cache(swp) NULL 297#define lookup_swap_cache(swp) NULL
298#define valid_swaphandles(swp, off) 0 298#define valid_swaphandles(swp, off) 0
299#define can_share_swap_page(p) 0 299#define can_share_swap_page(p) (page_mapcount(p) == 1)
300#define move_to_swap_cache(p, swp) 1 300#define move_to_swap_cache(p, swp) 1
301#define move_from_swap_cache(p, i, m) 1 301#define move_from_swap_cache(p, i, m) 1
302#define __delete_from_swap_cache(p) /*NOTHING*/ 302#define __delete_from_swap_cache(p) /*NOTHING*/
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index d3ebc0e68b2b..60d49e5456e7 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -52,6 +52,7 @@ struct utimbuf;
52struct mq_attr; 52struct mq_attr;
53struct compat_stat; 53struct compat_stat;
54struct compat_timeval; 54struct compat_timeval;
55struct robust_list_head;
55 56
56#include <linux/config.h> 57#include <linux/config.h>
57#include <linux/types.h> 58#include <linux/types.h>
@@ -574,9 +575,17 @@ asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
574 int fd_out, loff_t __user *off_out, 575 int fd_out, loff_t __user *off_out,
575 size_t len, unsigned int flags); 576 size_t len, unsigned int flags);
576 577
578asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov,
579 unsigned long nr_segs, unsigned int flags);
580
577asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags); 581asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags);
578 582
579asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, 583asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
580 unsigned int flags); 584 unsigned int flags);
585asmlinkage long sys_get_robust_list(int pid,
586 struct robust_list_head __user **head_ptr,
587 size_t __user *len_ptr);
588asmlinkage long sys_set_robust_list(struct robust_list_head __user *head,
589 size_t len);
581 590
582#endif 591#endif
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 76eaeff76f82..cee944dbdcd4 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -313,6 +313,7 @@ enum
313 NET_NF_CONNTRACK_FRAG6_TIMEOUT=29, 313 NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
314 NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30, 314 NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
315 NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31, 315 NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
316 NET_NF_CONNTRACK_CHECKSUM=32,
316}; 317};
317 318
318/* /proc/sys/net/ipv4 */ 319/* /proc/sys/net/ipv4 */
@@ -403,6 +404,8 @@ enum
403 NET_TCP_MTU_PROBING=113, 404 NET_TCP_MTU_PROBING=113,
404 NET_TCP_BASE_MSS=114, 405 NET_TCP_BASE_MSS=114,
405 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115, 406 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
407 NET_TCP_DMA_COPYBREAK=116,
408 NET_TCP_SLOW_START_AFTER_IDLE=117,
406}; 409};
407 410
408enum { 411enum {
@@ -491,6 +494,7 @@ enum
491 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25, 494 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
492 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26, 495 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
493 NET_IPV4_NF_CONNTRACK_COUNT=27, 496 NET_IPV4_NF_CONNTRACK_COUNT=27,
497 NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
494}; 498};
495 499
496/* /proc/sys/net/ipv6 */ 500/* /proc/sys/net/ipv6 */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 542d39596bd8..c90daa5da6c3 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -18,6 +18,7 @@
18#define _LINUX_TCP_H 18#define _LINUX_TCP_H
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/dmaengine.h>
21#include <asm/byteorder.h> 22#include <asm/byteorder.h>
22 23
23struct tcphdr { 24struct tcphdr {
@@ -233,6 +234,13 @@ struct tcp_sock {
233 struct iovec *iov; 234 struct iovec *iov;
234 int memory; 235 int memory;
235 int len; 236 int len;
237#ifdef CONFIG_NET_DMA
238 /* members for async copy */
239 struct dma_chan *dma_chan;
240 int wakeup;
241 struct dma_pinned_list *pinned_list;
242 dma_cookie_t dma_cookie;
243#endif
236 } ucopy; 244 } ucopy;
237 245
238 __u32 snd_wl1; /* Sequence for window update */ 246 __u32 snd_wl1; /* Sequence for window update */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index d7670ec1ec1e..ad7fa9c86c10 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1141,8 +1141,13 @@ extern char *v4l2_type_names[];
1141/* Compatibility layer interface -- v4l1-compat module */ 1141/* Compatibility layer interface -- v4l1-compat module */
1142typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, 1142typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
1143 unsigned int cmd, void *arg); 1143 unsigned int cmd, void *arg);
1144
1145#ifdef CONFIG_VIDEO_V4L1_COMPAT
1144int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, 1146int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
1145 int cmd, void *arg, v4l2_kioctl driver_ioctl); 1147 int cmd, void *arg, v4l2_kioctl driver_ioctl);
1148#else
1149#define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL
1150#endif
1146 1151
1147/* 32 Bits compatibility layer for 64 bits processors */ 1152/* 32 Bits compatibility layer for 64 bits processors */
1148extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, 1153extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 530ae3f4248c..fab5aed8ca31 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -73,11 +73,6 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
73int vt_waitactive(int vt); 73int vt_waitactive(int vt);
74void change_console(struct vc_data *new_vc); 74void change_console(struct vc_data *new_vc);
75void reset_vc(struct vc_data *vc); 75void reset_vc(struct vc_data *vc);
76#ifdef CONFIG_VT
77int is_console_suspend_safe(void);
78#else
79static inline int is_console_suspend_safe(void) { return 1; }
80#endif
81 76
82/* 77/*
83 * vc_screen.c shares this temporary buffer with the console write code so that 78 * vc_screen.c shares this temporary buffer with the console write code so that
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 6b42cc474c01..46a15c7a1a13 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -118,6 +118,10 @@ enum
118 XFRM_SHARE_UNIQUE /* Use once */ 118 XFRM_SHARE_UNIQUE /* Use once */
119}; 119};
120 120
121#define XFRM_MODE_TRANSPORT 0
122#define XFRM_MODE_TUNNEL 1
123#define XFRM_MODE_MAX 2
124
121/* Netlink configuration messages. */ 125/* Netlink configuration messages. */
122enum { 126enum {
123 XFRM_MSG_BASE = 0x10, 127 XFRM_MSG_BASE = 0x10,