aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-11-07 22:51:47 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-11-07 22:51:47 -0500
commit6b995751c2e851d2bc9c277b5884d0adb519e31d (patch)
tree7a15b41b5d8ce612915584a0773c670d5c0ab5b8 /include/linux
parent6c2f4267833f453156f8f439cc32eb4c92f357b4 (diff)
parentd27ba47e7e8c466c18983a1779d611f82d6a354f (diff)
Merge branch 'master'
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acct.h3
-rw-r--r--include/linux/aio.h5
-rw-r--r--include/linux/cn_proc.h127
-rw-r--r--include/linux/connector.h6
-rw-r--r--include/linux/console_struct.h2
-rw-r--r--include/linux/dcache.h1
-rw-r--r--include/linux/fb.h5
-rw-r--r--include/linux/file.h6
-rw-r--r--include/linux/font.h2
-rw-r--r--include/linux/fs.h21
-rw-r--r--include/linux/fuse.h29
-rw-r--r--include/linux/input.h2
-rw-r--r--include/linux/ioport.h2
-rw-r--r--include/linux/ipmi.h5
-rw-r--r--include/linux/irq.h1
-rw-r--r--include/linux/jbd.h3
-rw-r--r--include/linux/jffs2.h41
-rw-r--r--include/linux/jffs2_fs_i.h7
-rw-r--r--include/linux/jffs2_fs_sb.h19
-rw-r--r--include/linux/kernel.h3
-rw-r--r--include/linux/kernel_stat.h8
-rw-r--r--include/linux/kprobes.h40
-rw-r--r--include/linux/list.h13
-rw-r--r--include/linux/memory.h3
-rw-r--r--include/linux/mm.h8
-rw-r--r--include/linux/mount.h29
-rw-r--r--include/linux/mtd/bbm.h122
-rw-r--r--include/linux/mtd/blktrans.h4
-rw-r--r--include/linux/mtd/cfi.h33
-rw-r--r--include/linux/mtd/doc2000.h18
-rw-r--r--include/linux/mtd/flashchip.h14
-rw-r--r--include/linux/mtd/ftl.h6
-rw-r--r--include/linux/mtd/gen_probe.h4
-rw-r--r--include/linux/mtd/jedec.h20
-rw-r--r--include/linux/mtd/map.h14
-rw-r--r--include/linux/mtd/mtd.h36
-rw-r--r--include/linux/mtd/nand.h57
-rw-r--r--include/linux/mtd/onenand.h155
-rw-r--r--include/linux/mtd/onenand_regs.h180
-rw-r--r--include/linux/mtd/partitions.h20
-rw-r--r--include/linux/mtd/physmap.h12
-rw-r--r--include/linux/mtd/pmc551.h12
-rw-r--r--include/linux/mtd/xip.h20
-rw-r--r--include/linux/namespace.h3
-rw-r--r--include/linux/net.h1
-rw-r--r--include/linux/nfsd/nfsd.h2
-rw-r--r--include/linux/nfsd/syscall.h17
-rw-r--r--include/linux/nfsd/xdr3.h2
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/pkt_sched.h50
-rw-r--r--include/linux/pnp.h2
-rw-r--r--include/linux/ptrace.h2
-rw-r--r--include/linux/quota.h1
-rw-r--r--include/linux/quotaops.h12
-rw-r--r--include/linux/radix-tree.h1
-rw-r--r--include/linux/rio.h325
-rw-r--r--include/linux/rio_drv.h469
-rw-r--r--include/linux/rio_ids.h24
-rw-r--r--include/linux/rio_regs.h215
-rw-r--r--include/linux/rslib.h28
-rw-r--r--include/linux/sem.h2
-rw-r--r--include/linux/shm.h1
-rw-r--r--include/linux/skbuff.h38
-rw-r--r--include/linux/slab.h2
-rw-r--r--include/linux/sunrpc/svc.h3
-rw-r--r--include/linux/superhyway.h38
-rw-r--r--include/linux/wait.h1
67 files changed, 2080 insertions, 278 deletions
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 19f70462b3be..93c5b3cdf951 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -117,12 +117,15 @@ struct acct_v3
117#include <linux/config.h> 117#include <linux/config.h>
118 118
119#ifdef CONFIG_BSD_PROCESS_ACCT 119#ifdef CONFIG_BSD_PROCESS_ACCT
120struct vfsmount;
120struct super_block; 121struct super_block;
122extern void acct_auto_close_mnt(struct vfsmount *m);
121extern void acct_auto_close(struct super_block *sb); 123extern void acct_auto_close(struct super_block *sb);
122extern void acct_process(long exitcode); 124extern void acct_process(long exitcode);
123extern void acct_update_integrals(struct task_struct *tsk); 125extern void acct_update_integrals(struct task_struct *tsk);
124extern void acct_clear_integrals(struct task_struct *tsk); 126extern void acct_clear_integrals(struct task_struct *tsk);
125#else 127#else
128#define acct_auto_close_mnt(x) do { } while (0)
126#define acct_auto_close(x) do { } while (0) 129#define acct_auto_close(x) do { } while (0)
127#define acct_process(x) do { } while (0) 130#define acct_process(x) do { } while (0)
128#define acct_update_integrals(x) do { } while (0) 131#define acct_update_integrals(x) do { } while (0)
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 0decf66117c1..403d71dcb7c8 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -183,6 +183,7 @@ struct kioctx {
183 struct list_head active_reqs; /* used for cancellation */ 183 struct list_head active_reqs; /* used for cancellation */
184 struct list_head run_list; /* used for kicked reqs */ 184 struct list_head run_list; /* used for kicked reqs */
185 185
186 /* sys_io_setup currently limits this to an unsigned int */
186 unsigned max_reqs; 187 unsigned max_reqs;
187 188
188 struct aio_ring_info ring_info; 189 struct aio_ring_info ring_info;
@@ -234,7 +235,7 @@ static inline struct kiocb *list_kiocb(struct list_head *h)
234} 235}
235 236
236/* for sysctl: */ 237/* for sysctl: */
237extern atomic_t aio_nr; 238extern unsigned long aio_nr;
238extern unsigned aio_max_nr; 239extern unsigned long aio_max_nr;
239 240
240#endif /* __LINUX__AIO_H */ 241#endif /* __LINUX__AIO_H */
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
new file mode 100644
index 000000000000..70ab56317380
--- /dev/null
+++ b/include/linux/cn_proc.h
@@ -0,0 +1,127 @@
1/*
2 * cn_proc.h - process events connector
3 *
4 * Copyright (C) Matt Helsley, IBM Corp. 2005
5 * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin
6 * Original copyright notice follows:
7 * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com>
8 * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25#ifndef CN_PROC_H
26#define CN_PROC_H
27
28#include <linux/types.h>
29#include <linux/connector.h>
30
31/*
32 * Userspace sends this enum to register with the kernel that it is listening
33 * for events on the connector.
34 */
35enum proc_cn_mcast_op {
36 PROC_CN_MCAST_LISTEN = 1,
37 PROC_CN_MCAST_IGNORE = 2
38};
39
40/*
41 * From the user's point of view, the process
42 * ID is the thread group ID and thread ID is the internal
43 * kernel "pid". So, fields are assigned as follow:
44 *
45 * In user space - In kernel space
46 *
47 * parent process ID = parent->tgid
48 * parent thread ID = parent->pid
49 * child process ID = child->tgid
50 * child thread ID = child->pid
51 */
52
53struct proc_event {
54 enum what {
55 /* Use successive bits so the enums can be used to record
56 * sets of events as well
57 */
58 PROC_EVENT_NONE = 0x00000000,
59 PROC_EVENT_FORK = 0x00000001,
60 PROC_EVENT_EXEC = 0x00000002,
61 PROC_EVENT_UID = 0x00000004,
62 PROC_EVENT_GID = 0x00000040,
63 /* "next" should be 0x00000400 */
64 /* "last" is the last process event: exit */
65 PROC_EVENT_EXIT = 0x80000000
66 } what;
67 __u32 cpu;
68 union { /* must be last field of proc_event struct */
69 struct {
70 __u32 err;
71 } ack;
72
73 struct fork_proc_event {
74 pid_t parent_pid;
75 pid_t parent_tgid;
76 pid_t child_pid;
77 pid_t child_tgid;
78 } fork;
79
80 struct exec_proc_event {
81 pid_t process_pid;
82 pid_t process_tgid;
83 } exec;
84
85 struct id_proc_event {
86 pid_t process_pid;
87 pid_t process_tgid;
88 union {
89 uid_t ruid; /* current->uid */
90 gid_t rgid; /* current->gid */
91 } r;
92 union {
93 uid_t euid;
94 gid_t egid;
95 } e;
96 } id;
97
98 struct exit_proc_event {
99 pid_t process_pid;
100 pid_t process_tgid;
101 __u32 exit_code, exit_signal;
102 } exit;
103 } event_data;
104};
105
106#ifdef __KERNEL__
107#ifdef CONFIG_PROC_EVENTS
108void proc_fork_connector(struct task_struct *task);
109void proc_exec_connector(struct task_struct *task);
110void proc_id_connector(struct task_struct *task, int which_id);
111void proc_exit_connector(struct task_struct *task);
112#else
113static inline void proc_fork_connector(struct task_struct *task)
114{}
115
116static inline void proc_exec_connector(struct task_struct *task)
117{}
118
119static inline void proc_id_connector(struct task_struct *task,
120 int which_id)
121{}
122
123static inline void proc_exit_connector(struct task_struct *task)
124{}
125#endif /* CONFIG_PROC_EVENTS */
126#endif /* __KERNEL__ */
127#endif /* CN_PROC_H */
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 95952cc1f525..c5769c6585f4 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -27,6 +27,12 @@
27#define CN_IDX_CONNECTOR 0xffffffff 27#define CN_IDX_CONNECTOR 0xffffffff
28#define CN_VAL_CONNECTOR 0xffffffff 28#define CN_VAL_CONNECTOR 0xffffffff
29 29
30/*
31 * Process Events connector unique ids -- used for message routing
32 */
33#define CN_IDX_PROC 0x1
34#define CN_VAL_PROC 0x1
35
30#define CN_NETLINK_USERS 1 36#define CN_NETLINK_USERS 1
31 37
32/* 38/*
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index 725be90ef55e..f8e5587a0f92 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -9,6 +9,8 @@
9 * to achieve effects such as fast scrolling by changing the origin. 9 * to achieve effects such as fast scrolling by changing the origin.
10 */ 10 */
11 11
12#include <linux/vt.h>
13
12struct vt_struct; 14struct vt_struct;
13 15
14#define NPAR 16 16#define NPAR 16
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index ab04b4f9b0db..46a2ba617595 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -329,6 +329,7 @@ static inline int d_mountpoint(struct dentry *dentry)
329} 329}
330 330
331extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *); 331extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *);
332extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
332extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); 333extern struct dentry *lookup_create(struct nameidata *nd, int is_dir);
333 334
334extern int sysctl_vfs_cache_pressure; 335extern int sysctl_vfs_cache_pressure;
diff --git a/include/linux/fb.h b/include/linux/fb.h
index c698055266d0..e7ff98e395f6 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -810,7 +810,6 @@ struct fb_info {
810extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var); 810extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var);
811extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var); 811extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var);
812extern int fb_blank(struct fb_info *info, int blank); 812extern int fb_blank(struct fb_info *info, int blank);
813extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor);
814extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); 813extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
815extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); 814extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
816extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image); 815extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image);
@@ -898,11 +897,13 @@ extern struct fb_videomode *fb_match_mode(struct fb_var_screeninfo *var,
898 struct list_head *head); 897 struct list_head *head);
899extern struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var, 898extern struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var,
900 struct list_head *head); 899 struct list_head *head);
901extern struct fb_videomode *fb_find_nearest_mode(struct fb_var_screeninfo *var, 900extern struct fb_videomode *fb_find_nearest_mode(struct fb_videomode *mode,
902 struct list_head *head); 901 struct list_head *head);
903extern void fb_destroy_modelist(struct list_head *head); 902extern void fb_destroy_modelist(struct list_head *head);
904extern void fb_videomode_to_modelist(struct fb_videomode *modedb, int num, 903extern void fb_videomode_to_modelist(struct fb_videomode *modedb, int num,
905 struct list_head *head); 904 struct list_head *head);
905extern struct fb_videomode *fb_find_best_display(struct fb_monspecs *specs,
906 struct list_head *head);
906 907
907/* drivers/video/fbcmap.c */ 908/* drivers/video/fbcmap.c */
908extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); 909extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
diff --git a/include/linux/file.h b/include/linux/file.h
index f5bbd4c508b3..d3b1a15d5f21 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -59,9 +59,9 @@ extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag));
59extern void put_filp(struct file *); 59extern void put_filp(struct file *);
60extern int get_unused_fd(void); 60extern int get_unused_fd(void);
61extern void FASTCALL(put_unused_fd(unsigned int fd)); 61extern void FASTCALL(put_unused_fd(unsigned int fd));
62struct kmem_cache_s; 62struct kmem_cache;
63extern void filp_ctor(void * objp, struct kmem_cache_s *cachep, unsigned long cflags); 63extern void filp_ctor(void * objp, struct kmem_cache *cachep, unsigned long cflags);
64extern void filp_dtor(void * objp, struct kmem_cache_s *cachep, unsigned long dflags); 64extern void filp_dtor(void * objp, struct kmem_cache *cachep, unsigned long dflags);
65 65
66extern struct file ** alloc_fd_array(int); 66extern struct file ** alloc_fd_array(int);
67extern void free_fd_array(struct file **, int); 67extern void free_fd_array(struct file **, int);
diff --git a/include/linux/font.h b/include/linux/font.h
index 53b129f07f6f..8aac48c37f3d 100644
--- a/include/linux/font.h
+++ b/include/linux/font.h
@@ -31,6 +31,7 @@ struct font_desc {
31#define SUN12x22_IDX 7 31#define SUN12x22_IDX 7
32#define ACORN8x8_IDX 8 32#define ACORN8x8_IDX 8
33#define MINI4x6_IDX 9 33#define MINI4x6_IDX 9
34#define RL_IDX 10
34 35
35extern const struct font_desc font_vga_8x8, 36extern const struct font_desc font_vga_8x8,
36 font_vga_8x16, 37 font_vga_8x16,
@@ -41,6 +42,7 @@ extern const struct font_desc font_vga_8x8,
41 font_sun_8x16, 42 font_sun_8x16,
42 font_sun_12x22, 43 font_sun_12x22,
43 font_acorn_8x8, 44 font_acorn_8x8,
45 font_rl,
44 font_mini_4x6; 46 font_mini_4x6;
45 47
46/* Find a font with a specific name */ 48/* Find a font with a specific name */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 6d6226732c93..1b5f502a4b8f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -104,6 +104,10 @@ extern int dir_notify_enable;
104#define MS_MOVE 8192 104#define MS_MOVE 8192
105#define MS_REC 16384 105#define MS_REC 16384
106#define MS_VERBOSE 32768 106#define MS_VERBOSE 32768
107#define MS_UNBINDABLE (1<<17) /* change to unbindable */
108#define MS_PRIVATE (1<<18) /* change to private */
109#define MS_SLAVE (1<<19) /* change to slave */
110#define MS_SHARED (1<<20) /* change to shared */
107#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ 111#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
108#define MS_ACTIVE (1<<30) 112#define MS_ACTIVE (1<<30)
109#define MS_NOUSER (1<<31) 113#define MS_NOUSER (1<<31)
@@ -264,6 +268,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
264#define ATTR_ATTR_FLAG 1024 268#define ATTR_ATTR_FLAG 1024
265#define ATTR_KILL_SUID 2048 269#define ATTR_KILL_SUID 2048
266#define ATTR_KILL_SGID 4096 270#define ATTR_KILL_SGID 4096
271#define ATTR_FILE 8192
267 272
268/* 273/*
269 * This is the Inode Attributes structure, used for notify_change(). It 274 * This is the Inode Attributes structure, used for notify_change(). It
@@ -283,6 +288,13 @@ struct iattr {
283 struct timespec ia_atime; 288 struct timespec ia_atime;
284 struct timespec ia_mtime; 289 struct timespec ia_mtime;
285 struct timespec ia_ctime; 290 struct timespec ia_ctime;
291
292 /*
293 * Not an attribute, but an auxilary info for filesystems wanting to
294 * implement an ftruncate() like method. NOTE: filesystem should
295 * check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL).
296 */
297 struct file *ia_file;
286}; 298};
287 299
288/* 300/*
@@ -1088,6 +1100,8 @@ int sync_inode(struct inode *inode, struct writeback_control *wbc);
1088 * @get_name: find the name for a given inode in a given directory 1100 * @get_name: find the name for a given inode in a given directory
1089 * @get_parent: find the parent of a given directory 1101 * @get_parent: find the parent of a given directory
1090 * @get_dentry: find a dentry for the inode given a file handle sub-fragment 1102 * @get_dentry: find a dentry for the inode given a file handle sub-fragment
1103 * @find_exported_dentry:
1104 * set by the exporting module to a standard helper function.
1091 * 1105 *
1092 * Description: 1106 * Description:
1093 * The export_operations structure provides a means for nfsd to communicate 1107 * The export_operations structure provides a means for nfsd to communicate
@@ -1239,7 +1253,12 @@ extern int unregister_filesystem(struct file_system_type *);
1239extern struct vfsmount *kern_mount(struct file_system_type *); 1253extern struct vfsmount *kern_mount(struct file_system_type *);
1240extern int may_umount_tree(struct vfsmount *); 1254extern int may_umount_tree(struct vfsmount *);
1241extern int may_umount(struct vfsmount *); 1255extern int may_umount(struct vfsmount *);
1256extern void umount_tree(struct vfsmount *, int, struct list_head *);
1257extern void release_mounts(struct list_head *);
1242extern long do_mount(char *, char *, char *, unsigned long, void *); 1258extern long do_mount(char *, char *, char *, unsigned long, void *);
1259extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);
1260extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
1261 struct vfsmount *);
1243 1262
1244extern int vfs_statfs(struct super_block *, struct kstatfs *); 1263extern int vfs_statfs(struct super_block *, struct kstatfs *);
1245 1264
@@ -1288,7 +1307,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
1288 1307
1289/* fs/open.c */ 1308/* fs/open.c */
1290 1309
1291extern int do_truncate(struct dentry *, loff_t start); 1310extern int do_truncate(struct dentry *, loff_t start, struct file *filp);
1292extern long do_sys_open(const char __user *filename, int flags, int mode); 1311extern long do_sys_open(const char __user *filename, int flags, int mode);
1293extern struct file *filp_open(const char *, int, int); 1312extern struct file *filp_open(const char *, int, int);
1294extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); 1313extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index f98854c2abd7..b76b558b03d4 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -14,7 +14,7 @@
14#define FUSE_KERNEL_VERSION 7 14#define FUSE_KERNEL_VERSION 7
15 15
16/** Minor version number of this interface */ 16/** Minor version number of this interface */
17#define FUSE_KERNEL_MINOR_VERSION 2 17#define FUSE_KERNEL_MINOR_VERSION 3
18 18
19/** The node ID of the root inode */ 19/** The node ID of the root inode */
20#define FUSE_ROOT_ID 1 20#define FUSE_ROOT_ID 1
@@ -61,6 +61,7 @@ struct fuse_kstatfs {
61#define FATTR_SIZE (1 << 3) 61#define FATTR_SIZE (1 << 3)
62#define FATTR_ATIME (1 << 4) 62#define FATTR_ATIME (1 << 4)
63#define FATTR_MTIME (1 << 5) 63#define FATTR_MTIME (1 << 5)
64#define FATTR_FH (1 << 6)
64 65
65/** 66/**
66 * Flags returned by the OPEN request 67 * Flags returned by the OPEN request
@@ -99,7 +100,9 @@ enum fuse_opcode {
99 FUSE_OPENDIR = 27, 100 FUSE_OPENDIR = 27,
100 FUSE_READDIR = 28, 101 FUSE_READDIR = 28,
101 FUSE_RELEASEDIR = 29, 102 FUSE_RELEASEDIR = 29,
102 FUSE_FSYNCDIR = 30 103 FUSE_FSYNCDIR = 30,
104 FUSE_ACCESS = 34,
105 FUSE_CREATE = 35
103}; 106};
104 107
105/* Conservative buffer size for the client */ 108/* Conservative buffer size for the client */
@@ -152,12 +155,25 @@ struct fuse_link_in {
152struct fuse_setattr_in { 155struct fuse_setattr_in {
153 __u32 valid; 156 __u32 valid;
154 __u32 padding; 157 __u32 padding;
155 struct fuse_attr attr; 158 __u64 fh;
159 __u64 size;
160 __u64 unused1;
161 __u64 atime;
162 __u64 mtime;
163 __u64 unused2;
164 __u32 atimensec;
165 __u32 mtimensec;
166 __u32 unused3;
167 __u32 mode;
168 __u32 unused4;
169 __u32 uid;
170 __u32 gid;
171 __u32 unused5;
156}; 172};
157 173
158struct fuse_open_in { 174struct fuse_open_in {
159 __u32 flags; 175 __u32 flags;
160 __u32 padding; 176 __u32 mode;
161}; 177};
162 178
163struct fuse_open_out { 179struct fuse_open_out {
@@ -222,6 +238,11 @@ struct fuse_getxattr_out {
222 __u32 padding; 238 __u32 padding;
223}; 239};
224 240
241struct fuse_access_in {
242 __u32 mask;
243 __u32 padding;
244};
245
225struct fuse_init_in_out { 246struct fuse_init_in_out {
226 __u32 major; 247 __u32 major;
227 __u32 minor; 248 __u32 minor;
diff --git a/include/linux/input.h b/include/linux/input.h
index f623c745c21c..3c5823368ddb 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -1007,7 +1007,7 @@ static inline void input_put_device(struct input_dev *dev)
1007 class_device_put(&dev->cdev); 1007 class_device_put(&dev->cdev);
1008} 1008}
1009 1009
1010void input_register_device(struct input_dev *); 1010int input_register_device(struct input_dev *);
1011void input_unregister_device(struct input_dev *); 1011void input_unregister_device(struct input_dev *);
1012 1012
1013void input_register_handler(struct input_handler *); 1013void input_register_handler(struct input_handler *);
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 18d010bee635..cd6bd001ba4e 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -94,7 +94,7 @@ extern struct resource iomem_resource;
94extern int request_resource(struct resource *root, struct resource *new); 94extern int request_resource(struct resource *root, struct resource *new);
95extern struct resource * ____request_resource(struct resource *root, struct resource *new); 95extern struct resource * ____request_resource(struct resource *root, struct resource *new);
96extern int release_resource(struct resource *new); 96extern int release_resource(struct resource *new);
97extern int insert_resource(struct resource *parent, struct resource *new); 97extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new);
98extern int allocate_resource(struct resource *root, struct resource *new, 98extern int allocate_resource(struct resource *root, struct resource *new,
99 unsigned long size, 99 unsigned long size,
100 unsigned long min, unsigned long max, 100 unsigned long min, unsigned long max,
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 938d55b813a5..d6276e60b3bf 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -256,10 +256,7 @@ struct ipmi_recv_msg
256}; 256};
257 257
258/* Allocate and free the receive message. */ 258/* Allocate and free the receive message. */
259static inline void ipmi_free_recv_msg(struct ipmi_recv_msg *msg) 259void ipmi_free_recv_msg(struct ipmi_recv_msg *msg);
260{
261 msg->done(msg);
262}
263 260
264struct ipmi_user_hndl 261struct ipmi_user_hndl
265{ 262{
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 69681c3b1f05..c516382fbec2 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -10,6 +10,7 @@
10 */ 10 */
11 11
12#include <linux/config.h> 12#include <linux/config.h>
13#include <asm/smp.h> /* cpu_online_map */
13 14
14#if !defined(CONFIG_ARCH_S390) 15#if !defined(CONFIG_ARCH_S390)
15 16
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index be197eb90077..aa56172c6fed 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -611,6 +611,9 @@ struct transaction_s
611 * @j_revoke: The revoke table - maintains the list of revoked blocks in the 611 * @j_revoke: The revoke table - maintains the list of revoked blocks in the
612 * current transaction. 612 * current transaction.
613 * @j_revoke_table: alternate revoke tables for j_revoke 613 * @j_revoke_table: alternate revoke tables for j_revoke
614 * @j_wbuf: array of buffer_heads for journal_commit_transaction
615 * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the
616 * number that will fit in j_blocksize
614 * @j_private: An opaque pointer to fs-private information. 617 * @j_private: An opaque pointer to fs-private information.
615 */ 618 */
616 619
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
index 419fc953ac16..cf792bb3c726 100644
--- a/include/linux/jffs2.h
+++ b/include/linux/jffs2.h
@@ -5,10 +5,10 @@
5 * 5 *
6 * Created by David Woodhouse <dwmw2@infradead.org> 6 * Created by David Woodhouse <dwmw2@infradead.org>
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in the 8 * For licensing information, see the file 'LICENCE' in the
9 * jffs2 directory. 9 * jffs2 directory.
10 * 10 *
11 * $Id: jffs2.h,v 1.34 2004/11/16 20:36:14 dwmw2 Exp $ 11 * $Id: jffs2.h,v 1.38 2005/09/26 11:37:23 havasi Exp $
12 * 12 *
13 */ 13 */
14 14
@@ -28,6 +28,9 @@
28#define JFFS2_EMPTY_BITMASK 0xffff 28#define JFFS2_EMPTY_BITMASK 0xffff
29#define JFFS2_DIRTY_BITMASK 0x0000 29#define JFFS2_DIRTY_BITMASK 0x0000
30 30
31/* Summary node MAGIC marker */
32#define JFFS2_SUM_MAGIC 0x02851885
33
31/* We only allow a single char for length, and 0xFF is empty flash so 34/* We only allow a single char for length, and 0xFF is empty flash so
32 we don't want it confused with a real length. Hence max 254. 35 we don't want it confused with a real length. Hence max 254.
33*/ 36*/
@@ -43,8 +46,6 @@
43#define JFFS2_COMPR_COPY 0x04 46#define JFFS2_COMPR_COPY 0x04
44#define JFFS2_COMPR_DYNRUBIN 0x05 47#define JFFS2_COMPR_DYNRUBIN 0x05
45#define JFFS2_COMPR_ZLIB 0x06 48#define JFFS2_COMPR_ZLIB 0x06
46#define JFFS2_COMPR_LZO 0x07
47#define JFFS2_COMPR_LZARI 0x08
48/* Compatibility flags. */ 49/* Compatibility flags. */
49#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ 50#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */
50#define JFFS2_NODE_ACCURATE 0x2000 51#define JFFS2_NODE_ACCURATE 0x2000
@@ -62,15 +63,17 @@
62#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) 63#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
63#define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4) 64#define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4)
64 65
66#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
67
65// Maybe later... 68// Maybe later...
66//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) 69//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
67//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) 70//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
68 71
69 72
70#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at 73#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at
71 mount time, don't wait for it to 74 mount time, don't wait for it to
72 happen later */ 75 happen later */
73#define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific 76#define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific
74 compression type */ 77 compression type */
75 78
76 79
@@ -101,7 +104,7 @@ struct jffs2_unknown_node
101struct jffs2_raw_dirent 104struct jffs2_raw_dirent
102{ 105{
103 jint16_t magic; 106 jint16_t magic;
104 jint16_t nodetype; /* == JFFS_NODETYPE_DIRENT */ 107 jint16_t nodetype; /* == JFFS2_NODETYPE_DIRENT */
105 jint32_t totlen; 108 jint32_t totlen;
106 jint32_t hdr_crc; 109 jint32_t hdr_crc;
107 jint32_t pino; 110 jint32_t pino;
@@ -117,7 +120,7 @@ struct jffs2_raw_dirent
117} __attribute__((packed)); 120} __attribute__((packed));
118 121
119/* The JFFS2 raw inode structure: Used for storage on physical media. */ 122/* The JFFS2 raw inode structure: Used for storage on physical media. */
120/* The uid, gid, atime, mtime and ctime members could be longer, but 123/* The uid, gid, atime, mtime and ctime members could be longer, but
121 are left like this for space efficiency. If and when people decide 124 are left like this for space efficiency. If and when people decide
122 they really need them extended, it's simple enough to add support for 125 they really need them extended, it's simple enough to add support for
123 a new type of raw node. 126 a new type of raw node.
@@ -125,7 +128,7 @@ struct jffs2_raw_dirent
125struct jffs2_raw_inode 128struct jffs2_raw_inode
126{ 129{
127 jint16_t magic; /* A constant magic number. */ 130 jint16_t magic; /* A constant magic number. */
128 jint16_t nodetype; /* == JFFS_NODETYPE_INODE */ 131 jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */
129 jint32_t totlen; /* Total length of this node (inc data, etc.) */ 132 jint32_t totlen; /* Total length of this node (inc data, etc.) */
130 jint32_t hdr_crc; 133 jint32_t hdr_crc;
131 jint32_t ino; /* Inode number. */ 134 jint32_t ino; /* Inode number. */
@@ -148,9 +151,25 @@ struct jffs2_raw_inode
148 uint8_t data[0]; 151 uint8_t data[0];
149} __attribute__((packed)); 152} __attribute__((packed));
150 153
151union jffs2_node_union { 154struct jffs2_raw_summary
155{
156 jint16_t magic;
157 jint16_t nodetype; /* = JFFS2_NODETYPE_SUMMARY */
158 jint32_t totlen;
159 jint32_t hdr_crc;
160 jint32_t sum_num; /* number of sum entries*/
161 jint32_t cln_mkr; /* clean marker size, 0 = no cleanmarker */
162 jint32_t padded; /* sum of the size of padding nodes */
163 jint32_t sum_crc; /* summary information crc */
164 jint32_t node_crc; /* node crc */
165 jint32_t sum[0]; /* inode summary info */
166} __attribute__((packed));
167
168union jffs2_node_union
169{
152 struct jffs2_raw_inode i; 170 struct jffs2_raw_inode i;
153 struct jffs2_raw_dirent d; 171 struct jffs2_raw_dirent d;
172 struct jffs2_raw_summary s;
154 struct jffs2_unknown_node u; 173 struct jffs2_unknown_node u;
155}; 174};
156 175
diff --git a/include/linux/jffs2_fs_i.h b/include/linux/jffs2_fs_i.h
index 6dbb1cce6646..ef85ab56302b 100644
--- a/include/linux/jffs2_fs_i.h
+++ b/include/linux/jffs2_fs_i.h
@@ -1,4 +1,4 @@
1/* $Id: jffs2_fs_i.h,v 1.17 2004/11/11 23:51:27 dwmw2 Exp $ */ 1/* $Id: jffs2_fs_i.h,v 1.19 2005/11/07 11:14:52 gleixner Exp $ */
2 2
3#ifndef _JFFS2_FS_I 3#ifndef _JFFS2_FS_I
4#define _JFFS2_FS_I 4#define _JFFS2_FS_I
@@ -25,13 +25,16 @@ struct jffs2_inode_info {
25 /* There may be one datanode which isn't referenced by any of the 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 26 above fragments, if it contains a metadata update but no actual
27 data - or if this is a directory inode */ 27 data - or if this is a directory inode */
28 /* This also holds the _only_ dnode for symlinks/device nodes, 28 /* This also holds the _only_ dnode for symlinks/device nodes,
29 etc. */ 29 etc. */
30 struct jffs2_full_dnode *metadata; 30 struct jffs2_full_dnode *metadata;
31 31
32 /* Directory entries */ 32 /* Directory entries */
33 struct jffs2_full_dirent *dents; 33 struct jffs2_full_dirent *dents;
34 34
35 /* The target path if this is the inode of a symlink */
36 unsigned char *target;
37
35 /* Some stuff we just have to keep in-core at all times, for each inode. */ 38 /* Some stuff we just have to keep in-core at all times, for each inode. */
36 struct jffs2_inode_cache *inocache; 39 struct jffs2_inode_cache *inocache;
37 40
diff --git a/include/linux/jffs2_fs_sb.h b/include/linux/jffs2_fs_sb.h
index 1e21546622de..4bcfb5570221 100644
--- a/include/linux/jffs2_fs_sb.h
+++ b/include/linux/jffs2_fs_sb.h
@@ -1,4 +1,4 @@
1/* $Id: jffs2_fs_sb.h,v 1.52 2005/05/19 16:12:17 gleixner Exp $ */ 1/* $Id: jffs2_fs_sb.h,v 1.54 2005/09/21 13:37:34 dedekind Exp $ */
2 2
3#ifndef _JFFS2_FS_SB 3#ifndef _JFFS2_FS_SB
4#define _JFFS2_FS_SB 4#define _JFFS2_FS_SB
@@ -20,7 +20,7 @@
20struct jffs2_inodirty; 20struct jffs2_inodirty;
21 21
22/* A struct for the overall file system control. Pointers to 22/* A struct for the overall file system control. Pointers to
23 jffs2_sb_info structs are named `c' in the source code. 23 jffs2_sb_info structs are named `c' in the source code.
24 Nee jffs_control 24 Nee jffs_control
25*/ 25*/
26struct jffs2_sb_info { 26struct jffs2_sb_info {
@@ -35,7 +35,7 @@ struct jffs2_sb_info {
35 struct completion gc_thread_start; /* GC thread start completion */ 35 struct completion gc_thread_start; /* GC thread start completion */
36 struct completion gc_thread_exit; /* GC thread exit completion port */ 36 struct completion gc_thread_exit; /* GC thread exit completion port */
37 37
38 struct semaphore alloc_sem; /* Used to protect all the following 38 struct semaphore alloc_sem; /* Used to protect all the following
39 fields, and also to protect against 39 fields, and also to protect against
40 out-of-order writing of nodes. And GC. */ 40 out-of-order writing of nodes. And GC. */
41 uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER 41 uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER
@@ -64,7 +64,7 @@ struct jffs2_sb_info {
64 uint32_t nospc_dirty_size; 64 uint32_t nospc_dirty_size;
65 65
66 uint32_t nr_blocks; 66 uint32_t nr_blocks;
67 struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks 67 struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks
68 * from the offset (blocks[ofs / sector_size]) */ 68 * from the offset (blocks[ofs / sector_size]) */
69 struct jffs2_eraseblock *nextblock; /* The block we're currently filling */ 69 struct jffs2_eraseblock *nextblock; /* The block we're currently filling */
70 70
@@ -82,25 +82,26 @@ struct jffs2_sb_info {
82 struct list_head bad_list; /* Bad blocks. */ 82 struct list_head bad_list; /* Bad blocks. */
83 struct list_head bad_used_list; /* Bad blocks with valid data in. */ 83 struct list_head bad_used_list; /* Bad blocks with valid data in. */
84 84
85 spinlock_t erase_completion_lock; /* Protect free_list and erasing_list 85 spinlock_t erase_completion_lock; /* Protect free_list and erasing_list
86 against erase completion handler */ 86 against erase completion handler */
87 wait_queue_head_t erase_wait; /* For waiting for erases to complete */ 87 wait_queue_head_t erase_wait; /* For waiting for erases to complete */
88 88
89 wait_queue_head_t inocache_wq; 89 wait_queue_head_t inocache_wq;
90 struct jffs2_inode_cache **inocache_list; 90 struct jffs2_inode_cache **inocache_list;
91 spinlock_t inocache_lock; 91 spinlock_t inocache_lock;
92 92
93 /* Sem to allow jffs2_garbage_collect_deletion_dirent to 93 /* Sem to allow jffs2_garbage_collect_deletion_dirent to
94 drop the erase_completion_lock while it's holding a pointer 94 drop the erase_completion_lock while it's holding a pointer
95 to an obsoleted node. I don't like this. Alternatives welcomed. */ 95 to an obsoleted node. I don't like this. Alternatives welcomed. */
96 struct semaphore erase_free_sem; 96 struct semaphore erase_free_sem;
97 97
98 uint32_t wbuf_pagesize; /* 0 for NOR and other flashes with no wbuf */
99
98#ifdef CONFIG_JFFS2_FS_WRITEBUFFER 100#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
99 /* Write-behind buffer for NAND flash */ 101 /* Write-behind buffer for NAND flash */
100 unsigned char *wbuf; 102 unsigned char *wbuf;
101 uint32_t wbuf_ofs; 103 uint32_t wbuf_ofs;
102 uint32_t wbuf_len; 104 uint32_t wbuf_len;
103 uint32_t wbuf_pagesize;
104 struct jffs2_inodirty *wbuf_inodes; 105 struct jffs2_inodirty *wbuf_inodes;
105 106
106 struct rw_semaphore wbuf_sem; /* Protects the write buffer */ 107 struct rw_semaphore wbuf_sem; /* Protects the write buffer */
@@ -112,6 +113,8 @@ struct jffs2_sb_info {
112 uint32_t fsdata_len; 113 uint32_t fsdata_len;
113#endif 114#endif
114 115
116 struct jffs2_summary *summary; /* Summary information */
117
115 /* OS-private pointer for getting back to master superblock info */ 118 /* OS-private pointer for getting back to master superblock info */
116 void *os_priv; 119 void *os_priv;
117}; 120};
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f1925ccc9fe1..b1e407a4fbda 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -168,7 +168,7 @@ static inline void console_verbose(void)
168 168
169extern void bust_spinlocks(int yes); 169extern void bust_spinlocks(int yes);
170extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ 170extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
171extern int panic_timeout; 171extern __deprecated_for_modules int panic_timeout;
172extern int panic_on_oops; 172extern int panic_on_oops;
173extern int tainted; 173extern int tainted;
174extern const char *print_tainted(void); 174extern const char *print_tainted(void);
@@ -266,7 +266,6 @@ extern void dump_stack(void);
266 266
267/** 267/**
268 * container_of - cast a member of a structure out to the containing structure 268 * container_of - cast a member of a structure out to the containing structure
269 *
270 * @ptr: the pointer to the member. 269 * @ptr: the pointer to the member.
271 * @type: the type of the container struct this is embedded in. 270 * @type: the type of the container struct this is embedded in.
272 * @member: the name of the member within the struct. 271 * @member: the name of the member within the struct.
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index dba27749b428..a484572c302e 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -6,6 +6,7 @@
6#include <linux/smp.h> 6#include <linux/smp.h>
7#include <linux/threads.h> 7#include <linux/threads.h>
8#include <linux/percpu.h> 8#include <linux/percpu.h>
9#include <linux/cpumask.h>
9#include <asm/cputime.h> 10#include <asm/cputime.h>
10 11
11/* 12/*
@@ -43,11 +44,10 @@ extern unsigned long long nr_context_switches(void);
43 */ 44 */
44static inline int kstat_irqs(int irq) 45static inline int kstat_irqs(int irq)
45{ 46{
46 int i, sum=0; 47 int cpu, sum = 0;
47 48
48 for (i = 0; i < NR_CPUS; i++) 49 for_each_cpu(cpu)
49 if (cpu_possible(i)) 50 sum += kstat_cpu(cpu).irqs[irq];
50 sum += kstat_cpu(i).irqs[irq];
51 51
52 return sum; 52 return sum;
53} 53}
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index e30afdca7917..e373c4a9de53 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -33,6 +33,9 @@
33#include <linux/list.h> 33#include <linux/list.h>
34#include <linux/notifier.h> 34#include <linux/notifier.h>
35#include <linux/smp.h> 35#include <linux/smp.h>
36#include <linux/percpu.h>
37#include <linux/spinlock.h>
38#include <linux/rcupdate.h>
36 39
37#include <asm/kprobes.h> 40#include <asm/kprobes.h>
38 41
@@ -106,6 +109,9 @@ struct jprobe {
106 kprobe_opcode_t *entry; /* probe handling code to jump to */ 109 kprobe_opcode_t *entry; /* probe handling code to jump to */
107}; 110};
108 111
112DECLARE_PER_CPU(struct kprobe *, current_kprobe);
113DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
114
109#ifdef ARCH_SUPPORTS_KRETPROBES 115#ifdef ARCH_SUPPORTS_KRETPROBES
110extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs); 116extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs);
111#else /* ARCH_SUPPORTS_KRETPROBES */ 117#else /* ARCH_SUPPORTS_KRETPROBES */
@@ -142,17 +148,7 @@ struct kretprobe_instance {
142}; 148};
143 149
144#ifdef CONFIG_KPROBES 150#ifdef CONFIG_KPROBES
145/* Locks kprobe: irq must be disabled */ 151extern spinlock_t kretprobe_lock;
146void lock_kprobes(void);
147void unlock_kprobes(void);
148
149/* kprobe running now on this CPU? */
150static inline int kprobe_running(void)
151{
152 extern unsigned int kprobe_cpu;
153 return kprobe_cpu == smp_processor_id();
154}
155
156extern int arch_prepare_kprobe(struct kprobe *p); 152extern int arch_prepare_kprobe(struct kprobe *p);
157extern void arch_copy_kprobe(struct kprobe *p); 153extern void arch_copy_kprobe(struct kprobe *p);
158extern void arch_arm_kprobe(struct kprobe *p); 154extern void arch_arm_kprobe(struct kprobe *p);
@@ -163,10 +159,26 @@ extern void show_registers(struct pt_regs *regs);
163extern kprobe_opcode_t *get_insn_slot(void); 159extern kprobe_opcode_t *get_insn_slot(void);
164extern void free_insn_slot(kprobe_opcode_t *slot); 160extern void free_insn_slot(kprobe_opcode_t *slot);
165 161
166/* Get the kprobe at this addr (if any). Must have called lock_kprobes */ 162/* Get the kprobe at this addr (if any) - called with preemption disabled */
167struct kprobe *get_kprobe(void *addr); 163struct kprobe *get_kprobe(void *addr);
168struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); 164struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk);
169 165
166/* kprobe_running() will just return the current_kprobe on this CPU */
167static inline struct kprobe *kprobe_running(void)
168{
169 return (__get_cpu_var(current_kprobe));
170}
171
172static inline void reset_current_kprobe(void)
173{
174 __get_cpu_var(current_kprobe) = NULL;
175}
176
177static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void)
178{
179 return (&__get_cpu_var(kprobe_ctlblk));
180}
181
170int register_kprobe(struct kprobe *p); 182int register_kprobe(struct kprobe *p);
171void unregister_kprobe(struct kprobe *p); 183void unregister_kprobe(struct kprobe *p);
172int setjmp_pre_handler(struct kprobe *, struct pt_regs *); 184int setjmp_pre_handler(struct kprobe *, struct pt_regs *);
@@ -183,9 +195,9 @@ void add_rp_inst(struct kretprobe_instance *ri);
183void kprobe_flush_task(struct task_struct *tk); 195void kprobe_flush_task(struct task_struct *tk);
184void recycle_rp_inst(struct kretprobe_instance *ri); 196void recycle_rp_inst(struct kretprobe_instance *ri);
185#else /* CONFIG_KPROBES */ 197#else /* CONFIG_KPROBES */
186static inline int kprobe_running(void) 198static inline struct kprobe *kprobe_running(void)
187{ 199{
188 return 0; 200 return NULL;
189} 201}
190static inline int register_kprobe(struct kprobe *p) 202static inline int register_kprobe(struct kprobe *p)
191{ 203{
diff --git a/include/linux/list.h b/include/linux/list.h
index 084971f333fe..fbfca73355a3 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -601,7 +601,7 @@ static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
601 * or hlist_del_rcu(), running on this same list. 601 * or hlist_del_rcu(), running on this same list.
602 * However, it is perfectly legal to run concurrently with 602 * However, it is perfectly legal to run concurrently with
603 * the _rcu list-traversal primitives, such as 603 * the _rcu list-traversal primitives, such as
604 * hlist_for_each_rcu(), used to prevent memory-consistency 604 * hlist_for_each_entry_rcu(), used to prevent memory-consistency
605 * problems on Alpha CPUs. Regardless of the type of CPU, the 605 * problems on Alpha CPUs. Regardless of the type of CPU, the
606 * list-traversal primitive must be guarded by rcu_read_lock(). 606 * list-traversal primitive must be guarded by rcu_read_lock().
607 */ 607 */
@@ -650,7 +650,7 @@ static inline void hlist_add_after(struct hlist_node *n,
650 * or hlist_del_rcu(), running on this same list. 650 * or hlist_del_rcu(), running on this same list.
651 * However, it is perfectly legal to run concurrently with 651 * However, it is perfectly legal to run concurrently with
652 * the _rcu list-traversal primitives, such as 652 * the _rcu list-traversal primitives, such as
653 * hlist_for_each_rcu(), used to prevent memory-consistency 653 * hlist_for_each_entry_rcu(), used to prevent memory-consistency
654 * problems on Alpha CPUs. 654 * problems on Alpha CPUs.
655 */ 655 */
656static inline void hlist_add_before_rcu(struct hlist_node *n, 656static inline void hlist_add_before_rcu(struct hlist_node *n,
@@ -675,7 +675,7 @@ static inline void hlist_add_before_rcu(struct hlist_node *n,
675 * or hlist_del_rcu(), running on this same list. 675 * or hlist_del_rcu(), running on this same list.
676 * However, it is perfectly legal to run concurrently with 676 * However, it is perfectly legal to run concurrently with
677 * the _rcu list-traversal primitives, such as 677 * the _rcu list-traversal primitives, such as
678 * hlist_for_each_rcu(), used to prevent memory-consistency 678 * hlist_for_each_entry_rcu(), used to prevent memory-consistency
679 * problems on Alpha CPUs. 679 * problems on Alpha CPUs.
680 */ 680 */
681static inline void hlist_add_after_rcu(struct hlist_node *prev, 681static inline void hlist_add_after_rcu(struct hlist_node *prev,
@@ -699,11 +699,6 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
699 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ 699 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
700 pos = n) 700 pos = n)
701 701
702#define hlist_for_each_rcu(pos, head) \
703 for ((pos) = (head)->first; \
704 rcu_dereference((pos)) && ({ prefetch((pos)->next); 1; }); \
705 (pos) = (pos)->next)
706
707/** 702/**
708 * hlist_for_each_entry - iterate over list of given type 703 * hlist_for_each_entry - iterate over list of given type
709 * @tpos: the type * to use as a loop counter. 704 * @tpos: the type * to use as a loop counter.
@@ -756,7 +751,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
756 751
757/** 752/**
758 * hlist_for_each_entry_rcu - iterate over rcu list of given type 753 * hlist_for_each_entry_rcu - iterate over rcu list of given type
759 * @pos: the type * to use as a loop counter. 754 * @tpos: the type * to use as a loop counter.
760 * @pos: the &struct hlist_node to use as a loop counter. 755 * @pos: the &struct hlist_node to use as a loop counter.
761 * @head: the head for your list. 756 * @head: the head for your list.
762 * @member: the name of the hlist_node within the struct. 757 * @member: the name of the hlist_node within the struct.
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 0def328ab5cf..9a424383e6c6 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -54,6 +54,9 @@ struct memory_block {
54 */ 54 */
55#define MEM_MAPPING_INVALID (1<<3) 55#define MEM_MAPPING_INVALID (1<<3)
56 56
57struct notifier_block;
58struct mem_section;
59
57#ifndef CONFIG_MEMORY_HOTPLUG 60#ifndef CONFIG_MEMORY_HOTPLUG
58static inline int memory_dev_init(void) 61static inline int memory_dev_init(void)
59{ 62{
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 5c1fb0a2e806..7b115feca4df 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -932,13 +932,13 @@ int write_one_page(struct page *page, int wait);
932 * turning readahead off */ 932 * turning readahead off */
933 933
934int do_page_cache_readahead(struct address_space *mapping, struct file *filp, 934int do_page_cache_readahead(struct address_space *mapping, struct file *filp,
935 unsigned long offset, unsigned long nr_to_read); 935 pgoff_t offset, unsigned long nr_to_read);
936int force_page_cache_readahead(struct address_space *mapping, struct file *filp, 936int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
937 unsigned long offset, unsigned long nr_to_read); 937 pgoff_t offset, unsigned long nr_to_read);
938unsigned long page_cache_readahead(struct address_space *mapping, 938unsigned long page_cache_readahead(struct address_space *mapping,
939 struct file_ra_state *ra, 939 struct file_ra_state *ra,
940 struct file *filp, 940 struct file *filp,
941 unsigned long offset, 941 pgoff_t offset,
942 unsigned long size); 942 unsigned long size);
943void handle_ra_miss(struct address_space *mapping, 943void handle_ra_miss(struct address_space *mapping,
944 struct file_ra_state *ra, pgoff_t offset); 944 struct file_ra_state *ra, pgoff_t offset);
diff --git a/include/linux/mount.h b/include/linux/mount.h
index f8f39937e301..dd4e83eba933 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -17,12 +17,14 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19 19
20#define MNT_NOSUID 1 20#define MNT_NOSUID 0x01
21#define MNT_NODEV 2 21#define MNT_NODEV 0x02
22#define MNT_NOEXEC 4 22#define MNT_NOEXEC 0x04
23#define MNT_SHARED 0x10 /* if the vfsmount is a shared mount */
24#define MNT_UNBINDABLE 0x20 /* if the vfsmount is a unbindable mount */
25#define MNT_PNODE_MASK 0x30 /* propogation flag mask */
23 26
24struct vfsmount 27struct vfsmount {
25{
26 struct list_head mnt_hash; 28 struct list_head mnt_hash;
27 struct vfsmount *mnt_parent; /* fs we are mounted on */ 29 struct vfsmount *mnt_parent; /* fs we are mounted on */
28 struct dentry *mnt_mountpoint; /* dentry of mountpoint */ 30 struct dentry *mnt_mountpoint; /* dentry of mountpoint */
@@ -36,7 +38,12 @@ struct vfsmount
36 char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ 38 char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
37 struct list_head mnt_list; 39 struct list_head mnt_list;
38 struct list_head mnt_expire; /* link in fs-specific expiry list */ 40 struct list_head mnt_expire; /* link in fs-specific expiry list */
41 struct list_head mnt_share; /* circular list of shared mounts */
42 struct list_head mnt_slave_list;/* list of slave mounts */
43 struct list_head mnt_slave; /* slave list entry */
44 struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */
39 struct namespace *mnt_namespace; /* containing namespace */ 45 struct namespace *mnt_namespace; /* containing namespace */
46 int mnt_pinned;
40}; 47};
41 48
42static inline struct vfsmount *mntget(struct vfsmount *mnt) 49static inline struct vfsmount *mntget(struct vfsmount *mnt)
@@ -46,15 +53,9 @@ static inline struct vfsmount *mntget(struct vfsmount *mnt)
46 return mnt; 53 return mnt;
47} 54}
48 55
49extern void __mntput(struct vfsmount *mnt); 56extern void mntput_no_expire(struct vfsmount *mnt);
50 57extern void mnt_pin(struct vfsmount *mnt);
51static inline void mntput_no_expire(struct vfsmount *mnt) 58extern void mnt_unpin(struct vfsmount *mnt);
52{
53 if (mnt) {
54 if (atomic_dec_and_test(&mnt->mnt_count))
55 __mntput(mnt);
56 }
57}
58 59
59static inline void mntput(struct vfsmount *mnt) 60static inline void mntput(struct vfsmount *mnt)
60{ 61{
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
new file mode 100644
index 000000000000..7a7fbe87fef0
--- /dev/null
+++ b/include/linux/mtd/bbm.h
@@ -0,0 +1,122 @@
1/*
2 * linux/include/linux/mtd/bbm.h
3 *
4 * NAND family Bad Block Management (BBM) header file
5 * - Bad Block Table (BBT) implementation
6 *
7 * Copyright (c) 2005 Samsung Electronics
8 * Kyungmin Park <kyungmin.park@samsung.com>
9 *
10 * Copyright (c) 2000-2005
11 * Thomas Gleixner <tglx@linuxtronix.de>
12 *
13 */
14#ifndef __LINUX_MTD_BBM_H
15#define __LINUX_MTD_BBM_H
16
17/* The maximum number of NAND chips in an array */
18#define NAND_MAX_CHIPS 8
19
20/**
21 * struct nand_bbt_descr - bad block table descriptor
22 * @param options options for this descriptor
23 * @param pages the page(s) where we find the bbt, used with
24 * option BBT_ABSPAGE when bbt is searched,
25 * then we store the found bbts pages here.
26 * Its an array and supports up to 8 chips now
27 * @param offs offset of the pattern in the oob area of the page
28 * @param veroffs offset of the bbt version counter in the oob are of the page
29 * @param version version read from the bbt page during scan
30 * @param len length of the pattern, if 0 no pattern check is performed
31 * @param maxblocks maximum number of blocks to search for a bbt. This number of
32 * blocks is reserved at the end of the device
33 * where the tables are written.
34 * @param reserved_block_code if non-0, this pattern denotes a reserved
35 * (rather than bad) block in the stored bbt
36 * @param pattern pattern to identify bad block table or factory marked
37 * good / bad blocks, can be NULL, if len = 0
38 *
39 * Descriptor for the bad block table marker and the descriptor for the
40 * pattern which identifies good and bad blocks. The assumption is made
41 * that the pattern and the version count are always located in the oob area
42 * of the first block.
43 */
44struct nand_bbt_descr {
45 int options;
46 int pages[NAND_MAX_CHIPS];
47 int offs;
48 int veroffs;
49 uint8_t version[NAND_MAX_CHIPS];
50 int len;
51 int maxblocks;
52 int reserved_block_code;
53 uint8_t *pattern;
54};
55
56/* Options for the bad block table descriptors */
57
58/* The number of bits used per block in the bbt on the device */
59#define NAND_BBT_NRBITS_MSK 0x0000000F
60#define NAND_BBT_1BIT 0x00000001
61#define NAND_BBT_2BIT 0x00000002
62#define NAND_BBT_4BIT 0x00000004
63#define NAND_BBT_8BIT 0x00000008
64/* The bad block table is in the last good block of the device */
65#define NAND_BBT_LASTBLOCK 0x00000010
66/* The bbt is at the given page, else we must scan for the bbt */
67#define NAND_BBT_ABSPAGE 0x00000020
68/* The bbt is at the given page, else we must scan for the bbt */
69#define NAND_BBT_SEARCH 0x00000040
70/* bbt is stored per chip on multichip devices */
71#define NAND_BBT_PERCHIP 0x00000080
72/* bbt has a version counter at offset veroffs */
73#define NAND_BBT_VERSION 0x00000100
74/* Create a bbt if none axists */
75#define NAND_BBT_CREATE 0x00000200
76/* Search good / bad pattern through all pages of a block */
77#define NAND_BBT_SCANALLPAGES 0x00000400
78/* Scan block empty during good / bad block scan */
79#define NAND_BBT_SCANEMPTY 0x00000800
80/* Write bbt if neccecary */
81#define NAND_BBT_WRITE 0x00001000
82/* Read and write back block contents when writing bbt */
83#define NAND_BBT_SAVECONTENT 0x00002000
84/* Search good / bad pattern on the first and the second page */
85#define NAND_BBT_SCAN2NDPAGE 0x00004000
86
87/* The maximum number of blocks to scan for a bbt */
88#define NAND_BBT_SCAN_MAXBLOCKS 4
89
90/*
91 * Constants for oob configuration
92 */
93#define ONENAND_BADBLOCK_POS 0
94
95/**
96 * struct bbt_info - [GENERIC] Bad Block Table data structure
97 * @param bbt_erase_shift [INTERN] number of address bits in a bbt entry
98 * @param badblockpos [INTERN] position of the bad block marker in the oob area
99 * @param bbt [INTERN] bad block table pointer
100 * @param badblock_pattern [REPLACEABLE] bad block scan pattern used for initial bad block scan
101 * @param priv [OPTIONAL] pointer to private bbm date
102 */
103struct bbm_info {
104 int bbt_erase_shift;
105 int badblockpos;
106 int options;
107
108 uint8_t *bbt;
109
110 int (*isbad_bbt)(struct mtd_info *mtd, loff_t ofs, int allowbbt);
111
112 /* TODO Add more NAND specific fileds */
113 struct nand_bbt_descr *badblock_pattern;
114
115 void *priv;
116};
117
118/* OneNAND BBT interface */
119extern int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
120extern int onenand_default_bbt(struct mtd_info *mtd);
121
122#endif /* __LINUX_MTD_BBM_H */
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h
index 4ebc2e5a16e2..f46afec6fbf8 100644
--- a/include/linux/mtd/blktrans.h
+++ b/include/linux/mtd/blktrans.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: blktrans.h,v 1.5 2003/06/23 12:00:08 dwmw2 Exp $ 2 * $Id: blktrans.h,v 1.6 2005/11/07 11:14:54 gleixner Exp $
3 * 3 *
4 * (C) 2003 David Woodhouse <dwmw2@infradead.org> 4 * (C) 2003 David Woodhouse <dwmw2@infradead.org>
5 * 5 *
@@ -67,6 +67,6 @@ extern int register_mtd_blktrans(struct mtd_blktrans_ops *tr);
67extern int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr); 67extern int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr);
68extern int add_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); 68extern int add_mtd_blktrans_dev(struct mtd_blktrans_dev *dev);
69extern int del_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); 69extern int del_mtd_blktrans_dev(struct mtd_blktrans_dev *dev);
70 70
71 71
72#endif /* __MTD_TRANS_H__ */ 72#endif /* __MTD_TRANS_H__ */
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index e6b6a1c66bd5..39f1430bd6d5 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -1,7 +1,7 @@
1 1
2/* Common Flash Interface structures 2/* Common Flash Interface structures
3 * See http://support.intel.com/design/flash/technote/index.htm 3 * See http://support.intel.com/design/flash/technote/index.htm
4 * $Id: cfi.h,v 1.54 2005/06/06 23:04:36 tpoynor Exp $ 4 * $Id: cfi.h,v 1.56 2005/11/07 11:14:54 gleixner Exp $
5 */ 5 */
6 6
7#ifndef __MTD_CFI_H__ 7#ifndef __MTD_CFI_H__
@@ -82,8 +82,8 @@ static inline int cfi_interleave_supported(int i)
82} 82}
83 83
84 84
85/* NB: these values must represents the number of bytes needed to meet the 85/* NB: these values must represents the number of bytes needed to meet the
86 * device type (x8, x16, x32). Eg. a 32 bit device is 4 x 8 bytes. 86 * device type (x8, x16, x32). Eg. a 32 bit device is 4 x 8 bytes.
87 * These numbers are used in calculations. 87 * These numbers are used in calculations.
88 */ 88 */
89#define CFI_DEVICETYPE_X8 (8 / 8) 89#define CFI_DEVICETYPE_X8 (8 / 8)
@@ -173,6 +173,15 @@ struct cfi_intelext_regioninfo {
173 struct cfi_intelext_blockinfo BlockTypes[1]; 173 struct cfi_intelext_blockinfo BlockTypes[1];
174} __attribute__((packed)); 174} __attribute__((packed));
175 175
176struct cfi_intelext_programming_regioninfo {
177 uint8_t ProgRegShift;
178 uint8_t Reserved1;
179 uint8_t ControlValid;
180 uint8_t Reserved2;
181 uint8_t ControlInvalid;
182 uint8_t Reserved3;
183} __attribute__((packed));
184
176/* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */ 185/* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */
177 186
178struct cfi_pri_amdstd { 187struct cfi_pri_amdstd {
@@ -250,7 +259,7 @@ static inline uint32_t cfi_build_cmd_addr(uint32_t cmd_ofs, int interleave, int
250/* 259/*
251 * Transforms the CFI command for the given geometry (bus width & interleave). 260 * Transforms the CFI command for the given geometry (bus width & interleave).
252 * It looks too long to be inline, but in the common case it should almost all 261 * It looks too long to be inline, but in the common case it should almost all
253 * get optimised away. 262 * get optimised away.
254 */ 263 */
255static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi) 264static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi)
256{ 265{
@@ -259,7 +268,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
259 unsigned long onecmd; 268 unsigned long onecmd;
260 int i; 269 int i;
261 270
262 /* We do it this way to give the compiler a fighting chance 271 /* We do it this way to give the compiler a fighting chance
263 of optimising away all the crap for 'bankwidth' larger than 272 of optimising away all the crap for 'bankwidth' larger than
264 an unsigned long, in the common case where that support is 273 an unsigned long, in the common case where that support is
265 disabled */ 274 disabled */
@@ -270,7 +279,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
270 wordwidth = map_bankwidth(map); 279 wordwidth = map_bankwidth(map);
271 words_per_bus = 1; 280 words_per_bus = 1;
272 } 281 }
273 282
274 chip_mode = map_bankwidth(map) / cfi_interleave(cfi); 283 chip_mode = map_bankwidth(map) / cfi_interleave(cfi);
275 chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); 284 chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map);
276 285
@@ -289,7 +298,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
289 break; 298 break;
290 } 299 }
291 300
292 /* Now replicate it across the size of an unsigned long, or 301 /* Now replicate it across the size of an unsigned long, or
293 just to the bus width as appropriate */ 302 just to the bus width as appropriate */
294 switch (chips_per_word) { 303 switch (chips_per_word) {
295 default: BUG(); 304 default: BUG();
@@ -305,7 +314,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
305 ; 314 ;
306 } 315 }
307 316
308 /* And finally, for the multi-word case, replicate it 317 /* And finally, for the multi-word case, replicate it
309 in all words in the structure */ 318 in all words in the structure */
310 for (i=0; i < words_per_bus; i++) { 319 for (i=0; i < words_per_bus; i++) {
311 val.x[i] = onecmd; 320 val.x[i] = onecmd;
@@ -316,14 +325,14 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
316#define CMD(x) cfi_build_cmd((x), map, cfi) 325#define CMD(x) cfi_build_cmd((x), map, cfi)
317 326
318 327
319static inline unsigned char cfi_merge_status(map_word val, struct map_info *map, 328static inline unsigned long cfi_merge_status(map_word val, struct map_info *map,
320 struct cfi_private *cfi) 329 struct cfi_private *cfi)
321{ 330{
322 int wordwidth, words_per_bus, chip_mode, chips_per_word; 331 int wordwidth, words_per_bus, chip_mode, chips_per_word;
323 unsigned long onestat, res = 0; 332 unsigned long onestat, res = 0;
324 int i; 333 int i;
325 334
326 /* We do it this way to give the compiler a fighting chance 335 /* We do it this way to give the compiler a fighting chance
327 of optimising away all the crap for 'bankwidth' larger than 336 of optimising away all the crap for 'bankwidth' larger than
328 an unsigned long, in the common case where that support is 337 an unsigned long, in the common case where that support is
329 disabled */ 338 disabled */
@@ -334,7 +343,7 @@ static inline unsigned char cfi_merge_status(map_word val, struct map_info *map,
334 wordwidth = map_bankwidth(map); 343 wordwidth = map_bankwidth(map);
335 words_per_bus = 1; 344 words_per_bus = 1;
336 } 345 }
337 346
338 chip_mode = map_bankwidth(map) / cfi_interleave(cfi); 347 chip_mode = map_bankwidth(map) / cfi_interleave(cfi);
339 chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); 348 chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map);
340 349
diff --git a/include/linux/mtd/doc2000.h b/include/linux/mtd/doc2000.h
index 953e64fb8ac5..386a52cf8b1b 100644
--- a/include/linux/mtd/doc2000.h
+++ b/include/linux/mtd/doc2000.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Linux driver for Disk-On-Chip devices 2 * Linux driver for Disk-On-Chip devices
3 * 3 *
4 * Copyright (C) 1999 Machine Vision Holdings, Inc. 4 * Copyright (C) 1999 Machine Vision Holdings, Inc.
5 * Copyright (C) 2001-2003 David Woodhouse <dwmw2@infradead.org> 5 * Copyright (C) 2001-2003 David Woodhouse <dwmw2@infradead.org>
6 * Copyright (C) 2002-2003 Greg Ungerer <gerg@snapgear.com> 6 * Copyright (C) 2002-2003 Greg Ungerer <gerg@snapgear.com>
7 * Copyright (C) 2002-2003 SnapGear Inc 7 * Copyright (C) 2002-2003 SnapGear Inc
8 * 8 *
9 * $Id: doc2000.h,v 1.24 2005/01/05 12:40:38 dwmw2 Exp $ 9 * $Id: doc2000.h,v 1.25 2005/11/07 11:14:54 gleixner Exp $
10 * 10 *
11 * Released under GPL 11 * Released under GPL
12 */ 12 */
@@ -75,10 +75,10 @@
75#define DoC_Mplus_CtrlConfirm 0x1076 75#define DoC_Mplus_CtrlConfirm 0x1076
76#define DoC_Mplus_Power 0x1fff 76#define DoC_Mplus_Power 0x1fff
77 77
78/* How to access the device? 78/* How to access the device?
79 * On ARM, it'll be mmap'd directly with 32-bit wide accesses. 79 * On ARM, it'll be mmap'd directly with 32-bit wide accesses.
80 * On PPC, it's mmap'd and 16-bit wide. 80 * On PPC, it's mmap'd and 16-bit wide.
81 * Others use readb/writeb 81 * Others use readb/writeb
82 */ 82 */
83#if defined(__arm__) 83#if defined(__arm__)
84#define ReadDOC_(adr, reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)<<2)))) 84#define ReadDOC_(adr, reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)<<2))))
@@ -172,7 +172,7 @@ struct DiskOnChip {
172 unsigned long totlen; 172 unsigned long totlen;
173 unsigned char ChipID; /* Type of DiskOnChip */ 173 unsigned char ChipID; /* Type of DiskOnChip */
174 int ioreg; 174 int ioreg;
175 175
176 unsigned long mfr; /* Flash IDs - only one type of flash per device */ 176 unsigned long mfr; /* Flash IDs - only one type of flash per device */
177 unsigned long id; 177 unsigned long id;
178 int chipshift; 178 int chipshift;
@@ -180,10 +180,10 @@ struct DiskOnChip {
180 char pageadrlen; 180 char pageadrlen;
181 char interleave; /* Internal interleaving - Millennium Plus style */ 181 char interleave; /* Internal interleaving - Millennium Plus style */
182 unsigned long erasesize; 182 unsigned long erasesize;
183 183
184 int curfloor; 184 int curfloor;
185 int curchip; 185 int curchip;
186 186
187 int numchips; 187 int numchips;
188 struct Nand *chips; 188 struct Nand *chips;
189 struct mtd_info *nextdoc; 189 struct mtd_info *nextdoc;
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h
index 675776fa3e27..a293a3b78e05 100644
--- a/include/linux/mtd/flashchip.h
+++ b/include/linux/mtd/flashchip.h
@@ -1,12 +1,12 @@
1 1
2/* 2/*
3 * struct flchip definition 3 * struct flchip definition
4 * 4 *
5 * Contains information about the location and state of a given flash device 5 * Contains information about the location and state of a given flash device
6 * 6 *
7 * (C) 2000 Red Hat. GPLd. 7 * (C) 2000 Red Hat. GPLd.
8 * 8 *
9 * $Id: flashchip.h,v 1.17 2005/03/14 18:27:15 bjd Exp $ 9 * $Id: flashchip.h,v 1.18 2005/11/07 11:14:54 gleixner Exp $
10 * 10 *
11 */ 11 */
12 12
@@ -15,11 +15,11 @@
15 15
16/* For spinlocks. sched.h includes spinlock.h from whichever directory it 16/* For spinlocks. sched.h includes spinlock.h from whichever directory it
17 * happens to be in - so we don't have to care whether we're on 2.2, which 17 * happens to be in - so we don't have to care whether we're on 2.2, which
18 * has asm/spinlock.h, or 2.4, which has linux/spinlock.h 18 * has asm/spinlock.h, or 2.4, which has linux/spinlock.h
19 */ 19 */
20#include <linux/sched.h> 20#include <linux/sched.h>
21 21
22typedef enum { 22typedef enum {
23 FL_READY, 23 FL_READY,
24 FL_STATUS, 24 FL_STATUS,
25 FL_CFI_QUERY, 25 FL_CFI_QUERY,
@@ -45,7 +45,7 @@ typedef enum {
45 45
46 46
47 47
48/* NOTE: confusingly, this can be used to refer to more than one chip at a time, 48/* NOTE: confusingly, this can be used to refer to more than one chip at a time,
49 if they're interleaved. This can even refer to individual partitions on 49 if they're interleaved. This can even refer to individual partitions on
50 the same physical chip when present. */ 50 the same physical chip when present. */
51 51
diff --git a/include/linux/mtd/ftl.h b/include/linux/mtd/ftl.h
index 3678459b4535..d99609113307 100644
--- a/include/linux/mtd/ftl.h
+++ b/include/linux/mtd/ftl.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * $Id: ftl.h,v 1.6 2003/01/24 13:20:04 dwmw2 Exp $ 2 * $Id: ftl.h,v 1.7 2005/11/07 11:14:54 gleixner Exp $
3 * 3 *
4 * Derived from (and probably identical to): 4 * Derived from (and probably identical to):
5 * ftl.h 1.7 1999/10/25 20:23:17 5 * ftl.h 1.7 1999/10/25 20:23:17
6 * 6 *
@@ -12,7 +12,7 @@
12 * Software distributed under the License is distributed on an "AS IS" 12 * Software distributed under the License is distributed on an "AS IS"
13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 * the License for the specific language governing rights and 14 * the License for the specific language governing rights and
15 * limitations under the License. 15 * limitations under the License.
16 * 16 *
17 * The initial developer of the original code is David A. Hinds 17 * The initial developer of the original code is David A. Hinds
18 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds 18 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
diff --git a/include/linux/mtd/gen_probe.h b/include/linux/mtd/gen_probe.h
index 3d7bdec14f97..256e7342ed1e 100644
--- a/include/linux/mtd/gen_probe.h
+++ b/include/linux/mtd/gen_probe.h
@@ -1,14 +1,14 @@
1/* 1/*
2 * (C) 2001, 2001 Red Hat, Inc. 2 * (C) 2001, 2001 Red Hat, Inc.
3 * GPL'd 3 * GPL'd
4 * $Id: gen_probe.h,v 1.3 2004/10/20 22:10:33 dwmw2 Exp $ 4 * $Id: gen_probe.h,v 1.4 2005/11/07 11:14:54 gleixner Exp $
5 */ 5 */
6 6
7#ifndef __LINUX_MTD_GEN_PROBE_H__ 7#ifndef __LINUX_MTD_GEN_PROBE_H__
8#define __LINUX_MTD_GEN_PROBE_H__ 8#define __LINUX_MTD_GEN_PROBE_H__
9 9
10#include <linux/mtd/flashchip.h> 10#include <linux/mtd/flashchip.h>
11#include <linux/mtd/map.h> 11#include <linux/mtd/map.h>
12#include <linux/mtd/cfi.h> 12#include <linux/mtd/cfi.h>
13#include <linux/bitops.h> 13#include <linux/bitops.h>
14 14
diff --git a/include/linux/mtd/jedec.h b/include/linux/mtd/jedec.h
index 2ba0f700ddbc..9006feb218b9 100644
--- a/include/linux/mtd/jedec.h
+++ b/include/linux/mtd/jedec.h
@@ -1,13 +1,13 @@
1 1
2/* JEDEC Flash Interface. 2/* JEDEC Flash Interface.
3 * This is an older type of interface for self programming flash. It is 3 * This is an older type of interface for self programming flash. It is
4 * commonly use in older AMD chips and is obsolete compared with CFI. 4 * commonly use in older AMD chips and is obsolete compared with CFI.
5 * It is called JEDEC because the JEDEC association distributes the ID codes 5 * It is called JEDEC because the JEDEC association distributes the ID codes
6 * for the chips. 6 * for the chips.
7 * 7 *
8 * See the AMD flash databook for information on how to operate the interface. 8 * See the AMD flash databook for information on how to operate the interface.
9 * 9 *
10 * $Id: jedec.h,v 1.3 2003/05/21 11:51:01 dwmw2 Exp $ 10 * $Id: jedec.h,v 1.4 2005/11/07 11:14:54 gleixner Exp $
11 */ 11 */
12 12
13#ifndef __LINUX_MTD_JEDEC_H__ 13#ifndef __LINUX_MTD_JEDEC_H__
@@ -33,16 +33,16 @@ struct jedec_flash_chip
33 __u16 jedec; 33 __u16 jedec;
34 unsigned long size; 34 unsigned long size;
35 unsigned long sectorsize; 35 unsigned long sectorsize;
36 36
37 // *(__u8*)(base + (adder << addrshift)) = data << datashift 37 // *(__u8*)(base + (adder << addrshift)) = data << datashift
38 // Address size = size << addrshift 38 // Address size = size << addrshift
39 unsigned long base; // Byte 0 of the flash, will be unaligned 39 unsigned long base; // Byte 0 of the flash, will be unaligned
40 unsigned int datashift; // Useful for 32bit/16bit accesses 40 unsigned int datashift; // Useful for 32bit/16bit accesses
41 unsigned int addrshift; 41 unsigned int addrshift;
42 unsigned long offset; // linerized start. base==offset for unbanked, uninterleaved flash 42 unsigned long offset; // linerized start. base==offset for unbanked, uninterleaved flash
43 43
44 __u32 capabilities; 44 __u32 capabilities;
45 45
46 // These markers are filled in by the flash_chip_scan function 46 // These markers are filled in by the flash_chip_scan function
47 unsigned long start; 47 unsigned long start;
48 unsigned long length; 48 unsigned long length;
@@ -51,16 +51,16 @@ struct jedec_flash_chip
51struct jedec_private 51struct jedec_private
52{ 52{
53 unsigned long size; // Total size of all the devices 53 unsigned long size; // Total size of all the devices
54 54
55 /* Bank handling. If sum(bank_fill) == size then this is linear flash. 55 /* Bank handling. If sum(bank_fill) == size then this is linear flash.
56 Otherwise the mapping has holes in it. bank_fill may be used to 56 Otherwise the mapping has holes in it. bank_fill may be used to
57 find the holes, but in the common symetric case 57 find the holes, but in the common symetric case
58 bank_fill[0] == bank_fill[*], thus addresses may be computed 58 bank_fill[0] == bank_fill[*], thus addresses may be computed
59 mathmatically. bank_fill must be powers of two */ 59 mathmatically. bank_fill must be powers of two */
60 unsigned is_banked; 60 unsigned is_banked;
61 unsigned long bank_fill[MAX_JEDEC_CHIPS]; 61 unsigned long bank_fill[MAX_JEDEC_CHIPS];
62 62
63 struct jedec_flash_chip chips[MAX_JEDEC_CHIPS]; 63 struct jedec_flash_chip chips[MAX_JEDEC_CHIPS];
64}; 64};
65 65
66#endif 66#endif
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index fc28841f3409..fedfbc8a287f 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -1,6 +1,6 @@
1 1
2/* Overhauled routines for dealing with different mmap regions of flash */ 2/* Overhauled routines for dealing with different mmap regions of flash */
3/* $Id: map.h,v 1.52 2005/05/25 10:29:41 gleixner Exp $ */ 3/* $Id: map.h,v 1.54 2005/11/07 11:14:54 gleixner Exp $ */
4 4
5#ifndef __LINUX_MTD_MAP_H__ 5#ifndef __LINUX_MTD_MAP_H__
6#define __LINUX_MTD_MAP_H__ 6#define __LINUX_MTD_MAP_H__
@@ -170,14 +170,14 @@ typedef union {
170 to a chip probe routine -- either JEDEC or CFI probe or both -- via 170 to a chip probe routine -- either JEDEC or CFI probe or both -- via
171 do_map_probe(). If a chip is recognised, the probe code will invoke the 171 do_map_probe(). If a chip is recognised, the probe code will invoke the
172 appropriate chip driver (if present) and return a struct mtd_info. 172 appropriate chip driver (if present) and return a struct mtd_info.
173 At which point, you fill in the mtd->module with your own module 173 At which point, you fill in the mtd->module with your own module
174 address, and register it with the MTD core code. Or you could partition 174 address, and register it with the MTD core code. Or you could partition
175 it and register the partitions instead, or keep it for your own private 175 it and register the partitions instead, or keep it for your own private
176 use; whatever. 176 use; whatever.
177 177
178 The mtd->priv field will point to the struct map_info, and any further 178 The mtd->priv field will point to the struct map_info, and any further
179 private data required by the chip driver is linked from the 179 private data required by the chip driver is linked from the
180 mtd->priv->fldrv_priv field. This allows the map driver to get at 180 mtd->priv->fldrv_priv field. This allows the map driver to get at
181 the destructor function map->fldrv_destroy() when it's tired 181 the destructor function map->fldrv_destroy() when it's tired
182 of living. 182 of living.
183*/ 183*/
@@ -214,7 +214,7 @@ struct map_info {
214 If there is no cache to care about this can be set to NULL. */ 214 If there is no cache to care about this can be set to NULL. */
215 void (*inval_cache)(struct map_info *, unsigned long, ssize_t); 215 void (*inval_cache)(struct map_info *, unsigned long, ssize_t);
216 216
217 /* set_vpp() must handle being reentered -- enable, enable, disable 217 /* set_vpp() must handle being reentered -- enable, enable, disable
218 must leave it enabled. */ 218 must leave it enabled. */
219 void (*set_vpp)(struct map_info *, int); 219 void (*set_vpp)(struct map_info *, int);
220 220
@@ -353,7 +353,7 @@ static inline map_word map_word_ff(struct map_info *map)
353{ 353{
354 map_word r; 354 map_word r;
355 int i; 355 int i;
356 356
357 if (map_bankwidth(map) < MAP_FF_LIMIT) { 357 if (map_bankwidth(map) < MAP_FF_LIMIT) {
358 int bw = 8 * map_bankwidth(map); 358 int bw = 8 * map_bankwidth(map);
359 r.x[0] = (1 << bw) - 1; 359 r.x[0] = (1 << bw) - 1;
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index c50c3f3927d9..e95d0463a3e5 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: mtd.h,v 1.59 2005/04/11 10:19:02 gleixner Exp $ 2 * $Id: mtd.h,v 1.61 2005/11/07 11:14:54 gleixner Exp $
3 * 3 *
4 * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al. 4 * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al.
5 * 5 *
@@ -72,7 +72,17 @@ struct mtd_info {
72 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) 72 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16)
73 u_int32_t ecctype; 73 u_int32_t ecctype;
74 u_int32_t eccsize; 74 u_int32_t eccsize;
75 75
76 /*
77 * Reuse some of the above unused fields in the case of NOR flash
78 * with configurable programming regions to avoid modifying the
79 * user visible structure layout/size. Only valid when the
80 * MTD_PROGRAM_REGIONS flag is set.
81 * (Maybe we should have an union for those?)
82 */
83#define MTD_PROGREGION_SIZE(mtd) (mtd)->oobblock
84#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize
85#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype
76 86
77 // Kernel-only stuff starts here. 87 // Kernel-only stuff starts here.
78 char *name; 88 char *name;
@@ -80,13 +90,13 @@ struct mtd_info {
80 90
81 // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) 91 // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO)
82 struct nand_oobinfo oobinfo; 92 struct nand_oobinfo oobinfo;
83 u_int32_t oobavail; // Number of bytes in OOB area available for fs 93 u_int32_t oobavail; // Number of bytes in OOB area available for fs
84 94
85 /* Data for variable erase regions. If numeraseregions is zero, 95 /* Data for variable erase regions. If numeraseregions is zero,
86 * it means that the whole device has erasesize as given above. 96 * it means that the whole device has erasesize as given above.
87 */ 97 */
88 int numeraseregions; 98 int numeraseregions;
89 struct mtd_erase_region_info *eraseregions; 99 struct mtd_erase_region_info *eraseregions;
90 100
91 /* This really shouldn't be here. It can go away in 2.5 */ 101 /* This really shouldn't be here. It can go away in 2.5 */
92 u_int32_t bank_size; 102 u_int32_t bank_size;
@@ -109,10 +119,10 @@ struct mtd_info {
109 int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 119 int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
110 int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); 120 int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
111 121
112 /* 122 /*
113 * Methods to access the protection register area, present in some 123 * Methods to access the protection register area, present in some
114 * flash devices. The user data is one time programmable but the 124 * flash devices. The user data is one time programmable but the
115 * factory data is read only. 125 * factory data is read only.
116 */ 126 */
117 int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len); 127 int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len);
118 int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 128 int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
@@ -123,14 +133,14 @@ struct mtd_info {
123 133
124 /* kvec-based read/write methods. We need these especially for NAND flash, 134 /* kvec-based read/write methods. We need these especially for NAND flash,
125 with its limited number of write cycles per erase. 135 with its limited number of write cycles per erase.
126 NB: The 'count' parameter is the number of _vectors_, each of 136 NB: The 'count' parameter is the number of _vectors_, each of
127 which contains an (ofs, len) tuple. 137 which contains an (ofs, len) tuple.
128 */ 138 */
129 int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen); 139 int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen);
130 int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, 140 int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from,
131 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); 141 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
132 int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); 142 int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen);
133 int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, 143 int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to,
134 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); 144 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
135 145
136 /* Sync */ 146 /* Sync */
@@ -194,7 +204,7 @@ int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs,
194#define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args) 204#define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args)
195#define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args) 205#define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args)
196#define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args) 206#define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args)
197#define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0) 207#define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0)
198 208
199 209
200#ifdef CONFIG_MTD_PARTITIONS 210#ifdef CONFIG_MTD_PARTITIONS
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 9b5b76217584..da5e67b3fc70 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -5,7 +5,7 @@
5 * Steven J. Hill <sjhill@realitydiluted.com> 5 * Steven J. Hill <sjhill@realitydiluted.com>
6 * Thomas Gleixner <tglx@linutronix.de> 6 * Thomas Gleixner <tglx@linutronix.de>
7 * 7 *
8 * $Id: nand.h,v 1.73 2005/05/31 19:39:17 gleixner Exp $ 8 * $Id: nand.h,v 1.74 2005/09/15 13:58:50 vwool Exp $
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
@@ -24,7 +24,7 @@
24 * bat later if I did something naughty. 24 * bat later if I did something naughty.
25 * 10-11-2000 SJH Added private NAND flash structure for driver 25 * 10-11-2000 SJH Added private NAND flash structure for driver
26 * 10-24-2000 SJH Added prototype for 'nand_scan' function 26 * 10-24-2000 SJH Added prototype for 'nand_scan' function
27 * 10-29-2001 TG changed nand_chip structure to support 27 * 10-29-2001 TG changed nand_chip structure to support
28 * hardwarespecific function for accessing control lines 28 * hardwarespecific function for accessing control lines
29 * 02-21-2002 TG added support for different read/write adress and 29 * 02-21-2002 TG added support for different read/write adress and
30 * ready/busy line access function 30 * ready/busy line access function
@@ -36,21 +36,21 @@
36 * CONFIG_MTD_NAND_ECC_JFFS2 is not set 36 * CONFIG_MTD_NAND_ECC_JFFS2 is not set
37 * 08-10-2002 TG extensions to nand_chip structure to support HW-ECC 37 * 08-10-2002 TG extensions to nand_chip structure to support HW-ECC
38 * 38 *
39 * 08-29-2002 tglx nand_chip structure: data_poi for selecting 39 * 08-29-2002 tglx nand_chip structure: data_poi for selecting
40 * internal / fs-driver buffer 40 * internal / fs-driver buffer
41 * support for 6byte/512byte hardware ECC 41 * support for 6byte/512byte hardware ECC
42 * read_ecc, write_ecc extended for different oob-layout 42 * read_ecc, write_ecc extended for different oob-layout
43 * oob layout selections: NAND_NONE_OOB, NAND_JFFS2_OOB, 43 * oob layout selections: NAND_NONE_OOB, NAND_JFFS2_OOB,
44 * NAND_YAFFS_OOB 44 * NAND_YAFFS_OOB
45 * 11-25-2002 tglx Added Manufacturer code FUJITSU, NATIONAL 45 * 11-25-2002 tglx Added Manufacturer code FUJITSU, NATIONAL
46 * Split manufacturer and device ID structures 46 * Split manufacturer and device ID structures
47 * 47 *
48 * 02-08-2004 tglx added option field to nand structure for chip anomalities 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 49 * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id
50 * update of nand_chip structure description 50 * update of nand_chip structure description
51 * 01-17-2005 dmarlin added extended commands for AG-AND device and added option 51 * 01-17-2005 dmarlin added extended commands for AG-AND device and added option
52 * for BBT_AUTO_REFRESH. 52 * for BBT_AUTO_REFRESH.
53 * 01-20-2005 dmarlin added optional pointer to hardware specific callback for 53 * 01-20-2005 dmarlin added optional pointer to hardware specific callback for
54 * extra error status checks. 54 * extra error status checks.
55 */ 55 */
56#ifndef __LINUX_MTD_NAND_H 56#ifndef __LINUX_MTD_NAND_H
@@ -120,8 +120,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
120#define NAND_CMD_CACHEDPROG 0x15 120#define NAND_CMD_CACHEDPROG 0x15
121 121
122/* Extended commands for AG-AND device */ 122/* Extended commands for AG-AND device */
123/* 123/*
124 * Note: the command for NAND_CMD_DEPLETE1 is really 0x00 but 124 * Note: the command for NAND_CMD_DEPLETE1 is really 0x00 but
125 * there is no way to distinguish that from NAND_CMD_READ0 125 * there is no way to distinguish that from NAND_CMD_READ0
126 * until the remaining sequence of commands has been completed 126 * until the remaining sequence of commands has been completed
127 * so add a high order bit and mask it off in the command. 127 * so add a high order bit and mask it off in the command.
@@ -145,7 +145,7 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
145#define NAND_STATUS_READY 0x40 145#define NAND_STATUS_READY 0x40
146#define NAND_STATUS_WP 0x80 146#define NAND_STATUS_WP 0x80
147 147
148/* 148/*
149 * Constants for ECC_MODES 149 * Constants for ECC_MODES
150 */ 150 */
151 151
@@ -191,12 +191,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
191#define NAND_CACHEPRG 0x00000008 191#define NAND_CACHEPRG 0x00000008
192/* Chip has copy back function */ 192/* Chip has copy back function */
193#define NAND_COPYBACK 0x00000010 193#define NAND_COPYBACK 0x00000010
194/* AND Chip which has 4 banks and a confusing page / block 194/* AND Chip which has 4 banks and a confusing page / block
195 * assignment. See Renesas datasheet for further information */ 195 * assignment. See Renesas datasheet for further information */
196#define NAND_IS_AND 0x00000020 196#define NAND_IS_AND 0x00000020
197/* Chip has a array of 4 pages which can be read without 197/* Chip has a array of 4 pages which can be read without
198 * additional ready /busy waits */ 198 * additional ready /busy waits */
199#define NAND_4PAGE_ARRAY 0x00000040 199#define NAND_4PAGE_ARRAY 0x00000040
200/* Chip requires that BBT is periodically rewritten to prevent 200/* Chip requires that BBT is periodically rewritten to prevent
201 * bits from adjacent blocks from 'leaking' in altering data. 201 * bits from adjacent blocks from 'leaking' in altering data.
202 * This happens with the Renesas AG-AND chips, possibly others. */ 202 * This happens with the Renesas AG-AND chips, possibly others. */
@@ -219,8 +219,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
219/* Use a flash based bad block table. This option is passed to the 219/* Use a flash based bad block table. This option is passed to the
220 * default bad block table function. */ 220 * default bad block table function. */
221#define NAND_USE_FLASH_BBT 0x00010000 221#define NAND_USE_FLASH_BBT 0x00010000
222/* The hw ecc generator provides a syndrome instead a ecc value on read 222/* The hw ecc generator provides a syndrome instead a ecc value on read
223 * This can only work if we have the ecc bytes directly behind the 223 * This can only work if we have the ecc bytes directly behind the
224 * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */ 224 * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */
225#define NAND_HWECC_SYNDROME 0x00020000 225#define NAND_HWECC_SYNDROME 0x00020000
226/* This option skips the bbt scan during initialization. */ 226/* This option skips the bbt scan during initialization. */
@@ -244,6 +244,7 @@ typedef enum {
244 FL_ERASING, 244 FL_ERASING,
245 FL_SYNCING, 245 FL_SYNCING,
246 FL_CACHEDPRG, 246 FL_CACHEDPRG,
247 FL_PM_SUSPENDED,
247} nand_state_t; 248} nand_state_t;
248 249
249/* Keep gcc happy */ 250/* Keep gcc happy */
@@ -251,7 +252,7 @@ struct nand_chip;
251 252
252/** 253/**
253 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices 254 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices
254 * @lock: protection lock 255 * @lock: protection lock
255 * @active: the mtd device which holds the controller currently 256 * @active: the mtd device which holds the controller currently
256 * @wq: wait queue to sleep on if a NAND operation is in progress 257 * @wq: wait queue to sleep on if a NAND operation is in progress
257 * used instead of the per chip wait queue when a hw controller is available 258 * used instead of the per chip wait queue when a hw controller is available
@@ -264,8 +265,8 @@ struct nand_hw_control {
264 265
265/** 266/**
266 * struct nand_chip - NAND Private Flash Chip Data 267 * 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 268 * @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 269 * @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 270 * @read_byte: [REPLACEABLE] read one byte from the chip
270 * @write_byte: [REPLACEABLE] write one byte to the chip 271 * @write_byte: [REPLACEABLE] write one byte to the chip
271 * @read_word: [REPLACEABLE] read one word from the chip 272 * @read_word: [REPLACEABLE] read one word from the chip
@@ -288,7 +289,7 @@ struct nand_hw_control {
288 * be provided if a hardware ECC is available 289 * be provided if a hardware ECC is available
289 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support 290 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support
290 * @scan_bbt: [REPLACEABLE] function to scan bad block table 291 * @scan_bbt: [REPLACEABLE] function to scan bad block table
291 * @eccmode: [BOARDSPECIFIC] mode of ecc, see defines 292 * @eccmode: [BOARDSPECIFIC] mode of ecc, see defines
292 * @eccsize: [INTERN] databytes used per ecc-calculation 293 * @eccsize: [INTERN] databytes used per ecc-calculation
293 * @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step 294 * @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step
294 * @eccsteps: [INTERN] number of ecc calculation steps per page 295 * @eccsteps: [INTERN] number of ecc calculation steps per page
@@ -300,7 +301,7 @@ struct nand_hw_control {
300 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock 301 * @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 302 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry
302 * @chip_shift: [INTERN] number of address bits in one chip 303 * @chip_shift: [INTERN] number of address bits in one chip
303 * @data_buf: [INTERN] internal buffer for one page + oob 304 * @data_buf: [INTERN] internal buffer for one page + oob
304 * @oob_buf: [INTERN] oob buffer for one eraseblock 305 * @oob_buf: [INTERN] oob buffer for one eraseblock
305 * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized 306 * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized
306 * @data_poi: [INTERN] pointer to a data buffer 307 * @data_poi: [INTERN] pointer to a data buffer
@@ -315,22 +316,22 @@ struct nand_hw_control {
315 * @bbt: [INTERN] bad block table pointer 316 * @bbt: [INTERN] bad block table pointer
316 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup 317 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup
317 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor 318 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor
318 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan 319 * @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 320 * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices
320 * @priv: [OPTIONAL] pointer to private chip date 321 * @priv: [OPTIONAL] pointer to private chip date
321 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks 322 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
322 * (determine if errors are correctable) 323 * (determine if errors are correctable)
323 */ 324 */
324 325
325struct nand_chip { 326struct nand_chip {
326 void __iomem *IO_ADDR_R; 327 void __iomem *IO_ADDR_R;
327 void __iomem *IO_ADDR_W; 328 void __iomem *IO_ADDR_W;
328 329
329 u_char (*read_byte)(struct mtd_info *mtd); 330 u_char (*read_byte)(struct mtd_info *mtd);
330 void (*write_byte)(struct mtd_info *mtd, u_char byte); 331 void (*write_byte)(struct mtd_info *mtd, u_char byte);
331 u16 (*read_word)(struct mtd_info *mtd); 332 u16 (*read_word)(struct mtd_info *mtd);
332 void (*write_word)(struct mtd_info *mtd, u16 word); 333 void (*write_word)(struct mtd_info *mtd, u16 word);
333 334
334 void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len); 335 void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len);
335 void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len); 336 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 int (*verify_buf)(struct mtd_info *mtd, const u_char *buf, int len);
@@ -395,7 +396,7 @@ struct nand_chip {
395 * @name: Identify the device type 396 * @name: Identify the device type
396 * @id: device ID code 397 * @id: device ID code
397 * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 398 * @pagesize: Pagesize in bytes. Either 256 or 512 or 0
398 * If the pagesize is 0, then the real pagesize 399 * If the pagesize is 0, then the real pagesize
399 * and the eraseize are determined from the 400 * and the eraseize are determined from the
400 * extended id bytes in the chip 401 * extended id bytes in the chip
401 * @erasesize: Size of an erase block in the flash device. 402 * @erasesize: Size of an erase block in the flash device.
@@ -424,7 +425,7 @@ struct nand_manufacturers {
424extern struct nand_flash_dev nand_flash_ids[]; 425extern struct nand_flash_dev nand_flash_ids[];
425extern struct nand_manufacturers nand_manuf_ids[]; 426extern struct nand_manufacturers nand_manuf_ids[];
426 427
427/** 428/**
428 * struct nand_bbt_descr - bad block table descriptor 429 * struct nand_bbt_descr - bad block table descriptor
429 * @options: options for this descriptor 430 * @options: options for this descriptor
430 * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE 431 * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE
@@ -435,14 +436,14 @@ extern struct nand_manufacturers nand_manuf_ids[];
435 * @version: version read from the bbt page during scan 436 * @version: version read from the bbt page during scan
436 * @len: length of the pattern, if 0 no pattern check is performed 437 * @len: length of the pattern, if 0 no pattern check is performed
437 * @maxblocks: maximum number of blocks to search for a bbt. This number of 438 * @maxblocks: maximum number of blocks to search for a bbt. This number of
438 * blocks is reserved at the end of the device where the tables are 439 * blocks is reserved at the end of the device where the tables are
439 * written. 440 * written.
440 * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than 441 * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than
441 * bad) block in the stored bbt 442 * bad) block in the stored bbt
442 * @pattern: pattern to identify bad block table or factory marked good / 443 * @pattern: pattern to identify bad block table or factory marked good /
443 * bad blocks, can be NULL, if len = 0 444 * bad blocks, can be NULL, if len = 0
444 * 445 *
445 * Descriptor for the bad block table marker and the descriptor for the 446 * Descriptor for the bad block table marker and the descriptor for the
446 * pattern which identifies good and bad blocks. The assumption is made 447 * pattern which identifies good and bad blocks. The assumption is made
447 * that the pattern and the version count are always located in the oob area 448 * that the pattern and the version count are always located in the oob area
448 * of the first block. 449 * of the first block.
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
new file mode 100644
index 000000000000..f1fd4215686a
--- /dev/null
+++ b/include/linux/mtd/onenand.h
@@ -0,0 +1,155 @@
1/*
2 * linux/include/linux/mtd/onenand.h
3 *
4 * Copyright (C) 2005 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __LINUX_MTD_ONENAND_H
13#define __LINUX_MTD_ONENAND_H
14
15#include <linux/spinlock.h>
16#include <linux/mtd/onenand_regs.h>
17#include <linux/mtd/bbm.h>
18
19#define MAX_BUFFERRAM 2
20#define MAX_ONENAND_PAGESIZE (2048 + 64)
21
22/* Scan and identify a OneNAND device */
23extern int onenand_scan(struct mtd_info *mtd, int max_chips);
24/* Free resources held by the OneNAND device */
25extern void onenand_release(struct mtd_info *mtd);
26
27/**
28 * onenand_state_t - chip states
29 * Enumeration for OneNAND flash chip state
30 */
31typedef enum {
32 FL_READY,
33 FL_READING,
34 FL_WRITING,
35 FL_ERASING,
36 FL_SYNCING,
37 FL_UNLOCKING,
38 FL_LOCKING,
39 FL_PM_SUSPENDED,
40} onenand_state_t;
41
42/**
43 * struct onenand_bufferram - OneNAND BufferRAM Data
44 * @param block block address in BufferRAM
45 * @param page page address in BufferRAM
46 * @param valid valid flag
47 */
48struct onenand_bufferram {
49 int block;
50 int page;
51 int valid;
52};
53
54/**
55 * struct onenand_chip - OneNAND Private Flash Chip Data
56 * @param base [BOARDSPECIFIC] address to access OneNAND
57 * @param chipsize [INTERN] the size of one chip for multichip arrays
58 * @param device_id [INTERN] device ID
59 * @param verstion_id [INTERN] version ID
60 * @param options [BOARDSPECIFIC] various chip options. They can partly be set to inform onenand_scan about
61 * @param erase_shift [INTERN] number of address bits in a block
62 * @param page_shift [INTERN] number of address bits in a page
63 * @param ppb_shift [INTERN] number of address bits in a pages per block
64 * @param page_mask [INTERN] a page per block mask
65 * @param bufferam_index [INTERN] BufferRAM index
66 * @param bufferam [INTERN] BufferRAM info
67 * @param readw [REPLACEABLE] hardware specific function for read short
68 * @param writew [REPLACEABLE] hardware specific function for write short
69 * @param command [REPLACEABLE] hardware specific function for writing commands to the chip
70 * @param wait [REPLACEABLE] hardware specific function for wait on ready
71 * @param read_bufferram [REPLACEABLE] hardware specific function for BufferRAM Area
72 * @param write_bufferram [REPLACEABLE] hardware specific function for BufferRAM Area
73 * @param read_word [REPLACEABLE] hardware specific function for read register of OneNAND
74 * @param write_word [REPLACEABLE] hardware specific function for write register of OneNAND
75 * @param scan_bbt [REPLACEALBE] hardware specific function for scaning Bad block Table
76 * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip
77 * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress
78 * @param state [INTERN] the current state of the OneNAND device
79 * @param autooob [REPLACEABLE] the default (auto)placement scheme
80 * @param bbm [REPLACEABLE] pointer to Bad Block Management
81 * @param priv [OPTIONAL] pointer to private chip date
82 */
83struct onenand_chip {
84 void __iomem *base;
85 unsigned int chipsize;
86 unsigned int device_id;
87 unsigned int density_mask;
88 unsigned int options;
89
90 unsigned int erase_shift;
91 unsigned int page_shift;
92 unsigned int ppb_shift; /* Pages per block shift */
93 unsigned int page_mask;
94
95 unsigned int bufferram_index;
96 struct onenand_bufferram bufferram[MAX_BUFFERRAM];
97
98 int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len);
99 int (*wait)(struct mtd_info *mtd, int state);
100 int (*read_bufferram)(struct mtd_info *mtd, int area,
101 unsigned char *buffer, int offset, size_t count);
102 int (*write_bufferram)(struct mtd_info *mtd, int area,
103 const unsigned char *buffer, int offset, size_t count);
104 unsigned short (*read_word)(void __iomem *addr);
105 void (*write_word)(unsigned short value, void __iomem *addr);
106 void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
107 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
108 int (*scan_bbt)(struct mtd_info *mtd);
109
110 spinlock_t chip_lock;
111 wait_queue_head_t wq;
112 onenand_state_t state;
113
114 struct nand_oobinfo *autooob;
115
116 void *bbm;
117
118 void *priv;
119};
120
121/*
122 * Helper macros
123 */
124#define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index)
125#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1)
126#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1)
127
128#define ONENAND_GET_SYS_CFG1(this) \
129 (this->read_word(this->base + ONENAND_REG_SYS_CFG1))
130#define ONENAND_SET_SYS_CFG1(v, this) \
131 (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1))
132
133/*
134 * Options bits
135 */
136#define ONENAND_CONT_LOCK (0x0001)
137
138
139/*
140 * OneNAND Flash Manufacturer ID Codes
141 */
142#define ONENAND_MFR_SAMSUNG 0xec
143#define ONENAND_MFR_UNKNOWN 0x00
144
145/**
146 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure
147 * @param name: Manufacturer name
148 * @param id: manufacturer ID code of device.
149*/
150struct onenand_manufacturers {
151 int id;
152 char *name;
153};
154
155#endif /* __LINUX_MTD_ONENAND_H */
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
new file mode 100644
index 000000000000..d7832ef8ed63
--- /dev/null
+++ b/include/linux/mtd/onenand_regs.h
@@ -0,0 +1,180 @@
1/*
2 * linux/include/linux/mtd/onenand_regs.h
3 *
4 * OneNAND Register header file
5 *
6 * Copyright (C) 2005 Samsung Electronics
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ONENAND_REG_H
14#define __ONENAND_REG_H
15
16/* Memory Address Map Translation (Word order) */
17#define ONENAND_MEMORY_MAP(x) ((x) << 1)
18
19/*
20 * External BufferRAM area
21 */
22#define ONENAND_BOOTRAM ONENAND_MEMORY_MAP(0x0000)
23#define ONENAND_DATARAM ONENAND_MEMORY_MAP(0x0200)
24#define ONENAND_SPARERAM ONENAND_MEMORY_MAP(0x8010)
25
26/*
27 * OneNAND Registers
28 */
29#define ONENAND_REG_MANUFACTURER_ID ONENAND_MEMORY_MAP(0xF000)
30#define ONENAND_REG_DEVICE_ID ONENAND_MEMORY_MAP(0xF001)
31#define ONENAND_REG_VERSION_ID ONENAND_MEMORY_MAP(0xF002)
32#define ONENAND_REG_DATA_BUFFER_SIZE ONENAND_MEMORY_MAP(0xF003)
33#define ONENAND_REG_BOOT_BUFFER_SIZE ONENAND_MEMORY_MAP(0xF004)
34#define ONENAND_REG_NUM_BUFFERS ONENAND_MEMORY_MAP(0xF005)
35#define ONENAND_REG_TECHNOLOGY ONENAND_MEMORY_MAP(0xF006)
36
37#define ONENAND_REG_START_ADDRESS1 ONENAND_MEMORY_MAP(0xF100)
38#define ONENAND_REG_START_ADDRESS2 ONENAND_MEMORY_MAP(0xF101)
39#define ONENAND_REG_START_ADDRESS3 ONENAND_MEMORY_MAP(0xF102)
40#define ONENAND_REG_START_ADDRESS4 ONENAND_MEMORY_MAP(0xF103)
41#define ONENAND_REG_START_ADDRESS5 ONENAND_MEMORY_MAP(0xF104)
42#define ONENAND_REG_START_ADDRESS6 ONENAND_MEMORY_MAP(0xF105)
43#define ONENAND_REG_START_ADDRESS7 ONENAND_MEMORY_MAP(0xF106)
44#define ONENAND_REG_START_ADDRESS8 ONENAND_MEMORY_MAP(0xF107)
45
46#define ONENAND_REG_START_BUFFER ONENAND_MEMORY_MAP(0xF200)
47#define ONENAND_REG_COMMAND ONENAND_MEMORY_MAP(0xF220)
48#define ONENAND_REG_SYS_CFG1 ONENAND_MEMORY_MAP(0xF221)
49#define ONENAND_REG_SYS_CFG2 ONENAND_MEMORY_MAP(0xF222)
50#define ONENAND_REG_CTRL_STATUS ONENAND_MEMORY_MAP(0xF240)
51#define ONENAND_REG_INTERRUPT ONENAND_MEMORY_MAP(0xF241)
52#define ONENAND_REG_START_BLOCK_ADDRESS ONENAND_MEMORY_MAP(0xF24C)
53#define ONENAND_REG_END_BLOCK_ADDRESS ONENAND_MEMORY_MAP(0xF24D)
54#define ONENAND_REG_WP_STATUS ONENAND_MEMORY_MAP(0xF24E)
55
56#define ONENAND_REG_ECC_STATUS ONENAND_MEMORY_MAP(0xFF00)
57#define ONENAND_REG_ECC_M0 ONENAND_MEMORY_MAP(0xFF01)
58#define ONENAND_REG_ECC_S0 ONENAND_MEMORY_MAP(0xFF02)
59#define ONENAND_REG_ECC_M1 ONENAND_MEMORY_MAP(0xFF03)
60#define ONENAND_REG_ECC_S1 ONENAND_MEMORY_MAP(0xFF04)
61#define ONENAND_REG_ECC_M2 ONENAND_MEMORY_MAP(0xFF05)
62#define ONENAND_REG_ECC_S2 ONENAND_MEMORY_MAP(0xFF06)
63#define ONENAND_REG_ECC_M3 ONENAND_MEMORY_MAP(0xFF07)
64#define ONENAND_REG_ECC_S3 ONENAND_MEMORY_MAP(0xFF08)
65
66/*
67 * Device ID Register F001h (R)
68 */
69#define ONENAND_DEVICE_DENSITY_SHIFT (4)
70#define ONENAND_DEVICE_IS_DDP (1 << 3)
71#define ONENAND_DEVICE_IS_DEMUX (1 << 2)
72#define ONENAND_DEVICE_VCC_MASK (0x3)
73
74#define ONENAND_DEVICE_DENSITY_512Mb (0x002)
75
76/*
77 * Version ID Register F002h (R)
78 */
79#define ONENAND_VERSION_PROCESS_SHIFT (8)
80
81/*
82 * Start Address 1 F100h (R/W)
83 */
84#define ONENAND_DDP_SHIFT (15)
85
86/*
87 * Start Address 8 F107h (R/W)
88 */
89#define ONENAND_FPA_MASK (0x3f)
90#define ONENAND_FPA_SHIFT (2)
91#define ONENAND_FSA_MASK (0x03)
92
93/*
94 * Start Buffer Register F200h (R/W)
95 */
96#define ONENAND_BSA_MASK (0x03)
97#define ONENAND_BSA_SHIFT (8)
98#define ONENAND_BSA_BOOTRAM (0 << 2)
99#define ONENAND_BSA_DATARAM0 (2 << 2)
100#define ONENAND_BSA_DATARAM1 (3 << 2)
101#define ONENAND_BSC_MASK (0x03)
102
103/*
104 * Command Register F220h (R/W)
105 */
106#define ONENAND_CMD_READ (0x00)
107#define ONENAND_CMD_READOOB (0x13)
108#define ONENAND_CMD_PROG (0x80)
109#define ONENAND_CMD_PROGOOB (0x1A)
110#define ONENAND_CMD_UNLOCK (0x23)
111#define ONENAND_CMD_LOCK (0x2A)
112#define ONENAND_CMD_LOCK_TIGHT (0x2C)
113#define ONENAND_CMD_ERASE (0x94)
114#define ONENAND_CMD_RESET (0xF0)
115#define ONENAND_CMD_READID (0x90)
116
117/* NOTE: Those are not *REAL* commands */
118#define ONENAND_CMD_BUFFERRAM (0x1978)
119
120/*
121 * System Configuration 1 Register F221h (R, R/W)
122 */
123#define ONENAND_SYS_CFG1_SYNC_READ (1 << 15)
124#define ONENAND_SYS_CFG1_BRL_7 (7 << 12)
125#define ONENAND_SYS_CFG1_BRL_6 (6 << 12)
126#define ONENAND_SYS_CFG1_BRL_5 (5 << 12)
127#define ONENAND_SYS_CFG1_BRL_4 (4 << 12)
128#define ONENAND_SYS_CFG1_BRL_3 (3 << 12)
129#define ONENAND_SYS_CFG1_BRL_10 (2 << 12)
130#define ONENAND_SYS_CFG1_BRL_9 (1 << 12)
131#define ONENAND_SYS_CFG1_BRL_8 (0 << 12)
132#define ONENAND_SYS_CFG1_BRL_SHIFT (12)
133#define ONENAND_SYS_CFG1_BL_32 (4 << 9)
134#define ONENAND_SYS_CFG1_BL_16 (3 << 9)
135#define ONENAND_SYS_CFG1_BL_8 (2 << 9)
136#define ONENAND_SYS_CFG1_BL_4 (1 << 9)
137#define ONENAND_SYS_CFG1_BL_CONT (0 << 9)
138#define ONENAND_SYS_CFG1_BL_SHIFT (9)
139#define ONENAND_SYS_CFG1_NO_ECC (1 << 8)
140#define ONENAND_SYS_CFG1_RDY (1 << 7)
141#define ONENAND_SYS_CFG1_INT (1 << 6)
142#define ONENAND_SYS_CFG1_IOBE (1 << 5)
143#define ONENAND_SYS_CFG1_RDY_CONF (1 << 4)
144
145/*
146 * Controller Status Register F240h (R)
147 */
148#define ONENAND_CTRL_ONGO (1 << 15)
149#define ONENAND_CTRL_LOCK (1 << 14)
150#define ONENAND_CTRL_LOAD (1 << 13)
151#define ONENAND_CTRL_PROGRAM (1 << 12)
152#define ONENAND_CTRL_ERASE (1 << 11)
153#define ONENAND_CTRL_ERROR (1 << 10)
154#define ONENAND_CTRL_RSTB (1 << 7)
155
156/*
157 * Interrupt Status Register F241h (R)
158 */
159#define ONENAND_INT_MASTER (1 << 15)
160#define ONENAND_INT_READ (1 << 7)
161#define ONENAND_INT_WRITE (1 << 6)
162#define ONENAND_INT_ERASE (1 << 5)
163#define ONENAND_INT_RESET (1 << 4)
164#define ONENAND_INT_CLEAR (0 << 0)
165
166/*
167 * NAND Flash Write Protection Status Register F24Eh (R)
168 */
169#define ONENAND_WP_US (1 << 2)
170#define ONENAND_WP_LS (1 << 1)
171#define ONENAND_WP_LTS (1 << 0)
172
173/*
174 * ECC Status Reigser FF00h (R)
175 */
176#define ONENAND_ECC_1BIT (1 << 0)
177#define ONENAND_ECC_2BIT (1 << 1)
178#define ONENAND_ECC_2BIT_ALL (0xAAAA)
179
180#endif /* __ONENAND_REG_H */
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index 50b2edfc8f11..b03f512d51b9 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * This code is GPL 6 * This code is GPL
7 * 7 *
8 * $Id: partitions.h,v 1.16 2004/11/16 18:34:40 dwmw2 Exp $ 8 * $Id: partitions.h,v 1.17 2005/11/07 11:14:55 gleixner Exp $
9 */ 9 */
10 10
11#ifndef MTD_PARTITIONS_H 11#ifndef MTD_PARTITIONS_H
@@ -16,25 +16,25 @@
16 16
17/* 17/*
18 * Partition definition structure: 18 * Partition definition structure:
19 * 19 *
20 * An array of struct partition is passed along with a MTD object to 20 * An array of struct partition is passed along with a MTD object to
21 * add_mtd_partitions() to create them. 21 * add_mtd_partitions() to create them.
22 * 22 *
23 * For each partition, these fields are available: 23 * For each partition, these fields are available:
24 * name: string that will be used to label the partition's MTD device. 24 * name: string that will be used to label the partition's MTD device.
25 * size: the partition size; if defined as MTDPART_SIZ_FULL, the partition 25 * size: the partition size; if defined as MTDPART_SIZ_FULL, the partition
26 * will extend to the end of the master MTD device. 26 * will extend to the end of the master MTD device.
27 * offset: absolute starting position within the master MTD device; if 27 * offset: absolute starting position within the master MTD device; if
28 * defined as MTDPART_OFS_APPEND, the partition will start where the 28 * defined as MTDPART_OFS_APPEND, the partition will start where the
29 * previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block. 29 * previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block.
30 * mask_flags: contains flags that have to be masked (removed) from the 30 * mask_flags: contains flags that have to be masked (removed) from the
31 * master MTD flag set for the corresponding MTD partition. 31 * master MTD flag set for the corresponding MTD partition.
32 * For example, to force a read-only partition, simply adding 32 * For example, to force a read-only partition, simply adding
33 * MTD_WRITEABLE to the mask_flags will do the trick. 33 * MTD_WRITEABLE to the mask_flags will do the trick.
34 * 34 *
35 * Note: writeable partitions require their size and offset be 35 * Note: writeable partitions require their size and offset be
36 * erasesize aligned (e.g. use MTDPART_OFS_NEXTBLK). 36 * erasesize aligned (e.g. use MTDPART_OFS_NEXTBLK).
37 */ 37 */
38 38
39struct mtd_partition { 39struct mtd_partition {
40 char *name; /* identifier string */ 40 char *name; /* identifier string */
@@ -66,7 +66,7 @@ struct mtd_part_parser {
66 66
67extern int register_mtd_parser(struct mtd_part_parser *parser); 67extern int register_mtd_parser(struct mtd_part_parser *parser);
68extern int deregister_mtd_parser(struct mtd_part_parser *parser); 68extern int deregister_mtd_parser(struct mtd_part_parser *parser);
69extern int parse_mtd_partitions(struct mtd_info *master, const char **types, 69extern int parse_mtd_partitions(struct mtd_info *master, const char **types,
70 struct mtd_partition **pparts, unsigned long origin); 70 struct mtd_partition **pparts, unsigned long origin);
71 71
72#define put_partition_parser(p) do { module_put((p)->owner); } while(0) 72#define put_partition_parser(p) do { module_put((p)->owner); } while(0)
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index 05aa4970677f..c7b8bcdef013 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * For boards with physically mapped flash and using 2 * For boards with physically mapped flash and using
3 * drivers/mtd/maps/physmap.c mapping driver. 3 * drivers/mtd/maps/physmap.c mapping driver.
4 * 4 *
5 * $Id: physmap.h,v 1.3 2004/07/21 00:16:15 jwboyer Exp $ 5 * $Id: physmap.h,v 1.4 2005/11/07 11:14:55 gleixner Exp $
6 * 6 *
7 * Copyright (C) 2003 MontaVista Software Inc. 7 * Copyright (C) 2003 MontaVista Software Inc.
8 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net 8 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
@@ -18,7 +18,7 @@
18 18
19#include <linux/config.h> 19#include <linux/config.h>
20 20
21#if defined(CONFIG_MTD_PHYSMAP) 21#if defined(CONFIG_MTD_PHYSMAP)
22 22
23#include <linux/mtd/mtd.h> 23#include <linux/mtd/mtd.h>
24#include <linux/mtd/map.h> 24#include <linux/mtd/map.h>
@@ -44,12 +44,12 @@ static inline void physmap_configure(unsigned long addr, unsigned long size, int
44#if defined(CONFIG_MTD_PARTITIONS) 44#if defined(CONFIG_MTD_PARTITIONS)
45 45
46/* 46/*
47 * Machines that wish to do flash partition may want to call this function in 47 * Machines that wish to do flash partition may want to call this function in
48 * their setup routine. 48 * their setup routine.
49 * 49 *
50 * physmap_set_partitions(mypartitions, num_parts); 50 * physmap_set_partitions(mypartitions, num_parts);
51 * 51 *
52 * Note that one can always override this hard-coded partition with 52 * Note that one can always override this hard-coded partition with
53 * command line partition (you need to enable CONFIG_MTD_CMDLINE_PARTS). 53 * command line partition (you need to enable CONFIG_MTD_CMDLINE_PARTS).
54 */ 54 */
55void physmap_set_partitions(struct mtd_partition *parts, int num_parts); 55void physmap_set_partitions(struct mtd_partition *parts, int num_parts);
diff --git a/include/linux/mtd/pmc551.h b/include/linux/mtd/pmc551.h
index 113e3087f68a..a7f6d20ad407 100644
--- a/include/linux/mtd/pmc551.h
+++ b/include/linux/mtd/pmc551.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: pmc551.h,v 1.5 2003/01/24 16:49:53 dwmw2 Exp $ 2 * $Id: pmc551.h,v 1.6 2005/11/07 11:14:55 gleixner Exp $
3 * 3 *
4 * PMC551 PCI Mezzanine Ram Device 4 * PMC551 PCI Mezzanine Ram Device
5 * 5 *
@@ -7,7 +7,7 @@
7 * Mark Ferrell 7 * Mark Ferrell
8 * Copyright 1999,2000 Nortel Networks 8 * Copyright 1999,2000 Nortel Networks
9 * 9 *
10 * License: 10 * License:
11 * As part of this driver was derrived from the slram.c driver it falls 11 * As part of this driver was derrived from the slram.c driver it falls
12 * under the same license, which is GNU General Public License v2 12 * under the same license, which is GNU General Public License v2
13 */ 13 */
@@ -17,7 +17,7 @@
17 17
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19 19
20#define PMC551_VERSION "$Id: pmc551.h,v 1.5 2003/01/24 16:49:53 dwmw2 Exp $\n"\ 20#define PMC551_VERSION "$Id: pmc551.h,v 1.6 2005/11/07 11:14:55 gleixner Exp $\n"\
21 "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n" 21 "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n"
22 22
23/* 23/*
@@ -30,7 +30,7 @@ struct mypriv {
30 u32 curr_map0; 30 u32 curr_map0;
31 u32 asize; 31 u32 asize;
32 struct mtd_info *nextpmc551; 32 struct mtd_info *nextpmc551;
33}; 33};
34 34
35/* 35/*
36 * Function Prototypes 36 * Function Prototypes
@@ -39,7 +39,7 @@ static int pmc551_erase(struct mtd_info *, struct erase_info *);
39static void pmc551_unpoint(struct mtd_info *, u_char *, loff_t, size_t); 39static void pmc551_unpoint(struct mtd_info *, u_char *, loff_t, size_t);
40static int pmc551_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf); 40static int pmc551_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf);
41static int pmc551_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *); 41static int pmc551_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *);
42static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); 42static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
43 43
44 44
45/* 45/*
@@ -50,7 +50,7 @@ static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_cha
50#endif 50#endif
51 51
52#ifndef PCI_DEVICE_ID_V3_SEMI_V370PDC 52#ifndef PCI_DEVICE_ID_V3_SEMI_V370PDC
53#define PCI_DEVICE_ID_V3_SEMI_V370PDC 0x0200 53#define PCI_DEVICE_ID_V3_SEMI_V370PDC 0x0200
54#endif 54#endif
55 55
56 56
diff --git a/include/linux/mtd/xip.h b/include/linux/mtd/xip.h
index 7b7deef6b180..220d50bb71cd 100644
--- a/include/linux/mtd/xip.h
+++ b/include/linux/mtd/xip.h
@@ -12,7 +12,7 @@
12 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation. 13 * published by the Free Software Foundation.
14 * 14 *
15 * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $ 15 * $Id: xip.h,v 1.5 2005/11/07 11:14:55 gleixner Exp $
16 */ 16 */
17 17
18#ifndef __LINUX_MTD_XIP_H__ 18#ifndef __LINUX_MTD_XIP_H__
@@ -23,19 +23,19 @@
23#ifdef CONFIG_MTD_XIP 23#ifdef CONFIG_MTD_XIP
24 24
25/* 25/*
26 * Function that are modifying the flash state away from array mode must
27 * obviously not be running from flash. The __xipram is therefore marking
28 * those functions so they get relocated to ram.
29 */
30#define __xipram __attribute__ ((__section__ (".data")))
31
32/*
33 * We really don't want gcc to guess anything. 26 * We really don't want gcc to guess anything.
34 * We absolutely _need_ proper inlining. 27 * We absolutely _need_ proper inlining.
35 */ 28 */
36#include <linux/compiler.h> 29#include <linux/compiler.h>
37 30
38/* 31/*
32 * Function that are modifying the flash state away from array mode must
33 * obviously not be running from flash. The __xipram is therefore marking
34 * those functions so they get relocated to ram.
35 */
36#define __xipram noinline __attribute__ ((__section__ (".data")))
37
38/*
39 * Each architecture has to provide the following macros. They must access 39 * Each architecture has to provide the following macros. They must access
40 * the hardware directly and not rely on any other (XIP) functions since they 40 * the hardware directly and not rely on any other (XIP) functions since they
41 * won't be available when used (flash not in array mode). 41 * won't be available when used (flash not in array mode).
@@ -60,9 +60,9 @@
60 * overflowing. 60 * overflowing.
61 * 61 *
62 * xip_iprefetch() 62 * xip_iprefetch()
63 * 63 *
64 * Macro to fill instruction prefetch 64 * Macro to fill instruction prefetch
65 * e.g. a series of nops: asm volatile (".rep 8; nop; .endr"); 65 * e.g. a series of nops: asm volatile (".rep 8; nop; .endr");
66 */ 66 */
67 67
68#include <asm/mtd-xip.h> 68#include <asm/mtd-xip.h>
diff --git a/include/linux/namespace.h b/include/linux/namespace.h
index 0e5a86f13b2f..6731977c4c13 100644
--- a/include/linux/namespace.h
+++ b/include/linux/namespace.h
@@ -9,7 +9,8 @@ struct namespace {
9 atomic_t count; 9 atomic_t count;
10 struct vfsmount * root; 10 struct vfsmount * root;
11 struct list_head list; 11 struct list_head list;
12 struct rw_semaphore sem; 12 wait_queue_head_t poll;
13 int event;
13}; 14};
14 15
15extern int copy_namespace(int, struct task_struct *); 16extern int copy_namespace(int, struct task_struct *);
diff --git a/include/linux/net.h b/include/linux/net.h
index 4e981585a89a..d6a41e6577f6 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -71,6 +71,7 @@ typedef enum {
71 * @SOCK_RAW: raw socket 71 * @SOCK_RAW: raw socket
72 * @SOCK_RDM: reliably-delivered message 72 * @SOCK_RDM: reliably-delivered message
73 * @SOCK_SEQPACKET: sequential packet socket 73 * @SOCK_SEQPACKET: sequential packet socket
74 * @SOCK_DCCP: Datagram Congestion Control Protocol socket
74 * @SOCK_PACKET: linux specific way of getting packets at the dev level. 75 * @SOCK_PACKET: linux specific way of getting packets at the dev level.
75 * For writing rarp and other similar things on the user level. 76 * For writing rarp and other similar things on the user level.
76 * 77 *
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 6d5a24f3fc6d..51c231a1e5a6 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -60,7 +60,7 @@ typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int);
60extern struct svc_program nfsd_program; 60extern struct svc_program nfsd_program;
61extern struct svc_version nfsd_version2, nfsd_version3, 61extern struct svc_version nfsd_version2, nfsd_version3,
62 nfsd_version4; 62 nfsd_version4;
63 63extern struct svc_serv *nfsd_serv;
64/* 64/*
65 * Function prototypes. 65 * Function prototypes.
66 */ 66 */
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
index e65c9db6d13f..781efbf94ed3 100644
--- a/include/linux/nfsd/syscall.h
+++ b/include/linux/nfsd/syscall.h
@@ -39,6 +39,21 @@
39#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ 39#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
40#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ 40#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
41 41
42/*
43 * Macros used to set version
44 */
45#define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << (_v)))
46#define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v)))
47#define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << (_v)))
48
49#if defined(CONFIG_NFSD_V4)
50#define NFSCTL_VERALL (0x1c /* 0b011100 */)
51#elif defined(CONFIG_NFSD_V3)
52#define NFSCTL_VERALL (0x0c /* 0b001100 */)
53#else
54#define NFSCTL_VERALL (0x04 /* 0b000100 */)
55#endif
56
42/* SVC */ 57/* SVC */
43struct nfsctl_svc { 58struct nfsctl_svc {
44 unsigned short svc_port; 59 unsigned short svc_port;
@@ -120,6 +135,8 @@ extern int exp_delclient(struct nfsctl_client *ncp);
120extern int exp_export(struct nfsctl_export *nxp); 135extern int exp_export(struct nfsctl_export *nxp);
121extern int exp_unexport(struct nfsctl_export *nxp); 136extern int exp_unexport(struct nfsctl_export *nxp);
122 137
138extern unsigned int nfsd_versbits;
139
123#endif /* __KERNEL__ */ 140#endif /* __KERNEL__ */
124 141
125#endif /* NFSD_SYSCALL_H */ 142#endif /* NFSD_SYSCALL_H */
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
index 21e18ce7ca63..3c2a71b43bac 100644
--- a/include/linux/nfsd/xdr3.h
+++ b/include/linux/nfsd/xdr3.h
@@ -42,7 +42,7 @@ struct nfsd3_writeargs {
42 __u64 offset; 42 __u64 offset;
43 __u32 count; 43 __u32 count;
44 int stable; 44 int stable;
45 int len; 45 __u32 len;
46 struct kvec vec[RPCSVC_MAXPAGES]; 46 struct kvec vec[RPCSVC_MAXPAGES];
47 int vlen; 47 int vlen;
48}; 48};
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 8cadfdeef674..9a96f0588393 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -519,6 +519,7 @@
519#define PCI_DEVICE_ID_MATROX_MIL 0x0519 519#define PCI_DEVICE_ID_MATROX_MIL 0x0519
520#define PCI_DEVICE_ID_MATROX_MYS 0x051A 520#define PCI_DEVICE_ID_MATROX_MYS 0x051A
521#define PCI_DEVICE_ID_MATROX_MIL_2 0x051b 521#define PCI_DEVICE_ID_MATROX_MIL_2 0x051b
522#define PCI_DEVICE_ID_MATROX_MYS_AGP 0x051e
522#define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f 523#define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f
523#define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10 524#define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10
524#define PCI_DEVICE_ID_MATROX_G100_MM 0x1000 525#define PCI_DEVICE_ID_MATROX_G100_MM 0x1000
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index 60ffcb9c5791..e87b233615b3 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -93,6 +93,7 @@ struct tc_fifo_qopt
93/* PRIO section */ 93/* PRIO section */
94 94
95#define TCQ_PRIO_BANDS 16 95#define TCQ_PRIO_BANDS 16
96#define TCQ_MIN_PRIO_BANDS 2
96 97
97struct tc_prio_qopt 98struct tc_prio_qopt
98{ 99{
@@ -169,6 +170,7 @@ struct tc_red_qopt
169 unsigned char Scell_log; /* cell size for idle damping */ 170 unsigned char Scell_log; /* cell size for idle damping */
170 unsigned char flags; 171 unsigned char flags;
171#define TC_RED_ECN 1 172#define TC_RED_ECN 1
173#define TC_RED_HARDDROP 2
172}; 174};
173 175
174struct tc_red_xstats 176struct tc_red_xstats
@@ -194,38 +196,34 @@ enum
194 196
195#define TCA_GRED_MAX (__TCA_GRED_MAX - 1) 197#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
196 198
197#define TCA_SET_OFF TCA_GRED_PARMS
198struct tc_gred_qopt 199struct tc_gred_qopt
199{ 200{
200 __u32 limit; /* HARD maximal queue length (bytes) 201 __u32 limit; /* HARD maximal queue length (bytes) */
201*/ 202 __u32 qth_min; /* Min average length threshold (bytes) */
202 __u32 qth_min; /* Min average length threshold (bytes) 203 __u32 qth_max; /* Max average length threshold (bytes) */
203*/ 204 __u32 DP; /* upto 2^32 DPs */
204 __u32 qth_max; /* Max average length threshold (bytes) 205 __u32 backlog;
205*/ 206 __u32 qave;
206 __u32 DP; /* upto 2^32 DPs */ 207 __u32 forced;
207 __u32 backlog; 208 __u32 early;
208 __u32 qave; 209 __u32 other;
209 __u32 forced; 210 __u32 pdrop;
210 __u32 early; 211 __u8 Wlog; /* log(W) */
211 __u32 other; 212 __u8 Plog; /* log(P_max/(qth_max-qth_min)) */
212 __u32 pdrop; 213 __u8 Scell_log; /* cell size for idle damping */
213 214 __u8 prio; /* prio of this VQ */
214 unsigned char Wlog; /* log(W) */ 215 __u32 packets;
215 unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ 216 __u32 bytesin;
216 unsigned char Scell_log; /* cell size for idle damping */
217 __u8 prio; /* prio of this VQ */
218 __u32 packets;
219 __u32 bytesin;
220}; 217};
218
221/* gred setup */ 219/* gred setup */
222struct tc_gred_sopt 220struct tc_gred_sopt
223{ 221{
224 __u32 DPs; 222 __u32 DPs;
225 __u32 def_DP; 223 __u32 def_DP;
226 __u8 grio; 224 __u8 grio;
227 __u8 pad1; 225 __u8 flags;
228 __u16 pad2; 226 __u16 pad1;
229}; 227};
230 228
231/* HTB section */ 229/* HTB section */
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index aadbac29103c..584d57cb393a 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -353,7 +353,6 @@ struct pnp_protocol {
353int pnp_register_protocol(struct pnp_protocol *protocol); 353int pnp_register_protocol(struct pnp_protocol *protocol);
354void pnp_unregister_protocol(struct pnp_protocol *protocol); 354void pnp_unregister_protocol(struct pnp_protocol *protocol);
355int pnp_add_device(struct pnp_dev *dev); 355int pnp_add_device(struct pnp_dev *dev);
356void pnp_remove_device(struct pnp_dev *dev);
357int pnp_device_attach(struct pnp_dev *pnp_dev); 356int pnp_device_attach(struct pnp_dev *pnp_dev);
358void pnp_device_detach(struct pnp_dev *pnp_dev); 357void pnp_device_detach(struct pnp_dev *pnp_dev);
359extern struct list_head pnp_global; 358extern struct list_head pnp_global;
@@ -399,7 +398,6 @@ static inline int pnp_register_protocol(struct pnp_protocol *protocol) { return
399static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { } 398static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { }
400static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } 399static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; }
401static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } 400static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; }
402static inline void pnp_remove_device(struct pnp_dev *dev) { }
403static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } 401static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; }
404static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } 402static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; }
405 403
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index dc6f3647bfbc..b2b3dba1298d 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -78,6 +78,8 @@
78#include <linux/compiler.h> /* For unlikely. */ 78#include <linux/compiler.h> /* For unlikely. */
79#include <linux/sched.h> /* For struct task_struct. */ 79#include <linux/sched.h> /* For struct task_struct. */
80 80
81
82extern long arch_ptrace(struct task_struct *child, long request, long addr, long data);
81extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); 83extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
82extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); 84extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);
83extern int ptrace_attach(struct task_struct *tsk); 85extern int ptrace_attach(struct task_struct *tsk);
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 700ead45084f..f33aeb22c26a 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -289,7 +289,6 @@ struct quota_info {
289 struct semaphore dqonoff_sem; /* Serialize quotaon & quotaoff */ 289 struct semaphore dqonoff_sem; /* Serialize quotaon & quotaoff */
290 struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ 290 struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */
291 struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ 291 struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */
292 struct vfsmount *mnt[MAXQUOTAS]; /* mountpoint entries of filesystems with quota files */
293 struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ 292 struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */
294 struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ 293 struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */
295}; 294};
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index d211507ab246..4f34d3d60f2e 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -198,38 +198,38 @@ static __inline__ int DQUOT_OFF(struct super_block *sb)
198#define DQUOT_SYNC(sb) do { } while(0) 198#define DQUOT_SYNC(sb) do { } while(0)
199#define DQUOT_OFF(sb) do { } while(0) 199#define DQUOT_OFF(sb) do { } while(0)
200#define DQUOT_TRANSFER(inode, iattr) (0) 200#define DQUOT_TRANSFER(inode, iattr) (0)
201extern __inline__ int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) 201static inline int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
202{ 202{
203 inode_add_bytes(inode, nr); 203 inode_add_bytes(inode, nr);
204 return 0; 204 return 0;
205} 205}
206 206
207extern __inline__ int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr) 207static inline int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr)
208{ 208{
209 DQUOT_PREALLOC_SPACE_NODIRTY(inode, nr); 209 DQUOT_PREALLOC_SPACE_NODIRTY(inode, nr);
210 mark_inode_dirty(inode); 210 mark_inode_dirty(inode);
211 return 0; 211 return 0;
212} 212}
213 213
214extern __inline__ int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) 214static inline int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
215{ 215{
216 inode_add_bytes(inode, nr); 216 inode_add_bytes(inode, nr);
217 return 0; 217 return 0;
218} 218}
219 219
220extern __inline__ int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr) 220static inline int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr)
221{ 221{
222 DQUOT_ALLOC_SPACE_NODIRTY(inode, nr); 222 DQUOT_ALLOC_SPACE_NODIRTY(inode, nr);
223 mark_inode_dirty(inode); 223 mark_inode_dirty(inode);
224 return 0; 224 return 0;
225} 225}
226 226
227extern __inline__ void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr) 227static inline void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
228{ 228{
229 inode_sub_bytes(inode, nr); 229 inode_sub_bytes(inode, nr);
230} 230}
231 231
232extern __inline__ void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr) 232static inline void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr)
233{ 233{
234 DQUOT_FREE_SPACE_NODIRTY(inode, nr); 234 DQUOT_FREE_SPACE_NODIRTY(inode, nr);
235 mark_inode_dirty(inode); 235 mark_inode_dirty(inode);
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index 9f0f9281f42a..36e5d269612f 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -46,6 +46,7 @@ do { \
46 46
47int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); 47int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
48void *radix_tree_lookup(struct radix_tree_root *, unsigned long); 48void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
49void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long);
49void *radix_tree_delete(struct radix_tree_root *, unsigned long); 50void *radix_tree_delete(struct radix_tree_root *, unsigned long);
50unsigned int 51unsigned int
51radix_tree_gang_lookup(struct radix_tree_root *root, void **results, 52radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
diff --git a/include/linux/rio.h b/include/linux/rio.h
new file mode 100644
index 000000000000..c7e907faae9c
--- /dev/null
+++ b/include/linux/rio.h
@@ -0,0 +1,325 @@
1/*
2 * RapidIO interconnect services
3 * (RapidIO Interconnect Specification, http://www.rapidio.org)
4 *
5 * Copyright 2005 MontaVista Software, Inc.
6 * Matt Porter <mporter@kernel.crashing.org>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#ifndef LINUX_RIO_H
15#define LINUX_RIO_H
16
17#ifdef __KERNEL__
18
19#include <linux/types.h>
20#include <linux/config.h>
21#include <linux/ioport.h>
22#include <linux/list.h>
23#include <linux/errno.h>
24#include <linux/device.h>
25#include <linux/rio_regs.h>
26
27#define RIO_ANY_DESTID 0xff
28#define RIO_NO_HOPCOUNT -1
29
30#define RIO_MAX_MPORT_RESOURCES 16
31#define RIO_MAX_DEV_RESOURCES 16
32
33#define RIO_GLOBAL_TABLE 0xff /* Indicates access of a switch's
34 global routing table if it
35 has multiple (or per port)
36 tables */
37
38#define RIO_INVALID_ROUTE 0xff /* Indicates that a route table
39 entry is invalid (no route
40 exists for the device ID) */
41
42#ifdef CONFIG_RAPIDIO_8_BIT_TRANSPORT
43#define RIO_MAX_ROUTE_ENTRIES (1 << 8)
44#else
45#define RIO_MAX_ROUTE_ENTRIES (1 << 16)
46#endif
47
48#define RIO_MAX_MBOX 4
49#define RIO_MAX_MSG_SIZE 0x1000
50
51/*
52 * Error values that may be returned by RIO functions.
53 */
54#define RIO_SUCCESSFUL 0x00
55#define RIO_BAD_SIZE 0x81
56
57/*
58 * For RIO devices, the region numbers are assigned this way:
59 *
60 * 0 RapidIO outbound doorbells
61 * 1-15 RapidIO memory regions
62 *
63 * For RIO master ports, the region number are assigned this way:
64 *
65 * 0 RapidIO inbound doorbells
66 * 1 RapidIO inbound mailboxes
67 * 1 RapidIO outbound mailboxes
68 */
69#define RIO_DOORBELL_RESOURCE 0
70#define RIO_INB_MBOX_RESOURCE 1
71#define RIO_OUTB_MBOX_RESOURCE 2
72
73extern struct bus_type rio_bus_type;
74extern struct list_head rio_devices; /* list of all devices */
75
76struct rio_mport;
77
78/**
79 * struct rio_dev - RIO device info
80 * @global_list: Node in list of all RIO devices
81 * @net_list: Node in list of RIO devices in a network
82 * @net: Network this device is a part of
83 * @did: Device ID
84 * @vid: Vendor ID
85 * @device_rev: Device revision
86 * @asm_did: Assembly device ID
87 * @asm_vid: Assembly vendor ID
88 * @asm_rev: Assembly revision
89 * @efptr: Extended feature pointer
90 * @pef: Processing element features
91 * @swpinfo: Switch port info
92 * @src_ops: Source operation capabilities
93 * @dst_ops: Destination operation capabilities
94 * @dma_mask: Mask of bits of RIO address this device implements
95 * @rswitch: Pointer to &struct rio_switch if valid for this device
96 * @driver: Driver claiming this device
97 * @dev: Device model device
98 * @riores: RIO resources this device owns
99 * @destid: Network destination ID
100 */
101struct rio_dev {
102 struct list_head global_list; /* node in list of all RIO devices */
103 struct list_head net_list; /* node in per net list */
104 struct rio_net *net; /* RIO net this device resides in */
105 u16 did;
106 u16 vid;
107 u32 device_rev;
108 u16 asm_did;
109 u16 asm_vid;
110 u16 asm_rev;
111 u16 efptr;
112 u32 pef;
113 u32 swpinfo; /* Only used for switches */
114 u32 src_ops;
115 u32 dst_ops;
116 u64 dma_mask;
117 struct rio_switch *rswitch; /* RIO switch info */
118 struct rio_driver *driver; /* RIO driver claiming this device */
119 struct device dev; /* LDM device structure */
120 struct resource riores[RIO_MAX_DEV_RESOURCES];
121 u16 destid;
122};
123
124#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list)
125#define rio_dev_f(n) list_entry(n, struct rio_dev, net_list)
126#define to_rio_dev(n) container_of(n, struct rio_dev, dev)
127
128/**
129 * struct rio_msg - RIO message event
130 * @res: Mailbox resource
131 * @mcback: Message event callback
132 */
133struct rio_msg {
134 struct resource *res;
135 void (*mcback) (struct rio_mport * mport, void *dev_id, int mbox, int slot);
136};
137
138/**
139 * struct rio_dbell - RIO doorbell event
140 * @node: Node in list of doorbell events
141 * @res: Doorbell resource
142 * @dinb: Doorbell event callback
143 * @dev_id: Device specific pointer to pass on event
144 */
145struct rio_dbell {
146 struct list_head node;
147 struct resource *res;
148 void (*dinb) (struct rio_mport *mport, void *dev_id, u16 src, u16 dst, u16 info);
149 void *dev_id;
150};
151
152/**
153 * struct rio_mport - RIO master port info
154 * @dbells: List of doorbell events
155 * @node: Node in global list of master ports
156 * @nnode: Node in network list of master ports
157 * @iores: I/O mem resource that this master port interface owns
158 * @riores: RIO resources that this master port interfaces owns
159 * @inb_msg: RIO inbound message event descriptors
160 * @outb_msg: RIO outbound message event descriptors
161 * @host_deviceid: Host device ID associated with this master port
162 * @ops: configuration space functions
163 * @id: Port ID, unique among all ports
164 * @index: Port index, unique among all port interfaces of the same type
165 * @name: Port name string
166 */
167struct rio_mport {
168 struct list_head dbells; /* list of doorbell events */
169 struct list_head node; /* node in global list of ports */
170 struct list_head nnode; /* node in net list of ports */
171 struct resource iores;
172 struct resource riores[RIO_MAX_MPORT_RESOURCES];
173 struct rio_msg inb_msg[RIO_MAX_MBOX];
174 struct rio_msg outb_msg[RIO_MAX_MBOX];
175 int host_deviceid; /* Host device ID */
176 struct rio_ops *ops; /* maintenance transaction functions */
177 unsigned char id; /* port ID, unique among all ports */
178 unsigned char index; /* port index, unique among all port
179 interfaces of the same type */
180 unsigned char name[40];
181};
182
183/**
184 * struct rio_net - RIO network info
185 * @node: Node in global list of RIO networks
186 * @devices: List of devices in this network
187 * @mports: List of master ports accessing this network
188 * @hport: Default port for accessing this network
189 * @id: RIO network ID
190 */
191struct rio_net {
192 struct list_head node; /* node in list of networks */
193 struct list_head devices; /* list of devices in this net */
194 struct list_head mports; /* list of ports accessing net */
195 struct rio_mport *hport; /* primary port for accessing net */
196 unsigned char id; /* RIO network ID */
197};
198
199/**
200 * struct rio_switch - RIO switch info
201 * @node: Node in global list of switches
202 * @switchid: Switch ID that is unique across a network
203 * @hopcount: Hopcount to this switch
204 * @destid: Associated destid in the path
205 * @route_table: Copy of switch routing table
206 * @add_entry: Callback for switch-specific route add function
207 * @get_entry: Callback for switch-specific route get function
208 */
209struct rio_switch {
210 struct list_head node;
211 u16 switchid;
212 u16 hopcount;
213 u16 destid;
214 u8 route_table[RIO_MAX_ROUTE_ENTRIES];
215 int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
216 u16 table, u16 route_destid, u8 route_port);
217 int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
218 u16 table, u16 route_destid, u8 * route_port);
219};
220
221/* Low-level architecture-dependent routines */
222
223/**
224 * struct rio_ops - Low-level RIO configuration space operations
225 * @lcread: Callback to perform local (master port) read of config space.
226 * @lcwrite: Callback to perform local (master port) write of config space.
227 * @cread: Callback to perform network read of config space.
228 * @cwrite: Callback to perform network write of config space.
229 * @dsend: Callback to send a doorbell message.
230 */
231struct rio_ops {
232 int (*lcread) (int index, u32 offset, int len, u32 * data);
233 int (*lcwrite) (int index, u32 offset, int len, u32 data);
234 int (*cread) (int index, u16 destid, u8 hopcount, u32 offset, int len,
235 u32 * data);
236 int (*cwrite) (int index, u16 destid, u8 hopcount, u32 offset, int len,
237 u32 data);
238 int (*dsend) (int index, u16 destid, u16 data);
239};
240
241#define RIO_RESOURCE_MEM 0x00000100
242#define RIO_RESOURCE_DOORBELL 0x00000200
243#define RIO_RESOURCE_MAILBOX 0x00000400
244
245#define RIO_RESOURCE_CACHEABLE 0x00010000
246#define RIO_RESOURCE_PCI 0x00020000
247
248#define RIO_RESOURCE_BUSY 0x80000000
249
250/**
251 * struct rio_driver - RIO driver info
252 * @node: Node in list of drivers
253 * @name: RIO driver name
254 * @id_table: RIO device ids to be associated with this driver
255 * @probe: RIO device inserted
256 * @remove: RIO device removed
257 * @suspend: RIO device suspended
258 * @resume: RIO device awakened
259 * @enable_wake: RIO device enable wake event
260 * @driver: LDM driver struct
261 *
262 * Provides info on a RIO device driver for insertion/removal and
263 * power management purposes.
264 */
265struct rio_driver {
266 struct list_head node;
267 char *name;
268 const struct rio_device_id *id_table;
269 int (*probe) (struct rio_dev * dev, const struct rio_device_id * id);
270 void (*remove) (struct rio_dev * dev);
271 int (*suspend) (struct rio_dev * dev, u32 state);
272 int (*resume) (struct rio_dev * dev);
273 int (*enable_wake) (struct rio_dev * dev, u32 state, int enable);
274 struct device_driver driver;
275};
276
277#define to_rio_driver(drv) container_of(drv,struct rio_driver, driver)
278
279/**
280 * struct rio_device_id - RIO device identifier
281 * @did: RIO device ID
282 * @vid: RIO vendor ID
283 * @asm_did: RIO assembly device ID
284 * @asm_vid: RIO assembly vendor ID
285 *
286 * Identifies a RIO device based on both the device/vendor IDs and
287 * the assembly device/vendor IDs.
288 */
289struct rio_device_id {
290 u16 did, vid;
291 u16 asm_did, asm_vid;
292};
293
294/**
295 * struct rio_route_ops - Per-switch route operations
296 * @vid: RIO vendor ID
297 * @did: RIO device ID
298 * @add_hook: Callback that adds a route entry
299 * @get_hook: Callback that gets a route entry
300 *
301 * Defines the operations that are necessary to manipulate the route
302 * tables for a particular RIO switch device.
303 */
304struct rio_route_ops {
305 u16 vid, did;
306 int (*add_hook) (struct rio_mport * mport, u16 destid, u8 hopcount,
307 u16 table, u16 route_destid, u8 route_port);
308 int (*get_hook) (struct rio_mport * mport, u16 destid, u8 hopcount,
309 u16 table, u16 route_destid, u8 * route_port);
310};
311
312/* Architecture and hardware-specific functions */
313extern int rio_init_mports(void);
314extern void rio_register_mport(struct rio_mport *);
315extern int rio_hw_add_outb_message(struct rio_mport *, struct rio_dev *, int,
316 void *, size_t);
317extern int rio_hw_add_inb_buffer(struct rio_mport *, int, void *);
318extern void *rio_hw_get_inb_message(struct rio_mport *, int);
319extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int);
320extern void rio_close_inb_mbox(struct rio_mport *, int);
321extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int);
322extern void rio_close_outb_mbox(struct rio_mport *, int);
323
324#endif /* __KERNEL__ */
325#endif /* LINUX_RIO_H */
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h
new file mode 100644
index 000000000000..3bd7cce19e26
--- /dev/null
+++ b/include/linux/rio_drv.h
@@ -0,0 +1,469 @@
1/*
2 * RapidIO driver services
3 *
4 * Copyright 2005 MontaVista Software, Inc.
5 * Matt Porter <mporter@kernel.crashing.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef LINUX_RIO_DRV_H
14#define LINUX_RIO_DRV_H
15
16#ifdef __KERNEL__
17
18#include <linux/types.h>
19#include <linux/config.h>
20#include <linux/ioport.h>
21#include <linux/list.h>
22#include <linux/errno.h>
23#include <linux/device.h>
24#include <linux/rio.h>
25
26extern int __rio_local_read_config_32(struct rio_mport *port, u32 offset,
27 u32 * data);
28extern int __rio_local_write_config_32(struct rio_mport *port, u32 offset,
29 u32 data);
30extern int __rio_local_read_config_16(struct rio_mport *port, u32 offset,
31 u16 * data);
32extern int __rio_local_write_config_16(struct rio_mport *port, u32 offset,
33 u16 data);
34extern int __rio_local_read_config_8(struct rio_mport *port, u32 offset,
35 u8 * data);
36extern int __rio_local_write_config_8(struct rio_mport *port, u32 offset,
37 u8 data);
38
39extern int rio_mport_read_config_32(struct rio_mport *port, u16 destid,
40 u8 hopcount, u32 offset, u32 * data);
41extern int rio_mport_write_config_32(struct rio_mport *port, u16 destid,
42 u8 hopcount, u32 offset, u32 data);
43extern int rio_mport_read_config_16(struct rio_mport *port, u16 destid,
44 u8 hopcount, u32 offset, u16 * data);
45extern int rio_mport_write_config_16(struct rio_mport *port, u16 destid,
46 u8 hopcount, u32 offset, u16 data);
47extern int rio_mport_read_config_8(struct rio_mport *port, u16 destid,
48 u8 hopcount, u32 offset, u8 * data);
49extern int rio_mport_write_config_8(struct rio_mport *port, u16 destid,
50 u8 hopcount, u32 offset, u8 data);
51
52/**
53 * rio_local_read_config_32 - Read 32 bits from local configuration space
54 * @port: Master port
55 * @offset: Offset into local configuration space
56 * @data: Pointer to read data into
57 *
58 * Reads 32 bits of data from the specified offset within the local
59 * device's configuration space.
60 */
61static inline int rio_local_read_config_32(struct rio_mport *port, u32 offset,
62 u32 * data)
63{
64 return __rio_local_read_config_32(port, offset, data);
65}
66
67/**
68 * rio_local_write_config_32 - Write 32 bits to local configuration space
69 * @port: Master port
70 * @offset: Offset into local configuration space
71 * @data: Data to be written
72 *
73 * Writes 32 bits of data to the specified offset within the local
74 * device's configuration space.
75 */
76static inline int rio_local_write_config_32(struct rio_mport *port, u32 offset,
77 u32 data)
78{
79 return __rio_local_write_config_32(port, offset, data);
80}
81
82/**
83 * rio_local_read_config_16 - Read 16 bits from local configuration space
84 * @port: Master port
85 * @offset: Offset into local configuration space
86 * @data: Pointer to read data into
87 *
88 * Reads 16 bits of data from the specified offset within the local
89 * device's configuration space.
90 */
91static inline int rio_local_read_config_16(struct rio_mport *port, u32 offset,
92 u16 * data)
93{
94 return __rio_local_read_config_16(port, offset, data);
95}
96
97/**
98 * rio_local_write_config_16 - Write 16 bits to local configuration space
99 * @port: Master port
100 * @offset: Offset into local configuration space
101 * @data: Data to be written
102 *
103 * Writes 16 bits of data to the specified offset within the local
104 * device's configuration space.
105 */
106
107static inline int rio_local_write_config_16(struct rio_mport *port, u32 offset,
108 u16 data)
109{
110 return __rio_local_write_config_16(port, offset, data);
111}
112
113/**
114 * rio_local_read_config_8 - Read 8 bits from local configuration space
115 * @port: Master port
116 * @offset: Offset into local configuration space
117 * @data: Pointer to read data into
118 *
119 * Reads 8 bits of data from the specified offset within the local
120 * device's configuration space.
121 */
122static inline int rio_local_read_config_8(struct rio_mport *port, u32 offset,
123 u8 * data)
124{
125 return __rio_local_read_config_8(port, offset, data);
126}
127
128/**
129 * rio_local_write_config_8 - Write 8 bits to local configuration space
130 * @port: Master port
131 * @offset: Offset into local configuration space
132 * @data: Data to be written
133 *
134 * Writes 8 bits of data to the specified offset within the local
135 * device's configuration space.
136 */
137static inline int rio_local_write_config_8(struct rio_mport *port, u32 offset,
138 u8 data)
139{
140 return __rio_local_write_config_8(port, offset, data);
141}
142
143/**
144 * rio_read_config_32 - Read 32 bits from configuration space
145 * @rdev: RIO device
146 * @offset: Offset into device configuration space
147 * @data: Pointer to read data into
148 *
149 * Reads 32 bits of data from the specified offset within the
150 * RIO device's configuration space.
151 */
152static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset,
153 u32 * data)
154{
155 u8 hopcount = 0xff;
156 u16 destid = rdev->destid;
157
158 if (rdev->rswitch) {
159 destid = rdev->rswitch->destid;
160 hopcount = rdev->rswitch->hopcount;
161 }
162
163 return rio_mport_read_config_32(rdev->net->hport, destid, hopcount,
164 offset, data);
165};
166
167/**
168 * rio_write_config_32 - Write 32 bits to configuration space
169 * @rdev: RIO device
170 * @offset: Offset into device configuration space
171 * @data: Data to be written
172 *
173 * Writes 32 bits of data to the specified offset within the
174 * RIO device's configuration space.
175 */
176static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset,
177 u32 data)
178{
179 u8 hopcount = 0xff;
180 u16 destid = rdev->destid;
181
182 if (rdev->rswitch) {
183 destid = rdev->rswitch->destid;
184 hopcount = rdev->rswitch->hopcount;
185 }
186
187 return rio_mport_write_config_32(rdev->net->hport, destid, hopcount,
188 offset, data);
189};
190
191/**
192 * rio_read_config_16 - Read 16 bits from configuration space
193 * @rdev: RIO device
194 * @offset: Offset into device configuration space
195 * @data: Pointer to read data into
196 *
197 * Reads 16 bits of data from the specified offset within the
198 * RIO device's configuration space.
199 */
200static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset,
201 u16 * data)
202{
203 u8 hopcount = 0xff;
204 u16 destid = rdev->destid;
205
206 if (rdev->rswitch) {
207 destid = rdev->rswitch->destid;
208 hopcount = rdev->rswitch->hopcount;
209 }
210
211 return rio_mport_read_config_16(rdev->net->hport, destid, hopcount,
212 offset, data);
213};
214
215/**
216 * rio_write_config_16 - Write 16 bits to configuration space
217 * @rdev: RIO device
218 * @offset: Offset into device configuration space
219 * @data: Data to be written
220 *
221 * Writes 16 bits of data to the specified offset within the
222 * RIO device's configuration space.
223 */
224static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset,
225 u16 data)
226{
227 u8 hopcount = 0xff;
228 u16 destid = rdev->destid;
229
230 if (rdev->rswitch) {
231 destid = rdev->rswitch->destid;
232 hopcount = rdev->rswitch->hopcount;
233 }
234
235 return rio_mport_write_config_16(rdev->net->hport, destid, hopcount,
236 offset, data);
237};
238
239/**
240 * rio_read_config_8 - Read 8 bits from configuration space
241 * @rdev: RIO device
242 * @offset: Offset into device configuration space
243 * @data: Pointer to read data into
244 *
245 * Reads 8 bits of data from the specified offset within the
246 * RIO device's configuration space.
247 */
248static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data)
249{
250 u8 hopcount = 0xff;
251 u16 destid = rdev->destid;
252
253 if (rdev->rswitch) {
254 destid = rdev->rswitch->destid;
255 hopcount = rdev->rswitch->hopcount;
256 }
257
258 return rio_mport_read_config_8(rdev->net->hport, destid, hopcount,
259 offset, data);
260};
261
262/**
263 * rio_write_config_8 - Write 8 bits to configuration space
264 * @rdev: RIO device
265 * @offset: Offset into device configuration space
266 * @data: Data to be written
267 *
268 * Writes 8 bits of data to the specified offset within the
269 * RIO device's configuration space.
270 */
271static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data)
272{
273 u8 hopcount = 0xff;
274 u16 destid = rdev->destid;
275
276 if (rdev->rswitch) {
277 destid = rdev->rswitch->destid;
278 hopcount = rdev->rswitch->hopcount;
279 }
280
281 return rio_mport_write_config_8(rdev->net->hport, destid, hopcount,
282 offset, data);
283};
284
285extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid,
286 u16 data);
287
288/**
289 * rio_send_doorbell - Send a doorbell message to a device
290 * @rdev: RIO device
291 * @data: Doorbell message data
292 *
293 * Send a doorbell message to a RIO device. The doorbell message
294 * has a 16-bit info field provided by the @data argument.
295 */
296static inline int rio_send_doorbell(struct rio_dev *rdev, u16 data)
297{
298 return rio_mport_send_doorbell(rdev->net->hport, rdev->destid, data);
299};
300
301/**
302 * rio_init_mbox_res - Initialize a RIO mailbox resource
303 * @res: resource struct
304 * @start: start of mailbox range
305 * @end: end of mailbox range
306 *
307 * This function is used to initialize the fields of a resource
308 * for use as a mailbox resource. It initializes a range of
309 * mailboxes using the start and end arguments.
310 */
311static inline void rio_init_mbox_res(struct resource *res, int start, int end)
312{
313 memset(res, 0, sizeof(struct resource));
314 res->start = start;
315 res->end = end;
316 res->flags = RIO_RESOURCE_MAILBOX;
317}
318
319/**
320 * rio_init_dbell_res - Initialize a RIO doorbell resource
321 * @res: resource struct
322 * @start: start of doorbell range
323 * @end: end of doorbell range
324 *
325 * This function is used to initialize the fields of a resource
326 * for use as a doorbell resource. It initializes a range of
327 * doorbell messages using the start and end arguments.
328 */
329static inline void rio_init_dbell_res(struct resource *res, u16 start, u16 end)
330{
331 memset(res, 0, sizeof(struct resource));
332 res->start = start;
333 res->end = end;
334 res->flags = RIO_RESOURCE_DOORBELL;
335}
336
337/**
338 * RIO_DEVICE - macro used to describe a specific RIO device
339 * @vid: the 16 bit RIO vendor ID
340 * @did: the 16 bit RIO device ID
341 *
342 * This macro is used to create a struct rio_device_id that matches a
343 * specific device. The assembly vendor and assembly device fields
344 * will be set to %RIO_ANY_ID.
345 */
346#define RIO_DEVICE(dev,ven) \
347 .did = (dev), .vid = (ven), \
348 .asm_did = RIO_ANY_ID, .asm_vid = RIO_ANY_ID
349
350/* Mailbox management */
351extern int rio_request_outb_mbox(struct rio_mport *, void *, int, int,
352 void (*)(struct rio_mport *, void *,int, int));
353extern int rio_release_outb_mbox(struct rio_mport *, int);
354
355/**
356 * rio_add_outb_message - Add RIO message to an outbound mailbox queue
357 * @mport: RIO master port containing the outbound queue
358 * @rdev: RIO device the message is be sent to
359 * @mbox: The outbound mailbox queue
360 * @buffer: Pointer to the message buffer
361 * @len: Length of the message buffer
362 *
363 * Adds a RIO message buffer to an outbound mailbox queue for
364 * transmission. Returns 0 on success.
365 */
366static inline int rio_add_outb_message(struct rio_mport *mport,
367 struct rio_dev *rdev, int mbox,
368 void *buffer, size_t len)
369{
370 return rio_hw_add_outb_message(mport, rdev, mbox, buffer, len);
371}
372
373extern int rio_request_inb_mbox(struct rio_mport *, void *, int, int,
374 void (*)(struct rio_mport *, void *, int, int));
375extern int rio_release_inb_mbox(struct rio_mport *, int);
376
377/**
378 * rio_add_inb_buffer - Add buffer to an inbound mailbox queue
379 * @mport: Master port containing the inbound mailbox
380 * @mbox: The inbound mailbox number
381 * @buffer: Pointer to the message buffer
382 *
383 * Adds a buffer to an inbound mailbox queue for reception. Returns
384 * 0 on success.
385 */
386static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox,
387 void *buffer)
388{
389 return rio_hw_add_inb_buffer(mport, mbox, buffer);
390}
391
392/**
393 * rio_get_inb_message - Get A RIO message from an inbound mailbox queue
394 * @mport: Master port containing the inbound mailbox
395 * @mbox: The inbound mailbox number
396 * @buffer: Pointer to the message buffer
397 *
398 * Get a RIO message from an inbound mailbox queue. Returns 0 on success.
399 */
400static inline void *rio_get_inb_message(struct rio_mport *mport, int mbox)
401{
402 return rio_hw_get_inb_message(mport, mbox);
403}
404
405/* Doorbell management */
406extern int rio_request_inb_dbell(struct rio_mport *, void *, u16, u16,
407 void (*)(struct rio_mport *, void *, u16, u16, u16));
408extern int rio_release_inb_dbell(struct rio_mport *, u16, u16);
409extern struct resource *rio_request_outb_dbell(struct rio_dev *, u16, u16);
410extern int rio_release_outb_dbell(struct rio_dev *, struct resource *);
411
412/* Memory region management */
413int rio_claim_resource(struct rio_dev *, int);
414int rio_request_regions(struct rio_dev *, char *);
415void rio_release_regions(struct rio_dev *);
416int rio_request_region(struct rio_dev *, int, char *);
417void rio_release_region(struct rio_dev *, int);
418
419/* LDM support */
420int rio_register_driver(struct rio_driver *);
421void rio_unregister_driver(struct rio_driver *);
422struct rio_dev *rio_dev_get(struct rio_dev *);
423void rio_dev_put(struct rio_dev *);
424
425/**
426 * rio_name - Get the unique RIO device identifier
427 * @rdev: RIO device
428 *
429 * Get the unique RIO device identifier. Returns the device
430 * identifier string.
431 */
432static inline char *rio_name(struct rio_dev *rdev)
433{
434 return rdev->dev.bus_id;
435}
436
437/**
438 * rio_get_drvdata - Get RIO driver specific data
439 * @rdev: RIO device
440 *
441 * Get RIO driver specific data. Returns a pointer to the
442 * driver specific data.
443 */
444static inline void *rio_get_drvdata(struct rio_dev *rdev)
445{
446 return dev_get_drvdata(&rdev->dev);
447}
448
449/**
450 * rio_set_drvdata - Set RIO driver specific data
451 * @rdev: RIO device
452 * @data: Pointer to driver specific data
453 *
454 * Set RIO driver specific data. device struct driver data pointer
455 * is set to the @data argument.
456 */
457static inline void rio_set_drvdata(struct rio_dev *rdev, void *data)
458{
459 dev_set_drvdata(&rdev->dev, data);
460}
461
462/* Misc driver helpers */
463extern u16 rio_local_get_device_id(struct rio_mport *port);
464extern struct rio_dev *rio_get_device(u16 vid, u16 did, struct rio_dev *from);
465extern struct rio_dev *rio_get_asm(u16 vid, u16 did, u16 asm_vid, u16 asm_did,
466 struct rio_dev *from);
467
468#endif /* __KERNEL__ */
469#endif /* LINUX_RIO_DRV_H */
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h
new file mode 100644
index 000000000000..919d4e07d54e
--- /dev/null
+++ b/include/linux/rio_ids.h
@@ -0,0 +1,24 @@
1/*
2 * RapidIO devices
3 *
4 * Copyright 2005 MontaVista Software, Inc.
5 * Matt Porter <mporter@kernel.crashing.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef LINUX_RIO_IDS_H
14#define LINUX_RIO_IDS_H
15
16#define RIO_ANY_ID 0xffff
17
18#define RIO_VID_FREESCALE 0x0002
19#define RIO_DID_MPC8560 0x0003
20
21#define RIO_VID_TUNDRA 0x000d
22#define RIO_DID_TSI500 0x0500
23
24#endif /* LINUX_RIO_IDS_H */
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h
new file mode 100644
index 000000000000..326540f9b54e
--- /dev/null
+++ b/include/linux/rio_regs.h
@@ -0,0 +1,215 @@
1/*
2 * RapidIO register definitions
3 *
4 * Copyright 2005 MontaVista Software, Inc.
5 * Matt Porter <mporter@kernel.crashing.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef LINUX_RIO_REGS_H
14#define LINUX_RIO_REGS_H
15
16/*
17 * In RapidIO, each device has a 2MB configuration space that is
18 * accessed via maintenance transactions. Portions of configuration
19 * space are standardized and/or reserved.
20 */
21#define RIO_DEV_ID_CAR 0x00 /* [I] Device Identity CAR */
22#define RIO_DEV_INFO_CAR 0x04 /* [I] Device Information CAR */
23#define RIO_ASM_ID_CAR 0x08 /* [I] Assembly Identity CAR */
24#define RIO_ASM_ID_MASK 0xffff0000 /* [I] Asm ID Mask */
25#define RIO_ASM_VEN_ID_MASK 0x0000ffff /* [I] Asm Vend Mask */
26
27#define RIO_ASM_INFO_CAR 0x0c /* [I] Assembly Information CAR */
28#define RIO_ASM_REV_MASK 0xffff0000 /* [I] Asm Rev Mask */
29#define RIO_EXT_FTR_PTR_MASK 0x0000ffff /* [I] EF_PTR Mask */
30
31#define RIO_PEF_CAR 0x10 /* [I] Processing Element Features CAR */
32#define RIO_PEF_BRIDGE 0x80000000 /* [I] Bridge */
33#define RIO_PEF_MEMORY 0x40000000 /* [I] MMIO */
34#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */
35#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */
36#define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */
37#define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */
38#define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */
39#define RIO_PEF_INB_MBOX2 0x00200000 /* [II] Mailbox 2 */
40#define RIO_PEF_INB_MBOX3 0x00100000 /* [II] Mailbox 3 */
41#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II] Doorbells */
42#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */
43#define RIO_PEF_EXT_FEATURES 0x00000008 /* [I] EFT_PTR valid */
44#define RIO_PEF_ADDR_66 0x00000004 /* [I] 66 bits */
45#define RIO_PEF_ADDR_50 0x00000002 /* [I] 50 bits */
46#define RIO_PEF_ADDR_34 0x00000001 /* [I] 34 bits */
47
48#define RIO_SWP_INFO_CAR 0x14 /* [I] Switch Port Information CAR */
49#define RIO_SWP_INFO_PORT_TOTAL_MASK 0x0000ff00 /* [I] Total number of ports */
50#define RIO_SWP_INFO_PORT_NUM_MASK 0x000000ff /* [I] Maintenance transaction port number */
51#define RIO_GET_TOTAL_PORTS(x) ((x & RIO_SWP_INFO_PORT_TOTAL_MASK) >> 8)
52
53#define RIO_SRC_OPS_CAR 0x18 /* [I] Source Operations CAR */
54#define RIO_SRC_OPS_READ 0x00008000 /* [I] Read op */
55#define RIO_SRC_OPS_WRITE 0x00004000 /* [I] Write op */
56#define RIO_SRC_OPS_STREAM_WRITE 0x00002000 /* [I] Str-write op */
57#define RIO_SRC_OPS_WRITE_RESPONSE 0x00001000 /* [I] Write/resp op */
58#define RIO_SRC_OPS_DATA_MSG 0x00000800 /* [II] Data msg op */
59#define RIO_SRC_OPS_DOORBELL 0x00000400 /* [II] Doorbell op */
60#define RIO_SRC_OPS_ATOMIC_TST_SWP 0x00000100 /* [I] Atomic TAS op */
61#define RIO_SRC_OPS_ATOMIC_INC 0x00000080 /* [I] Atomic inc op */
62#define RIO_SRC_OPS_ATOMIC_DEC 0x00000040 /* [I] Atomic dec op */
63#define RIO_SRC_OPS_ATOMIC_SET 0x00000020 /* [I] Atomic set op */
64#define RIO_SRC_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */
65#define RIO_SRC_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */
66
67#define RIO_DST_OPS_CAR 0x1c /* Destination Operations CAR */
68#define RIO_DST_OPS_READ 0x00008000 /* [I] Read op */
69#define RIO_DST_OPS_WRITE 0x00004000 /* [I] Write op */
70#define RIO_DST_OPS_STREAM_WRITE 0x00002000 /* [I] Str-write op */
71#define RIO_DST_OPS_WRITE_RESPONSE 0x00001000 /* [I] Write/resp op */
72#define RIO_DST_OPS_DATA_MSG 0x00000800 /* [II] Data msg op */
73#define RIO_DST_OPS_DOORBELL 0x00000400 /* [II] Doorbell op */
74#define RIO_DST_OPS_ATOMIC_TST_SWP 0x00000100 /* [I] Atomic TAS op */
75#define RIO_DST_OPS_ATOMIC_INC 0x00000080 /* [I] Atomic inc op */
76#define RIO_DST_OPS_ATOMIC_DEC 0x00000040 /* [I] Atomic dec op */
77#define RIO_DST_OPS_ATOMIC_SET 0x00000020 /* [I] Atomic set op */
78#define RIO_DST_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */
79#define RIO_DST_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */
80
81#define RIO_OPS_READ 0x00008000 /* [I] Read op */
82#define RIO_OPS_WRITE 0x00004000 /* [I] Write op */
83#define RIO_OPS_STREAM_WRITE 0x00002000 /* [I] Str-write op */
84#define RIO_OPS_WRITE_RESPONSE 0x00001000 /* [I] Write/resp op */
85#define RIO_OPS_DATA_MSG 0x00000800 /* [II] Data msg op */
86#define RIO_OPS_DOORBELL 0x00000400 /* [II] Doorbell op */
87#define RIO_OPS_ATOMIC_TST_SWP 0x00000100 /* [I] Atomic TAS op */
88#define RIO_OPS_ATOMIC_INC 0x00000080 /* [I] Atomic inc op */
89#define RIO_OPS_ATOMIC_DEC 0x00000040 /* [I] Atomic dec op */
90#define RIO_OPS_ATOMIC_SET 0x00000020 /* [I] Atomic set op */
91#define RIO_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */
92#define RIO_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */
93
94 /* 0x20-0x3c *//* Reserved */
95
96#define RIO_MBOX_CSR 0x40 /* [II] Mailbox CSR */
97#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */
98#define RIO_MBOX0_FULL 0x40000000 /* [II] Mbox 0 full */
99#define RIO_MBOX0_EMPTY 0x20000000 /* [II] Mbox 0 empty */
100#define RIO_MBOX0_BUSY 0x10000000 /* [II] Mbox 0 busy */
101#define RIO_MBOX0_FAIL 0x08000000 /* [II] Mbox 0 fail */
102#define RIO_MBOX0_ERROR 0x04000000 /* [II] Mbox 0 error */
103#define RIO_MBOX1_AVAIL 0x00800000 /* [II] Mbox 1 avail */
104#define RIO_MBOX1_FULL 0x00200000 /* [II] Mbox 1 full */
105#define RIO_MBOX1_EMPTY 0x00200000 /* [II] Mbox 1 empty */
106#define RIO_MBOX1_BUSY 0x00100000 /* [II] Mbox 1 busy */
107#define RIO_MBOX1_FAIL 0x00080000 /* [II] Mbox 1 fail */
108#define RIO_MBOX1_ERROR 0x00040000 /* [II] Mbox 1 error */
109#define RIO_MBOX2_AVAIL 0x00008000 /* [II] Mbox 2 avail */
110#define RIO_MBOX2_FULL 0x00004000 /* [II] Mbox 2 full */
111#define RIO_MBOX2_EMPTY 0x00002000 /* [II] Mbox 2 empty */
112#define RIO_MBOX2_BUSY 0x00001000 /* [II] Mbox 2 busy */
113#define RIO_MBOX2_FAIL 0x00000800 /* [II] Mbox 2 fail */
114#define RIO_MBOX2_ERROR 0x00000400 /* [II] Mbox 2 error */
115#define RIO_MBOX3_AVAIL 0x00000080 /* [II] Mbox 3 avail */
116#define RIO_MBOX3_FULL 0x00000040 /* [II] Mbox 3 full */
117#define RIO_MBOX3_EMPTY 0x00000020 /* [II] Mbox 3 empty */
118#define RIO_MBOX3_BUSY 0x00000010 /* [II] Mbox 3 busy */
119#define RIO_MBOX3_FAIL 0x00000008 /* [II] Mbox 3 fail */
120#define RIO_MBOX3_ERROR 0x00000004 /* [II] Mbox 3 error */
121
122#define RIO_WRITE_PORT_CSR 0x44 /* [I] Write Port CSR */
123#define RIO_DOORBELL_CSR 0x44 /* [II] Doorbell CSR */
124#define RIO_DOORBELL_AVAIL 0x80000000 /* [II] Doorbell avail */
125#define RIO_DOORBELL_FULL 0x40000000 /* [II] Doorbell full */
126#define RIO_DOORBELL_EMPTY 0x20000000 /* [II] Doorbell empty */
127#define RIO_DOORBELL_BUSY 0x10000000 /* [II] Doorbell busy */
128#define RIO_DOORBELL_FAILED 0x08000000 /* [II] Doorbell failed */
129#define RIO_DOORBELL_ERROR 0x04000000 /* [II] Doorbell error */
130#define RIO_WRITE_PORT_AVAILABLE 0x00000080 /* [I] Write Port Available */
131#define RIO_WRITE_PORT_FULL 0x00000040 /* [I] Write Port Full */
132#define RIO_WRITE_PORT_EMPTY 0x00000020 /* [I] Write Port Empty */
133#define RIO_WRITE_PORT_BUSY 0x00000010 /* [I] Write Port Busy */
134#define RIO_WRITE_PORT_FAILED 0x00000008 /* [I] Write Port Failed */
135#define RIO_WRITE_PORT_ERROR 0x00000004 /* [I] Write Port Error */
136
137 /* 0x48 *//* Reserved */
138
139#define RIO_PELL_CTRL_CSR 0x4c /* [I] PE Logical Layer Control CSR */
140#define RIO_PELL_ADDR_66 0x00000004 /* [I] 66-bit addr */
141#define RIO_PELL_ADDR_50 0x00000002 /* [I] 50-bit addr */
142#define RIO_PELL_ADDR_34 0x00000001 /* [I] 34-bit addr */
143
144 /* 0x50-0x54 *//* Reserved */
145
146#define RIO_LCSH_BA 0x58 /* [I] LCS High Base Address */
147#define RIO_LCSL_BA 0x5c /* [I] LCS Base Address */
148
149#define RIO_DID_CSR 0x60 /* [III] Base Device ID CSR */
150
151 /* 0x64 *//* Reserved */
152
153#define RIO_HOST_DID_LOCK_CSR 0x68 /* [III] Host Base Device ID Lock CSR */
154#define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */
155
156 /* 0x70-0xf8 *//* Reserved */
157 /* 0x100-0xfff8 *//* [I] Extended Features Space */
158 /* 0x10000-0xfffff8 *//* [I] Implementation-defined Space */
159
160/*
161 * Extended Features Space is a configuration space area where
162 * functionality is mapped into extended feature blocks via a
163 * singly linked list of extended feature pointers (EFT_PTR).
164 *
165 * Each extended feature block can be identified/located in
166 * Extended Features Space by walking the extended feature
167 * list starting with the Extended Feature Pointer located
168 * in the Assembly Information CAR.
169 *
170 * Extended Feature Blocks (EFBs) are identified with an assigned
171 * EFB ID. Extended feature block offsets in the definitions are
172 * relative to the offset of the EFB within the Extended Features
173 * Space.
174 */
175
176/* Helper macros to parse the Extended Feature Block header */
177#define RIO_EFB_PTR_MASK 0xffff0000
178#define RIO_EFB_ID_MASK 0x0000ffff
179#define RIO_GET_BLOCK_PTR(x) ((x & RIO_EFB_PTR_MASK) >> 16)
180#define RIO_GET_BLOCK_ID(x) (x & RIO_EFB_ID_MASK)
181
182/* Extended Feature Block IDs */
183#define RIO_EFB_PAR_EP_ID 0x0001 /* [IV] LP/LVDS EP Devices */
184#define RIO_EFB_PAR_EP_REC_ID 0x0002 /* [IV] LP/LVDS EP Recovery Devices */
185#define RIO_EFB_PAR_EP_FREE_ID 0x0003 /* [IV] LP/LVDS EP Free Devices */
186#define RIO_EFB_SER_EP_ID 0x0004 /* [VI] LP/Serial EP Devices */
187#define RIO_EFB_SER_EP_REC_ID 0x0005 /* [VI] LP/Serial EP Recovery Devices */
188#define RIO_EFB_SER_EP_FREE_ID 0x0006 /* [VI] LP/Serial EP Free Devices */
189
190/*
191 * Physical 8/16 LP-LVDS
192 * ID=0x0001, Generic End Point Devices
193 * ID=0x0002, Generic End Point Devices, software assisted recovery option
194 * ID=0x0003, Generic End Point Free Devices
195 *
196 * Physical LP-Serial
197 * ID=0x0004, Generic End Point Devices
198 * ID=0x0005, Generic End Point Devices, software assisted recovery option
199 * ID=0x0006, Generic End Point Free Devices
200 */
201#define RIO_PORT_MNT_HEADER 0x0000
202#define RIO_PORT_REQ_CTL_CSR 0x0020
203#define RIO_PORT_RSP_CTL_CSR 0x0024 /* 0x0001/0x0002 */
204#define RIO_PORT_GEN_CTL_CSR 0x003c
205#define RIO_PORT_GEN_HOST 0x80000000
206#define RIO_PORT_GEN_MASTER 0x40000000
207#define RIO_PORT_GEN_DISCOVERED 0x20000000
208#define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */
209#define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */
210#define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */
211#define RIO_PORT_N_ERR_STS_CSR(x) (0x58 + x*0x20)
212#define PORT_N_ERR_STS_PORT_OK 0x00000002
213#define RIO_PORT_N_CTL_CSR(x) (0x5c + x*0x20)
214
215#endif /* LINUX_RIO_REGS_H */
diff --git a/include/linux/rslib.h b/include/linux/rslib.h
index 980c8f74d8dc..ace25acfdc97 100644
--- a/include/linux/rslib.h
+++ b/include/linux/rslib.h
@@ -1,15 +1,15 @@
1/* 1/*
2 * include/linux/rslib.h 2 * include/linux/rslib.h
3 * 3 *
4 * Overview: 4 * Overview:
5 * Generic Reed Solomon encoder / decoder library 5 * Generic Reed Solomon encoder / decoder library
6 * 6 *
7 * Copyright (C) 2004 Thomas Gleixner (tglx@linutronix.de) 7 * Copyright (C) 2004 Thomas Gleixner (tglx@linutronix.de)
8 * 8 *
9 * RS code lifted from reed solomon library written by Phil Karn 9 * RS code lifted from reed solomon library written by Phil Karn
10 * Copyright 2002 Phil Karn, KA9Q 10 * Copyright 2002 Phil Karn, KA9Q
11 * 11 *
12 * $Id: rslib.h,v 1.3 2004/10/05 22:08:22 gleixner Exp $ 12 * $Id: rslib.h,v 1.4 2005/11/07 11:14:52 gleixner Exp $
13 * 13 *
14 * This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as 15 * it under the terms of the GNU General Public License version 2 as
@@ -21,20 +21,20 @@
21 21
22#include <linux/list.h> 22#include <linux/list.h>
23 23
24/** 24/**
25 * struct rs_control - rs control structure 25 * struct rs_control - rs control structure
26 * 26 *
27 * @mm: Bits per symbol 27 * @mm: Bits per symbol
28 * @nn: Symbols per block (= (1<<mm)-1) 28 * @nn: Symbols per block (= (1<<mm)-1)
29 * @alpha_to: log lookup table 29 * @alpha_to: log lookup table
30 * @index_of: Antilog lookup table 30 * @index_of: Antilog lookup table
31 * @genpoly: Generator polynomial 31 * @genpoly: Generator polynomial
32 * @nroots: Number of generator roots = number of parity symbols 32 * @nroots: Number of generator roots = number of parity symbols
33 * @fcr: First consecutive root, index form 33 * @fcr: First consecutive root, index form
34 * @prim: Primitive element, index form 34 * @prim: Primitive element, index form
35 * @iprim: prim-th root of 1, index form 35 * @iprim: prim-th root of 1, index form
36 * @gfpoly: The primitive generator polynominal 36 * @gfpoly: The primitive generator polynominal
37 * @users: Users of this structure 37 * @users: Users of this structure
38 * @list: List entry for the rs control list 38 * @list: List entry for the rs control list
39*/ 39*/
40struct rs_control { 40struct rs_control {
@@ -58,7 +58,7 @@ int encode_rs8(struct rs_control *rs, uint8_t *data, int len, uint16_t *par,
58 uint16_t invmsk); 58 uint16_t invmsk);
59#endif 59#endif
60#ifdef CONFIG_REED_SOLOMON_DEC8 60#ifdef CONFIG_REED_SOLOMON_DEC8
61int decode_rs8(struct rs_control *rs, uint8_t *data, uint16_t *par, int len, 61int decode_rs8(struct rs_control *rs, uint8_t *data, uint16_t *par, int len,
62 uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, 62 uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk,
63 uint16_t *corr); 63 uint16_t *corr);
64#endif 64#endif
@@ -75,7 +75,7 @@ int decode_rs16(struct rs_control *rs, uint16_t *data, uint16_t *par, int len,
75#endif 75#endif
76 76
77/* Create or get a matching rs control structure */ 77/* Create or get a matching rs control structure */
78struct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim, 78struct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim,
79 int nroots); 79 int nroots);
80 80
81/* Release a rs control structure */ 81/* Release a rs control structure */
@@ -87,9 +87,9 @@ void free_rs(struct rs_control *rs);
87 * @x: the value to reduce 87 * @x: the value to reduce
88 * 88 *
89 * where 89 * where
90 * rs->mm = number of bits per symbol 90 * rs->mm = number of bits per symbol
91 * rs->nn = (2^rs->mm) - 1 91 * rs->nn = (2^rs->mm) - 1
92 * 92 *
93 * Simple arithmetic modulo would return a wrong result for values 93 * Simple arithmetic modulo would return a wrong result for values
94 * >= 3 * rs->nn 94 * >= 3 * rs->nn
95*/ 95*/
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 106f9757339a..3c1f1120fe88 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -79,6 +79,8 @@ struct seminfo {
79 79
80#ifdef __KERNEL__ 80#ifdef __KERNEL__
81 81
82struct task_struct;
83
82/* One semaphore structure for each semaphore in the system. */ 84/* One semaphore structure for each semaphore in the system. */
83struct sem { 85struct sem {
84 int semval; /* current value */ 86 int semval; /* current value */
diff --git a/include/linux/shm.h b/include/linux/shm.h
index 80113a1f60bc..a2c896ad0bef 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -92,6 +92,7 @@ struct shmid_kernel /* private to the kernel */
92#define SHM_DEST 01000 /* segment will be destroyed on last detach */ 92#define SHM_DEST 01000 /* segment will be destroyed on last detach */
93#define SHM_LOCKED 02000 /* segment will not be swapped */ 93#define SHM_LOCKED 02000 /* segment will not be swapped */
94#define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ 94#define SHM_HUGETLB 04000 /* segment will use huge TLB pages */
95#define SHM_NORESERVE 010000 /* don't check for reservations */
95 96
96#ifdef CONFIG_SYSVIPC 97#ifdef CONFIG_SYSVIPC
97long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); 98long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 4286d832166f..fdfb8fe8c38c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -603,23 +603,23 @@ static inline void skb_queue_head_init(struct sk_buff_head *list)
603 */ 603 */
604 604
605/** 605/**
606 * __skb_queue_head - queue a buffer at the list head 606 * __skb_queue_after - queue a buffer at the list head
607 * @list: list to use 607 * @list: list to use
608 * @prev: place after this buffer
608 * @newsk: buffer to queue 609 * @newsk: buffer to queue
609 * 610 *
610 * Queue a buffer at the start of a list. This function takes no locks 611 * Queue a buffer int the middle of a list. This function takes no locks
611 * and you must therefore hold required locks before calling it. 612 * and you must therefore hold required locks before calling it.
612 * 613 *
613 * A buffer cannot be placed on two lists at the same time. 614 * A buffer cannot be placed on two lists at the same time.
614 */ 615 */
615extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); 616static inline void __skb_queue_after(struct sk_buff_head *list,
616static inline void __skb_queue_head(struct sk_buff_head *list, 617 struct sk_buff *prev,
617 struct sk_buff *newsk) 618 struct sk_buff *newsk)
618{ 619{
619 struct sk_buff *prev, *next; 620 struct sk_buff *next;
620
621 list->qlen++; 621 list->qlen++;
622 prev = (struct sk_buff *)list; 622
623 next = prev->next; 623 next = prev->next;
624 newsk->next = next; 624 newsk->next = next;
625 newsk->prev = prev; 625 newsk->prev = prev;
@@ -627,6 +627,23 @@ static inline void __skb_queue_head(struct sk_buff_head *list,
627} 627}
628 628
629/** 629/**
630 * __skb_queue_head - queue a buffer at the list head
631 * @list: list to use
632 * @newsk: buffer to queue
633 *
634 * Queue a buffer at the start of a list. This function takes no locks
635 * and you must therefore hold required locks before calling it.
636 *
637 * A buffer cannot be placed on two lists at the same time.
638 */
639extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk);
640static inline void __skb_queue_head(struct sk_buff_head *list,
641 struct sk_buff *newsk)
642{
643 __skb_queue_after(list, (struct sk_buff *)list, newsk);
644}
645
646/**
630 * __skb_queue_tail - queue a buffer at the list tail 647 * __skb_queue_tail - queue a buffer at the list tail
631 * @list: list to use 648 * @list: list to use
632 * @newsk: buffer to queue 649 * @newsk: buffer to queue
@@ -1203,6 +1220,11 @@ static inline void kunmap_skb_frag(void *vaddr)
1203 prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ 1220 prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \
1204 skb = skb->next) 1221 skb = skb->next)
1205 1222
1223#define skb_queue_reverse_walk(queue, skb) \
1224 for (skb = (queue)->prev; \
1225 prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \
1226 skb = skb->prev)
1227
1206 1228
1207extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, 1229extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags,
1208 int noblock, int *err); 1230 int noblock, int *err);
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 09b9aa60063d..d1ea4051b996 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -9,7 +9,7 @@
9 9
10#if defined(__KERNEL__) 10#if defined(__KERNEL__)
11 11
12typedef struct kmem_cache_s kmem_cache_t; 12typedef struct kmem_cache kmem_cache_t;
13 13
14#include <linux/config.h> /* kmalloc_sizes.h needs CONFIG_ options */ 14#include <linux/config.h> /* kmalloc_sizes.h needs CONFIG_ options */
15#include <linux/gfp.h> 15#include <linux/gfp.h>
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 5af8800e0ce3..e4086ec8b952 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -171,7 +171,8 @@ xdr_argsize_check(struct svc_rqst *rqstp, u32 *p)
171{ 171{
172 char *cp = (char *)p; 172 char *cp = (char *)p;
173 struct kvec *vec = &rqstp->rq_arg.head[0]; 173 struct kvec *vec = &rqstp->rq_arg.head[0];
174 return cp - (char*)vec->iov_base <= vec->iov_len; 174 return cp >= (char*)vec->iov_base
175 && cp <= (char*)vec->iov_base + vec->iov_len;
175} 176}
176 177
177static inline int 178static inline int
diff --git a/include/linux/superhyway.h b/include/linux/superhyway.h
index c906c5a0aaef..17ea468fa362 100644
--- a/include/linux/superhyway.h
+++ b/include/linux/superhyway.h
@@ -19,7 +19,7 @@
19 */ 19 */
20#define SUPERHYWAY_DEVICE_ID_SH5_DMAC 0x0183 20#define SUPERHYWAY_DEVICE_ID_SH5_DMAC 0x0183
21 21
22struct vcr_info { 22struct superhyway_vcr_info {
23 u8 perr_flags; /* P-port Error flags */ 23 u8 perr_flags; /* P-port Error flags */
24 u8 merr_flags; /* Module Error flags */ 24 u8 merr_flags; /* Module Error flags */
25 u16 mod_vers; /* Module Version */ 25 u16 mod_vers; /* Module Version */
@@ -28,6 +28,17 @@ struct vcr_info {
28 u8 top_mb; /* Top Memory block */ 28 u8 top_mb; /* Top Memory block */
29}; 29};
30 30
31struct superhyway_ops {
32 int (*read_vcr)(unsigned long base, struct superhyway_vcr_info *vcr);
33 int (*write_vcr)(unsigned long base, struct superhyway_vcr_info vcr);
34};
35
36struct superhyway_bus {
37 struct superhyway_ops *ops;
38};
39
40extern struct superhyway_bus superhyway_channels[];
41
31struct superhyway_device_id { 42struct superhyway_device_id {
32 unsigned int id; 43 unsigned int id;
33 unsigned long driver_data; 44 unsigned long driver_data;
@@ -55,9 +66,11 @@ struct superhyway_device {
55 66
56 struct superhyway_device_id id; 67 struct superhyway_device_id id;
57 struct superhyway_driver *drv; 68 struct superhyway_driver *drv;
69 struct superhyway_bus *bus;
58 70
59 struct resource resource; 71 int num_resources;
60 struct vcr_info vcr; 72 struct resource *resource;
73 struct superhyway_vcr_info vcr;
61}; 74};
62 75
63#define to_superhyway_device(d) container_of((d), struct superhyway_device, dev) 76#define to_superhyway_device(d) container_of((d), struct superhyway_device, dev)
@@ -65,12 +78,27 @@ struct superhyway_device {
65#define superhyway_get_drvdata(d) dev_get_drvdata(&(d)->dev) 78#define superhyway_get_drvdata(d) dev_get_drvdata(&(d)->dev)
66#define superhyway_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p)) 79#define superhyway_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p))
67 80
68extern int superhyway_scan_bus(void); 81static inline int
82superhyway_read_vcr(struct superhyway_device *dev, unsigned long base,
83 struct superhyway_vcr_info *vcr)
84{
85 return dev->bus->ops->read_vcr(base, vcr);
86}
87
88static inline int
89superhyway_write_vcr(struct superhyway_device *dev, unsigned long base,
90 struct superhyway_vcr_info vcr)
91{
92 return dev->bus->ops->write_vcr(base, vcr);
93}
94
95extern int superhyway_scan_bus(struct superhyway_bus *);
69 96
70/* drivers/sh/superhyway/superhyway.c */ 97/* drivers/sh/superhyway/superhyway.c */
71int superhyway_register_driver(struct superhyway_driver *); 98int superhyway_register_driver(struct superhyway_driver *);
72void superhyway_unregister_driver(struct superhyway_driver *); 99void superhyway_unregister_driver(struct superhyway_driver *);
73int superhyway_add_device(unsigned int, unsigned long, unsigned long long); 100int superhyway_add_device(unsigned long base, struct superhyway_device *, struct superhyway_bus *);
101int superhyway_add_devices(struct superhyway_bus *bus, struct superhyway_device **devices, int nr_devices);
74 102
75/* drivers/sh/superhyway/superhyway-sysfs.c */ 103/* drivers/sh/superhyway/superhyway-sysfs.c */
76extern struct device_attribute superhyway_dev_attrs[]; 104extern struct device_attribute superhyway_dev_attrs[];
diff --git a/include/linux/wait.h b/include/linux/wait.h
index d38c9fecdc36..d28518236b62 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -54,6 +54,7 @@ struct __wait_queue_head {
54}; 54};
55typedef struct __wait_queue_head wait_queue_head_t; 55typedef struct __wait_queue_head wait_queue_head_t;
56 56
57struct task_struct;
57 58
58/* 59/*
59 * Macros for declaration and initialisaton of the datatypes 60 * Macros for declaration and initialisaton of the datatypes