aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/console.h4
-rw-r--r--include/linux/dmaengine.h359
-rw-r--r--include/linux/elevator.h2
-rw-r--r--include/linux/hrtimer.h2
-rw-r--r--include/linux/i2o.h5
-rw-r--r--include/linux/igmp.h2
-rw-r--r--include/linux/input.h13
-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/m48t86.h4
-rw-r--r--include/linux/mempolicy.h1
-rw-r--r--include/linux/mmzone.h1
-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.h28
-rw-r--r--include/linux/netdevice.h45
-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/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_types.h3
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_sip.h44
-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/rbtree.h26
-rw-r--r--include/linux/security.h40
-rw-r--r--include/linux/selinux.h32
-rw-r--r--include/linux/skbuff.h74
-rw-r--r--include/linux/sysctl.h4
-rw-r--r--include/linux/tcp.h8
-rw-r--r--include/linux/vt_kern.h5
-rw-r--r--include/linux/xfrm.h4
46 files changed, 1169 insertions, 444 deletions
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/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/hrtimer.h b/include/linux/hrtimer.h
index 306acf1dc6d5..7d2a1b974c5e 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -127,7 +127,7 @@ extern ktime_t hrtimer_get_next_event(void);
127 127
128static inline int hrtimer_active(const struct hrtimer *timer) 128static inline int hrtimer_active(const struct hrtimer *timer)
129{ 129{
130 return timer->node.rb_parent != HRTIMER_INACTIVE; 130 return rb_parent(&timer->node) != &timer->node;
131} 131}
132 132
133/* Forward a hrtimer so it expires after now: */ 133/* Forward a hrtimer so it expires after now: */
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 b48d9873cbbc..b32c2b6e53f6 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -346,6 +346,8 @@ struct input_absinfo {
346#define KEY_SAVE 234 346#define KEY_SAVE 234
347#define KEY_DOCUMENTS 235 347#define KEY_DOCUMENTS 235
348 348
349#define KEY_BATTERY 236
350
349#define KEY_UNKNOWN 240 351#define KEY_UNKNOWN 240
350 352
351#define BTN_MISC 0x100 353#define BTN_MISC 0x100
@@ -578,14 +580,9 @@ struct input_absinfo {
578 * Switch events 580 * Switch events
579 */ 581 */
580 582
581#define SW_0 0x00 583#define SW_LID 0x00 /* set = lid shut */
582#define SW_1 0x01 584#define SW_TABLET_MODE 0x01 /* set = tablet mode */
583#define SW_2 0x02 585#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */
584#define SW_3 0x03
585#define SW_4 0x04
586#define SW_5 0x05
587#define SW_6 0x06
588#define SW_7 0x07
589#define SW_MAX 0x0f 586#define SW_MAX 0x0f
590 587
591/* 588/*
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/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 8dfdd352bccd..72440f0a443d 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -35,6 +35,7 @@
35#include <linux/nodemask.h> 35#include <linux/nodemask.h>
36 36
37struct vm_area_struct; 37struct vm_area_struct;
38struct mm_struct;
38 39
39#ifdef CONFIG_NUMA 40#ifdef CONFIG_NUMA
40 41
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 230180c3eb61..9742e3c16222 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -14,6 +14,7 @@
14#include <linux/seqlock.h> 14#include <linux/seqlock.h>
15#include <linux/nodemask.h> 15#include <linux/nodemask.h>
16#include <asm/atomic.h> 16#include <asm/atomic.h>
17#include <asm/page.h>
17 18
18/* Free memory management - zoned buddy allocator. */ 19/* Free memory management - zoned buddy allocator. */
19#ifndef CONFIG_FORCE_MAX_ZONEORDER 20#ifndef CONFIG_FORCE_MAX_ZONEORDER
diff --git a/include/linux/module.h b/include/linux/module.h
index 05e7dd17b7d0..c2d89e037af0 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -556,13 +556,4 @@ static inline void module_remove_driver(struct device_driver *driver)
556 556
557#define __MODULE_STRING(x) __stringify(x) 557#define __MODULE_STRING(x) __stringify(x)
558 558
559/* Use symbol_get and symbol_put instead. You'll thank me. */
560#define HAVE_INTER_MODULE
561extern void __deprecated inter_module_register(const char *,
562 struct module *, const void *);
563extern void __deprecated inter_module_unregister(const char *);
564extern const void * __deprecated inter_module_get_request(const char *,
565 const char *);
566extern void __deprecated inter_module_put(const char *);
567
568#endif /* _LINUX_MODULE_H */ 559#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 012a47df1960..9b7a2b525d63 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -55,18 +55,69 @@ struct mtd_erase_region_info {
55 u_int32_t numblocks; /* Number of blocks of erasesize in this region */ 55 u_int32_t numblocks; /* Number of blocks of erasesize in this region */
56}; 56};
57 57
58/*
59 * oob operation modes
60 *
61 * MTD_OOB_PLACE: oob data are placed at the given offset
62 * MTD_OOB_AUTO: oob data are automatically placed at the free areas
63 * which are defined by the ecclayout
64 * MTD_OOB_RAW: mode to read raw data+oob in one chunk. The oob data
65 * is inserted into the data. Thats a raw image of the
66 * flash contents.
67 */
68typedef enum {
69 MTD_OOB_PLACE,
70 MTD_OOB_AUTO,
71 MTD_OOB_RAW,
72} mtd_oob_mode_t;
73
74/**
75 * struct mtd_oob_ops - oob operation operands
76 * @mode: operation mode
77 *
78 * @len: number of bytes to write/read. When a data buffer is given
79 * (datbuf != NULL) this is the number of data bytes. When
80 + no data buffer is available this is the number of oob bytes.
81 *
82 * @retlen: number of bytes written/read. When a data buffer is given
83 * (datbuf != NULL) this is the number of data bytes. When
84 + no data buffer is available this is the number of oob bytes.
85 *
86 * @ooblen: number of oob bytes per page
87 * @ooboffs: offset of oob data in the oob area (only relevant when
88 * mode = MTD_OOB_PLACE)
89 * @datbuf: data buffer - if NULL only oob data are read/written
90 * @oobbuf: oob data buffer
91 */
92struct mtd_oob_ops {
93 mtd_oob_mode_t mode;
94 size_t len;
95 size_t retlen;
96 size_t ooblen;
97 uint32_t ooboffs;
98 uint8_t *datbuf;
99 uint8_t *oobbuf;
100};
101
58struct mtd_info { 102struct mtd_info {
59 u_char type; 103 u_char type;
60 u_int32_t flags; 104 u_int32_t flags;
61 u_int32_t size; // Total size of the MTD 105 u_int32_t size; // Total size of the MTD
62 106
63 /* "Major" erase size for the device. Naïve users may take this 107 /* "Major" erase size for the device. Naïve users may take this
64 * to be the only erase size available, or may use the more detailed 108 * to be the only erase size available, or may use the more detailed
65 * information below if they desire 109 * information below if they desire
66 */ 110 */
67 u_int32_t erasesize; 111 u_int32_t erasesize;
112 /* Minimal writable flash unit size. In case of NOR flash it is 1 (even
113 * though individual bits can be cleared), in case of NAND flash it is
114 * one NAND page (or half, or one-fourths of it), in case of ECC-ed NOR
115 * it is of ECC block size, etc. It is illegal to have writesize = 0.
116 * Any driver registering a struct mtd_info must ensure a writesize of
117 * 1 or larger.
118 */
119 u_int32_t writesize;
68 120
69 u_int32_t oobblock; // Size of OOB blocks (e.g. 512)
70 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) 121 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16)
71 u_int32_t ecctype; 122 u_int32_t ecctype;
72 u_int32_t eccsize; 123 u_int32_t eccsize;
@@ -78,7 +129,6 @@ struct mtd_info {
78 * MTD_PROGRAM_REGIONS flag is set. 129 * MTD_PROGRAM_REGIONS flag is set.
79 * (Maybe we should have an union for those?) 130 * (Maybe we should have an union for those?)
80 */ 131 */
81#define MTD_PROGREGION_SIZE(mtd) (mtd)->oobblock
82#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize 132#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize
83#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype 133#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype
84 134
@@ -86,9 +136,8 @@ struct mtd_info {
86 char *name; 136 char *name;
87 int index; 137 int index;
88 138
89 // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) 139 /* ecc layout structure pointer - read only ! */
90 struct nand_oobinfo oobinfo; 140 struct nand_ecclayout *ecclayout;
91 u_int32_t oobavail; // Number of bytes in OOB area available for fs
92 141
93 /* Data for variable erase regions. If numeraseregions is zero, 142 /* Data for variable erase regions. If numeraseregions is zero,
94 * it means that the whole device has erasesize as given above. 143 * it means that the whole device has erasesize as given above.
@@ -111,11 +160,10 @@ struct mtd_info {
111 int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 160 int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
112 int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); 161 int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
113 162
114 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); 163 int (*read_oob) (struct mtd_info *mtd, loff_t from,
115 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); 164 struct mtd_oob_ops *ops);
116 165 int (*write_oob) (struct mtd_info *mtd, loff_t to,
117 int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 166 struct mtd_oob_ops *ops);
118 int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
119 167
120 /* 168 /*
121 * Methods to access the protection register area, present in some 169 * Methods to access the protection register area, present in some
@@ -129,17 +177,11 @@ struct mtd_info {
129 int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 177 int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
130 int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len); 178 int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len);
131 179
132 /* kvec-based read/write methods. We need these especially for NAND flash, 180 /* kvec-based read/write methods.
133 with its limited number of write cycles per erase.
134 NB: The 'count' parameter is the number of _vectors_, each of 181 NB: The 'count' parameter is the number of _vectors_, each of
135 which contains an (ofs, len) tuple. 182 which contains an (ofs, len) tuple.
136 */ 183 */
137 int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen);
138 int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from,
139 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
140 int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); 184 int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen);
141 int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to,
142 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
143 185
144 /* Sync */ 186 /* Sync */
145 void (*sync) (struct mtd_info *mtd); 187 void (*sync) (struct mtd_info *mtd);
@@ -158,6 +200,9 @@ struct mtd_info {
158 200
159 struct notifier_block reboot_notifier; /* default mode before reboot */ 201 struct notifier_block reboot_notifier; /* default mode before reboot */
160 202
203 /* ECC status information */
204 struct mtd_ecc_stats ecc_stats;
205
161 void *priv; 206 void *priv;
162 207
163 struct module *owner; 208 struct module *owner;
@@ -191,20 +236,6 @@ int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
191int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, 236int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs,
192 unsigned long count, loff_t from, size_t *retlen); 237 unsigned long count, loff_t from, size_t *retlen);
193 238
194#define MTD_ERASE(mtd, args...) (*(mtd->erase))(mtd, args)
195#define MTD_POINT(mtd, a,b,c,d) (*(mtd->point))(mtd, a,b,c, (u_char **)(d))
196#define MTD_UNPOINT(mtd, arg) (*(mtd->unpoint))(mtd, (u_char *)arg)
197#define MTD_READ(mtd, args...) (*(mtd->read))(mtd, args)
198#define MTD_WRITE(mtd, args...) (*(mtd->write))(mtd, args)
199#define MTD_READV(mtd, args...) (*(mtd->readv))(mtd, args)
200#define MTD_WRITEV(mtd, args...) (*(mtd->writev))(mtd, args)
201#define MTD_READECC(mtd, args...) (*(mtd->read_ecc))(mtd, args)
202#define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args)
203#define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args)
204#define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args)
205#define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0)
206
207
208#ifdef CONFIG_MTD_PARTITIONS 239#ifdef CONFIG_MTD_PARTITIONS
209void mtd_erase_callback(struct erase_info *instr); 240void mtd_erase_callback(struct erase_info *instr);
210#else 241#else
@@ -225,7 +256,7 @@ static inline void mtd_erase_callback(struct erase_info *instr)
225 256
226#ifdef CONFIG_MTD_DEBUG 257#ifdef CONFIG_MTD_DEBUG
227#define DEBUG(n, args...) \ 258#define DEBUG(n, args...) \
228 do { \ 259 do { \
229 if (n <= CONFIG_MTD_DEBUG_VERBOSE) \ 260 if (n <= CONFIG_MTD_DEBUG_VERBOSE) \
230 printk(KERN_INFO args); \ 261 printk(KERN_INFO args); \
231 } while(0) 262 } while(0)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 4b99d285803f..66559272ebcb 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
@@ -66,10 +30,6 @@ extern int nand_scan (struct mtd_info *mtd, int max_chips);
66/* Free resources held by the NAND device */ 30/* Free resources held by the NAND device */
67extern void nand_release (struct mtd_info *mtd); 31extern void nand_release (struct mtd_info *mtd);
68 32
69/* Read raw data from the device without ECC */
70extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_t len, size_t ooblen);
71
72
73/* The maximum number of NAND chips in an array */ 33/* The maximum number of NAND chips in an array */
74#define NAND_MAX_CHIPS 8 34#define NAND_MAX_CHIPS 8
75 35
@@ -78,44 +38,45 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
78 * adjust this accordingly. 38 * adjust this accordingly.
79 */ 39 */
80#define NAND_MAX_OOBSIZE 64 40#define NAND_MAX_OOBSIZE 64
41#define NAND_MAX_PAGESIZE 2048
81 42
82/* 43/*
83 * Constants for hardware specific CLE/ALE/NCE function 44 * Constants for hardware specific CLE/ALE/NCE function
84*/ 45 *
46 * These are bits which can be or'ed to set/clear multiple
47 * bits in one go.
48 */
85/* Select the chip by setting nCE to low */ 49/* Select the chip by setting nCE to low */
86#define NAND_CTL_SETNCE 1 50#define NAND_NCE 0x01
87/* Deselect the chip by setting nCE to high */
88#define NAND_CTL_CLRNCE 2
89/* Select the command latch by setting CLE to high */ 51/* Select the command latch by setting CLE to high */
90#define NAND_CTL_SETCLE 3 52#define NAND_CLE 0x02
91/* Deselect the command latch by setting CLE to low */
92#define NAND_CTL_CLRCLE 4
93/* Select the address latch by setting ALE to high */ 53/* Select the address latch by setting ALE to high */
94#define NAND_CTL_SETALE 5 54#define NAND_ALE 0x04
95/* Deselect the address latch by setting ALE to low */ 55
96#define NAND_CTL_CLRALE 6 56#define NAND_CTRL_CLE (NAND_NCE | NAND_CLE)
97/* Set write protection by setting WP to high. Not used! */ 57#define NAND_CTRL_ALE (NAND_NCE | NAND_ALE)
98#define NAND_CTL_SETWP 7 58#define NAND_CTRL_CHANGE 0x80
99/* Clear write protection by setting WP to low. Not used! */
100#define NAND_CTL_CLRWP 8
101 59
102/* 60/*
103 * Standard NAND flash commands 61 * Standard NAND flash commands
104 */ 62 */
105#define NAND_CMD_READ0 0 63#define NAND_CMD_READ0 0
106#define NAND_CMD_READ1 1 64#define NAND_CMD_READ1 1
65#define NAND_CMD_RNDOUT 5
107#define NAND_CMD_PAGEPROG 0x10 66#define NAND_CMD_PAGEPROG 0x10
108#define NAND_CMD_READOOB 0x50 67#define NAND_CMD_READOOB 0x50
109#define NAND_CMD_ERASE1 0x60 68#define NAND_CMD_ERASE1 0x60
110#define NAND_CMD_STATUS 0x70 69#define NAND_CMD_STATUS 0x70
111#define NAND_CMD_STATUS_MULTI 0x71 70#define NAND_CMD_STATUS_MULTI 0x71
112#define NAND_CMD_SEQIN 0x80 71#define NAND_CMD_SEQIN 0x80
72#define NAND_CMD_RNDIN 0x85
113#define NAND_CMD_READID 0x90 73#define NAND_CMD_READID 0x90
114#define NAND_CMD_ERASE2 0xd0 74#define NAND_CMD_ERASE2 0xd0
115#define NAND_CMD_RESET 0xff 75#define NAND_CMD_RESET 0xff
116 76
117/* Extended commands for large page devices */ 77/* Extended commands for large page devices */
118#define NAND_CMD_READSTART 0x30 78#define NAND_CMD_READSTART 0x30
79#define NAND_CMD_RNDOUTSTART 0xE0
119#define NAND_CMD_CACHEDPROG 0x15 80#define NAND_CMD_CACHEDPROG 0x15
120 81
121/* Extended commands for AG-AND device */ 82/* Extended commands for AG-AND device */
@@ -137,6 +98,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
137#define NAND_CMD_STATUS_RESET 0x7f 98#define NAND_CMD_STATUS_RESET 0x7f
138#define NAND_CMD_STATUS_CLEAR 0xff 99#define NAND_CMD_STATUS_CLEAR 0xff
139 100
101#define NAND_CMD_NONE -1
102
140/* Status bits */ 103/* Status bits */
141#define NAND_STATUS_FAIL 0x01 104#define NAND_STATUS_FAIL 0x01
142#define NAND_STATUS_FAIL_N1 0x02 105#define NAND_STATUS_FAIL_N1 0x02
@@ -147,21 +110,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
147/* 110/*
148 * Constants for ECC_MODES 111 * Constants for ECC_MODES
149 */ 112 */
150 113typedef enum {
151/* No ECC. Usage is not recommended ! */ 114 NAND_ECC_NONE,
152#define NAND_ECC_NONE 0 115 NAND_ECC_SOFT,
153/* Software ECC 3 byte ECC per 256 Byte data */ 116 NAND_ECC_HW,
154#define NAND_ECC_SOFT 1 117 NAND_ECC_HW_SYNDROME,
155/* Hardware ECC 3 byte ECC per 256 Byte data */ 118} nand_ecc_modes_t;
156#define NAND_ECC_HW3_256 2
157/* Hardware ECC 3 byte ECC per 512 Byte data */
158#define NAND_ECC_HW3_512 3
159/* Hardware ECC 3 byte ECC per 512 Byte data */
160#define NAND_ECC_HW6_512 4
161/* Hardware ECC 8 byte ECC per 512 Byte data */
162#define NAND_ECC_HW8_512 6
163/* Hardware ECC 12 byte ECC per 2048 Byte data */
164#define NAND_ECC_HW12_2048 7
165 119
166/* 120/*
167 * Constants for Hardware ECC 121 * Constants for Hardware ECC
@@ -200,6 +154,10 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
200 * bits from adjacent blocks from 'leaking' in altering data. 154 * bits from adjacent blocks from 'leaking' in altering data.
201 * This happens with the Renesas AG-AND chips, possibly others. */ 155 * This happens with the Renesas AG-AND chips, possibly others. */
202#define BBT_AUTO_REFRESH 0x00000080 156#define BBT_AUTO_REFRESH 0x00000080
157/* Chip does not require ready check on read. True
158 * for all large page devices, as they do not support
159 * autoincrement.*/
160#define NAND_NO_READRDY 0x00000100
203 161
204/* Options valid for Samsung large page devices */ 162/* Options valid for Samsung large page devices */
205#define NAND_SAMSUNG_LP_OPTIONS \ 163#define NAND_SAMSUNG_LP_OPTIONS \
@@ -218,18 +176,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
218/* Use a flash based bad block table. This option is passed to the 176/* Use a flash based bad block table. This option is passed to the
219 * default bad block table function. */ 177 * default bad block table function. */
220#define NAND_USE_FLASH_BBT 0x00010000 178#define NAND_USE_FLASH_BBT 0x00010000
221/* The hw ecc generator provides a syndrome instead a ecc value on read
222 * This can only work if we have the ecc bytes directly behind the
223 * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */
224#define NAND_HWECC_SYNDROME 0x00020000
225/* This option skips the bbt scan during initialization. */ 179/* This option skips the bbt scan during initialization. */
226#define NAND_SKIP_BBTSCAN 0x00040000 180#define NAND_SKIP_BBTSCAN 0x00020000
227 181
228/* Options set by nand scan */ 182/* Options set by nand scan */
229/* Nand scan has allocated oob_buf */ 183/* Nand scan has allocated controller struct */
230#define NAND_OOBBUF_ALLOC 0x40000000 184#define NAND_CONTROLLER_ALLOC 0x80000000
231/* Nand scan has allocated data_buf */
232#define NAND_DATABUF_ALLOC 0x80000000
233 185
234 186
235/* 187/*
@@ -263,45 +215,102 @@ struct nand_hw_control {
263}; 215};
264 216
265/** 217/**
218 * struct nand_ecc_ctrl - Control structure for ecc
219 * @mode: ecc mode
220 * @steps: number of ecc steps per page
221 * @size: data bytes per ecc step
222 * @bytes: ecc bytes per step
223 * @total: total number of ecc bytes per page
224 * @prepad: padding information for syndrome based ecc generators
225 * @postpad: padding information for syndrome based ecc generators
226 * @hwctl: function to control hardware ecc generator. Must only
227 * be provided if an hardware ECC is available
228 * @calculate: function for ecc calculation or readback from ecc hardware
229 * @correct: function for ecc correction, matching to ecc generator (sw/hw)
230 * @read_page: function to read a page according to the ecc generator requirements
231 * @write_page: function to write a page according to the ecc generator requirements
232 */
233struct nand_ecc_ctrl {
234 nand_ecc_modes_t mode;
235 int steps;
236 int size;
237 int bytes;
238 int total;
239 int prepad;
240 int postpad;
241 struct nand_ecclayout *layout;
242 void (*hwctl)(struct mtd_info *mtd, int mode);
243 int (*calculate)(struct mtd_info *mtd,
244 const uint8_t *dat,
245 uint8_t *ecc_code);
246 int (*correct)(struct mtd_info *mtd, uint8_t *dat,
247 uint8_t *read_ecc,
248 uint8_t *calc_ecc);
249 int (*read_page)(struct mtd_info *mtd,
250 struct nand_chip *chip,
251 uint8_t *buf);
252 void (*write_page)(struct mtd_info *mtd,
253 struct nand_chip *chip,
254 const uint8_t *buf);
255 int (*read_oob)(struct mtd_info *mtd,
256 struct nand_chip *chip,
257 int page,
258 int sndcmd);
259 int (*write_oob)(struct mtd_info *mtd,
260 struct nand_chip *chip,
261 int page);
262};
263
264/**
265 * struct nand_buffers - buffer structure for read/write
266 * @ecccalc: buffer for calculated ecc
267 * @ecccode: buffer for ecc read from flash
268 * @oobwbuf: buffer for write oob data
269 * @databuf: buffer for data - dynamically sized
270 * @oobrbuf: buffer to read oob data
271 *
272 * Do not change the order of buffers. databuf and oobrbuf must be in
273 * consecutive order.
274 */
275struct nand_buffers {
276 uint8_t ecccalc[NAND_MAX_OOBSIZE];
277 uint8_t ecccode[NAND_MAX_OOBSIZE];
278 uint8_t oobwbuf[NAND_MAX_OOBSIZE];
279 uint8_t databuf[NAND_MAX_PAGESIZE];
280 uint8_t oobrbuf[NAND_MAX_OOBSIZE];
281};
282
283/**
266 * struct nand_chip - NAND Private Flash Chip Data 284 * struct nand_chip - NAND Private Flash Chip Data
267 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device 285 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device
268 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device 286 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device
269 * @read_byte: [REPLACEABLE] read one byte from the chip 287 * @read_byte: [REPLACEABLE] read one byte from the chip
270 * @write_byte: [REPLACEABLE] write one byte to the chip
271 * @read_word: [REPLACEABLE] read one word from the chip 288 * @read_word: [REPLACEABLE] read one word from the chip
272 * @write_word: [REPLACEABLE] write one word to the chip
273 * @write_buf: [REPLACEABLE] write data from the buffer to the chip 289 * @write_buf: [REPLACEABLE] write data from the buffer to the chip
274 * @read_buf: [REPLACEABLE] read data from the chip into the buffer 290 * @read_buf: [REPLACEABLE] read data from the chip into the buffer
275 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data 291 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data
276 * @select_chip: [REPLACEABLE] select chip nr 292 * @select_chip: [REPLACEABLE] select chip nr
277 * @block_bad: [REPLACEABLE] check, if the block is bad 293 * @block_bad: [REPLACEABLE] check, if the block is bad
278 * @block_markbad: [REPLACEABLE] mark the block bad 294 * @block_markbad: [REPLACEABLE] mark the block bad
279 * @hwcontrol: [BOARDSPECIFIC] hardwarespecific function for accesing control-lines 295 * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling
296 * ALE/CLE/nCE. Also used to write command and address
280 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line 297 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line
281 * If set to NULL no access to ready/busy is available and the ready/busy information 298 * If set to NULL no access to ready/busy is available and the ready/busy information
282 * is read from the chip status register 299 * is read from the chip status register
283 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip 300 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip
284 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready 301 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready
285 * @calculate_ecc: [REPLACEABLE] function for ecc calculation or readback from ecc hardware 302 * @ecc: [BOARDSPECIFIC] ecc control ctructure
286 * @correct_data: [REPLACEABLE] function for ecc correction, matching to ecc generator (sw/hw)
287 * @enable_hwecc: [BOARDSPECIFIC] function to enable (reset) hardware ecc generator. Must only
288 * be provided if a hardware ECC is available
289 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support 303 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support
290 * @scan_bbt: [REPLACEABLE] function to scan bad block table 304 * @scan_bbt: [REPLACEABLE] function to scan bad block table
291 * @eccmode: [BOARDSPECIFIC] mode of ecc, see defines
292 * @eccsize: [INTERN] databytes used per ecc-calculation
293 * @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step
294 * @eccsteps: [INTERN] number of ecc calculation steps per page
295 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) 305 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR)
296 * @chip_lock: [INTERN] spinlock used to protect access to this structure and the chip
297 * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress 306 * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress
298 * @state: [INTERN] the current state of the NAND device 307 * @state: [INTERN] the current state of the NAND device
299 * @page_shift: [INTERN] number of address bits in a page (column address bits) 308 * @page_shift: [INTERN] number of address bits in a page (column address bits)
300 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock 309 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock
301 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry 310 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry
302 * @chip_shift: [INTERN] number of address bits in one chip 311 * @chip_shift: [INTERN] number of address bits in one chip
303 * @data_buf: [INTERN] internal buffer for one page + oob 312 * @datbuf: [INTERN] internal buffer for one page + oob
304 * @oob_buf: [INTERN] oob buffer for one eraseblock 313 * @oobbuf: [INTERN] oob buffer for one eraseblock
305 * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized 314 * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized
306 * @data_poi: [INTERN] pointer to a data buffer 315 * @data_poi: [INTERN] pointer to a data buffer
307 * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about 316 * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about
@@ -311,12 +320,13 @@ struct nand_hw_control {
311 * @chipsize: [INTERN] the size of one chip for multichip arrays 320 * @chipsize: [INTERN] the size of one chip for multichip arrays
312 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 321 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
313 * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf 322 * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf
314 * @autooob: [REPLACEABLE] the default (auto)placement scheme 323 * @ecclayout: [REPLACEABLE] the default ecc placement scheme
315 * @bbt: [INTERN] bad block table pointer 324 * @bbt: [INTERN] bad block table pointer
316 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup 325 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup
317 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor 326 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor
318 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan 327 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan
319 * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices 328 * @controller: [REPLACEABLE] a pointer to a hardware controller structure
329 * which is shared among multiple independend devices
320 * @priv: [OPTIONAL] pointer to private chip date 330 * @priv: [OPTIONAL] pointer to private chip date
321 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks 331 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
322 * (determine if errors are correctable) 332 * (determine if errors are correctable)
@@ -324,58 +334,57 @@ struct nand_hw_control {
324 334
325struct nand_chip { 335struct nand_chip {
326 void __iomem *IO_ADDR_R; 336 void __iomem *IO_ADDR_R;
327 void __iomem *IO_ADDR_W; 337 void __iomem *IO_ADDR_W;
328 338
329 u_char (*read_byte)(struct mtd_info *mtd); 339 uint8_t (*read_byte)(struct mtd_info *mtd);
330 void (*write_byte)(struct mtd_info *mtd, u_char byte);
331 u16 (*read_word)(struct mtd_info *mtd); 340 u16 (*read_word)(struct mtd_info *mtd);
332 void (*write_word)(struct mtd_info *mtd, u16 word); 341 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
333 342 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
334 void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len); 343 int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
335 void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len);
336 int (*verify_buf)(struct mtd_info *mtd, const u_char *buf, int len);
337 void (*select_chip)(struct mtd_info *mtd, int chip); 344 void (*select_chip)(struct mtd_info *mtd, int chip);
338 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); 345 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
339 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); 346 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
340 void (*hwcontrol)(struct mtd_info *mtd, int cmd); 347 void (*cmd_ctrl)(struct mtd_info *mtd, int dat,
341 int (*dev_ready)(struct mtd_info *mtd); 348 unsigned int ctrl);
342 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); 349 int (*dev_ready)(struct mtd_info *mtd);
343 int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this, int state); 350 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr);
344 int (*calculate_ecc)(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); 351 int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
345 int (*correct_data)(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc);
346 void (*enable_hwecc)(struct mtd_info *mtd, int mode);
347 void (*erase_cmd)(struct mtd_info *mtd, int page); 352 void (*erase_cmd)(struct mtd_info *mtd, int page);
348 int (*scan_bbt)(struct mtd_info *mtd); 353 int (*scan_bbt)(struct mtd_info *mtd);
349 int eccmode; 354 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
350 int eccsize; 355
351 int eccbytes; 356 int chip_delay;
352 int eccsteps; 357 unsigned int options;
353 int chip_delay; 358
354 spinlock_t chip_lock; 359 int page_shift;
355 wait_queue_head_t wq;
356 nand_state_t state;
357 int page_shift;
358 int phys_erase_shift; 360 int phys_erase_shift;
359 int bbt_erase_shift; 361 int bbt_erase_shift;
360 int chip_shift; 362 int chip_shift;
361 u_char *data_buf;
362 u_char *oob_buf;
363 int oobdirty;
364 u_char *data_poi;
365 unsigned int options;
366 int badblockpos;
367 int numchips; 363 int numchips;
368 unsigned long chipsize; 364 unsigned long chipsize;
369 int pagemask; 365 int pagemask;
370 int pagebuf; 366 int pagebuf;
371 struct nand_oobinfo *autooob; 367 int badblockpos;
368
369 nand_state_t state;
370
371 uint8_t *oob_poi;
372 struct nand_hw_control *controller;
373 struct nand_ecclayout *ecclayout;
374
375 struct nand_ecc_ctrl ecc;
376 struct nand_buffers buffers;
377 struct nand_hw_control hwcontrol;
378
379 struct mtd_oob_ops ops;
380
372 uint8_t *bbt; 381 uint8_t *bbt;
373 struct nand_bbt_descr *bbt_td; 382 struct nand_bbt_descr *bbt_td;
374 struct nand_bbt_descr *bbt_md; 383 struct nand_bbt_descr *bbt_md;
384
375 struct nand_bbt_descr *badblock_pattern; 385 struct nand_bbt_descr *badblock_pattern;
376 struct nand_hw_control *controller; 386
377 void *priv; 387 void *priv;
378 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
379}; 388};
380 389
381/* 390/*
@@ -387,19 +396,19 @@ struct nand_chip {
387#define NAND_MFR_NATIONAL 0x8f 396#define NAND_MFR_NATIONAL 0x8f
388#define NAND_MFR_RENESAS 0x07 397#define NAND_MFR_RENESAS 0x07
389#define NAND_MFR_STMICRO 0x20 398#define NAND_MFR_STMICRO 0x20
390#define NAND_MFR_HYNIX 0xad 399#define NAND_MFR_HYNIX 0xad
391 400
392/** 401/**
393 * struct nand_flash_dev - NAND Flash Device ID Structure 402 * struct nand_flash_dev - NAND Flash Device ID Structure
394 * 403 *
395 * @name: Identify the device type 404 * @name: Identify the device type
396 * @id: device ID code 405 * @id: device ID code
397 * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 406 * @pagesize: Pagesize in bytes. Either 256 or 512 or 0
398 * If the pagesize is 0, then the real pagesize 407 * If the pagesize is 0, then the real pagesize
399 * and the eraseize are determined from the 408 * and the eraseize are determined from the
400 * extended id bytes in the chip 409 * extended id bytes in the chip
401 * @erasesize: Size of an erase block in the flash device. 410 * @erasesize: Size of an erase block in the flash device.
402 * @chipsize: Total chipsize in Mega Bytes 411 * @chipsize: Total chipsize in Mega Bytes
403 * @options: Bitfield to store chip relevant options 412 * @options: Bitfield to store chip relevant options
404 */ 413 */
405struct nand_flash_dev { 414struct nand_flash_dev {
@@ -414,7 +423,7 @@ struct nand_flash_dev {
414/** 423/**
415 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure 424 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure
416 * @name: Manufacturer name 425 * @name: Manufacturer name
417 * @id: manufacturer ID code of device. 426 * @id: manufacturer ID code of device.
418*/ 427*/
419struct nand_manufacturers { 428struct nand_manufacturers {
420 int id; 429 int id;
@@ -454,7 +463,7 @@ struct nand_bbt_descr {
454 int veroffs; 463 int veroffs;
455 uint8_t version[NAND_MAX_CHIPS]; 464 uint8_t version[NAND_MAX_CHIPS];
456 int len; 465 int len;
457 int maxblocks; 466 int maxblocks;
458 int reserved_block_code; 467 int reserved_block_code;
459 uint8_t *pattern; 468 uint8_t *pattern;
460}; 469};
@@ -493,14 +502,14 @@ struct nand_bbt_descr {
493/* The maximum number of blocks to scan for a bbt */ 502/* The maximum number of blocks to scan for a bbt */
494#define NAND_BBT_SCAN_MAXBLOCKS 4 503#define NAND_BBT_SCAN_MAXBLOCKS 4
495 504
496extern int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd); 505extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
497extern int nand_update_bbt (struct mtd_info *mtd, loff_t offs); 506extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs);
498extern int nand_default_bbt (struct mtd_info *mtd); 507extern int nand_default_bbt(struct mtd_info *mtd);
499extern int nand_isbad_bbt (struct mtd_info *mtd, loff_t offs, int allowbbt); 508extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt);
500extern int nand_erase_nand (struct mtd_info *mtd, struct erase_info *instr, int allowbbt); 509extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
501extern int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, 510 int allowbbt);
502 size_t * retlen, u_char * buf, u_char * oob_buf, 511extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
503 struct nand_oobinfo *oobsel, int flags); 512 size_t * retlen, uint8_t * buf);
504 513
505/* 514/*
506* Constants for oob configuration 515* Constants for oob configuration
@@ -508,4 +517,53 @@ extern int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
508#define NAND_SMALL_BADBLOCK_POS 5 517#define NAND_SMALL_BADBLOCK_POS 5
509#define NAND_LARGE_BADBLOCK_POS 0 518#define NAND_LARGE_BADBLOCK_POS 0
510 519
520/**
521 * struct platform_nand_chip - chip level device structure
522 *
523 * @nr_chips: max. number of chips to scan for
524 * @chip_offs: chip number offset
525 * @nr_partitions: number of partitions pointed to by partitions (or zero)
526 * @partitions: mtd partition list
527 * @chip_delay: R/B delay value in us
528 * @options: Option flags, e.g. 16bit buswidth
529 * @ecclayout: ecc layout info structure
530 * @priv: hardware controller specific settings
531 */
532struct platform_nand_chip {
533 int nr_chips;
534 int chip_offset;
535 int nr_partitions;
536 struct mtd_partition *partitions;
537 struct nand_ecclayout *ecclayout;
538 int chip_delay;
539 unsigned int options;
540 void *priv;
541};
542
543/**
544 * struct platform_nand_ctrl - controller level device structure
545 *
546 * @hwcontrol: platform specific hardware control structure
547 * @dev_ready: platform specific function to read ready/busy pin
548 * @select_chip: platform specific chip select function
549 * @priv_data: private data to transport driver specific settings
550 *
551 * All fields are optional and depend on the hardware driver requirements
552 */
553struct platform_nand_ctrl {
554 void (*hwcontrol)(struct mtd_info *mtd, int cmd);
555 int (*dev_ready)(struct mtd_info *mtd);
556 void (*select_chip)(struct mtd_info *mtd, int chip);
557 void *priv;
558};
559
560/* Some helpers to access the data structures */
561static inline
562struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd)
563{
564 struct nand_chip *chip = mtd->priv;
565
566 return chip->priv;
567}
568
511#endif /* __LINUX_MTD_NAND_H */ 569#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 bffaade1111e..86831e3594f6 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -15,32 +15,26 @@
15 */ 15 */
16 16
17#ifndef __LINUX_MTD_PHYSMAP__ 17#ifndef __LINUX_MTD_PHYSMAP__
18 18#define __LINUX_MTD_PHYSMAP__
19
20#if defined(CONFIG_MTD_PHYSMAP)
21 19
22#include <linux/mtd/mtd.h> 20#include <linux/mtd/mtd.h>
23#include <linux/mtd/map.h> 21#include <linux/mtd/map.h>
24#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
25 23
26/* 24struct physmap_flash_data {
27 * The map_info for physmap. Board can override size, buswidth, phys, 25 unsigned int width;
28 * (*set_vpp)(), etc in their initial setup routine. 26 void (*set_vpp)(struct map_info *, int);
29 */ 27 unsigned int nr_parts;
30extern struct map_info physmap_map; 28 struct mtd_partition *parts;
29};
31 30
32/* 31/*
33 * Board needs to specify the exact mapping during their setup time. 32 * Board needs to specify the exact mapping during their setup time.
34 */ 33 */
35static 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,
36{ 35 int bankwidth, void (*set_vpp)(struct map_info *, int) );
37 physmap_map.phys = addr;
38 physmap_map.size = size;
39 physmap_map.bankwidth = bankwidth;
40 physmap_map.set_vpp = set_vpp;
41}
42 36
43#if defined(CONFIG_MTD_PARTITIONS) 37#ifdef CONFIG_MTD_PARTITIONS
44 38
45/* 39/*
46 * 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
@@ -54,7 +48,5 @@ static inline void physmap_configure(unsigned long addr, unsigned long size, int
54void physmap_set_partitions(struct mtd_partition *parts, int num_parts); 48void physmap_set_partitions(struct mtd_partition *parts, int num_parts);
55 49
56#endif /* defined(CONFIG_MTD_PARTITIONS) */ 50#endif /* defined(CONFIG_MTD_PARTITIONS) */
57#endif /* defined(CONFIG_MTD) */
58 51
59#endif /* __LINUX_MTD_PHYSMAP__ */ 52#endif /* __LINUX_MTD_PHYSMAP__ */
60
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index cebe677e153b..5e8e2d50429a 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -36,6 +36,7 @@
36 36
37#include <linux/device.h> 37#include <linux/device.h>
38#include <linux/percpu.h> 38#include <linux/percpu.h>
39#include <linux/dmaengine.h>
39 40
40struct divert_blk; 41struct divert_blk;
41struct vlan_group; 42struct vlan_group;
@@ -310,6 +311,9 @@ struct net_device
310#define NETIF_F_LLTX 4096 /* LockLess TX */ 311#define NETIF_F_LLTX 4096 /* LockLess TX */
311#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ 312#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/
312 313
314#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
315#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
316
313 struct net_device *next_sched; 317 struct net_device *next_sched;
314 318
315 /* Interface index. Unique device identifier */ 319 /* Interface index. Unique device identifier */
@@ -405,7 +409,7 @@ struct net_device
405 * One part is mostly used on xmit path (device) 409 * One part is mostly used on xmit path (device)
406 */ 410 */
407 /* hard_start_xmit synchronizer */ 411 /* hard_start_xmit synchronizer */
408 spinlock_t xmit_lock ____cacheline_aligned_in_smp; 412 spinlock_t _xmit_lock ____cacheline_aligned_in_smp;
409 /* cpu id of processor entered to hard_start_xmit or -1, 413 /* cpu id of processor entered to hard_start_xmit or -1,
410 if nobody entered there. 414 if nobody entered there.
411 */ 415 */
@@ -592,6 +596,9 @@ struct softnet_data
592 struct sk_buff *completion_queue; 596 struct sk_buff *completion_queue;
593 597
594 struct net_device backlog_dev; /* Sorry. 8) */ 598 struct net_device backlog_dev; /* Sorry. 8) */
599#ifdef CONFIG_NET_DMA
600 struct dma_chan *net_dma;
601#endif
595}; 602};
596 603
597DECLARE_PER_CPU(struct softnet_data,softnet_data); 604DECLARE_PER_CPU(struct softnet_data,softnet_data);
@@ -888,11 +895,43 @@ static inline void __netif_rx_complete(struct net_device *dev)
888 clear_bit(__LINK_STATE_RX_SCHED, &dev->state); 895 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
889} 896}
890 897
898static inline void netif_tx_lock(struct net_device *dev)
899{
900 spin_lock(&dev->_xmit_lock);
901 dev->xmit_lock_owner = smp_processor_id();
902}
903
904static inline void netif_tx_lock_bh(struct net_device *dev)
905{
906 spin_lock_bh(&dev->_xmit_lock);
907 dev->xmit_lock_owner = smp_processor_id();
908}
909
910static inline int netif_tx_trylock(struct net_device *dev)
911{
912 int err = spin_trylock(&dev->_xmit_lock);
913 if (!err)
914 dev->xmit_lock_owner = smp_processor_id();
915 return err;
916}
917
918static inline void netif_tx_unlock(struct net_device *dev)
919{
920 dev->xmit_lock_owner = -1;
921 spin_unlock(&dev->_xmit_lock);
922}
923
924static inline void netif_tx_unlock_bh(struct net_device *dev)
925{
926 dev->xmit_lock_owner = -1;
927 spin_unlock_bh(&dev->_xmit_lock);
928}
929
891static inline void netif_tx_disable(struct net_device *dev) 930static inline void netif_tx_disable(struct net_device *dev)
892{ 931{
893 spin_lock_bh(&dev->xmit_lock); 932 netif_tx_lock_bh(dev);
894 netif_stop_queue(dev); 933 netif_stop_queue(dev);
895 spin_unlock_bh(&dev->xmit_lock); 934 netif_tx_unlock_bh(dev);
896} 935}
897 936
898/* These functions live elsewhere (drivers/net/net_init.c, but related) */ 937/* 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/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 4255bfec0920..51dbec1892c8 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -120,6 +120,10 @@ struct ip_conntrack
120 u_int32_t mark; 120 u_int32_t mark;
121#endif 121#endif
122 122
123#ifdef CONFIG_IP_NF_CONNTRACK_SECMARK
124 u_int32_t secmark;
125#endif
126
123 /* Traversed often, so hopefully in different cacheline to top */ 127 /* Traversed often, so hopefully in different cacheline to top */
124 /* These are my tuples; original and reply */ 128 /* These are my tuples; original and reply */
125 struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX]; 129 struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX];
@@ -153,6 +157,7 @@ struct ip_conntrack_expect
153 unsigned int flags; 157 unsigned int flags;
154 158
155#ifdef CONFIG_IP_NF_NAT_NEEDED 159#ifdef CONFIG_IP_NF_NAT_NEEDED
160 u_int32_t saved_ip;
156 /* This is the original per-proto part, used to map the 161 /* This is the original per-proto part, used to map the
157 * expected connection the way the recipient expects. */ 162 * expected connection the way the recipient expects. */
158 union ip_conntrack_manip_proto saved_proto; 163 union ip_conntrack_manip_proto saved_proto;
@@ -292,6 +297,7 @@ static inline int is_dying(struct ip_conntrack *ct)
292} 297}
293 298
294extern unsigned int ip_conntrack_htable_size; 299extern unsigned int ip_conntrack_htable_size;
300extern int ip_conntrack_checksum;
295 301
296#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) 302#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++)
297 303
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_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/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 fee8275df6d8..6c4bc773f7b7 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -441,6 +441,7 @@ struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int devic
441struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); 441struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
442int pci_find_capability (struct pci_dev *dev, int cap); 442int pci_find_capability (struct pci_dev *dev, int cap);
443int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 443int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
444int pci_find_ext_capability (struct pci_dev *dev, int cap);
444struct pci_bus * pci_find_next_bus(const struct pci_bus *from); 445struct pci_bus * pci_find_next_bus(const struct pci_bus *from);
445 446
446struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from); 447struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from);
@@ -661,6 +662,7 @@ static inline int pci_register_driver(struct pci_driver *drv) { return 0;}
661static inline void pci_unregister_driver(struct pci_driver *drv) { } 662static inline void pci_unregister_driver(struct pci_driver *drv) { }
662static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } 663static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
663static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, 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_ext_capability (struct pci_dev *dev, int cap) {return 0; }
664static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; } 666static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; }
665 667
666/* Power management related routines */ 668/* 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/rbtree.h b/include/linux/rbtree.h
index 4b7cc4fe366d..f37006f21664 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -99,19 +99,36 @@ static inline struct page * rb_insert_page_cache(struct inode * inode,
99 99
100struct rb_node 100struct rb_node
101{ 101{
102 struct rb_node *rb_parent; 102 unsigned long rb_parent_color;
103 int rb_color;
104#define RB_RED 0 103#define RB_RED 0
105#define RB_BLACK 1 104#define RB_BLACK 1
106 struct rb_node *rb_right; 105 struct rb_node *rb_right;
107 struct rb_node *rb_left; 106 struct rb_node *rb_left;
108}; 107} __attribute__((aligned(sizeof(long))));
108 /* The alignment might seem pointless, but allegedly CRIS needs it */
109 109
110struct rb_root 110struct rb_root
111{ 111{
112 struct rb_node *rb_node; 112 struct rb_node *rb_node;
113}; 113};
114 114
115
116#define rb_parent(r) ((struct rb_node *)((r)->rb_parent_color & ~3))
117#define rb_color(r) ((r)->rb_parent_color & 1)
118#define rb_is_red(r) (!rb_color(r))
119#define rb_is_black(r) rb_color(r)
120#define rb_set_red(r) do { (r)->rb_parent_color &= ~1; } while (0)
121#define rb_set_black(r) do { (r)->rb_parent_color |= 1; } while (0)
122
123static inline void rb_set_parent(struct rb_node *rb, struct rb_node *p)
124{
125 rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p;
126}
127static inline void rb_set_color(struct rb_node *rb, int color)
128{
129 rb->rb_parent_color = (rb->rb_parent_color & ~1) | color;
130}
131
115#define RB_ROOT (struct rb_root) { NULL, } 132#define RB_ROOT (struct rb_root) { NULL, }
116#define rb_entry(ptr, type, member) container_of(ptr, type, member) 133#define rb_entry(ptr, type, member) container_of(ptr, type, member)
117 134
@@ -131,8 +148,7 @@ extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
131static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, 148static inline void rb_link_node(struct rb_node * node, struct rb_node * parent,
132 struct rb_node ** rb_link) 149 struct rb_node ** rb_link)
133{ 150{
134 node->rb_parent = parent; 151 node->rb_parent_color = (unsigned long )parent;
135 node->rb_color = RB_RED;
136 node->rb_left = node->rb_right = NULL; 152 node->rb_left = node->rb_right = NULL;
137 153
138 *rb_link = node; 154 *rb_link = node;
diff --git a/include/linux/security.h b/include/linux/security.h
index 1bab48f6aeac..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.
@@ -1298,8 +1304,10 @@ struct security_operations {
1298 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);
1299 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);
1300 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);
1301 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);
1302 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);
1303 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);
1304#endif /* CONFIG_SECURITY_NETWORK_XFRM */ 1312#endif /* CONFIG_SECURITY_NETWORK_XFRM */
1305 1313
@@ -2934,11 +2942,21 @@ static inline void security_xfrm_policy_free(struct xfrm_policy *xp)
2934 security_ops->xfrm_policy_free_security(xp); 2942 security_ops->xfrm_policy_free_security(xp);
2935} 2943}
2936 2944
2945static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
2946{
2947 return security_ops->xfrm_policy_delete_security(xp);
2948}
2949
2937static 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)
2938{ 2951{
2939 return security_ops->xfrm_state_alloc_security(x, sec_ctx); 2952 return security_ops->xfrm_state_alloc_security(x, sec_ctx);
2940} 2953}
2941 2954
2955static inline int security_xfrm_state_delete(struct xfrm_state *x)
2956{
2957 return security_ops->xfrm_state_delete_security(x);
2958}
2959
2942static inline void security_xfrm_state_free(struct xfrm_state *x) 2960static inline void security_xfrm_state_free(struct xfrm_state *x)
2943{ 2961{
2944 security_ops->xfrm_state_free_security(x); 2962 security_ops->xfrm_state_free_security(x);
@@ -2963,6 +2981,11 @@ static inline void security_xfrm_policy_free(struct xfrm_policy *xp)
2963{ 2981{
2964} 2982}
2965 2983
2984static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
2985{
2986 return 0;
2987}
2988
2966static 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)
2967{ 2990{
2968 return 0; 2991 return 0;
@@ -2972,6 +2995,11 @@ static inline void security_xfrm_state_free(struct xfrm_state *x)
2972{ 2995{
2973} 2996}
2974 2997
2998static inline int security_xfrm_state_delete(struct xfrm_state *x)
2999{
3000 return 0;
3001}
3002
2975static 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)
2976{ 3004{
2977 return 0; 3005 return 0;
diff --git a/include/linux/selinux.h b/include/linux/selinux.h
index 4047bcde4484..aad4e390d6a5 100644
--- a/include/linux/selinux.h
+++ b/include/linux/selinux.h
@@ -118,6 +118,27 @@ void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid);
118 */ 118 */
119void selinux_get_task_sid(struct task_struct *tsk, u32 *sid); 119void selinux_get_task_sid(struct task_struct *tsk, u32 *sid);
120 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);
121 142
122#else 143#else
123 144
@@ -172,6 +193,17 @@ static inline void selinux_get_task_sid(struct task_struct *tsk, u32 *sid)
172 *sid = 0; 193 *sid = 0;
173} 194}
174 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
175#endif /* CONFIG_SECURITY_SELINUX */ 207#endif /* CONFIG_SECURITY_SELINUX */
176 208
177#endif /* _LINUX_SELINUX_H */ 209#endif /* _LINUX_SELINUX_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 4dc65b55812e..66f8819f9568 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -28,6 +28,7 @@
28#include <linux/net.h> 28#include <linux/net.h>
29#include <linux/textsearch.h> 29#include <linux/textsearch.h>
30#include <net/checksum.h> 30#include <net/checksum.h>
31#include <linux/dmaengine.h>
31 32
32#define HAVE_ALLOC_SKB /* For the drivers to know */ 33#define HAVE_ALLOC_SKB /* For the drivers to know */
33#define HAVE_ALIGNABLE_SKB /* Ditto 8) */ 34#define HAVE_ALIGNABLE_SKB /* Ditto 8) */
@@ -208,6 +209,7 @@ enum {
208 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 209 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
209 * @tc_index: Traffic control index 210 * @tc_index: Traffic control index
210 * @tc_verd: traffic control verdict 211 * @tc_verd: traffic control verdict
212 * @secmark: security marking
211 */ 213 */
212 214
213struct sk_buff { 215struct sk_buff {
@@ -284,6 +286,12 @@ struct sk_buff {
284 __u16 tc_verd; /* traffic control verdict */ 286 __u16 tc_verd; /* traffic control verdict */
285#endif 287#endif
286#endif 288#endif
289#ifdef CONFIG_NET_DMA
290 dma_cookie_t dma_cookie;
291#endif
292#ifdef CONFIG_NETWORK_SECMARK
293 __u32 secmark;
294#endif
287 295
288 296
289 /* These elements must be at the end, see alloc_skb() for details. */ 297 /* These elements must be at the end, see alloc_skb() for details. */
@@ -966,15 +974,16 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
966#define NET_SKB_PAD 16 974#define NET_SKB_PAD 16
967#endif 975#endif
968 976
969extern int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc); 977extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
970 978
971static inline void __skb_trim(struct sk_buff *skb, unsigned int len) 979static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
972{ 980{
973 if (!skb->data_len) { 981 if (unlikely(skb->data_len)) {
974 skb->len = len; 982 WARN_ON(1);
975 skb->tail = skb->data + len; 983 return;
976 } else 984 }
977 ___pskb_trim(skb, len, 0); 985 skb->len = len;
986 skb->tail = skb->data + len;
978} 987}
979 988
980/** 989/**
@@ -984,6 +993,7 @@ static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
984 * 993 *
985 * Cut the length of a buffer down by removing data from the tail. If 994 * Cut the length of a buffer down by removing data from the tail. If
986 * the buffer is already under the length specified it is not modified. 995 * the buffer is already under the length specified it is not modified.
996 * The skb must be linear.
987 */ 997 */
988static inline void skb_trim(struct sk_buff *skb, unsigned int len) 998static inline void skb_trim(struct sk_buff *skb, unsigned int len)
989{ 999{
@@ -994,12 +1004,10 @@ static inline void skb_trim(struct sk_buff *skb, unsigned int len)
994 1004
995static inline int __pskb_trim(struct sk_buff *skb, unsigned int len) 1005static inline int __pskb_trim(struct sk_buff *skb, unsigned int len)
996{ 1006{
997 if (!skb->data_len) { 1007 if (skb->data_len)
998 skb->len = len; 1008 return ___pskb_trim(skb, len);
999 skb->tail = skb->data+len; 1009 __skb_trim(skb, len);
1000 return 0; 1010 return 0;
1001 }
1002 return ___pskb_trim(skb, len, 1);
1003} 1011}
1004 1012
1005static inline int pskb_trim(struct sk_buff *skb, unsigned int len) 1013static inline int pskb_trim(struct sk_buff *skb, unsigned int len)
@@ -1160,18 +1168,34 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i,
1160 return 0; 1168 return 0;
1161} 1169}
1162 1170
1171static inline int __skb_linearize(struct sk_buff *skb)
1172{
1173 return __pskb_pull_tail(skb, skb->data_len) ? 0 : -ENOMEM;
1174}
1175
1163/** 1176/**
1164 * skb_linearize - convert paged skb to linear one 1177 * skb_linearize - convert paged skb to linear one
1165 * @skb: buffer to linarize 1178 * @skb: buffer to linarize
1166 * @gfp: allocation mode
1167 * 1179 *
1168 * If there is no free memory -ENOMEM is returned, otherwise zero 1180 * If there is no free memory -ENOMEM is returned, otherwise zero
1169 * is returned and the old skb data released. 1181 * is returned and the old skb data released.
1170 */ 1182 */
1171extern int __skb_linearize(struct sk_buff *skb, gfp_t gfp); 1183static inline int skb_linearize(struct sk_buff *skb)
1172static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp) 1184{
1185 return skb_is_nonlinear(skb) ? __skb_linearize(skb) : 0;
1186}
1187
1188/**
1189 * skb_linearize_cow - make sure skb is linear and writable
1190 * @skb: buffer to process
1191 *
1192 * If there is no free memory -ENOMEM is returned, otherwise zero
1193 * is returned and the old skb data released.
1194 */
1195static inline int skb_linearize_cow(struct sk_buff *skb)
1173{ 1196{
1174 return __skb_linearize(skb, gfp); 1197 return skb_is_nonlinear(skb) || skb_cloned(skb) ?
1198 __skb_linearize(skb) : 0;
1175} 1199}
1176 1200
1177/** 1201/**
@@ -1395,5 +1419,23 @@ static inline void nf_reset(struct sk_buff *skb)
1395static inline void nf_reset(struct sk_buff *skb) {} 1419static inline void nf_reset(struct sk_buff *skb) {}
1396#endif /* CONFIG_NETFILTER */ 1420#endif /* CONFIG_NETFILTER */
1397 1421
1422#ifdef CONFIG_NETWORK_SECMARK
1423static inline void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from)
1424{
1425 to->secmark = from->secmark;
1426}
1427
1428static inline void skb_init_secmark(struct sk_buff *skb)
1429{
1430 skb->secmark = 0;
1431}
1432#else
1433static inline void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from)
1434{ }
1435
1436static inline void skb_init_secmark(struct sk_buff *skb)
1437{ }
1438#endif
1439
1398#endif /* __KERNEL__ */ 1440#endif /* __KERNEL__ */
1399#endif /* _LINUX_SKBUFF_H */ 1441#endif /* _LINUX_SKBUFF_H */
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 a8b24eff5b5f..420a689c3fb4 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 {
@@ -232,6 +233,13 @@ struct tcp_sock {
232 struct iovec *iov; 233 struct iovec *iov;
233 int memory; 234 int memory;
234 int len; 235 int len;
236#ifdef CONFIG_NET_DMA
237 /* members for async copy */
238 struct dma_chan *dma_chan;
239 int wakeup;
240 struct dma_pinned_list *pinned_list;
241 dma_cookie_t dma_cookie;
242#endif
235 } ucopy; 243 } ucopy;
236 244
237 __u32 snd_wl1; /* Sequence for window update */ 245 __u32 snd_wl1; /* Sequence for window update */
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 6ef527bb6235..940d0261a545 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -72,11 +72,6 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
72int vt_waitactive(int vt); 72int vt_waitactive(int vt);
73void change_console(struct vc_data *new_vc); 73void change_console(struct vc_data *new_vc);
74void reset_vc(struct vc_data *vc); 74void reset_vc(struct vc_data *vc);
75#ifdef CONFIG_VT
76int is_console_suspend_safe(void);
77#else
78static inline int is_console_suspend_safe(void) { return 1; }
79#endif
80 75
81/* 76/*
82 * vc_screen.c shares this temporary buffer with the console write code so that 77 * 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,