diff options
Diffstat (limited to 'include/linux')
111 files changed, 2824 insertions, 872 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 |
| 120 | struct vfsmount; | ||
| 120 | struct super_block; | 121 | struct super_block; |
| 122 | extern void acct_auto_close_mnt(struct vfsmount *m); | ||
| 121 | extern void acct_auto_close(struct super_block *sb); | 123 | extern void acct_auto_close(struct super_block *sb); |
| 122 | extern void acct_process(long exitcode); | 124 | extern void acct_process(long exitcode); |
| 123 | extern void acct_update_integrals(struct task_struct *tsk); | 125 | extern void acct_update_integrals(struct task_struct *tsk); |
| 124 | extern void acct_clear_integrals(struct task_struct *tsk); | 126 | extern 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: */ |
| 237 | extern atomic_t aio_nr; | 238 | extern unsigned long aio_nr; |
| 238 | extern unsigned aio_max_nr; | 239 | extern 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 | */ | ||
| 35 | enum 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 | |||
| 53 | struct 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 | ||
| 108 | void proc_fork_connector(struct task_struct *task); | ||
| 109 | void proc_exec_connector(struct task_struct *task); | ||
| 110 | void proc_id_connector(struct task_struct *task, int which_id); | ||
| 111 | void proc_exit_connector(struct task_struct *task); | ||
| 112 | #else | ||
| 113 | static inline void proc_fork_connector(struct task_struct *task) | ||
| 114 | {} | ||
| 115 | |||
| 116 | static inline void proc_exec_connector(struct task_struct *task) | ||
| 117 | {} | ||
| 118 | |||
| 119 | static inline void proc_id_connector(struct task_struct *task, | ||
| 120 | int which_id) | ||
| 121 | {} | ||
| 122 | |||
| 123 | static 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/compat_ioctl.h b/include/linux/compat_ioctl.h index ecb0d39c0798..2209ad3499a3 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
| @@ -10,6 +10,10 @@ | |||
| 10 | #define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)sys_ioctl) | 10 | #define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)sys_ioctl) |
| 11 | #endif | 11 | #endif |
| 12 | 12 | ||
| 13 | |||
| 14 | COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */ | ||
| 15 | COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */ | ||
| 16 | |||
| 13 | /* Big T */ | 17 | /* Big T */ |
| 14 | COMPATIBLE_IOCTL(TCGETA) | 18 | COMPATIBLE_IOCTL(TCGETA) |
| 15 | COMPATIBLE_IOCTL(TCSETA) | 19 | COMPATIBLE_IOCTL(TCSETA) |
| @@ -52,13 +56,6 @@ ULONG_IOCTL(TIOCSCTTY) | |||
| 52 | COMPATIBLE_IOCTL(TIOCGPTN) | 56 | COMPATIBLE_IOCTL(TIOCGPTN) |
| 53 | COMPATIBLE_IOCTL(TIOCSPTLCK) | 57 | COMPATIBLE_IOCTL(TIOCSPTLCK) |
| 54 | COMPATIBLE_IOCTL(TIOCSERGETLSR) | 58 | COMPATIBLE_IOCTL(TIOCSERGETLSR) |
| 55 | /* Big F */ | ||
| 56 | COMPATIBLE_IOCTL(FBIOBLANK) | ||
| 57 | COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO) | ||
| 58 | COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO) | ||
| 59 | COMPATIBLE_IOCTL(FBIOPAN_DISPLAY) | ||
| 60 | COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP) | ||
| 61 | COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP) | ||
| 62 | /* Little f */ | 59 | /* Little f */ |
| 63 | COMPATIBLE_IOCTL(FIOCLEX) | 60 | COMPATIBLE_IOCTL(FIOCLEX) |
| 64 | COMPATIBLE_IOCTL(FIONCLEX) | 61 | COMPATIBLE_IOCTL(FIONCLEX) |
| @@ -81,6 +78,8 @@ COMPATIBLE_IOCTL(HDIO_DRIVE_CMD) | |||
| 81 | COMPATIBLE_IOCTL(HDIO_DRIVE_TASK) | 78 | COMPATIBLE_IOCTL(HDIO_DRIVE_TASK) |
| 82 | COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE) | 79 | COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE) |
| 83 | COMPATIBLE_IOCTL(HDIO_SET_NICE) | 80 | COMPATIBLE_IOCTL(HDIO_SET_NICE) |
| 81 | COMPATIBLE_IOCTL(HDIO_SET_KEEPSETTINGS) | ||
| 82 | COMPATIBLE_IOCTL(HDIO_SCAN_HWIF) | ||
| 84 | /* 0x02 -- Floppy ioctls */ | 83 | /* 0x02 -- Floppy ioctls */ |
| 85 | COMPATIBLE_IOCTL(FDMSGON) | 84 | COMPATIBLE_IOCTL(FDMSGON) |
| 86 | COMPATIBLE_IOCTL(FDMSGOFF) | 85 | COMPATIBLE_IOCTL(FDMSGOFF) |
| @@ -99,6 +98,7 @@ COMPATIBLE_IOCTL(FDTWADDLE) | |||
| 99 | COMPATIBLE_IOCTL(FDFMTTRK) | 98 | COMPATIBLE_IOCTL(FDFMTTRK) |
| 100 | COMPATIBLE_IOCTL(FDRAWCMD) | 99 | COMPATIBLE_IOCTL(FDRAWCMD) |
| 101 | /* 0x12 */ | 100 | /* 0x12 */ |
| 101 | COMPATIBLE_IOCTL(BLKRASET) | ||
| 102 | COMPATIBLE_IOCTL(BLKROSET) | 102 | COMPATIBLE_IOCTL(BLKROSET) |
| 103 | COMPATIBLE_IOCTL(BLKROGET) | 103 | COMPATIBLE_IOCTL(BLKROGET) |
| 104 | COMPATIBLE_IOCTL(BLKRRPART) | 104 | COMPATIBLE_IOCTL(BLKRRPART) |
| @@ -262,6 +262,7 @@ COMPATIBLE_IOCTL(RTC_WKALM_RD) | |||
| 262 | /* Little m */ | 262 | /* Little m */ |
| 263 | COMPATIBLE_IOCTL(MTIOCTOP) | 263 | COMPATIBLE_IOCTL(MTIOCTOP) |
| 264 | /* Socket level stuff */ | 264 | /* Socket level stuff */ |
| 265 | COMPATIBLE_IOCTL(FIOQSIZE) | ||
| 265 | COMPATIBLE_IOCTL(FIOSETOWN) | 266 | COMPATIBLE_IOCTL(FIOSETOWN) |
| 266 | COMPATIBLE_IOCTL(SIOCSPGRP) | 267 | COMPATIBLE_IOCTL(SIOCSPGRP) |
| 267 | COMPATIBLE_IOCTL(FIOGETOWN) | 268 | COMPATIBLE_IOCTL(FIOGETOWN) |
diff --git a/include/linux/config.h b/include/linux/config.h index 9d1c14f7ad6d..a91f5e55b525 100644 --- a/include/linux/config.h +++ b/include/linux/config.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef _LINUX_CONFIG_H | 1 | #ifndef _LINUX_CONFIG_H |
| 2 | #define _LINUX_CONFIG_H | 2 | #define _LINUX_CONFIG_H |
| 3 | 3 | /* This file is no longer in use and kept only for backward compatibility. | |
| 4 | * autoconf.h is now included via -imacros on the commandline | ||
| 5 | */ | ||
| 4 | #include <linux/autoconf.h> | 6 | #include <linux/autoconf.h> |
| 5 | 7 | ||
| 6 | #endif | 8 | #endif |
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 | |||
| 12 | struct vt_struct; | 14 | struct vt_struct; |
| 13 | 15 | ||
| 14 | #define NPAR 16 | 16 | #define NPAR 16 |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 1f7b2c097503..43c44530ef9d 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -42,6 +42,7 @@ struct notifier_block; | |||
| 42 | /* Need to know about CPUs going up/down? */ | 42 | /* Need to know about CPUs going up/down? */ |
| 43 | extern int register_cpu_notifier(struct notifier_block *nb); | 43 | extern int register_cpu_notifier(struct notifier_block *nb); |
| 44 | extern void unregister_cpu_notifier(struct notifier_block *nb); | 44 | extern void unregister_cpu_notifier(struct notifier_block *nb); |
| 45 | extern int current_in_cpu_hotplug(void); | ||
| 45 | 46 | ||
| 46 | int cpu_up(unsigned int cpu); | 47 | int cpu_up(unsigned int cpu); |
| 47 | 48 | ||
| @@ -54,6 +55,10 @@ static inline int register_cpu_notifier(struct notifier_block *nb) | |||
| 54 | static inline void unregister_cpu_notifier(struct notifier_block *nb) | 55 | static inline void unregister_cpu_notifier(struct notifier_block *nb) |
| 55 | { | 56 | { |
| 56 | } | 57 | } |
| 58 | static inline int current_in_cpu_hotplug(void) | ||
| 59 | { | ||
| 60 | return 0; | ||
| 61 | } | ||
| 57 | 62 | ||
| 58 | #endif /* CONFIG_SMP */ | 63 | #endif /* CONFIG_SMP */ |
| 59 | extern struct sysdev_class cpu_sysdev_class; | 64 | extern struct sysdev_class cpu_sysdev_class; |
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 | ||
| 331 | extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *); | 331 | extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *); |
| 332 | extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int); | ||
| 332 | extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); | 333 | extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); |
| 333 | 334 | ||
| 334 | extern int sysctl_vfs_cache_pressure; | 335 | extern int sysctl_vfs_cache_pressure; |
diff --git a/include/linux/eeprom.h b/include/linux/eeprom.h deleted file mode 100644 index 38afd9da1dfe..000000000000 --- a/include/linux/eeprom.h +++ /dev/null | |||
| @@ -1,136 +0,0 @@ | |||
| 1 | /* credit winbond-840.c | ||
| 2 | */ | ||
| 3 | #include <asm/io.h> | ||
| 4 | struct eeprom_ops { | ||
| 5 | void (*set_cs)(void *ee); | ||
| 6 | void (*clear_cs)(void *ee); | ||
| 7 | }; | ||
| 8 | |||
| 9 | #define EEPOL_EEDI 0x01 | ||
| 10 | #define EEPOL_EEDO 0x02 | ||
| 11 | #define EEPOL_EECLK 0x04 | ||
| 12 | #define EEPOL_EESEL 0x08 | ||
| 13 | |||
| 14 | struct eeprom { | ||
| 15 | void *dev; | ||
| 16 | struct eeprom_ops *ops; | ||
| 17 | |||
| 18 | void __iomem * addr; | ||
| 19 | |||
| 20 | unsigned ee_addr_bits; | ||
| 21 | |||
| 22 | unsigned eesel; | ||
| 23 | unsigned eeclk; | ||
| 24 | unsigned eedo; | ||
| 25 | unsigned eedi; | ||
| 26 | unsigned polarity; | ||
| 27 | unsigned ee_state; | ||
| 28 | |||
| 29 | spinlock_t *lock; | ||
| 30 | u32 *cache; | ||
| 31 | }; | ||
| 32 | |||
| 33 | |||
| 34 | u8 eeprom_readb(struct eeprom *ee, unsigned address); | ||
| 35 | void eeprom_read(struct eeprom *ee, unsigned address, u8 *bytes, | ||
| 36 | unsigned count); | ||
| 37 | void eeprom_writeb(struct eeprom *ee, unsigned address, u8 data); | ||
| 38 | void eeprom_write(struct eeprom *ee, unsigned address, u8 *bytes, | ||
| 39 | unsigned count); | ||
| 40 | |||
| 41 | /* The EEPROM commands include the alway-set leading bit. */ | ||
| 42 | enum EEPROM_Cmds { | ||
| 43 | EE_WriteCmd=(5 << 6), EE_ReadCmd=(6 << 6), EE_EraseCmd=(7 << 6), | ||
| 44 | }; | ||
| 45 | |||
| 46 | void setup_ee_mem_bitbanger(struct eeprom *ee, void __iomem *memaddr, int eesel_bit, int eeclk_bit, int eedo_bit, int eedi_bit, unsigned polarity) | ||
| 47 | { | ||
| 48 | ee->addr = memaddr; | ||
| 49 | ee->eesel = 1 << eesel_bit; | ||
| 50 | ee->eeclk = 1 << eeclk_bit; | ||
| 51 | ee->eedo = 1 << eedo_bit; | ||
| 52 | ee->eedi = 1 << eedi_bit; | ||
| 53 | |||
| 54 | ee->polarity = polarity; | ||
| 55 | |||
| 56 | *ee->cache = readl(ee->addr); | ||
| 57 | } | ||
| 58 | |||
| 59 | /* foo. put this in a .c file */ | ||
| 60 | static inline void eeprom_update(struct eeprom *ee, u32 mask, int pol) | ||
| 61 | { | ||
| 62 | unsigned long flags; | ||
| 63 | u32 data; | ||
| 64 | |||
| 65 | spin_lock_irqsave(ee->lock, flags); | ||
| 66 | data = *ee->cache; | ||
| 67 | |||
| 68 | data &= ~mask; | ||
| 69 | if (pol) | ||
| 70 | data |= mask; | ||
| 71 | |||
| 72 | *ee->cache = data; | ||
| 73 | //printk("update: %08x\n", data); | ||
| 74 | writel(data, ee->addr); | ||
| 75 | spin_unlock_irqrestore(ee->lock, flags); | ||
| 76 | } | ||
| 77 | |||
| 78 | void eeprom_clk_lo(struct eeprom *ee) | ||
| 79 | { | ||
| 80 | int pol = !!(ee->polarity & EEPOL_EECLK); | ||
| 81 | |||
| 82 | eeprom_update(ee, ee->eeclk, pol); | ||
| 83 | udelay(2); | ||
| 84 | } | ||
| 85 | |||
| 86 | void eeprom_clk_hi(struct eeprom *ee) | ||
| 87 | { | ||
| 88 | int pol = !!(ee->polarity & EEPOL_EECLK); | ||
| 89 | |||
| 90 | eeprom_update(ee, ee->eeclk, !pol); | ||
| 91 | udelay(2); | ||
| 92 | } | ||
| 93 | |||
| 94 | void eeprom_send_addr(struct eeprom *ee, unsigned address) | ||
| 95 | { | ||
| 96 | int pol = !!(ee->polarity & EEPOL_EEDI); | ||
| 97 | unsigned i; | ||
| 98 | address |= 6 << 6; | ||
| 99 | |||
| 100 | /* Shift the read command bits out. */ | ||
| 101 | for (i=0; i<11; i++) { | ||
| 102 | eeprom_update(ee, ee->eedi, ((address >> 10) & 1) ^ pol); | ||
| 103 | address <<= 1; | ||
| 104 | eeprom_clk_hi(ee); | ||
| 105 | eeprom_clk_lo(ee); | ||
| 106 | } | ||
| 107 | eeprom_update(ee, ee->eedi, pol); | ||
| 108 | } | ||
| 109 | |||
| 110 | u16 eeprom_readw(struct eeprom *ee, unsigned address) | ||
| 111 | { | ||
| 112 | unsigned i; | ||
| 113 | u16 res = 0; | ||
| 114 | |||
| 115 | eeprom_clk_lo(ee); | ||
| 116 | eeprom_update(ee, ee->eesel, 1 ^ !!(ee->polarity & EEPOL_EESEL)); | ||
| 117 | eeprom_send_addr(ee, address); | ||
| 118 | |||
| 119 | for (i=0; i<16; i++) { | ||
| 120 | u32 data; | ||
| 121 | eeprom_clk_hi(ee); | ||
| 122 | res <<= 1; | ||
| 123 | data = readl(ee->addr); | ||
| 124 | //printk("eeprom_readw: %08x\n", data); | ||
| 125 | res |= !!(data & ee->eedo) ^ !!(ee->polarity & EEPOL_EEDO); | ||
| 126 | eeprom_clk_lo(ee); | ||
| 127 | } | ||
| 128 | eeprom_update(ee, ee->eesel, 0 ^ !!(ee->polarity & EEPOL_EESEL)); | ||
| 129 | |||
| 130 | return res; | ||
| 131 | } | ||
| 132 | |||
| 133 | |||
| 134 | void eeprom_writeb(struct eeprom *ee, unsigned address, u8 data) | ||
| 135 | { | ||
| 136 | } | ||
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index d2c390eff1b2..93535f093216 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
| @@ -453,10 +453,11 @@ struct ethtool_ops { | |||
| 453 | * it was foced up into this mode or autonegotiated. | 453 | * it was foced up into this mode or autonegotiated. |
| 454 | */ | 454 | */ |
| 455 | 455 | ||
| 456 | /* The forced speed, 10Mb, 100Mb, gigabit, 10GbE. */ | 456 | /* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */ |
| 457 | #define SPEED_10 10 | 457 | #define SPEED_10 10 |
| 458 | #define SPEED_100 100 | 458 | #define SPEED_100 100 |
| 459 | #define SPEED_1000 1000 | 459 | #define SPEED_1000 1000 |
| 460 | #define SPEED_2500 2500 | ||
| 460 | #define SPEED_10000 10000 | 461 | #define SPEED_10000 10000 |
| 461 | 462 | ||
| 462 | /* Duplex, half or full. */ | 463 | /* Duplex, half or full. */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index c698055266d0..04a58f33ec53 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -201,6 +201,14 @@ struct fb_bitfield { | |||
| 201 | #define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */ | 201 | #define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */ |
| 202 | #define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */ | 202 | #define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */ |
| 203 | 203 | ||
| 204 | /* | ||
| 205 | * Display rotation support | ||
| 206 | */ | ||
| 207 | #define FB_ROTATE_UR 0 | ||
| 208 | #define FB_ROTATE_CW 1 | ||
| 209 | #define FB_ROTATE_UD 2 | ||
| 210 | #define FB_ROTATE_CCW 3 | ||
| 211 | |||
| 204 | #define PICOS2KHZ(a) (1000000000UL/(a)) | 212 | #define PICOS2KHZ(a) (1000000000UL/(a)) |
| 205 | #define KHZ2PICOS(a) (1000000000UL/(a)) | 213 | #define KHZ2PICOS(a) (1000000000UL/(a)) |
| 206 | 214 | ||
| @@ -489,9 +497,9 @@ struct fb_cursor_user { | |||
| 489 | #define FB_EVENT_MODE_DELETE 0x04 | 497 | #define FB_EVENT_MODE_DELETE 0x04 |
| 490 | /* A driver registered itself */ | 498 | /* A driver registered itself */ |
| 491 | #define FB_EVENT_FB_REGISTERED 0x05 | 499 | #define FB_EVENT_FB_REGISTERED 0x05 |
| 492 | /* get console to framebuffer mapping */ | 500 | /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ |
| 493 | #define FB_EVENT_GET_CONSOLE_MAP 0x06 | 501 | #define FB_EVENT_GET_CONSOLE_MAP 0x06 |
| 494 | /* set console to framebuffer mapping */ | 502 | /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ |
| 495 | #define FB_EVENT_SET_CONSOLE_MAP 0x07 | 503 | #define FB_EVENT_SET_CONSOLE_MAP 0x07 |
| 496 | /* A display blank is requested */ | 504 | /* A display blank is requested */ |
| 497 | #define FB_EVENT_BLANK 0x08 | 505 | #define FB_EVENT_BLANK 0x08 |
| @@ -500,6 +508,12 @@ struct fb_cursor_user { | |||
| 500 | /* The resolution of the passed in fb_info about to change and | 508 | /* The resolution of the passed in fb_info about to change and |
| 501 | all vc's should be changed */ | 509 | all vc's should be changed */ |
| 502 | #define FB_EVENT_MODE_CHANGE_ALL 0x0A | 510 | #define FB_EVENT_MODE_CHANGE_ALL 0x0A |
| 511 | /* CONSOLE-SPECIFIC: set console rotation */ | ||
| 512 | #define FB_EVENT_SET_CON_ROTATE 0x0B | ||
| 513 | /* CONSOLE-SPECIFIC: get console rotation */ | ||
| 514 | #define FB_EVENT_GET_CON_ROTATE 0x0C | ||
| 515 | /* CONSOLE-SPECIFIC: rotate all consoles */ | ||
| 516 | #define FB_EVENT_SET_CON_ROTATE_ALL 0x0D | ||
| 503 | 517 | ||
| 504 | struct fb_event { | 518 | struct fb_event { |
| 505 | struct fb_info *info; | 519 | struct fb_info *info; |
| @@ -810,7 +824,6 @@ struct fb_info { | |||
| 810 | extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var); | 824 | extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var); |
| 811 | extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var); | 825 | extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var); |
| 812 | extern int fb_blank(struct fb_info *info, int blank); | 826 | extern int fb_blank(struct fb_info *info, int blank); |
| 813 | extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor); | ||
| 814 | extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); | 827 | extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); |
| 815 | extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); | 828 | extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); |
| 816 | extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image); | 829 | extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image); |
| @@ -818,8 +831,8 @@ extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image); | |||
| 818 | /* drivers/video/fbmem.c */ | 831 | /* drivers/video/fbmem.c */ |
| 819 | extern int register_framebuffer(struct fb_info *fb_info); | 832 | extern int register_framebuffer(struct fb_info *fb_info); |
| 820 | extern int unregister_framebuffer(struct fb_info *fb_info); | 833 | extern int unregister_framebuffer(struct fb_info *fb_info); |
| 821 | extern int fb_prepare_logo(struct fb_info *fb_info); | 834 | extern int fb_prepare_logo(struct fb_info *fb_info, int rotate); |
| 822 | extern int fb_show_logo(struct fb_info *fb_info); | 835 | extern int fb_show_logo(struct fb_info *fb_info, int rotate); |
| 823 | extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); | 836 | extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); |
| 824 | extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx, | 837 | extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx, |
| 825 | u32 height, u32 shift_high, u32 shift_low, u32 mod); | 838 | u32 height, u32 shift_high, u32 shift_low, u32 mod); |
| @@ -829,6 +842,7 @@ extern int fb_get_color_depth(struct fb_var_screeninfo *var, | |||
| 829 | struct fb_fix_screeninfo *fix); | 842 | struct fb_fix_screeninfo *fix); |
| 830 | extern int fb_get_options(char *name, char **option); | 843 | extern int fb_get_options(char *name, char **option); |
| 831 | extern int fb_new_modelist(struct fb_info *info); | 844 | extern int fb_new_modelist(struct fb_info *info); |
| 845 | extern int fb_con_duit(struct fb_info *info, int event, void *data); | ||
| 832 | 846 | ||
| 833 | extern struct fb_info *registered_fb[FB_MAX]; | 847 | extern struct fb_info *registered_fb[FB_MAX]; |
| 834 | extern int num_registered_fb; | 848 | extern int num_registered_fb; |
| @@ -898,11 +912,13 @@ extern struct fb_videomode *fb_match_mode(struct fb_var_screeninfo *var, | |||
| 898 | struct list_head *head); | 912 | struct list_head *head); |
| 899 | extern struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var, | 913 | extern struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var, |
| 900 | struct list_head *head); | 914 | struct list_head *head); |
| 901 | extern struct fb_videomode *fb_find_nearest_mode(struct fb_var_screeninfo *var, | 915 | extern struct fb_videomode *fb_find_nearest_mode(struct fb_videomode *mode, |
| 902 | struct list_head *head); | 916 | struct list_head *head); |
| 903 | extern void fb_destroy_modelist(struct list_head *head); | 917 | extern void fb_destroy_modelist(struct list_head *head); |
| 904 | extern void fb_videomode_to_modelist(struct fb_videomode *modedb, int num, | 918 | extern void fb_videomode_to_modelist(struct fb_videomode *modedb, int num, |
| 905 | struct list_head *head); | 919 | struct list_head *head); |
| 920 | extern struct fb_videomode *fb_find_best_display(struct fb_monspecs *specs, | ||
| 921 | struct list_head *head); | ||
| 906 | 922 | ||
| 907 | /* drivers/video/fbcmap.c */ | 923 | /* drivers/video/fbcmap.c */ |
| 908 | extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); | 924 | extern 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)); | |||
| 59 | extern void put_filp(struct file *); | 59 | extern void put_filp(struct file *); |
| 60 | extern int get_unused_fd(void); | 60 | extern int get_unused_fd(void); |
| 61 | extern void FASTCALL(put_unused_fd(unsigned int fd)); | 61 | extern void FASTCALL(put_unused_fd(unsigned int fd)); |
| 62 | struct kmem_cache_s; | 62 | struct kmem_cache; |
| 63 | extern void filp_ctor(void * objp, struct kmem_cache_s *cachep, unsigned long cflags); | 63 | extern void filp_ctor(void * objp, struct kmem_cache *cachep, unsigned long cflags); |
| 64 | extern void filp_dtor(void * objp, struct kmem_cache_s *cachep, unsigned long dflags); | 64 | extern void filp_dtor(void * objp, struct kmem_cache *cachep, unsigned long dflags); |
| 65 | 65 | ||
| 66 | extern struct file ** alloc_fd_array(int); | 66 | extern struct file ** alloc_fd_array(int); |
| 67 | extern void free_fd_array(struct file **, int); | 67 | extern 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 | ||
| 35 | extern const struct font_desc font_vga_8x8, | 36 | extern 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..cc35b6ac778d 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 | /* |
| @@ -862,6 +874,7 @@ static inline void unlock_super(struct super_block * sb) | |||
| 862 | /* | 874 | /* |
| 863 | * VFS helper functions.. | 875 | * VFS helper functions.. |
| 864 | */ | 876 | */ |
| 877 | extern int vfs_permission(struct nameidata *, int); | ||
| 865 | extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); | 878 | extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); |
| 866 | extern int vfs_mkdir(struct inode *, struct dentry *, int); | 879 | extern int vfs_mkdir(struct inode *, struct dentry *, int); |
| 867 | extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); | 880 | extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); |
| @@ -877,6 +890,11 @@ extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct de | |||
| 877 | extern void dentry_unhash(struct dentry *dentry); | 890 | extern void dentry_unhash(struct dentry *dentry); |
| 878 | 891 | ||
| 879 | /* | 892 | /* |
| 893 | * VFS file helper functions. | ||
| 894 | */ | ||
| 895 | extern int file_permission(struct file *, int); | ||
| 896 | |||
| 897 | /* | ||
| 880 | * File types | 898 | * File types |
| 881 | * | 899 | * |
| 882 | * NOTE! These match bits 12..15 of stat.st_mode | 900 | * NOTE! These match bits 12..15 of stat.st_mode |
| @@ -1088,6 +1106,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 | 1106 | * @get_name: find the name for a given inode in a given directory |
| 1089 | * @get_parent: find the parent of a given directory | 1107 | * @get_parent: find the parent of a given directory |
| 1090 | * @get_dentry: find a dentry for the inode given a file handle sub-fragment | 1108 | * @get_dentry: find a dentry for the inode given a file handle sub-fragment |
| 1109 | * @find_exported_dentry: | ||
| 1110 | * set by the exporting module to a standard helper function. | ||
| 1091 | * | 1111 | * |
| 1092 | * Description: | 1112 | * Description: |
| 1093 | * The export_operations structure provides a means for nfsd to communicate | 1113 | * The export_operations structure provides a means for nfsd to communicate |
| @@ -1239,7 +1259,12 @@ extern int unregister_filesystem(struct file_system_type *); | |||
| 1239 | extern struct vfsmount *kern_mount(struct file_system_type *); | 1259 | extern struct vfsmount *kern_mount(struct file_system_type *); |
| 1240 | extern int may_umount_tree(struct vfsmount *); | 1260 | extern int may_umount_tree(struct vfsmount *); |
| 1241 | extern int may_umount(struct vfsmount *); | 1261 | extern int may_umount(struct vfsmount *); |
| 1262 | extern void umount_tree(struct vfsmount *, int, struct list_head *); | ||
| 1263 | extern void release_mounts(struct list_head *); | ||
| 1242 | extern long do_mount(char *, char *, char *, unsigned long, void *); | 1264 | extern long do_mount(char *, char *, char *, unsigned long, void *); |
| 1265 | extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int); | ||
| 1266 | extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, | ||
| 1267 | struct vfsmount *); | ||
| 1243 | 1268 | ||
| 1244 | extern int vfs_statfs(struct super_block *, struct kstatfs *); | 1269 | extern int vfs_statfs(struct super_block *, struct kstatfs *); |
| 1245 | 1270 | ||
| @@ -1288,7 +1313,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
| 1288 | 1313 | ||
| 1289 | /* fs/open.c */ | 1314 | /* fs/open.c */ |
| 1290 | 1315 | ||
| 1291 | extern int do_truncate(struct dentry *, loff_t start); | 1316 | extern int do_truncate(struct dentry *, loff_t start, struct file *filp); |
| 1292 | extern long do_sys_open(const char __user *filename, int flags, int mode); | 1317 | extern long do_sys_open(const char __user *filename, int flags, int mode); |
| 1293 | extern struct file *filp_open(const char *, int, int); | 1318 | extern struct file *filp_open(const char *, int, int); |
| 1294 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); | 1319 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); |
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h index bef23bbf8690..783c476b8674 100644 --- a/include/linux/fs_enet_pd.h +++ b/include/linux/fs_enet_pd.h | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #ifndef FS_ENET_PD_H | 16 | #ifndef FS_ENET_PD_H |
| 17 | #define FS_ENET_PD_H | 17 | #define FS_ENET_PD_H |
| 18 | 18 | ||
| 19 | #include <linux/version.h> | ||
| 20 | #include <asm/types.h> | 19 | #include <asm/types.h> |
| 21 | 20 | ||
| 22 | #define FS_ENET_NAME "fs_enet" | 21 | #define FS_ENET_NAME "fs_enet" |
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 { | |||
| 152 | struct fuse_setattr_in { | 155 | struct 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 | ||
| 158 | struct fuse_open_in { | 174 | struct fuse_open_in { |
| 159 | __u32 flags; | 175 | __u32 flags; |
| 160 | __u32 padding; | 176 | __u32 mode; |
| 161 | }; | 177 | }; |
| 162 | 178 | ||
| 163 | struct fuse_open_out { | 179 | struct fuse_open_out { |
| @@ -222,6 +238,11 @@ struct fuse_getxattr_out { | |||
| 222 | __u32 padding; | 238 | __u32 padding; |
| 223 | }; | 239 | }; |
| 224 | 240 | ||
| 241 | struct fuse_access_in { | ||
| 242 | __u32 mask; | ||
| 243 | __u32 padding; | ||
| 244 | }; | ||
| 245 | |||
| 225 | struct fuse_init_in_out { | 246 | struct fuse_init_in_out { |
| 226 | __u32 major; | 247 | __u32 major; |
| 227 | __u32 minor; | 248 | __u32 minor; |
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h new file mode 100644 index 000000000000..84f12a41dc01 --- /dev/null +++ b/include/linux/genetlink.h | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | #ifndef __LINUX_GENERIC_NETLINK_H | ||
| 2 | #define __LINUX_GENERIC_NETLINK_H | ||
| 3 | |||
| 4 | #include <linux/netlink.h> | ||
| 5 | |||
| 6 | #define GENL_NAMSIZ 16 /* length of family name */ | ||
| 7 | |||
| 8 | #define GENL_MIN_ID NLMSG_MIN_TYPE | ||
| 9 | #define GENL_MAX_ID 1023 | ||
| 10 | |||
| 11 | struct genlmsghdr { | ||
| 12 | __u8 cmd; | ||
| 13 | __u8 version; | ||
| 14 | __u16 reserved; | ||
| 15 | }; | ||
| 16 | |||
| 17 | #define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr)) | ||
| 18 | |||
| 19 | /* | ||
| 20 | * List of reserved static generic netlink identifiers: | ||
| 21 | */ | ||
| 22 | #define GENL_ID_GENERATE 0 | ||
| 23 | #define GENL_ID_CTRL NLMSG_MIN_TYPE | ||
| 24 | |||
| 25 | /************************************************************************** | ||
| 26 | * Controller | ||
| 27 | **************************************************************************/ | ||
| 28 | |||
| 29 | enum { | ||
| 30 | CTRL_CMD_UNSPEC, | ||
| 31 | CTRL_CMD_NEWFAMILY, | ||
| 32 | CTRL_CMD_DELFAMILY, | ||
| 33 | CTRL_CMD_GETFAMILY, | ||
| 34 | CTRL_CMD_NEWOPS, | ||
| 35 | CTRL_CMD_DELOPS, | ||
| 36 | CTRL_CMD_GETOPS, | ||
| 37 | __CTRL_CMD_MAX, | ||
| 38 | }; | ||
| 39 | |||
| 40 | #define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1) | ||
| 41 | |||
| 42 | enum { | ||
| 43 | CTRL_ATTR_UNSPEC, | ||
| 44 | CTRL_ATTR_FAMILY_ID, | ||
| 45 | CTRL_ATTR_FAMILY_NAME, | ||
| 46 | __CTRL_ATTR_MAX, | ||
| 47 | }; | ||
| 48 | |||
| 49 | #define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1) | ||
| 50 | |||
| 51 | #endif /* __LINUX_GENERIC_NETLINK_H */ | ||
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 1ce4b54caa21..74abaecdb572 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
| @@ -27,10 +27,10 @@ | |||
| 27 | * ---- Driver types ----------------------------------------------------- | 27 | * ---- Driver types ----------------------------------------------------- |
| 28 | * device id name + number function description, i2c address(es) | 28 | * device id name + number function description, i2c address(es) |
| 29 | * | 29 | * |
| 30 | * Range 1000-1999 range is defined in sensors/sensors.h | 30 | * Range 1000-1999 range is defined in sensors/sensors.h |
| 31 | * Range 0x100 - 0x1ff is for V4L2 Common Components | 31 | * Range 0x100 - 0x1ff is for V4L2 Common Components |
| 32 | * Range 0xf000 - 0xffff is reserved for local experimentation, and should | 32 | * Range 0xf000 - 0xffff is reserved for local experimentation, and should |
| 33 | * never be used in official drivers | 33 | * never be used in official drivers |
| 34 | */ | 34 | */ |
| 35 | 35 | ||
| 36 | #define I2C_DRIVERID_MSP3400 1 | 36 | #define I2C_DRIVERID_MSP3400 1 |
| @@ -99,7 +99,14 @@ | |||
| 99 | #define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ | 99 | #define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ |
| 100 | #define I2C_DRIVERID_SAA7114H 64 /* video decoder */ | 100 | #define I2C_DRIVERID_SAA7114H 64 /* video decoder */ |
| 101 | #define I2C_DRIVERID_DS1374 65 /* DS1374 real time clock */ | 101 | #define I2C_DRIVERID_DS1374 65 /* DS1374 real time clock */ |
| 102 | 102 | #define I2C_DRIVERID_TDA9874 66 /* TV sound decoder */ | |
| 103 | #define I2C_DRIVERID_SAA6752HS 67 /* MPEG2 encoder */ | ||
| 104 | #define I2C_DRIVERID_TVEEPROM 68 /* TV EEPROM */ | ||
| 105 | #define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */ | ||
| 106 | #define I2C_DRIVERID_CS53L32A 70 /* cs53l32a audio processor */ | ||
| 107 | #define I2C_DRIVERID_CX25840 71 /* cx2584x video encoder */ | ||
| 108 | #define I2C_DRIVERID_SAA7127 72 /* saa7124 video encoder */ | ||
| 109 | #define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */ | ||
| 103 | 110 | ||
| 104 | #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ | 111 | #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ |
| 105 | #define I2C_DRIVERID_EXP1 0xF1 | 112 | #define I2C_DRIVERID_EXP1 0xF1 |
| @@ -111,7 +118,7 @@ | |||
| 111 | #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ | 118 | #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ |
| 112 | #define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */ | 119 | #define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */ |
| 113 | 120 | ||
| 114 | /* IDs -- Use DRIVERIDs 1000-1999 for sensors. | 121 | /* IDs -- Use DRIVERIDs 1000-1999 for sensors. |
| 115 | These were originally in sensors.h in the lm_sensors package */ | 122 | These were originally in sensors.h in the lm_sensors package */ |
| 116 | #define I2C_DRIVERID_LM78 1002 | 123 | #define I2C_DRIVERID_LM78 1002 |
| 117 | #define I2C_DRIVERID_LM75 1003 | 124 | #define I2C_DRIVERID_LM75 1003 |
| @@ -190,6 +197,7 @@ | |||
| 190 | #define I2C_HW_B_NVIDIA 0x01001c /* nvidia framebuffer driver */ | 197 | #define I2C_HW_B_NVIDIA 0x01001c /* nvidia framebuffer driver */ |
| 191 | #define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */ | 198 | #define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */ |
| 192 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ | 199 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ |
| 200 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ | ||
| 193 | 201 | ||
| 194 | /* --- PCF 8584 based algorithms */ | 202 | /* --- PCF 8584 based algorithms */ |
| 195 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ | 203 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 3461abc1e854..77ae55d4c13c 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -230,6 +230,7 @@ typedef struct hw_regs_s { | |||
| 230 | int dma; /* our dma entry */ | 230 | int dma; /* our dma entry */ |
| 231 | ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ | 231 | ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ |
| 232 | hwif_chipset_t chipset; | 232 | hwif_chipset_t chipset; |
| 233 | struct device *dev; | ||
| 233 | } hw_regs_t; | 234 | } hw_regs_t; |
| 234 | 235 | ||
| 235 | /* | 236 | /* |
| @@ -266,6 +267,10 @@ static inline void ide_std_init_ports(hw_regs_t *hw, | |||
| 266 | 267 | ||
| 267 | #include <asm/ide.h> | 268 | #include <asm/ide.h> |
| 268 | 269 | ||
| 270 | #ifndef MAX_HWIFS | ||
| 271 | #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS | ||
| 272 | #endif | ||
| 273 | |||
| 269 | /* needed on alpha, x86/x86_64, ia64, mips, ppc32 and sh */ | 274 | /* needed on alpha, x86/x86_64, ia64, mips, ppc32 and sh */ |
| 270 | #ifndef IDE_ARCH_OBSOLETE_DEFAULTS | 275 | #ifndef IDE_ARCH_OBSOLETE_DEFAULTS |
| 271 | # define ide_default_io_base(index) (0) | 276 | # define ide_default_io_base(index) (0) |
diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h index 572aff7daa21..768372f07caa 100644 --- a/include/linux/if_ppp.h +++ b/include/linux/if_ppp.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | /* | 23 | /* |
| 24 | * ==FILEVERSION 20000724== | 24 | * ==FILEVERSION 20050812== |
| 25 | * | 25 | * |
| 26 | * NOTE TO MAINTAINERS: | 26 | * NOTE TO MAINTAINERS: |
| 27 | * If you modify this file at all, please set the above date. | 27 | * If you modify this file at all, please set the above date. |
| @@ -35,6 +35,8 @@ | |||
| 35 | #ifndef _IF_PPP_H_ | 35 | #ifndef _IF_PPP_H_ |
| 36 | #define _IF_PPP_H_ | 36 | #define _IF_PPP_H_ |
| 37 | 37 | ||
| 38 | #include <linux/compiler.h> | ||
| 39 | |||
| 38 | /* | 40 | /* |
| 39 | * Packet sizes | 41 | * Packet sizes |
| 40 | */ | 42 | */ |
| @@ -70,7 +72,8 @@ | |||
| 70 | #define SC_LOG_RAWIN 0x00080000 /* log all chars received */ | 72 | #define SC_LOG_RAWIN 0x00080000 /* log all chars received */ |
| 71 | #define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */ | 73 | #define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */ |
| 72 | #define SC_SYNC 0x00200000 /* synchronous serial mode */ | 74 | #define SC_SYNC 0x00200000 /* synchronous serial mode */ |
| 73 | #define SC_MASK 0x0f200fff /* bits that user can change */ | 75 | #define SC_MUST_COMP 0x00400000 /* no uncompressed packets may be sent or received */ |
| 76 | #define SC_MASK 0x0f600fff /* bits that user can change */ | ||
| 74 | 77 | ||
| 75 | /* state bits */ | 78 | /* state bits */ |
| 76 | #define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */ | 79 | #define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */ |
diff --git a/include/linux/if_wanpipe_common.h b/include/linux/if_wanpipe_common.h index f25fec8ee2ca..6e5461d69fdd 100644 --- a/include/linux/if_wanpipe_common.h +++ b/include/linux/if_wanpipe_common.h | |||
| @@ -17,8 +17,6 @@ | |||
| 17 | #ifndef _WANPIPE_SOCK_DRIVER_COMMON_H | 17 | #ifndef _WANPIPE_SOCK_DRIVER_COMMON_H |
| 18 | #define _WANPIPE_SOCK_DRIVER_COMMON_H | 18 | #define _WANPIPE_SOCK_DRIVER_COMMON_H |
| 19 | 19 | ||
| 20 | #include <linux/version.h> | ||
| 21 | |||
| 22 | typedef struct { | 20 | typedef struct { |
| 23 | struct net_device *slave; | 21 | struct net_device *slave; |
| 24 | atomic_t packet_sent; | 22 | atomic_t packet_sent; |
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 | ||
| 1010 | void input_register_device(struct input_dev *); | 1010 | int input_register_device(struct input_dev *); |
| 1011 | void input_unregister_device(struct input_dev *); | 1011 | void input_unregister_device(struct input_dev *); |
| 1012 | 1012 | ||
| 1013 | void input_register_handler(struct input_handler *); | 1013 | void 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; | |||
| 94 | extern int request_resource(struct resource *root, struct resource *new); | 94 | extern int request_resource(struct resource *root, struct resource *new); |
| 95 | extern struct resource * ____request_resource(struct resource *root, struct resource *new); | 95 | extern struct resource * ____request_resource(struct resource *root, struct resource *new); |
| 96 | extern int release_resource(struct resource *new); | 96 | extern int release_resource(struct resource *new); |
| 97 | extern int insert_resource(struct resource *parent, struct resource *new); | 97 | extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new); |
| 98 | extern int allocate_resource(struct resource *root, struct resource *new, | 98 | extern 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. */ |
| 259 | static inline void ipmi_free_recv_msg(struct ipmi_recv_msg *msg) | 259 | void ipmi_free_recv_msg(struct ipmi_recv_msg *msg); |
| 260 | { | ||
| 261 | msg->done(msg); | ||
| 262 | } | ||
| 263 | 260 | ||
| 264 | struct ipmi_user_hndl | 261 | struct 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/istallion.h b/include/linux/istallion.h index 5f4ee646c119..1f996621bc9c 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h | |||
| @@ -21,8 +21,6 @@ | |||
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 22 | */ | 22 | */ |
| 23 | 23 | ||
| 24 | #include <linux/version.h> | ||
| 25 | |||
| 26 | /*****************************************************************************/ | 24 | /*****************************************************************************/ |
| 27 | #ifndef _ISTALLION_H | 25 | #ifndef _ISTALLION_H |
| 28 | #define _ISTALLION_H | 26 | #define _ISTALLION_H |
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 | |||
| 101 | struct jffs2_raw_dirent | 104 | struct 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 | |||
| 125 | struct jffs2_raw_inode | 128 | struct 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 | ||
| 151 | union jffs2_node_union { | 154 | struct 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 | |||
| 168 | union 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 @@ | |||
| 20 | struct jffs2_inodirty; | 20 | struct 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 | */ |
| 26 | struct jffs2_sb_info { | 26 | struct 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 | ||
| 169 | extern void bust_spinlocks(int yes); | 169 | extern void bust_spinlocks(int yes); |
| 170 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ | 170 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ |
| 171 | extern int panic_timeout; | 171 | extern __deprecated_for_modules int panic_timeout; |
| 172 | extern int panic_on_oops; | 172 | extern int panic_on_oops; |
| 173 | extern int tainted; | 173 | extern int tainted; |
| 174 | extern const char *print_tainted(void); | 174 | extern 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 | */ |
| 44 | static inline int kstat_irqs(int irq) | 45 | static 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 | ||
| 112 | DECLARE_PER_CPU(struct kprobe *, current_kprobe); | ||
| 113 | DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | ||
| 114 | |||
| 109 | #ifdef ARCH_SUPPORTS_KRETPROBES | 115 | #ifdef ARCH_SUPPORTS_KRETPROBES |
| 110 | extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs); | 116 | extern 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 */ | 151 | extern spinlock_t kretprobe_lock; |
| 146 | void lock_kprobes(void); | ||
| 147 | void unlock_kprobes(void); | ||
| 148 | |||
| 149 | /* kprobe running now on this CPU? */ | ||
| 150 | static inline int kprobe_running(void) | ||
| 151 | { | ||
| 152 | extern unsigned int kprobe_cpu; | ||
| 153 | return kprobe_cpu == smp_processor_id(); | ||
| 154 | } | ||
| 155 | |||
| 156 | extern int arch_prepare_kprobe(struct kprobe *p); | 152 | extern int arch_prepare_kprobe(struct kprobe *p); |
| 157 | extern void arch_copy_kprobe(struct kprobe *p); | 153 | extern void arch_copy_kprobe(struct kprobe *p); |
| 158 | extern void arch_arm_kprobe(struct kprobe *p); | 154 | extern void arch_arm_kprobe(struct kprobe *p); |
| @@ -163,10 +159,26 @@ extern void show_registers(struct pt_regs *regs); | |||
| 163 | extern kprobe_opcode_t *get_insn_slot(void); | 159 | extern kprobe_opcode_t *get_insn_slot(void); |
| 164 | extern void free_insn_slot(kprobe_opcode_t *slot); | 160 | extern 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 */ |
| 167 | struct kprobe *get_kprobe(void *addr); | 163 | struct kprobe *get_kprobe(void *addr); |
| 168 | struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); | 164 | struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); |
| 169 | 165 | ||
| 166 | /* kprobe_running() will just return the current_kprobe on this CPU */ | ||
| 167 | static inline struct kprobe *kprobe_running(void) | ||
| 168 | { | ||
| 169 | return (__get_cpu_var(current_kprobe)); | ||
| 170 | } | ||
| 171 | |||
| 172 | static inline void reset_current_kprobe(void) | ||
| 173 | { | ||
| 174 | __get_cpu_var(current_kprobe) = NULL; | ||
| 175 | } | ||
| 176 | |||
| 177 | static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void) | ||
| 178 | { | ||
| 179 | return (&__get_cpu_var(kprobe_ctlblk)); | ||
| 180 | } | ||
| 181 | |||
| 170 | int register_kprobe(struct kprobe *p); | 182 | int register_kprobe(struct kprobe *p); |
| 171 | void unregister_kprobe(struct kprobe *p); | 183 | void unregister_kprobe(struct kprobe *p); |
| 172 | int setjmp_pre_handler(struct kprobe *, struct pt_regs *); | 184 | int setjmp_pre_handler(struct kprobe *, struct pt_regs *); |
| @@ -183,9 +195,9 @@ void add_rp_inst(struct kretprobe_instance *ri); | |||
| 183 | void kprobe_flush_task(struct task_struct *tk); | 195 | void kprobe_flush_task(struct task_struct *tk); |
| 184 | void recycle_rp_inst(struct kretprobe_instance *ri); | 196 | void recycle_rp_inst(struct kretprobe_instance *ri); |
| 185 | #else /* CONFIG_KPROBES */ | 197 | #else /* CONFIG_KPROBES */ |
| 186 | static inline int kprobe_running(void) | 198 | static inline struct kprobe *kprobe_running(void) |
| 187 | { | 199 | { |
| 188 | return 0; | 200 | return NULL; |
| 189 | } | 201 | } |
| 190 | static inline int register_kprobe(struct kprobe *p) | 202 | static inline int register_kprobe(struct kprobe *p) |
| 191 | { | 203 | { |
diff --git a/include/linux/libata.h b/include/linux/libata.h index dcd17e7458ab..6f0752219f64 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -214,7 +214,7 @@ struct ata_probe_ent { | |||
| 214 | struct list_head node; | 214 | struct list_head node; |
| 215 | struct device *dev; | 215 | struct device *dev; |
| 216 | const struct ata_port_operations *port_ops; | 216 | const struct ata_port_operations *port_ops; |
| 217 | Scsi_Host_Template *sht; | 217 | struct scsi_host_template *sht; |
| 218 | struct ata_ioports port[ATA_MAX_PORTS]; | 218 | struct ata_ioports port[ATA_MAX_PORTS]; |
| 219 | unsigned int n_ports; | 219 | unsigned int n_ports; |
| 220 | unsigned int hard_port_no; | 220 | unsigned int hard_port_no; |
| @@ -398,7 +398,7 @@ struct ata_port_operations { | |||
| 398 | }; | 398 | }; |
| 399 | 399 | ||
| 400 | struct ata_port_info { | 400 | struct ata_port_info { |
| 401 | Scsi_Host_Template *sht; | 401 | struct scsi_host_template *sht; |
| 402 | unsigned long host_flags; | 402 | unsigned long host_flags; |
| 403 | unsigned long pio_mask; | 403 | unsigned long pio_mask; |
| 404 | unsigned long mwdma_mask; | 404 | unsigned long mwdma_mask; |
| @@ -433,7 +433,7 @@ extern void ata_pci_remove_one (struct pci_dev *pdev); | |||
| 433 | #endif /* CONFIG_PCI */ | 433 | #endif /* CONFIG_PCI */ |
| 434 | extern int ata_device_add(const struct ata_probe_ent *ent); | 434 | extern int ata_device_add(const struct ata_probe_ent *ent); |
| 435 | extern void ata_host_set_remove(struct ata_host_set *host_set); | 435 | extern void ata_host_set_remove(struct ata_host_set *host_set); |
| 436 | extern int ata_scsi_detect(Scsi_Host_Template *sht); | 436 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
| 437 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 437 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
| 438 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 438 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
| 439 | extern int ata_scsi_error(struct Scsi_Host *host); | 439 | extern int ata_scsi_error(struct Scsi_Host *host); |
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 | */ |
| 656 | static inline void hlist_add_before_rcu(struct hlist_node *n, | 656 | static 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 | */ |
| 681 | static inline void hlist_add_after_rcu(struct hlist_node *prev, | 681 | static 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 | ||
| 57 | struct notifier_block; | ||
| 58 | struct mem_section; | ||
| 59 | |||
| 57 | #ifndef CONFIG_MEMORY_HOTPLUG | 60 | #ifndef CONFIG_MEMORY_HOTPLUG |
| 58 | static inline int memory_dev_init(void) | 61 | static 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 | ||
| 934 | int do_page_cache_readahead(struct address_space *mapping, struct file *filp, | 934 | int 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); |
| 936 | int force_page_cache_readahead(struct address_space *mapping, struct file *filp, | 936 | int 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); |
| 938 | unsigned long page_cache_readahead(struct address_space *mapping, | 938 | unsigned 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); |
| 943 | void handle_ra_miss(struct address_space *mapping, | 943 | void 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 | ||
| 24 | struct vfsmount | 27 | struct 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 | ||
| 42 | static inline struct vfsmount *mntget(struct vfsmount *mnt) | 49 | static 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 | ||
| 49 | extern void __mntput(struct vfsmount *mnt); | 56 | extern void mntput_no_expire(struct vfsmount *mnt); |
| 50 | 57 | extern void mnt_pin(struct vfsmount *mnt); | |
| 51 | static inline void mntput_no_expire(struct vfsmount *mnt) | 58 | extern 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 | ||
| 59 | static inline void mntput(struct vfsmount *mnt) | 60 | static 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 | */ | ||
| 44 | struct 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 | */ | ||
| 103 | struct 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 */ | ||
| 119 | extern int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd); | ||
| 120 | extern 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); | |||
| 67 | extern int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr); | 67 | extern int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr); |
| 68 | extern int add_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); | 68 | extern int add_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); |
| 69 | extern int del_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); | 69 | extern 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..3c9ea4b7adda 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
| @@ -1,14 +1,13 @@ | |||
| 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__ |
| 8 | #define __MTD_CFI_H__ | 8 | #define __MTD_CFI_H__ |
| 9 | 9 | ||
| 10 | #include <linux/config.h> | 10 | #include <linux/config.h> |
| 11 | #include <linux/version.h> | ||
| 12 | #include <linux/delay.h> | 11 | #include <linux/delay.h> |
| 13 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 14 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
| @@ -82,8 +81,8 @@ static inline int cfi_interleave_supported(int i) | |||
| 82 | } | 81 | } |
| 83 | 82 | ||
| 84 | 83 | ||
| 85 | /* NB: these values must represents the number of bytes needed to meet the | 84 | /* 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. | 85 | * device type (x8, x16, x32). Eg. a 32 bit device is 4 x 8 bytes. |
| 87 | * These numbers are used in calculations. | 86 | * These numbers are used in calculations. |
| 88 | */ | 87 | */ |
| 89 | #define CFI_DEVICETYPE_X8 (8 / 8) | 88 | #define CFI_DEVICETYPE_X8 (8 / 8) |
| @@ -173,6 +172,15 @@ struct cfi_intelext_regioninfo { | |||
| 173 | struct cfi_intelext_blockinfo BlockTypes[1]; | 172 | struct cfi_intelext_blockinfo BlockTypes[1]; |
| 174 | } __attribute__((packed)); | 173 | } __attribute__((packed)); |
| 175 | 174 | ||
| 175 | struct cfi_intelext_programming_regioninfo { | ||
| 176 | uint8_t ProgRegShift; | ||
| 177 | uint8_t Reserved1; | ||
| 178 | uint8_t ControlValid; | ||
| 179 | uint8_t Reserved2; | ||
| 180 | uint8_t ControlInvalid; | ||
| 181 | uint8_t Reserved3; | ||
| 182 | } __attribute__((packed)); | ||
| 183 | |||
| 176 | /* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */ | 184 | /* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */ |
| 177 | 185 | ||
| 178 | struct cfi_pri_amdstd { | 186 | struct cfi_pri_amdstd { |
| @@ -250,7 +258,7 @@ static inline uint32_t cfi_build_cmd_addr(uint32_t cmd_ofs, int interleave, int | |||
| 250 | /* | 258 | /* |
| 251 | * Transforms the CFI command for the given geometry (bus width & interleave). | 259 | * 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 | 260 | * It looks too long to be inline, but in the common case it should almost all |
| 253 | * get optimised away. | 261 | * get optimised away. |
| 254 | */ | 262 | */ |
| 255 | static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi) | 263 | static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi) |
| 256 | { | 264 | { |
| @@ -259,7 +267,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf | |||
| 259 | unsigned long onecmd; | 267 | unsigned long onecmd; |
| 260 | int i; | 268 | int i; |
| 261 | 269 | ||
| 262 | /* We do it this way to give the compiler a fighting chance | 270 | /* We do it this way to give the compiler a fighting chance |
| 263 | of optimising away all the crap for 'bankwidth' larger than | 271 | of optimising away all the crap for 'bankwidth' larger than |
| 264 | an unsigned long, in the common case where that support is | 272 | an unsigned long, in the common case where that support is |
| 265 | disabled */ | 273 | disabled */ |
| @@ -270,7 +278,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf | |||
| 270 | wordwidth = map_bankwidth(map); | 278 | wordwidth = map_bankwidth(map); |
| 271 | words_per_bus = 1; | 279 | words_per_bus = 1; |
| 272 | } | 280 | } |
| 273 | 281 | ||
| 274 | chip_mode = map_bankwidth(map) / cfi_interleave(cfi); | 282 | chip_mode = map_bankwidth(map) / cfi_interleave(cfi); |
| 275 | chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); | 283 | chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); |
| 276 | 284 | ||
| @@ -289,7 +297,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf | |||
| 289 | break; | 297 | break; |
| 290 | } | 298 | } |
| 291 | 299 | ||
| 292 | /* Now replicate it across the size of an unsigned long, or | 300 | /* Now replicate it across the size of an unsigned long, or |
| 293 | just to the bus width as appropriate */ | 301 | just to the bus width as appropriate */ |
| 294 | switch (chips_per_word) { | 302 | switch (chips_per_word) { |
| 295 | default: BUG(); | 303 | default: BUG(); |
| @@ -305,7 +313,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf | |||
| 305 | ; | 313 | ; |
| 306 | } | 314 | } |
| 307 | 315 | ||
| 308 | /* And finally, for the multi-word case, replicate it | 316 | /* And finally, for the multi-word case, replicate it |
| 309 | in all words in the structure */ | 317 | in all words in the structure */ |
| 310 | for (i=0; i < words_per_bus; i++) { | 318 | for (i=0; i < words_per_bus; i++) { |
| 311 | val.x[i] = onecmd; | 319 | val.x[i] = onecmd; |
| @@ -316,14 +324,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) | 324 | #define CMD(x) cfi_build_cmd((x), map, cfi) |
| 317 | 325 | ||
| 318 | 326 | ||
| 319 | static inline unsigned char cfi_merge_status(map_word val, struct map_info *map, | 327 | static inline unsigned long cfi_merge_status(map_word val, struct map_info *map, |
| 320 | struct cfi_private *cfi) | 328 | struct cfi_private *cfi) |
| 321 | { | 329 | { |
| 322 | int wordwidth, words_per_bus, chip_mode, chips_per_word; | 330 | int wordwidth, words_per_bus, chip_mode, chips_per_word; |
| 323 | unsigned long onestat, res = 0; | 331 | unsigned long onestat, res = 0; |
| 324 | int i; | 332 | int i; |
| 325 | 333 | ||
| 326 | /* We do it this way to give the compiler a fighting chance | 334 | /* We do it this way to give the compiler a fighting chance |
| 327 | of optimising away all the crap for 'bankwidth' larger than | 335 | of optimising away all the crap for 'bankwidth' larger than |
| 328 | an unsigned long, in the common case where that support is | 336 | an unsigned long, in the common case where that support is |
| 329 | disabled */ | 337 | disabled */ |
| @@ -334,7 +342,7 @@ static inline unsigned char cfi_merge_status(map_word val, struct map_info *map, | |||
| 334 | wordwidth = map_bankwidth(map); | 342 | wordwidth = map_bankwidth(map); |
| 335 | words_per_bus = 1; | 343 | words_per_bus = 1; |
| 336 | } | 344 | } |
| 337 | 345 | ||
| 338 | chip_mode = map_bankwidth(map) / cfi_interleave(cfi); | 346 | chip_mode = map_bankwidth(map) / cfi_interleave(cfi); |
| 339 | chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); | 347 | chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); |
| 340 | 348 | ||
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 | ||
| 22 | typedef enum { | 22 | typedef 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 | |||
| 51 | struct jedec_private | 51 | struct 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..b6f2fdae65c6 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 | * |
| @@ -14,7 +14,6 @@ | |||
| 14 | #endif | 14 | #endif |
| 15 | 15 | ||
| 16 | #include <linux/config.h> | 16 | #include <linux/config.h> |
| 17 | #include <linux/version.h> | ||
| 18 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 19 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| 20 | #include <linux/uio.h> | 19 | #include <linux/uio.h> |
| @@ -72,7 +71,17 @@ struct mtd_info { | |||
| 72 | u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) | 71 | u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) |
| 73 | u_int32_t ecctype; | 72 | u_int32_t ecctype; |
| 74 | u_int32_t eccsize; | 73 | u_int32_t eccsize; |
| 75 | 74 | ||
| 75 | /* | ||
| 76 | * Reuse some of the above unused fields in the case of NOR flash | ||
| 77 | * with configurable programming regions to avoid modifying the | ||
| 78 | * user visible structure layout/size. Only valid when the | ||
| 79 | * MTD_PROGRAM_REGIONS flag is set. | ||
| 80 | * (Maybe we should have an union for those?) | ||
| 81 | */ | ||
| 82 | #define MTD_PROGREGION_SIZE(mtd) (mtd)->oobblock | ||
| 83 | #define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize | ||
| 84 | #define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype | ||
| 76 | 85 | ||
| 77 | // Kernel-only stuff starts here. | 86 | // Kernel-only stuff starts here. |
| 78 | char *name; | 87 | char *name; |
| @@ -80,13 +89,13 @@ struct mtd_info { | |||
| 80 | 89 | ||
| 81 | // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) | 90 | // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) |
| 82 | struct nand_oobinfo oobinfo; | 91 | struct nand_oobinfo oobinfo; |
| 83 | u_int32_t oobavail; // Number of bytes in OOB area available for fs | 92 | u_int32_t oobavail; // Number of bytes in OOB area available for fs |
| 84 | 93 | ||
| 85 | /* Data for variable erase regions. If numeraseregions is zero, | 94 | /* Data for variable erase regions. If numeraseregions is zero, |
| 86 | * it means that the whole device has erasesize as given above. | 95 | * it means that the whole device has erasesize as given above. |
| 87 | */ | 96 | */ |
| 88 | int numeraseregions; | 97 | int numeraseregions; |
| 89 | struct mtd_erase_region_info *eraseregions; | 98 | struct mtd_erase_region_info *eraseregions; |
| 90 | 99 | ||
| 91 | /* This really shouldn't be here. It can go away in 2.5 */ | 100 | /* This really shouldn't be here. It can go away in 2.5 */ |
| 92 | u_int32_t bank_size; | 101 | u_int32_t bank_size; |
| @@ -109,10 +118,10 @@ struct mtd_info { | |||
| 109 | int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 118 | 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); | 119 | int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); |
| 111 | 120 | ||
| 112 | /* | 121 | /* |
| 113 | * Methods to access the protection register area, present in some | 122 | * Methods to access the protection register area, present in some |
| 114 | * flash devices. The user data is one time programmable but the | 123 | * flash devices. The user data is one time programmable but the |
| 115 | * factory data is read only. | 124 | * factory data is read only. |
| 116 | */ | 125 | */ |
| 117 | int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len); | 126 | 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); | 127 | int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); |
| @@ -123,14 +132,14 @@ struct mtd_info { | |||
| 123 | 132 | ||
| 124 | /* kvec-based read/write methods. We need these especially for NAND flash, | 133 | /* kvec-based read/write methods. We need these especially for NAND flash, |
| 125 | with its limited number of write cycles per erase. | 134 | with its limited number of write cycles per erase. |
| 126 | NB: The 'count' parameter is the number of _vectors_, each of | 135 | NB: The 'count' parameter is the number of _vectors_, each of |
| 127 | which contains an (ofs, len) tuple. | 136 | which contains an (ofs, len) tuple. |
| 128 | */ | 137 | */ |
| 129 | int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen); | 138 | 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, | 139 | 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); | 140 | 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); | 141 | 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, | 142 | 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); | 143 | size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); |
| 135 | 144 | ||
| 136 | /* Sync */ | 145 | /* Sync */ |
| @@ -194,7 +203,7 @@ int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, | |||
| 194 | #define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args) | 203 | #define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args) |
| 195 | #define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args) | 204 | #define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args) |
| 196 | #define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args) | 205 | #define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args) |
| 197 | #define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0) | 206 | #define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0) |
| 198 | 207 | ||
| 199 | 208 | ||
| 200 | #ifdef CONFIG_MTD_PARTITIONS | 209 | #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 | ||
| 325 | struct nand_chip { | 326 | struct 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 { | |||
| 424 | extern struct nand_flash_dev nand_flash_ids[]; | 425 | extern struct nand_flash_dev nand_flash_ids[]; |
| 425 | extern struct nand_manufacturers nand_manuf_ids[]; | 426 | extern 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 */ | ||
| 23 | extern int onenand_scan(struct mtd_info *mtd, int max_chips); | ||
| 24 | /* Free resources held by the OneNAND device */ | ||
| 25 | extern void onenand_release(struct mtd_info *mtd); | ||
| 26 | |||
| 27 | /** | ||
| 28 | * onenand_state_t - chip states | ||
| 29 | * Enumeration for OneNAND flash chip state | ||
| 30 | */ | ||
| 31 | typedef 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 | */ | ||
| 48 | struct 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 | */ | ||
| 83 | struct 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 | */ | ||
| 150 | struct 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 | ||
| 39 | struct mtd_partition { | 39 | struct mtd_partition { |
| 40 | char *name; /* identifier string */ | 40 | char *name; /* identifier string */ |
| @@ -66,7 +66,7 @@ struct mtd_part_parser { | |||
| 66 | 66 | ||
| 67 | extern int register_mtd_parser(struct mtd_part_parser *parser); | 67 | extern int register_mtd_parser(struct mtd_part_parser *parser); |
| 68 | extern int deregister_mtd_parser(struct mtd_part_parser *parser); | 68 | extern int deregister_mtd_parser(struct mtd_part_parser *parser); |
| 69 | extern int parse_mtd_partitions(struct mtd_info *master, const char **types, | 69 | extern 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 | */ |
| 55 | void physmap_set_partitions(struct mtd_partition *parts, int num_parts); | 55 | void 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 *); | |||
| 39 | static void pmc551_unpoint(struct mtd_info *, u_char *, loff_t, size_t); | 39 | static void pmc551_unpoint(struct mtd_info *, u_char *, loff_t, size_t); |
| 40 | static int pmc551_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf); | 40 | static int pmc551_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf); |
| 41 | static int pmc551_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *); | 41 | static int pmc551_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *); |
| 42 | static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); | 42 | static 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/namei.h b/include/linux/namei.h index 1c975d0d9e94..455660eafba9 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
| @@ -74,7 +74,7 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); | |||
| 74 | extern void release_open_intent(struct nameidata *); | 74 | extern void release_open_intent(struct nameidata *); |
| 75 | 75 | ||
| 76 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); | 76 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); |
| 77 | extern struct dentry * lookup_hash(struct qstr *, struct dentry *); | 77 | extern struct dentry * lookup_hash(struct nameidata *); |
| 78 | 78 | ||
| 79 | extern int follow_down(struct vfsmount **, struct dentry **); | 79 | extern int follow_down(struct vfsmount **, struct dentry **); |
| 80 | extern int follow_up(struct vfsmount **, struct dentry **); | 80 | extern int follow_up(struct vfsmount **, struct dentry **); |
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 | ||
| 15 | extern int copy_namespace(int, struct task_struct *); | 16 | extern 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/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h new file mode 100644 index 000000000000..6d39b518486b --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
| @@ -0,0 +1,159 @@ | |||
| 1 | #ifndef _NF_CONNTRACK_COMMON_H | ||
| 2 | #define _NF_CONNTRACK_COMMON_H | ||
| 3 | /* Connection state tracking for netfilter. This is separated from, | ||
| 4 | but required by, the NAT layer; it can also be used by an iptables | ||
| 5 | extension. */ | ||
| 6 | enum ip_conntrack_info | ||
| 7 | { | ||
| 8 | /* Part of an established connection (either direction). */ | ||
| 9 | IP_CT_ESTABLISHED, | ||
| 10 | |||
| 11 | /* Like NEW, but related to an existing connection, or ICMP error | ||
| 12 | (in either direction). */ | ||
| 13 | IP_CT_RELATED, | ||
| 14 | |||
| 15 | /* Started a new connection to track (only | ||
| 16 | IP_CT_DIR_ORIGINAL); may be a retransmission. */ | ||
| 17 | IP_CT_NEW, | ||
| 18 | |||
| 19 | /* >= this indicates reply direction */ | ||
| 20 | IP_CT_IS_REPLY, | ||
| 21 | |||
| 22 | /* Number of distinct IP_CT types (no NEW in reply dirn). */ | ||
| 23 | IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1 | ||
| 24 | }; | ||
| 25 | |||
| 26 | /* Bitset representing status of connection. */ | ||
| 27 | enum ip_conntrack_status { | ||
| 28 | /* It's an expected connection: bit 0 set. This bit never changed */ | ||
| 29 | IPS_EXPECTED_BIT = 0, | ||
| 30 | IPS_EXPECTED = (1 << IPS_EXPECTED_BIT), | ||
| 31 | |||
| 32 | /* We've seen packets both ways: bit 1 set. Can be set, not unset. */ | ||
| 33 | IPS_SEEN_REPLY_BIT = 1, | ||
| 34 | IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT), | ||
| 35 | |||
| 36 | /* Conntrack should never be early-expired. */ | ||
| 37 | IPS_ASSURED_BIT = 2, | ||
| 38 | IPS_ASSURED = (1 << IPS_ASSURED_BIT), | ||
| 39 | |||
| 40 | /* Connection is confirmed: originating packet has left box */ | ||
| 41 | IPS_CONFIRMED_BIT = 3, | ||
| 42 | IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT), | ||
| 43 | |||
| 44 | /* Connection needs src nat in orig dir. This bit never changed. */ | ||
| 45 | IPS_SRC_NAT_BIT = 4, | ||
| 46 | IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT), | ||
| 47 | |||
| 48 | /* Connection needs dst nat in orig dir. This bit never changed. */ | ||
| 49 | IPS_DST_NAT_BIT = 5, | ||
| 50 | IPS_DST_NAT = (1 << IPS_DST_NAT_BIT), | ||
| 51 | |||
| 52 | /* Both together. */ | ||
| 53 | IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT), | ||
| 54 | |||
| 55 | /* Connection needs TCP sequence adjusted. */ | ||
| 56 | IPS_SEQ_ADJUST_BIT = 6, | ||
| 57 | IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT), | ||
| 58 | |||
| 59 | /* NAT initialization bits. */ | ||
| 60 | IPS_SRC_NAT_DONE_BIT = 7, | ||
| 61 | IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT), | ||
| 62 | |||
| 63 | IPS_DST_NAT_DONE_BIT = 8, | ||
| 64 | IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT), | ||
| 65 | |||
| 66 | /* Both together */ | ||
| 67 | IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE), | ||
| 68 | |||
| 69 | /* Connection is dying (removed from lists), can not be unset. */ | ||
| 70 | IPS_DYING_BIT = 9, | ||
| 71 | IPS_DYING = (1 << IPS_DYING_BIT), | ||
| 72 | }; | ||
| 73 | |||
| 74 | /* Connection tracking event bits */ | ||
| 75 | enum ip_conntrack_events | ||
| 76 | { | ||
| 77 | /* New conntrack */ | ||
| 78 | IPCT_NEW_BIT = 0, | ||
| 79 | IPCT_NEW = (1 << IPCT_NEW_BIT), | ||
| 80 | |||
| 81 | /* Expected connection */ | ||
| 82 | IPCT_RELATED_BIT = 1, | ||
| 83 | IPCT_RELATED = (1 << IPCT_RELATED_BIT), | ||
| 84 | |||
| 85 | /* Destroyed conntrack */ | ||
| 86 | IPCT_DESTROY_BIT = 2, | ||
| 87 | IPCT_DESTROY = (1 << IPCT_DESTROY_BIT), | ||
| 88 | |||
| 89 | /* Timer has been refreshed */ | ||
| 90 | IPCT_REFRESH_BIT = 3, | ||
| 91 | IPCT_REFRESH = (1 << IPCT_REFRESH_BIT), | ||
| 92 | |||
| 93 | /* Status has changed */ | ||
| 94 | IPCT_STATUS_BIT = 4, | ||
| 95 | IPCT_STATUS = (1 << IPCT_STATUS_BIT), | ||
| 96 | |||
| 97 | /* Update of protocol info */ | ||
| 98 | IPCT_PROTOINFO_BIT = 5, | ||
| 99 | IPCT_PROTOINFO = (1 << IPCT_PROTOINFO_BIT), | ||
| 100 | |||
| 101 | /* Volatile protocol info */ | ||
| 102 | IPCT_PROTOINFO_VOLATILE_BIT = 6, | ||
| 103 | IPCT_PROTOINFO_VOLATILE = (1 << IPCT_PROTOINFO_VOLATILE_BIT), | ||
| 104 | |||
| 105 | /* New helper for conntrack */ | ||
| 106 | IPCT_HELPER_BIT = 7, | ||
| 107 | IPCT_HELPER = (1 << IPCT_HELPER_BIT), | ||
| 108 | |||
| 109 | /* Update of helper info */ | ||
| 110 | IPCT_HELPINFO_BIT = 8, | ||
| 111 | IPCT_HELPINFO = (1 << IPCT_HELPINFO_BIT), | ||
| 112 | |||
| 113 | /* Volatile helper info */ | ||
| 114 | IPCT_HELPINFO_VOLATILE_BIT = 9, | ||
| 115 | IPCT_HELPINFO_VOLATILE = (1 << IPCT_HELPINFO_VOLATILE_BIT), | ||
| 116 | |||
| 117 | /* NAT info */ | ||
| 118 | IPCT_NATINFO_BIT = 10, | ||
| 119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), | ||
| 120 | |||
| 121 | /* Counter highest bit has been set */ | ||
| 122 | IPCT_COUNTER_FILLING_BIT = 11, | ||
| 123 | IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), | ||
| 124 | }; | ||
| 125 | |||
| 126 | enum ip_conntrack_expect_events { | ||
| 127 | IPEXP_NEW_BIT = 0, | ||
| 128 | IPEXP_NEW = (1 << IPEXP_NEW_BIT), | ||
| 129 | }; | ||
| 130 | |||
| 131 | #ifdef __KERNEL__ | ||
| 132 | struct ip_conntrack_counter | ||
| 133 | { | ||
| 134 | u_int32_t packets; | ||
| 135 | u_int32_t bytes; | ||
| 136 | }; | ||
| 137 | |||
| 138 | struct ip_conntrack_stat | ||
| 139 | { | ||
| 140 | unsigned int searched; | ||
| 141 | unsigned int found; | ||
| 142 | unsigned int new; | ||
| 143 | unsigned int invalid; | ||
| 144 | unsigned int ignore; | ||
| 145 | unsigned int delete; | ||
| 146 | unsigned int delete_list; | ||
| 147 | unsigned int insert; | ||
| 148 | unsigned int insert_failed; | ||
| 149 | unsigned int drop; | ||
| 150 | unsigned int early_drop; | ||
| 151 | unsigned int error; | ||
| 152 | unsigned int expect_new; | ||
| 153 | unsigned int expect_create; | ||
| 154 | unsigned int expect_delete; | ||
| 155 | }; | ||
| 156 | |||
| 157 | #endif /* __KERNEL__ */ | ||
| 158 | |||
| 159 | #endif /* _NF_CONNTRACK_COMMON_H */ | ||
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h new file mode 100644 index 000000000000..ad4a41c9ce93 --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_ftp.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #ifndef _NF_CONNTRACK_FTP_H | ||
| 2 | #define _NF_CONNTRACK_FTP_H | ||
| 3 | /* FTP tracking. */ | ||
| 4 | |||
| 5 | /* This enum is exposed to userspace */ | ||
| 6 | enum ip_ct_ftp_type | ||
| 7 | { | ||
| 8 | /* PORT command from client */ | ||
| 9 | IP_CT_FTP_PORT, | ||
| 10 | /* PASV response from server */ | ||
| 11 | IP_CT_FTP_PASV, | ||
| 12 | /* EPRT command from client */ | ||
| 13 | IP_CT_FTP_EPRT, | ||
| 14 | /* EPSV response from server */ | ||
| 15 | IP_CT_FTP_EPSV, | ||
| 16 | }; | ||
| 17 | |||
| 18 | #ifdef __KERNEL__ | ||
| 19 | |||
| 20 | #define FTP_PORT 21 | ||
| 21 | |||
| 22 | #define NUM_SEQ_TO_REMEMBER 2 | ||
| 23 | /* This structure exists only once per master */ | ||
| 24 | struct ip_ct_ftp_master { | ||
| 25 | /* Valid seq positions for cmd matching after newline */ | ||
| 26 | u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER]; | ||
| 27 | /* 0 means seq_match_aft_nl not set */ | ||
| 28 | int seq_aft_nl_num[IP_CT_DIR_MAX]; | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct ip_conntrack_expect; | ||
| 32 | |||
| 33 | /* For NAT to hook in when we find a packet which describes what other | ||
| 34 | * connection we should expect. */ | ||
| 35 | extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb, | ||
| 36 | enum ip_conntrack_info ctinfo, | ||
| 37 | enum ip_ct_ftp_type type, | ||
| 38 | unsigned int matchoff, | ||
| 39 | unsigned int matchlen, | ||
| 40 | struct ip_conntrack_expect *exp, | ||
| 41 | u32 *seq); | ||
| 42 | #endif /* __KERNEL__ */ | ||
| 43 | |||
| 44 | #endif /* _NF_CONNTRACK_FTP_H */ | ||
diff --git a/include/linux/netfilter/nf_conntrack_sctp.h b/include/linux/netfilter/nf_conntrack_sctp.h new file mode 100644 index 000000000000..b8994d9fd1a9 --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_sctp.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #ifndef _NF_CONNTRACK_SCTP_H | ||
| 2 | #define _NF_CONNTRACK_SCTP_H | ||
| 3 | /* SCTP tracking. */ | ||
| 4 | |||
| 5 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | ||
| 6 | |||
| 7 | enum sctp_conntrack { | ||
| 8 | SCTP_CONNTRACK_NONE, | ||
| 9 | SCTP_CONNTRACK_CLOSED, | ||
| 10 | SCTP_CONNTRACK_COOKIE_WAIT, | ||
| 11 | SCTP_CONNTRACK_COOKIE_ECHOED, | ||
| 12 | SCTP_CONNTRACK_ESTABLISHED, | ||
| 13 | SCTP_CONNTRACK_SHUTDOWN_SENT, | ||
| 14 | SCTP_CONNTRACK_SHUTDOWN_RECD, | ||
| 15 | SCTP_CONNTRACK_SHUTDOWN_ACK_SENT, | ||
| 16 | SCTP_CONNTRACK_MAX | ||
| 17 | }; | ||
| 18 | |||
| 19 | struct ip_ct_sctp | ||
| 20 | { | ||
| 21 | enum sctp_conntrack state; | ||
| 22 | |||
| 23 | u_int32_t vtag[IP_CT_DIR_MAX]; | ||
| 24 | u_int32_t ttag[IP_CT_DIR_MAX]; | ||
| 25 | }; | ||
| 26 | |||
| 27 | #endif /* _NF_CONNTRACK_SCTP_H */ | ||
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h new file mode 100644 index 000000000000..b2feeffde384 --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_tcp.h | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | #ifndef _NF_CONNTRACK_TCP_H | ||
| 2 | #define _NF_CONNTRACK_TCP_H | ||
| 3 | /* TCP tracking. */ | ||
| 4 | |||
| 5 | /* This is exposed to userspace (ctnetlink) */ | ||
| 6 | enum tcp_conntrack { | ||
| 7 | TCP_CONNTRACK_NONE, | ||
| 8 | TCP_CONNTRACK_SYN_SENT, | ||
| 9 | TCP_CONNTRACK_SYN_RECV, | ||
| 10 | TCP_CONNTRACK_ESTABLISHED, | ||
| 11 | TCP_CONNTRACK_FIN_WAIT, | ||
| 12 | TCP_CONNTRACK_CLOSE_WAIT, | ||
| 13 | TCP_CONNTRACK_LAST_ACK, | ||
| 14 | TCP_CONNTRACK_TIME_WAIT, | ||
| 15 | TCP_CONNTRACK_CLOSE, | ||
| 16 | TCP_CONNTRACK_LISTEN, | ||
| 17 | TCP_CONNTRACK_MAX, | ||
| 18 | TCP_CONNTRACK_IGNORE | ||
| 19 | }; | ||
| 20 | |||
| 21 | /* Window scaling is advertised by the sender */ | ||
| 22 | #define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01 | ||
| 23 | |||
| 24 | /* SACK is permitted by the sender */ | ||
| 25 | #define IP_CT_TCP_FLAG_SACK_PERM 0x02 | ||
| 26 | |||
| 27 | /* This sender sent FIN first */ | ||
| 28 | #define IP_CT_TCP_FLAG_CLOSE_INIT 0x03 | ||
| 29 | |||
| 30 | #ifdef __KERNEL__ | ||
| 31 | |||
| 32 | struct ip_ct_tcp_state { | ||
| 33 | u_int32_t td_end; /* max of seq + len */ | ||
| 34 | u_int32_t td_maxend; /* max of ack + max(win, 1) */ | ||
| 35 | u_int32_t td_maxwin; /* max(win) */ | ||
| 36 | u_int8_t td_scale; /* window scale factor */ | ||
| 37 | u_int8_t loose; /* used when connection picked up from the middle */ | ||
| 38 | u_int8_t flags; /* per direction options */ | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct ip_ct_tcp | ||
| 42 | { | ||
| 43 | struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */ | ||
| 44 | u_int8_t state; /* state of the connection (enum tcp_conntrack) */ | ||
| 45 | /* For detecting stale connections */ | ||
| 46 | u_int8_t last_dir; /* Direction of the last packet (enum ip_conntrack_dir) */ | ||
| 47 | u_int8_t retrans; /* Number of retransmitted packets */ | ||
| 48 | u_int8_t last_index; /* Index of the last packet */ | ||
| 49 | u_int32_t last_seq; /* Last sequence number seen in dir */ | ||
| 50 | u_int32_t last_ack; /* Last sequence number seen in opposite dir */ | ||
| 51 | u_int32_t last_end; /* Last seq + len */ | ||
| 52 | }; | ||
| 53 | |||
| 54 | #endif /* __KERNEL__ */ | ||
| 55 | |||
| 56 | #endif /* _NF_CONNTRACK_TCP_H */ | ||
diff --git a/include/linux/netfilter/nf_conntrack_tuple_common.h b/include/linux/netfilter/nf_conntrack_tuple_common.h new file mode 100644 index 000000000000..8e145f0d61cb --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_tuple_common.h | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #ifndef _NF_CONNTRACK_TUPLE_COMMON_H | ||
| 2 | #define _NF_CONNTRACK_TUPLE_COMMON_H | ||
| 3 | |||
| 4 | enum ip_conntrack_dir | ||
| 5 | { | ||
| 6 | IP_CT_DIR_ORIGINAL, | ||
| 7 | IP_CT_DIR_REPLY, | ||
| 8 | IP_CT_DIR_MAX | ||
| 9 | }; | ||
| 10 | |||
| 11 | #define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL) | ||
| 12 | |||
| 13 | #endif /* _NF_CONNTRACK_TUPLE_COMMON_H */ | ||
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index f08e870100f4..72975fa8795d 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
| @@ -146,7 +146,7 @@ extern void nfnl_unlock(void); | |||
| 146 | extern int nfnetlink_subsys_register(struct nfnetlink_subsystem *n); | 146 | extern int nfnetlink_subsys_register(struct nfnetlink_subsystem *n); |
| 147 | extern int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n); | 147 | extern int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n); |
| 148 | 148 | ||
| 149 | extern int nfattr_parse(struct nfattr *tb[], int maxattr, | 149 | extern void nfattr_parse(struct nfattr *tb[], int maxattr, |
| 150 | struct nfattr *nfa, int len); | 150 | struct nfattr *nfa, int len); |
| 151 | 151 | ||
| 152 | #define nfattr_parse_nested(tb, max, nfa) \ | 152 | #define nfattr_parse_nested(tb, max, nfa) \ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index d078bb91d9e5..b3432ab59a17 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
| @@ -1,132 +1,7 @@ | |||
| 1 | #ifndef _IP_CONNTRACK_H | 1 | #ifndef _IP_CONNTRACK_H |
| 2 | #define _IP_CONNTRACK_H | 2 | #define _IP_CONNTRACK_H |
| 3 | /* Connection state tracking for netfilter. This is separated from, | ||
| 4 | but required by, the NAT layer; it can also be used by an iptables | ||
| 5 | extension. */ | ||
| 6 | enum ip_conntrack_info | ||
| 7 | { | ||
| 8 | /* Part of an established connection (either direction). */ | ||
| 9 | IP_CT_ESTABLISHED, | ||
| 10 | |||
| 11 | /* Like NEW, but related to an existing connection, or ICMP error | ||
| 12 | (in either direction). */ | ||
| 13 | IP_CT_RELATED, | ||
| 14 | |||
| 15 | /* Started a new connection to track (only | ||
| 16 | IP_CT_DIR_ORIGINAL); may be a retransmission. */ | ||
| 17 | IP_CT_NEW, | ||
| 18 | |||
| 19 | /* >= this indicates reply direction */ | ||
| 20 | IP_CT_IS_REPLY, | ||
| 21 | |||
| 22 | /* Number of distinct IP_CT types (no NEW in reply dirn). */ | ||
| 23 | IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1 | ||
| 24 | }; | ||
| 25 | |||
| 26 | /* Bitset representing status of connection. */ | ||
| 27 | enum ip_conntrack_status { | ||
| 28 | /* It's an expected connection: bit 0 set. This bit never changed */ | ||
| 29 | IPS_EXPECTED_BIT = 0, | ||
| 30 | IPS_EXPECTED = (1 << IPS_EXPECTED_BIT), | ||
| 31 | |||
| 32 | /* We've seen packets both ways: bit 1 set. Can be set, not unset. */ | ||
| 33 | IPS_SEEN_REPLY_BIT = 1, | ||
| 34 | IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT), | ||
| 35 | |||
| 36 | /* Conntrack should never be early-expired. */ | ||
| 37 | IPS_ASSURED_BIT = 2, | ||
| 38 | IPS_ASSURED = (1 << IPS_ASSURED_BIT), | ||
| 39 | |||
| 40 | /* Connection is confirmed: originating packet has left box */ | ||
| 41 | IPS_CONFIRMED_BIT = 3, | ||
| 42 | IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT), | ||
| 43 | |||
| 44 | /* Connection needs src nat in orig dir. This bit never changed. */ | ||
| 45 | IPS_SRC_NAT_BIT = 4, | ||
| 46 | IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT), | ||
| 47 | |||
| 48 | /* Connection needs dst nat in orig dir. This bit never changed. */ | ||
| 49 | IPS_DST_NAT_BIT = 5, | ||
| 50 | IPS_DST_NAT = (1 << IPS_DST_NAT_BIT), | ||
| 51 | |||
| 52 | /* Both together. */ | ||
| 53 | IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT), | ||
| 54 | |||
| 55 | /* Connection needs TCP sequence adjusted. */ | ||
| 56 | IPS_SEQ_ADJUST_BIT = 6, | ||
| 57 | IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT), | ||
| 58 | |||
| 59 | /* NAT initialization bits. */ | ||
| 60 | IPS_SRC_NAT_DONE_BIT = 7, | ||
| 61 | IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT), | ||
| 62 | |||
| 63 | IPS_DST_NAT_DONE_BIT = 8, | ||
| 64 | IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT), | ||
| 65 | |||
| 66 | /* Both together */ | ||
| 67 | IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE), | ||
| 68 | |||
| 69 | /* Connection is dying (removed from lists), can not be unset. */ | ||
| 70 | IPS_DYING_BIT = 9, | ||
| 71 | IPS_DYING = (1 << IPS_DYING_BIT), | ||
| 72 | }; | ||
| 73 | |||
| 74 | /* Connection tracking event bits */ | ||
| 75 | enum ip_conntrack_events | ||
| 76 | { | ||
| 77 | /* New conntrack */ | ||
| 78 | IPCT_NEW_BIT = 0, | ||
| 79 | IPCT_NEW = (1 << IPCT_NEW_BIT), | ||
| 80 | |||
| 81 | /* Expected connection */ | ||
| 82 | IPCT_RELATED_BIT = 1, | ||
| 83 | IPCT_RELATED = (1 << IPCT_RELATED_BIT), | ||
| 84 | |||
| 85 | /* Destroyed conntrack */ | ||
| 86 | IPCT_DESTROY_BIT = 2, | ||
| 87 | IPCT_DESTROY = (1 << IPCT_DESTROY_BIT), | ||
| 88 | |||
| 89 | /* Timer has been refreshed */ | ||
| 90 | IPCT_REFRESH_BIT = 3, | ||
| 91 | IPCT_REFRESH = (1 << IPCT_REFRESH_BIT), | ||
| 92 | |||
| 93 | /* Status has changed */ | ||
| 94 | IPCT_STATUS_BIT = 4, | ||
| 95 | IPCT_STATUS = (1 << IPCT_STATUS_BIT), | ||
| 96 | |||
| 97 | /* Update of protocol info */ | ||
| 98 | IPCT_PROTOINFO_BIT = 5, | ||
| 99 | IPCT_PROTOINFO = (1 << IPCT_PROTOINFO_BIT), | ||
| 100 | |||
| 101 | /* Volatile protocol info */ | ||
| 102 | IPCT_PROTOINFO_VOLATILE_BIT = 6, | ||
| 103 | IPCT_PROTOINFO_VOLATILE = (1 << IPCT_PROTOINFO_VOLATILE_BIT), | ||
| 104 | |||
| 105 | /* New helper for conntrack */ | ||
| 106 | IPCT_HELPER_BIT = 7, | ||
| 107 | IPCT_HELPER = (1 << IPCT_HELPER_BIT), | ||
| 108 | |||
| 109 | /* Update of helper info */ | ||
| 110 | IPCT_HELPINFO_BIT = 8, | ||
| 111 | IPCT_HELPINFO = (1 << IPCT_HELPINFO_BIT), | ||
| 112 | |||
| 113 | /* Volatile helper info */ | ||
| 114 | IPCT_HELPINFO_VOLATILE_BIT = 9, | ||
| 115 | IPCT_HELPINFO_VOLATILE = (1 << IPCT_HELPINFO_VOLATILE_BIT), | ||
| 116 | 3 | ||
| 117 | /* NAT info */ | 4 | #include <linux/netfilter/nf_conntrack_common.h> |
| 118 | IPCT_NATINFO_BIT = 10, | ||
| 119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), | ||
| 120 | |||
| 121 | /* Counter highest bit has been set */ | ||
| 122 | IPCT_COUNTER_FILLING_BIT = 11, | ||
| 123 | IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), | ||
| 124 | }; | ||
| 125 | |||
| 126 | enum ip_conntrack_expect_events { | ||
| 127 | IPEXP_NEW_BIT = 0, | ||
| 128 | IPEXP_NEW = (1 << IPEXP_NEW_BIT), | ||
| 129 | }; | ||
| 130 | 5 | ||
| 131 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
| 132 | #include <linux/config.h> | 7 | #include <linux/config.h> |
| @@ -194,12 +69,6 @@ do { \ | |||
| 194 | #define IP_NF_ASSERT(x) | 69 | #define IP_NF_ASSERT(x) |
| 195 | #endif | 70 | #endif |
| 196 | 71 | ||
| 197 | struct ip_conntrack_counter | ||
| 198 | { | ||
| 199 | u_int32_t packets; | ||
| 200 | u_int32_t bytes; | ||
| 201 | }; | ||
| 202 | |||
| 203 | struct ip_conntrack_helper; | 72 | struct ip_conntrack_helper; |
| 204 | 73 | ||
| 205 | struct ip_conntrack | 74 | struct ip_conntrack |
| @@ -426,25 +295,6 @@ static inline int is_dying(struct ip_conntrack *ct) | |||
| 426 | 295 | ||
| 427 | extern unsigned int ip_conntrack_htable_size; | 296 | extern unsigned int ip_conntrack_htable_size; |
| 428 | 297 | ||
| 429 | struct ip_conntrack_stat | ||
| 430 | { | ||
| 431 | unsigned int searched; | ||
| 432 | unsigned int found; | ||
| 433 | unsigned int new; | ||
| 434 | unsigned int invalid; | ||
| 435 | unsigned int ignore; | ||
| 436 | unsigned int delete; | ||
| 437 | unsigned int delete_list; | ||
| 438 | unsigned int insert; | ||
| 439 | unsigned int insert_failed; | ||
| 440 | unsigned int drop; | ||
| 441 | unsigned int early_drop; | ||
| 442 | unsigned int error; | ||
| 443 | unsigned int expect_new; | ||
| 444 | unsigned int expect_create; | ||
| 445 | unsigned int expect_delete; | ||
| 446 | }; | ||
| 447 | |||
| 448 | #define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) | 298 | #define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) |
| 449 | 299 | ||
| 450 | #ifdef CONFIG_IP_NF_CONNTRACK_EVENTS | 300 | #ifdef CONFIG_IP_NF_CONNTRACK_EVENTS |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_ftp.h b/include/linux/netfilter_ipv4/ip_conntrack_ftp.h index 5f06429b9047..63811934de4d 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_ftp.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_ftp.h | |||
| @@ -1,43 +1,6 @@ | |||
| 1 | #ifndef _IP_CONNTRACK_FTP_H | 1 | #ifndef _IP_CONNTRACK_FTP_H |
| 2 | #define _IP_CONNTRACK_FTP_H | 2 | #define _IP_CONNTRACK_FTP_H |
| 3 | /* FTP tracking. */ | ||
| 4 | 3 | ||
| 5 | #ifdef __KERNEL__ | 4 | #include <linux/netfilter/nf_conntrack_ftp.h> |
| 6 | 5 | ||
| 7 | #define FTP_PORT 21 | ||
| 8 | |||
| 9 | #endif /* __KERNEL__ */ | ||
| 10 | |||
| 11 | enum ip_ct_ftp_type | ||
| 12 | { | ||
| 13 | /* PORT command from client */ | ||
| 14 | IP_CT_FTP_PORT, | ||
| 15 | /* PASV response from server */ | ||
| 16 | IP_CT_FTP_PASV, | ||
| 17 | /* EPRT command from client */ | ||
| 18 | IP_CT_FTP_EPRT, | ||
| 19 | /* EPSV response from server */ | ||
| 20 | IP_CT_FTP_EPSV, | ||
| 21 | }; | ||
| 22 | |||
| 23 | #define NUM_SEQ_TO_REMEMBER 2 | ||
| 24 | /* This structure exists only once per master */ | ||
| 25 | struct ip_ct_ftp_master { | ||
| 26 | /* Valid seq positions for cmd matching after newline */ | ||
| 27 | u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER]; | ||
| 28 | /* 0 means seq_match_aft_nl not set */ | ||
| 29 | int seq_aft_nl_num[IP_CT_DIR_MAX]; | ||
| 30 | }; | ||
| 31 | |||
| 32 | struct ip_conntrack_expect; | ||
| 33 | |||
| 34 | /* For NAT to hook in when we find a packet which describes what other | ||
| 35 | * connection we should expect. */ | ||
| 36 | extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb, | ||
| 37 | enum ip_conntrack_info ctinfo, | ||
| 38 | enum ip_ct_ftp_type type, | ||
| 39 | unsigned int matchoff, | ||
| 40 | unsigned int matchlen, | ||
| 41 | struct ip_conntrack_expect *exp, | ||
| 42 | u32 *seq); | ||
| 43 | #endif /* _IP_CONNTRACK_FTP_H */ | 6 | #endif /* _IP_CONNTRACK_FTP_H */ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_icmp.h b/include/linux/netfilter_ipv4/ip_conntrack_icmp.h index f1664abbe392..eed5ee3e4744 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_icmp.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_icmp.h | |||
| @@ -1,11 +1,6 @@ | |||
| 1 | #ifndef _IP_CONNTRACK_ICMP_H | 1 | #ifndef _IP_CONNTRACK_ICMP_H |
| 2 | #define _IP_CONNTRACK_ICMP_H | 2 | #define _IP_CONNTRACK_ICMP_H |
| 3 | /* ICMP tracking. */ | ||
| 4 | #include <asm/atomic.h> | ||
| 5 | 3 | ||
| 6 | struct ip_ct_icmp | 4 | #include <net/netfilter/ipv4/nf_conntrack_icmp.h> |
| 7 | { | 5 | |
| 8 | /* Optimization: when number in == number out, forget immediately. */ | ||
| 9 | atomic_t count; | ||
| 10 | }; | ||
| 11 | #endif /* _IP_CONNTRACK_ICMP_H */ | 6 | #endif /* _IP_CONNTRACK_ICMP_H */ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_sctp.h b/include/linux/netfilter_ipv4/ip_conntrack_sctp.h index 7a8d869321f7..4099a041a32a 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_sctp.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_sctp.h | |||
| @@ -1,25 +1,6 @@ | |||
| 1 | #ifndef _IP_CONNTRACK_SCTP_H | 1 | #ifndef _IP_CONNTRACK_SCTP_H |
| 2 | #define _IP_CONNTRACK_SCTP_H | 2 | #define _IP_CONNTRACK_SCTP_H |
| 3 | /* SCTP tracking. */ | ||
| 4 | 3 | ||
| 5 | enum sctp_conntrack { | 4 | #include <linux/netfilter/nf_conntrack_sctp.h> |
| 6 | SCTP_CONNTRACK_NONE, | ||
| 7 | SCTP_CONNTRACK_CLOSED, | ||
| 8 | SCTP_CONNTRACK_COOKIE_WAIT, | ||
| 9 | SCTP_CONNTRACK_COOKIE_ECHOED, | ||
| 10 | SCTP_CONNTRACK_ESTABLISHED, | ||
| 11 | SCTP_CONNTRACK_SHUTDOWN_SENT, | ||
| 12 | SCTP_CONNTRACK_SHUTDOWN_RECD, | ||
| 13 | SCTP_CONNTRACK_SHUTDOWN_ACK_SENT, | ||
| 14 | SCTP_CONNTRACK_MAX | ||
| 15 | }; | ||
| 16 | |||
| 17 | struct ip_ct_sctp | ||
| 18 | { | ||
| 19 | enum sctp_conntrack state; | ||
| 20 | |||
| 21 | u_int32_t vtag[IP_CT_DIR_MAX]; | ||
| 22 | u_int32_t ttag[IP_CT_DIR_MAX]; | ||
| 23 | }; | ||
| 24 | 5 | ||
| 25 | #endif /* _IP_CONNTRACK_SCTP_H */ | 6 | #endif /* _IP_CONNTRACK_SCTP_H */ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tcp.h b/include/linux/netfilter_ipv4/ip_conntrack_tcp.h index 16da044d97a7..876b8fb17e68 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tcp.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tcp.h | |||
| @@ -1,51 +1,6 @@ | |||
| 1 | #ifndef _IP_CONNTRACK_TCP_H | 1 | #ifndef _IP_CONNTRACK_TCP_H |
| 2 | #define _IP_CONNTRACK_TCP_H | 2 | #define _IP_CONNTRACK_TCP_H |
| 3 | /* TCP tracking. */ | ||
| 4 | 3 | ||
| 5 | enum tcp_conntrack { | 4 | #include <linux/netfilter/nf_conntrack_tcp.h> |
| 6 | TCP_CONNTRACK_NONE, | ||
| 7 | TCP_CONNTRACK_SYN_SENT, | ||
| 8 | TCP_CONNTRACK_SYN_RECV, | ||
| 9 | TCP_CONNTRACK_ESTABLISHED, | ||
| 10 | TCP_CONNTRACK_FIN_WAIT, | ||
| 11 | TCP_CONNTRACK_CLOSE_WAIT, | ||
| 12 | TCP_CONNTRACK_LAST_ACK, | ||
| 13 | TCP_CONNTRACK_TIME_WAIT, | ||
| 14 | TCP_CONNTRACK_CLOSE, | ||
| 15 | TCP_CONNTRACK_LISTEN, | ||
| 16 | TCP_CONNTRACK_MAX, | ||
| 17 | TCP_CONNTRACK_IGNORE | ||
| 18 | }; | ||
| 19 | |||
| 20 | /* Window scaling is advertised by the sender */ | ||
| 21 | #define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01 | ||
| 22 | |||
| 23 | /* SACK is permitted by the sender */ | ||
| 24 | #define IP_CT_TCP_FLAG_SACK_PERM 0x02 | ||
| 25 | |||
| 26 | /* This sender sent FIN first */ | ||
| 27 | #define IP_CT_TCP_FLAG_CLOSE_INIT 0x03 | ||
| 28 | |||
| 29 | struct ip_ct_tcp_state { | ||
| 30 | u_int32_t td_end; /* max of seq + len */ | ||
| 31 | u_int32_t td_maxend; /* max of ack + max(win, 1) */ | ||
| 32 | u_int32_t td_maxwin; /* max(win) */ | ||
| 33 | u_int8_t td_scale; /* window scale factor */ | ||
| 34 | u_int8_t loose; /* used when connection picked up from the middle */ | ||
| 35 | u_int8_t flags; /* per direction options */ | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct ip_ct_tcp | ||
| 39 | { | ||
| 40 | struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */ | ||
| 41 | u_int8_t state; /* state of the connection (enum tcp_conntrack) */ | ||
| 42 | /* For detecting stale connections */ | ||
| 43 | u_int8_t last_dir; /* Direction of the last packet (enum ip_conntrack_dir) */ | ||
| 44 | u_int8_t retrans; /* Number of retransmitted packets */ | ||
| 45 | u_int8_t last_index; /* Index of the last packet */ | ||
| 46 | u_int32_t last_seq; /* Last sequence number seen in dir */ | ||
| 47 | u_int32_t last_ack; /* Last sequence number seen in opposite dir */ | ||
| 48 | u_int32_t last_end; /* Last seq + len */ | ||
| 49 | }; | ||
| 50 | 5 | ||
| 51 | #endif /* _IP_CONNTRACK_TCP_H */ | 6 | #endif /* _IP_CONNTRACK_TCP_H */ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h index 3232db11a4e5..2fdabdb4c0ef 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _IP_CONNTRACK_TUPLE_H | 2 | #define _IP_CONNTRACK_TUPLE_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | ||
| 5 | 6 | ||
| 6 | /* A `tuple' is a structure containing the information to uniquely | 7 | /* A `tuple' is a structure containing the information to uniquely |
| 7 | identify a connection. ie. if two packets have the same tuple, they | 8 | identify a connection. ie. if two packets have the same tuple, they |
| @@ -88,13 +89,6 @@ struct ip_conntrack_tuple | |||
| 88 | (tuple)->dst.u.all = 0; \ | 89 | (tuple)->dst.u.all = 0; \ |
| 89 | } while (0) | 90 | } while (0) |
| 90 | 91 | ||
| 91 | enum ip_conntrack_dir | ||
| 92 | { | ||
| 93 | IP_CT_DIR_ORIGINAL, | ||
| 94 | IP_CT_DIR_REPLY, | ||
| 95 | IP_CT_DIR_MAX | ||
| 96 | }; | ||
| 97 | |||
| 98 | #ifdef __KERNEL__ | 92 | #ifdef __KERNEL__ |
| 99 | 93 | ||
| 100 | #define DUMP_TUPLE(tp) \ | 94 | #define DUMP_TUPLE(tp) \ |
| @@ -103,8 +97,6 @@ DEBUGP("tuple %p: %u %u.%u.%u.%u:%hu -> %u.%u.%u.%u:%hu\n", \ | |||
| 103 | NIPQUAD((tp)->src.ip), ntohs((tp)->src.u.all), \ | 97 | NIPQUAD((tp)->src.ip), ntohs((tp)->src.u.all), \ |
| 104 | NIPQUAD((tp)->dst.ip), ntohs((tp)->dst.u.all)) | 98 | NIPQUAD((tp)->dst.ip), ntohs((tp)->dst.u.all)) |
| 105 | 99 | ||
| 106 | #define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL) | ||
| 107 | |||
| 108 | /* If we're the first tuple, it's the original dir. */ | 100 | /* If we're the first tuple, it's the original dir. */ |
| 109 | #define DIRECTION(h) ((enum ip_conntrack_dir)(h)->tuple.dst.dir) | 101 | #define DIRECTION(h) ((enum ip_conntrack_dir)(h)->tuple.dst.dir) |
| 110 | 102 | ||
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index edcc2c6eb5c7..53b2983f6278 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
| @@ -59,6 +59,7 @@ | |||
| 59 | 59 | ||
| 60 | enum nf_ip6_hook_priorities { | 60 | enum nf_ip6_hook_priorities { |
| 61 | NF_IP6_PRI_FIRST = INT_MIN, | 61 | NF_IP6_PRI_FIRST = INT_MIN, |
| 62 | NF_IP6_PRI_CONNTRACK_DEFRAG = -400, | ||
| 62 | NF_IP6_PRI_SELINUX_FIRST = -225, | 63 | NF_IP6_PRI_SELINUX_FIRST = -225, |
| 63 | NF_IP6_PRI_CONNTRACK = -200, | 64 | NF_IP6_PRI_CONNTRACK = -200, |
| 64 | NF_IP6_PRI_BRIDGE_SABOTAGE_FORWARD = -175, | 65 | NF_IP6_PRI_BRIDGE_SABOTAGE_FORWARD = -175, |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index ba25ca874c20..6a2ccf78a356 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
| @@ -71,7 +71,8 @@ struct nlmsghdr | |||
| 71 | 71 | ||
| 72 | #define NLMSG_ALIGNTO 4 | 72 | #define NLMSG_ALIGNTO 4 |
| 73 | #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) | 73 | #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) |
| 74 | #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(sizeof(struct nlmsghdr))) | 74 | #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) |
| 75 | #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN)) | ||
| 75 | #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) | 76 | #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) |
| 76 | #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) | 77 | #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) |
| 77 | #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ | 78 | #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ |
| @@ -86,6 +87,8 @@ struct nlmsghdr | |||
| 86 | #define NLMSG_DONE 0x3 /* End of a dump */ | 87 | #define NLMSG_DONE 0x3 /* End of a dump */ |
| 87 | #define NLMSG_OVERRUN 0x4 /* Data lost */ | 88 | #define NLMSG_OVERRUN 0x4 /* Data lost */ |
| 88 | 89 | ||
| 90 | #define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */ | ||
| 91 | |||
| 89 | struct nlmsgerr | 92 | struct nlmsgerr |
| 90 | { | 93 | { |
| 91 | int error; | 94 | int error; |
| @@ -108,6 +111,25 @@ enum { | |||
| 108 | NETLINK_CONNECTED, | 111 | NETLINK_CONNECTED, |
| 109 | }; | 112 | }; |
| 110 | 113 | ||
| 114 | /* | ||
| 115 | * <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)--> | ||
| 116 | * +---------------------+- - -+- - - - - - - - - -+- - -+ | ||
| 117 | * | Header | Pad | Payload | Pad | | ||
| 118 | * | (struct nlattr) | ing | | ing | | ||
| 119 | * +---------------------+- - -+- - - - - - - - - -+- - -+ | ||
| 120 | * <-------------- nlattr->nla_len --------------> | ||
| 121 | */ | ||
| 122 | |||
| 123 | struct nlattr | ||
| 124 | { | ||
| 125 | __u16 nla_len; | ||
| 126 | __u16 nla_type; | ||
| 127 | }; | ||
| 128 | |||
| 129 | #define NLA_ALIGNTO 4 | ||
| 130 | #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) | ||
| 131 | #define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr))) | ||
| 132 | |||
| 111 | #ifdef __KERNEL__ | 133 | #ifdef __KERNEL__ |
| 112 | 134 | ||
| 113 | #include <linux/capability.h> | 135 | #include <linux/capability.h> |
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); | |||
| 60 | extern struct svc_program nfsd_program; | 60 | extern struct svc_program nfsd_program; |
| 61 | extern struct svc_version nfsd_version2, nfsd_version3, | 61 | extern struct svc_version nfsd_version2, nfsd_version3, |
| 62 | nfsd_version4; | 62 | nfsd_version4; |
| 63 | 63 | extern 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 */ |
| 43 | struct nfsctl_svc { | 58 | struct nfsctl_svc { |
| 44 | unsigned short svc_port; | 59 | unsigned short svc_port; |
| @@ -120,6 +135,8 @@ extern int exp_delclient(struct nfsctl_client *ncp); | |||
| 120 | extern int exp_export(struct nfsctl_export *nxp); | 135 | extern int exp_export(struct nfsctl_export *nxp); |
| 121 | extern int exp_unexport(struct nfsctl_export *nxp); | 136 | extern int exp_unexport(struct nfsctl_export *nxp); |
| 122 | 137 | ||
| 138 | extern 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 88de3f8ce1a2..4e06eb0f4451 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -387,6 +387,7 @@ | |||
| 387 | #define PCI_DEVICE_ID_NS_SC1100_SMI 0x0511 | 387 | #define PCI_DEVICE_ID_NS_SC1100_SMI 0x0511 |
| 388 | #define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515 | 388 | #define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515 |
| 389 | #define PCI_DEVICE_ID_NS_87410 0xd001 | 389 | #define PCI_DEVICE_ID_NS_87410 0xd001 |
| 390 | #define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d | ||
| 390 | 391 | ||
| 391 | #define PCI_VENDOR_ID_TSENG 0x100c | 392 | #define PCI_VENDOR_ID_TSENG 0x100c |
| 392 | #define PCI_DEVICE_ID_TSENG_W32P_2 0x3202 | 393 | #define PCI_DEVICE_ID_TSENG_W32P_2 0x3202 |
| @@ -487,6 +488,8 @@ | |||
| 487 | #define PCI_DEVICE_ID_AMD_8151_0 0x7454 | 488 | #define PCI_DEVICE_ID_AMD_8151_0 0x7454 |
| 488 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7450 | 489 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7450 |
| 489 | 490 | ||
| 491 | #define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A | ||
| 492 | |||
| 490 | #define PCI_VENDOR_ID_TRIDENT 0x1023 | 493 | #define PCI_VENDOR_ID_TRIDENT 0x1023 |
| 491 | #define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 | 494 | #define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 |
| 492 | #define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001 | 495 | #define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001 |
| @@ -519,6 +522,7 @@ | |||
| 519 | #define PCI_DEVICE_ID_MATROX_MIL 0x0519 | 522 | #define PCI_DEVICE_ID_MATROX_MIL 0x0519 |
| 520 | #define PCI_DEVICE_ID_MATROX_MYS 0x051A | 523 | #define PCI_DEVICE_ID_MATROX_MYS 0x051A |
| 521 | #define PCI_DEVICE_ID_MATROX_MIL_2 0x051b | 524 | #define PCI_DEVICE_ID_MATROX_MIL_2 0x051b |
| 525 | #define PCI_DEVICE_ID_MATROX_MYS_AGP 0x051e | ||
| 522 | #define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f | 526 | #define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f |
| 523 | #define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10 | 527 | #define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10 |
| 524 | #define PCI_DEVICE_ID_MATROX_G100_MM 0x1000 | 528 | #define PCI_DEVICE_ID_MATROX_G100_MM 0x1000 |
| @@ -1785,6 +1789,7 @@ | |||
| 1785 | #define PCI_DEVICE_ID_TIGON3_5704 0x1648 | 1789 | #define PCI_DEVICE_ID_TIGON3_5704 0x1648 |
| 1786 | #define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649 | 1790 | #define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649 |
| 1787 | #define PCI_DEVICE_ID_NX2_5706 0x164a | 1791 | #define PCI_DEVICE_ID_NX2_5706 0x164a |
| 1792 | #define PCI_DEVICE_ID_NX2_5708 0x164c | ||
| 1788 | #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d | 1793 | #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d |
| 1789 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 | 1794 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 |
| 1790 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 | 1795 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 |
| @@ -1809,6 +1814,7 @@ | |||
| 1809 | #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 | 1814 | #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 |
| 1810 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 | 1815 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 |
| 1811 | #define PCI_DEVICE_ID_NX2_5706S 0x16aa | 1816 | #define PCI_DEVICE_ID_NX2_5706S 0x16aa |
| 1817 | #define PCI_DEVICE_ID_NX2_5708S 0x16ac | ||
| 1812 | #define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 | 1818 | #define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 |
| 1813 | #define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 | 1819 | #define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 |
| 1814 | #define PCI_DEVICE_ID_TIGON3_5781 0x16dd | 1820 | #define PCI_DEVICE_ID_TIGON3_5781 0x16dd |
diff --git a/include/linux/phonedev.h b/include/linux/phonedev.h index d54049eed0c3..a0e31adf3abe 100644 --- a/include/linux/phonedev.h +++ b/include/linux/phonedev.h | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | #define __LINUX_PHONEDEV_H | 2 | #define __LINUX_PHONEDEV_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/version.h> | ||
| 6 | 5 | ||
| 7 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
| 8 | 7 | ||
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 | ||
| 97 | struct tc_prio_qopt | 98 | struct 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 | ||
| 174 | struct tc_red_xstats | 176 | struct 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 | ||
| 198 | struct tc_gred_qopt | 199 | struct 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 */ |
| 222 | struct tc_gred_sopt | 220 | struct 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/platform_device.h b/include/linux/platform_device.h index a726225e0afe..1a165b7ae01b 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -37,4 +37,10 @@ extern int platform_add_devices(struct platform_device **, int); | |||
| 37 | 37 | ||
| 38 | extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int); | 38 | extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int); |
| 39 | 39 | ||
| 40 | extern struct platform_device *platform_device_alloc(const char *name, unsigned int id); | ||
| 41 | extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); | ||
| 42 | extern int platform_device_add_data(struct platform_device *pdev, void *data, size_t size); | ||
| 43 | extern int platform_device_add(struct platform_device *pdev); | ||
| 44 | extern void platform_device_put(struct platform_device *pdev); | ||
| 45 | |||
| 40 | #endif /* _PLATFORM_DEVICE_H_ */ | 46 | #endif /* _PLATFORM_DEVICE_H_ */ |
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 { | |||
| 353 | int pnp_register_protocol(struct pnp_protocol *protocol); | 353 | int pnp_register_protocol(struct pnp_protocol *protocol); |
| 354 | void pnp_unregister_protocol(struct pnp_protocol *protocol); | 354 | void pnp_unregister_protocol(struct pnp_protocol *protocol); |
| 355 | int pnp_add_device(struct pnp_dev *dev); | 355 | int pnp_add_device(struct pnp_dev *dev); |
| 356 | void pnp_remove_device(struct pnp_dev *dev); | ||
| 357 | int pnp_device_attach(struct pnp_dev *pnp_dev); | 356 | int pnp_device_attach(struct pnp_dev *pnp_dev); |
| 358 | void pnp_device_detach(struct pnp_dev *pnp_dev); | 357 | void pnp_device_detach(struct pnp_dev *pnp_dev); |
| 359 | extern struct list_head pnp_global; | 358 | extern struct list_head pnp_global; |
| @@ -399,7 +398,6 @@ static inline int pnp_register_protocol(struct pnp_protocol *protocol) { return | |||
| 399 | static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { } | 398 | static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { } |
| 400 | static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } | 399 | static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } |
| 401 | static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } | 400 | static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } |
| 402 | static inline void pnp_remove_device(struct pnp_dev *dev) { } | ||
| 403 | static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } | 401 | static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } |
| 404 | static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } | 402 | static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } |
| 405 | 403 | ||
diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h index 7227e653b3be..e86a7a5cf355 100644 --- a/include/linux/ppp-comp.h +++ b/include/linux/ppp-comp.h | |||
| @@ -111,6 +111,8 @@ struct compressor { | |||
| 111 | 111 | ||
| 112 | /* Used in locking compressor modules */ | 112 | /* Used in locking compressor modules */ |
| 113 | struct module *owner; | 113 | struct module *owner; |
| 114 | /* Extra skb space needed by the compressor algorithm */ | ||
| 115 | unsigned int comp_extra; | ||
| 114 | }; | 116 | }; |
| 115 | 117 | ||
| 116 | /* | 118 | /* |
| @@ -191,6 +193,13 @@ struct compressor { | |||
| 191 | #define DEFLATE_CHK_SEQUENCE 0 | 193 | #define DEFLATE_CHK_SEQUENCE 0 |
| 192 | 194 | ||
| 193 | /* | 195 | /* |
| 196 | * Definitions for MPPE. | ||
| 197 | */ | ||
| 198 | |||
| 199 | #define CI_MPPE 18 /* config option for MPPE */ | ||
| 200 | #define CILEN_MPPE 6 /* length of config option */ | ||
| 201 | |||
| 202 | /* | ||
| 194 | * Definitions for other, as yet unsupported, compression methods. | 203 | * Definitions for other, as yet unsupported, compression methods. |
| 195 | */ | 204 | */ |
| 196 | 205 | ||
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 0563581e3a02..74488e49166d 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
| @@ -66,6 +66,7 @@ struct proc_dir_entry { | |||
| 66 | write_proc_t *write_proc; | 66 | write_proc_t *write_proc; |
| 67 | atomic_t count; /* use count */ | 67 | atomic_t count; /* use count */ |
| 68 | int deleted; /* delete flag */ | 68 | int deleted; /* delete flag */ |
| 69 | void *set; | ||
| 69 | }; | 70 | }; |
| 70 | 71 | ||
| 71 | struct kcore_list { | 72 | struct kcore_list { |
| @@ -139,15 +140,12 @@ extern void proc_tty_unregister_driver(struct tty_driver *driver); | |||
| 139 | /* | 140 | /* |
| 140 | * proc_devtree.c | 141 | * proc_devtree.c |
| 141 | */ | 142 | */ |
| 143 | #ifdef CONFIG_PROC_DEVICETREE | ||
| 142 | struct device_node; | 144 | struct device_node; |
| 145 | struct property; | ||
| 143 | extern void proc_device_tree_init(void); | 146 | extern void proc_device_tree_init(void); |
| 144 | #ifdef CONFIG_PROC_DEVICETREE | ||
| 145 | extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); | 147 | extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); |
| 146 | #else /* !CONFIG_PROC_DEVICETREE */ | 148 | extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); |
| 147 | static inline void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *pde) | ||
| 148 | { | ||
| 149 | return; | ||
| 150 | } | ||
| 151 | #endif /* CONFIG_PROC_DEVICETREE */ | 149 | #endif /* CONFIG_PROC_DEVICETREE */ |
| 152 | 150 | ||
| 153 | extern struct proc_dir_entry *proc_symlink(const char *, | 151 | extern struct proc_dir_entry *proc_symlink(const char *, |
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 | |||
| 82 | extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); | ||
| 81 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); | 83 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); |
| 82 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); | 84 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); |
| 83 | extern int ptrace_attach(struct task_struct *tsk); | 85 | extern 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) |
| 201 | extern __inline__ int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | 201 | static 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 | ||
| 207 | extern __inline__ int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr) | 207 | static 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 | ||
| 214 | extern __inline__ int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | 214 | static 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 | ||
| 220 | extern __inline__ int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr) | 220 | static 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 | ||
| 227 | extern __inline__ void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | 227 | static 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 | ||
| 232 | extern __inline__ void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr) | 232 | static 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 | ||
| 47 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); | 47 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); |
| 48 | void *radix_tree_lookup(struct radix_tree_root *, unsigned long); | 48 | void *radix_tree_lookup(struct radix_tree_root *, unsigned long); |
| 49 | void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); | ||
| 49 | void *radix_tree_delete(struct radix_tree_root *, unsigned long); | 50 | void *radix_tree_delete(struct radix_tree_root *, unsigned long); |
| 50 | unsigned int | 51 | unsigned int |
| 51 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, | 52 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, |
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index 9de99198caf1..899437802aea 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
| @@ -6,7 +6,13 @@ | |||
| 6 | #ifndef BITMAP_H | 6 | #ifndef BITMAP_H |
| 7 | #define BITMAP_H 1 | 7 | #define BITMAP_H 1 |
| 8 | 8 | ||
| 9 | #define BITMAP_MAJOR 3 | 9 | #define BITMAP_MAJOR_LO 3 |
| 10 | /* version 4 insists the bitmap is in little-endian order | ||
| 11 | * with version 3, it is host-endian which is non-portable | ||
| 12 | */ | ||
| 13 | #define BITMAP_MAJOR_HI 4 | ||
| 14 | #define BITMAP_MAJOR_HOSTENDIAN 3 | ||
| 15 | |||
| 10 | #define BITMAP_MINOR 39 | 16 | #define BITMAP_MINOR 39 |
| 11 | 17 | ||
| 12 | /* | 18 | /* |
| @@ -133,7 +139,8 @@ typedef __u16 bitmap_counter_t; | |||
| 133 | /* use these for bitmap->flags and bitmap->sb->state bit-fields */ | 139 | /* use these for bitmap->flags and bitmap->sb->state bit-fields */ |
| 134 | enum bitmap_state { | 140 | enum bitmap_state { |
| 135 | BITMAP_ACTIVE = 0x001, /* the bitmap is in use */ | 141 | BITMAP_ACTIVE = 0x001, /* the bitmap is in use */ |
| 136 | BITMAP_STALE = 0x002 /* the bitmap file is out of date or had -EIO */ | 142 | BITMAP_STALE = 0x002, /* the bitmap file is out of date or had -EIO */ |
| 143 | BITMAP_HOSTENDIAN = 0x8000, | ||
| 137 | }; | 144 | }; |
| 138 | 145 | ||
| 139 | /* the superblock at the front of the bitmap file -- little endian */ | 146 | /* the superblock at the front of the bitmap file -- little endian */ |
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index ffa316ce4dc8..13e7c4b62367 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
| @@ -66,8 +66,10 @@ | |||
| 66 | * and major_version/minor_version accordingly | 66 | * and major_version/minor_version accordingly |
| 67 | * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT | 67 | * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT |
| 68 | * in the super status byte | 68 | * in the super status byte |
| 69 | * >=3 means that bitmap superblock version 4 is supported, which uses | ||
| 70 | * little-ending representation rather than host-endian | ||
| 69 | */ | 71 | */ |
| 70 | #define MD_PATCHLEVEL_VERSION 2 | 72 | #define MD_PATCHLEVEL_VERSION 3 |
| 71 | 73 | ||
| 72 | extern int register_md_personality (int p_num, mdk_personality_t *p); | 74 | extern int register_md_personality (int p_num, mdk_personality_t *p); |
| 73 | extern int unregister_md_personality (int p_num); | 75 | extern int unregister_md_personality (int p_num); |
| @@ -87,6 +89,7 @@ extern void md_print_devices (void); | |||
| 87 | 89 | ||
| 88 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, | 90 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, |
| 89 | sector_t sector, int size, struct page *page); | 91 | sector_t sector, int size, struct page *page); |
| 92 | extern void md_super_wait(mddev_t *mddev); | ||
| 90 | extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, | 93 | extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, |
| 91 | struct page *page, int rw); | 94 | struct page *page, int rw); |
| 92 | 95 | ||
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index ebce949b1443..46629a275ba9 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
| @@ -105,6 +105,8 @@ struct mdk_rdev_s | |||
| 105 | int sb_size; /* bytes in the superblock */ | 105 | int sb_size; /* bytes in the superblock */ |
| 106 | int preferred_minor; /* autorun support */ | 106 | int preferred_minor; /* autorun support */ |
| 107 | 107 | ||
| 108 | struct kobject kobj; | ||
| 109 | |||
| 108 | /* A device can be in one of three states based on two flags: | 110 | /* A device can be in one of three states based on two flags: |
| 109 | * Not working: faulty==1 in_sync==0 | 111 | * Not working: faulty==1 in_sync==0 |
| 110 | * Fully working: faulty==0 in_sync==1 | 112 | * Fully working: faulty==0 in_sync==1 |
| @@ -115,11 +117,12 @@ struct mdk_rdev_s | |||
| 115 | * It can never have faulty==1, in_sync==1 | 117 | * It can never have faulty==1, in_sync==1 |
| 116 | * This reduces the burden of testing multiple flags in many cases | 118 | * This reduces the burden of testing multiple flags in many cases |
| 117 | */ | 119 | */ |
| 118 | int faulty; /* if faulty do not issue IO requests */ | ||
| 119 | int in_sync; /* device is a full member of the array */ | ||
| 120 | 120 | ||
| 121 | unsigned long flags; /* Should include faulty and in_sync here. */ | 121 | unsigned long flags; |
| 122 | #define Faulty 1 /* device is known to have a fault */ | ||
| 123 | #define In_sync 2 /* device is in_sync with rest of array */ | ||
| 122 | #define WriteMostly 4 /* Avoid reading if at all possible */ | 124 | #define WriteMostly 4 /* Avoid reading if at all possible */ |
| 125 | #define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */ | ||
| 123 | 126 | ||
| 124 | int desc_nr; /* descriptor index in the superblock */ | 127 | int desc_nr; /* descriptor index in the superblock */ |
| 125 | int raid_disk; /* role of device in array */ | 128 | int raid_disk; /* role of device in array */ |
| @@ -132,6 +135,9 @@ struct mdk_rdev_s | |||
| 132 | * only maintained for arrays that | 135 | * only maintained for arrays that |
| 133 | * support hot removal | 136 | * support hot removal |
| 134 | */ | 137 | */ |
| 138 | atomic_t read_errors; /* number of consecutive read errors that | ||
| 139 | * we have tried to ignore. | ||
| 140 | */ | ||
| 135 | }; | 141 | }; |
| 136 | 142 | ||
| 137 | typedef struct mdk_personality_s mdk_personality_t; | 143 | typedef struct mdk_personality_s mdk_personality_t; |
| @@ -148,6 +154,8 @@ struct mddev_s | |||
| 148 | 154 | ||
| 149 | struct gendisk *gendisk; | 155 | struct gendisk *gendisk; |
| 150 | 156 | ||
| 157 | struct kobject kobj; | ||
| 158 | |||
| 151 | /* Superblock information */ | 159 | /* Superblock information */ |
| 152 | int major_version, | 160 | int major_version, |
| 153 | minor_version, | 161 | minor_version, |
| @@ -171,6 +179,10 @@ struct mddev_s | |||
| 171 | sector_t resync_mark_cnt;/* blocks written at resync_mark */ | 179 | sector_t resync_mark_cnt;/* blocks written at resync_mark */ |
| 172 | 180 | ||
| 173 | sector_t resync_max_sectors; /* may be set by personality */ | 181 | sector_t resync_max_sectors; /* may be set by personality */ |
| 182 | |||
| 183 | sector_t resync_mismatches; /* count of sectors where | ||
| 184 | * parity/replica mismatch found | ||
| 185 | */ | ||
| 174 | /* recovery/resync flags | 186 | /* recovery/resync flags |
| 175 | * NEEDED: we might need to start a resync/recover | 187 | * NEEDED: we might need to start a resync/recover |
| 176 | * RUNNING: a thread is running, or about to be started | 188 | * RUNNING: a thread is running, or about to be started |
| @@ -178,6 +190,8 @@ struct mddev_s | |||
| 178 | * ERR: and IO error was detected - abort the resync/recovery | 190 | * ERR: and IO error was detected - abort the resync/recovery |
| 179 | * INTR: someone requested a (clean) early abort. | 191 | * INTR: someone requested a (clean) early abort. |
| 180 | * DONE: thread is done and is waiting to be reaped | 192 | * DONE: thread is done and is waiting to be reaped |
| 193 | * REQUEST: user-space has requested a sync (used with SYNC) | ||
| 194 | * CHECK: user-space request for for check-only, no repair | ||
| 181 | */ | 195 | */ |
| 182 | #define MD_RECOVERY_RUNNING 0 | 196 | #define MD_RECOVERY_RUNNING 0 |
| 183 | #define MD_RECOVERY_SYNC 1 | 197 | #define MD_RECOVERY_SYNC 1 |
| @@ -185,6 +199,8 @@ struct mddev_s | |||
| 185 | #define MD_RECOVERY_INTR 3 | 199 | #define MD_RECOVERY_INTR 3 |
| 186 | #define MD_RECOVERY_DONE 4 | 200 | #define MD_RECOVERY_DONE 4 |
| 187 | #define MD_RECOVERY_NEEDED 5 | 201 | #define MD_RECOVERY_NEEDED 5 |
| 202 | #define MD_RECOVERY_REQUESTED 6 | ||
| 203 | #define MD_RECOVERY_CHECK 7 | ||
| 188 | unsigned long recovery; | 204 | unsigned long recovery; |
| 189 | 205 | ||
| 190 | int in_sync; /* know to not need resync */ | 206 | int in_sync; /* know to not need resync */ |
| @@ -195,6 +211,13 @@ struct mddev_s | |||
| 195 | int degraded; /* whether md should consider | 211 | int degraded; /* whether md should consider |
| 196 | * adding a spare | 212 | * adding a spare |
| 197 | */ | 213 | */ |
| 214 | int barriers_work; /* initialised to true, cleared as soon | ||
| 215 | * as a barrier request to slave | ||
| 216 | * fails. Only supported | ||
| 217 | */ | ||
| 218 | struct bio *biolist; /* bios that need to be retried | ||
| 219 | * because BIO_RW_BARRIER is not supported | ||
| 220 | */ | ||
| 198 | 221 | ||
| 199 | atomic_t recovery_active; /* blocks scheduled, but not written */ | 222 | atomic_t recovery_active; /* blocks scheduled, but not written */ |
| 200 | wait_queue_head_t recovery_wait; | 223 | wait_queue_head_t recovery_wait; |
| @@ -232,7 +255,7 @@ struct mddev_s | |||
| 232 | 255 | ||
| 233 | static inline void rdev_dec_pending(mdk_rdev_t *rdev, mddev_t *mddev) | 256 | static inline void rdev_dec_pending(mdk_rdev_t *rdev, mddev_t *mddev) |
| 234 | { | 257 | { |
| 235 | int faulty = rdev->faulty; | 258 | int faulty = test_bit(Faulty, &rdev->flags); |
| 236 | if (atomic_dec_and_test(&rdev->nr_pending) && faulty) | 259 | if (atomic_dec_and_test(&rdev->nr_pending) && faulty) |
| 237 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 260 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
| 238 | } | 261 | } |
| @@ -270,6 +293,13 @@ struct mdk_personality_s | |||
| 270 | }; | 293 | }; |
| 271 | 294 | ||
| 272 | 295 | ||
| 296 | struct md_sysfs_entry { | ||
| 297 | struct attribute attr; | ||
| 298 | ssize_t (*show)(mddev_t *, char *); | ||
| 299 | ssize_t (*store)(mddev_t *, const char *, size_t); | ||
| 300 | }; | ||
| 301 | |||
| 302 | |||
| 273 | static inline char * mdname (mddev_t * mddev) | 303 | static inline char * mdname (mddev_t * mddev) |
| 274 | { | 304 | { |
| 275 | return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; | 305 | return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; |
| @@ -304,10 +334,8 @@ typedef struct mdk_thread_s { | |||
| 304 | mddev_t *mddev; | 334 | mddev_t *mddev; |
| 305 | wait_queue_head_t wqueue; | 335 | wait_queue_head_t wqueue; |
| 306 | unsigned long flags; | 336 | unsigned long flags; |
| 307 | struct completion *event; | ||
| 308 | struct task_struct *tsk; | 337 | struct task_struct *tsk; |
| 309 | unsigned long timeout; | 338 | unsigned long timeout; |
| 310 | const char *name; | ||
| 311 | } mdk_thread_t; | 339 | } mdk_thread_t; |
| 312 | 340 | ||
| 313 | #define THREAD_WAKEUP 0 | 341 | #define THREAD_WAKEUP 0 |
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index 60e19b667548..292b98f2b408 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h | |||
| @@ -110,7 +110,9 @@ struct r1bio_s { | |||
| 110 | #define R1BIO_Uptodate 0 | 110 | #define R1BIO_Uptodate 0 |
| 111 | #define R1BIO_IsSync 1 | 111 | #define R1BIO_IsSync 1 |
| 112 | #define R1BIO_Degraded 2 | 112 | #define R1BIO_Degraded 2 |
| 113 | #define R1BIO_BehindIO 3 | 113 | #define R1BIO_BehindIO 3 |
| 114 | #define R1BIO_Barrier 4 | ||
| 115 | #define R1BIO_BarrierRetry 5 | ||
| 114 | /* For write-behind requests, we call bi_end_io when | 116 | /* For write-behind requests, we call bi_end_io when |
| 115 | * the last non-write-behind device completes, providing | 117 | * the last non-write-behind device completes, providing |
| 116 | * any write was successful. Otherwise we call when | 118 | * any write was successful. Otherwise we call when |
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index 176fc653c284..f025ba6fb14c 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h | |||
| @@ -154,6 +154,8 @@ struct stripe_head { | |||
| 154 | #define R5_Wantwrite 5 | 154 | #define R5_Wantwrite 5 |
| 155 | #define R5_Syncio 6 /* this io need to be accounted as resync io */ | 155 | #define R5_Syncio 6 /* this io need to be accounted as resync io */ |
| 156 | #define R5_Overlap 7 /* There is a pending overlapping request on this block */ | 156 | #define R5_Overlap 7 /* There is a pending overlapping request on this block */ |
| 157 | #define R5_ReadError 8 /* seen a read error here recently */ | ||
| 158 | #define R5_ReWrite 9 /* have tried to over-write the readerror */ | ||
| 157 | 159 | ||
| 158 | /* | 160 | /* |
| 159 | * Write method | 161 | * Write method |
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 | |||
| 73 | extern struct bus_type rio_bus_type; | ||
| 74 | extern struct list_head rio_devices; /* list of all devices */ | ||
| 75 | |||
| 76 | struct 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 | */ | ||
| 101 | struct 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 | */ | ||
| 133 | struct 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 | */ | ||
| 145 | struct 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 | */ | ||
| 167 | struct 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 | */ | ||
| 191 | struct 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 | */ | ||
| 209 | struct 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 | */ | ||
| 231 | struct 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 | */ | ||
| 265 | struct 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 | */ | ||
| 289 | struct 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 | */ | ||
| 304 | struct 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 */ | ||
| 313 | extern int rio_init_mports(void); | ||
| 314 | extern void rio_register_mport(struct rio_mport *); | ||
| 315 | extern int rio_hw_add_outb_message(struct rio_mport *, struct rio_dev *, int, | ||
| 316 | void *, size_t); | ||
| 317 | extern int rio_hw_add_inb_buffer(struct rio_mport *, int, void *); | ||
| 318 | extern void *rio_hw_get_inb_message(struct rio_mport *, int); | ||
| 319 | extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int); | ||
| 320 | extern void rio_close_inb_mbox(struct rio_mport *, int); | ||
| 321 | extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int); | ||
| 322 | extern 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 | |||
| 26 | extern int __rio_local_read_config_32(struct rio_mport *port, u32 offset, | ||
| 27 | u32 * data); | ||
| 28 | extern int __rio_local_write_config_32(struct rio_mport *port, u32 offset, | ||
| 29 | u32 data); | ||
| 30 | extern int __rio_local_read_config_16(struct rio_mport *port, u32 offset, | ||
| 31 | u16 * data); | ||
| 32 | extern int __rio_local_write_config_16(struct rio_mport *port, u32 offset, | ||
| 33 | u16 data); | ||
| 34 | extern int __rio_local_read_config_8(struct rio_mport *port, u32 offset, | ||
| 35 | u8 * data); | ||
| 36 | extern int __rio_local_write_config_8(struct rio_mport *port, u32 offset, | ||
| 37 | u8 data); | ||
| 38 | |||
| 39 | extern int rio_mport_read_config_32(struct rio_mport *port, u16 destid, | ||
| 40 | u8 hopcount, u32 offset, u32 * data); | ||
| 41 | extern int rio_mport_write_config_32(struct rio_mport *port, u16 destid, | ||
| 42 | u8 hopcount, u32 offset, u32 data); | ||
| 43 | extern int rio_mport_read_config_16(struct rio_mport *port, u16 destid, | ||
| 44 | u8 hopcount, u32 offset, u16 * data); | ||
| 45 | extern int rio_mport_write_config_16(struct rio_mport *port, u16 destid, | ||
| 46 | u8 hopcount, u32 offset, u16 data); | ||
| 47 | extern int rio_mport_read_config_8(struct rio_mport *port, u16 destid, | ||
| 48 | u8 hopcount, u32 offset, u8 * data); | ||
| 49 | extern 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 | */ | ||
| 61 | static 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 | */ | ||
| 76 | static 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 | */ | ||
| 91 | static 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 | |||
| 107 | static 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 | */ | ||
| 122 | static 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 | */ | ||
| 137 | static 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 | */ | ||
| 152 | static 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 | */ | ||
| 176 | static 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 | */ | ||
| 200 | static 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 | */ | ||
| 224 | static 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 | */ | ||
| 248 | static 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 | */ | ||
| 271 | static 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 | |||
| 285 | extern 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 | */ | ||
| 296 | static 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 | */ | ||
| 311 | static 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 | */ | ||
| 329 | static 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 */ | ||
| 351 | extern int rio_request_outb_mbox(struct rio_mport *, void *, int, int, | ||
| 352 | void (*)(struct rio_mport *, void *,int, int)); | ||
| 353 | extern 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 | */ | ||
| 366 | static 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 | |||
| 373 | extern int rio_request_inb_mbox(struct rio_mport *, void *, int, int, | ||
| 374 | void (*)(struct rio_mport *, void *, int, int)); | ||
| 375 | extern 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 | */ | ||
| 386 | static 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 | */ | ||
| 400 | static 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 */ | ||
| 406 | extern int rio_request_inb_dbell(struct rio_mport *, void *, u16, u16, | ||
| 407 | void (*)(struct rio_mport *, void *, u16, u16, u16)); | ||
| 408 | extern int rio_release_inb_dbell(struct rio_mport *, u16, u16); | ||
| 409 | extern struct resource *rio_request_outb_dbell(struct rio_dev *, u16, u16); | ||
| 410 | extern int rio_release_outb_dbell(struct rio_dev *, struct resource *); | ||
| 411 | |||
| 412 | /* Memory region management */ | ||
| 413 | int rio_claim_resource(struct rio_dev *, int); | ||
| 414 | int rio_request_regions(struct rio_dev *, char *); | ||
| 415 | void rio_release_regions(struct rio_dev *); | ||
| 416 | int rio_request_region(struct rio_dev *, int, char *); | ||
| 417 | void rio_release_region(struct rio_dev *, int); | ||
| 418 | |||
| 419 | /* LDM support */ | ||
| 420 | int rio_register_driver(struct rio_driver *); | ||
| 421 | void rio_unregister_driver(struct rio_driver *); | ||
| 422 | struct rio_dev *rio_dev_get(struct rio_dev *); | ||
| 423 | void 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 | */ | ||
| 432 | static 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 | */ | ||
| 444 | static 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 | */ | ||
| 457 | static 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 */ | ||
| 463 | extern u16 rio_local_get_device_id(struct rio_mport *port); | ||
| 464 | extern struct rio_dev *rio_get_device(u16 vid, u16 did, struct rio_dev *from); | ||
| 465 | extern 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 | */ |
| 40 | struct rs_control { | 40 | struct 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 |
| 61 | int decode_rs8(struct rs_control *rs, uint8_t *data, uint16_t *par, int len, | 61 | int 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 */ |
| 78 | struct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim, | 78 | struct 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/sched.h b/include/linux/sched.h index 03b68a7b4b82..2bbf968b23d9 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -909,6 +909,7 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0) | |||
| 909 | #define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */ | 909 | #define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */ |
| 910 | #define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ | 910 | #define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ |
| 911 | #define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ | 911 | #define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ |
| 912 | #define PF_HOTPLUG_CPU 0x01000000 /* Currently performing CPU hotplug */ | ||
| 912 | 913 | ||
| 913 | /* | 914 | /* |
| 914 | * Only the _current_ task can read/write to tsk->flags, but other | 915 | * Only the _current_ task can read/write to tsk->flags, but other |
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 | ||
| 82 | struct task_struct; | ||
| 83 | |||
| 82 | /* One semaphore structure for each semaphore in the system. */ | 84 | /* One semaphore structure for each semaphore in the system. */ |
| 83 | struct sem { | 85 | struct sem { |
| 84 | int semval; /* current value */ | 86 | int semval; /* current value */ |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index 2b799d40d669..cee302aefdb7 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
| @@ -42,6 +42,7 @@ enum { | |||
| 42 | PLAT8250_DEV_BOCA, | 42 | PLAT8250_DEV_BOCA, |
| 43 | PLAT8250_DEV_HUB6, | 43 | PLAT8250_DEV_HUB6, |
| 44 | PLAT8250_DEV_MCA, | 44 | PLAT8250_DEV_MCA, |
| 45 | PLAT8250_DEV_AU1X00, | ||
| 45 | }; | 46 | }; |
| 46 | 47 | ||
| 47 | /* | 48 | /* |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 9d2579230689..a3ac92b19aca 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -211,6 +211,7 @@ struct uart_port { | |||
| 211 | #define UPIO_HUB6 (1) | 211 | #define UPIO_HUB6 (1) |
| 212 | #define UPIO_MEM (2) | 212 | #define UPIO_MEM (2) |
| 213 | #define UPIO_MEM32 (3) | 213 | #define UPIO_MEM32 (3) |
| 214 | #define UPIO_AU (4) /* Au1x00 type IO */ | ||
| 214 | 215 | ||
| 215 | unsigned int read_status_mask; /* driver specific */ | 216 | unsigned int read_status_mask; /* driver specific */ |
| 216 | unsigned int ignore_status_mask; /* driver specific */ | 217 | unsigned int ignore_status_mask; /* driver specific */ |
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 |
| 97 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); | 98 | long 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..83010231db99 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -274,6 +274,9 @@ struct sk_buff { | |||
| 274 | #if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) | 274 | #if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) |
| 275 | __u8 ipvs_property:1; | 275 | __u8 ipvs_property:1; |
| 276 | #endif | 276 | #endif |
| 277 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
| 278 | struct sk_buff *nfct_reasm; | ||
| 279 | #endif | ||
| 277 | #ifdef CONFIG_BRIDGE_NETFILTER | 280 | #ifdef CONFIG_BRIDGE_NETFILTER |
| 278 | struct nf_bridge_info *nf_bridge; | 281 | struct nf_bridge_info *nf_bridge; |
| 279 | #endif | 282 | #endif |
| @@ -603,23 +606,23 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) | |||
| 603 | */ | 606 | */ |
| 604 | 607 | ||
| 605 | /** | 608 | /** |
| 606 | * __skb_queue_head - queue a buffer at the list head | 609 | * __skb_queue_after - queue a buffer at the list head |
| 607 | * @list: list to use | 610 | * @list: list to use |
| 611 | * @prev: place after this buffer | ||
| 608 | * @newsk: buffer to queue | 612 | * @newsk: buffer to queue |
| 609 | * | 613 | * |
| 610 | * Queue a buffer at the start of a list. This function takes no locks | 614 | * 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. | 615 | * and you must therefore hold required locks before calling it. |
| 612 | * | 616 | * |
| 613 | * A buffer cannot be placed on two lists at the same time. | 617 | * A buffer cannot be placed on two lists at the same time. |
| 614 | */ | 618 | */ |
| 615 | extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); | 619 | static inline void __skb_queue_after(struct sk_buff_head *list, |
| 616 | static inline void __skb_queue_head(struct sk_buff_head *list, | 620 | struct sk_buff *prev, |
| 617 | struct sk_buff *newsk) | 621 | struct sk_buff *newsk) |
| 618 | { | 622 | { |
| 619 | struct sk_buff *prev, *next; | 623 | struct sk_buff *next; |
| 620 | |||
| 621 | list->qlen++; | 624 | list->qlen++; |
| 622 | prev = (struct sk_buff *)list; | 625 | |
| 623 | next = prev->next; | 626 | next = prev->next; |
| 624 | newsk->next = next; | 627 | newsk->next = next; |
| 625 | newsk->prev = prev; | 628 | newsk->prev = prev; |
| @@ -627,6 +630,23 @@ static inline void __skb_queue_head(struct sk_buff_head *list, | |||
| 627 | } | 630 | } |
| 628 | 631 | ||
| 629 | /** | 632 | /** |
| 633 | * __skb_queue_head - queue a buffer at the list head | ||
| 634 | * @list: list to use | ||
| 635 | * @newsk: buffer to queue | ||
| 636 | * | ||
| 637 | * Queue a buffer at the start of a list. This function takes no locks | ||
| 638 | * and you must therefore hold required locks before calling it. | ||
| 639 | * | ||
| 640 | * A buffer cannot be placed on two lists at the same time. | ||
| 641 | */ | ||
| 642 | extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); | ||
| 643 | static inline void __skb_queue_head(struct sk_buff_head *list, | ||
| 644 | struct sk_buff *newsk) | ||
| 645 | { | ||
| 646 | __skb_queue_after(list, (struct sk_buff *)list, newsk); | ||
| 647 | } | ||
| 648 | |||
| 649 | /** | ||
| 630 | * __skb_queue_tail - queue a buffer at the list tail | 650 | * __skb_queue_tail - queue a buffer at the list tail |
| 631 | * @list: list to use | 651 | * @list: list to use |
| 632 | * @newsk: buffer to queue | 652 | * @newsk: buffer to queue |
| @@ -1203,6 +1223,11 @@ static inline void kunmap_skb_frag(void *vaddr) | |||
| 1203 | prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ | 1223 | prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ |
| 1204 | skb = skb->next) | 1224 | skb = skb->next) |
| 1205 | 1225 | ||
| 1226 | #define skb_queue_reverse_walk(queue, skb) \ | ||
| 1227 | for (skb = (queue)->prev; \ | ||
| 1228 | prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ | ||
| 1229 | skb = skb->prev) | ||
| 1230 | |||
| 1206 | 1231 | ||
| 1207 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, | 1232 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, |
| 1208 | int noblock, int *err); | 1233 | int noblock, int *err); |
| @@ -1291,10 +1316,26 @@ static inline void nf_conntrack_get(struct nf_conntrack *nfct) | |||
| 1291 | if (nfct) | 1316 | if (nfct) |
| 1292 | atomic_inc(&nfct->use); | 1317 | atomic_inc(&nfct->use); |
| 1293 | } | 1318 | } |
| 1319 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
| 1320 | static inline void nf_conntrack_get_reasm(struct sk_buff *skb) | ||
| 1321 | { | ||
| 1322 | if (skb) | ||
| 1323 | atomic_inc(&skb->users); | ||
| 1324 | } | ||
| 1325 | static inline void nf_conntrack_put_reasm(struct sk_buff *skb) | ||
| 1326 | { | ||
| 1327 | if (skb) | ||
| 1328 | kfree_skb(skb); | ||
| 1329 | } | ||
| 1330 | #endif | ||
| 1294 | static inline void nf_reset(struct sk_buff *skb) | 1331 | static inline void nf_reset(struct sk_buff *skb) |
| 1295 | { | 1332 | { |
| 1296 | nf_conntrack_put(skb->nfct); | 1333 | nf_conntrack_put(skb->nfct); |
| 1297 | skb->nfct = NULL; | 1334 | skb->nfct = NULL; |
| 1335 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
| 1336 | nf_conntrack_put_reasm(skb->nfct_reasm); | ||
| 1337 | skb->nfct_reasm = NULL; | ||
| 1338 | #endif | ||
| 1298 | } | 1339 | } |
| 1299 | 1340 | ||
| 1300 | #ifdef CONFIG_BRIDGE_NETFILTER | 1341 | #ifdef CONFIG_BRIDGE_NETFILTER |
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 | ||
| 12 | typedef struct kmem_cache_s kmem_cache_t; | 12 | typedef 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/stallion.h b/include/linux/stallion.h index e89b77b6505a..13a37f137ea2 100644 --- a/include/linux/stallion.h +++ b/include/linux/stallion.h | |||
| @@ -21,8 +21,6 @@ | |||
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 22 | */ | 22 | */ |
| 23 | 23 | ||
| 24 | #include <linux/version.h> | ||
| 25 | |||
| 26 | /*****************************************************************************/ | 24 | /*****************************************************************************/ |
| 27 | #ifndef _STALLION_H | 25 | #ifndef _STALLION_H |
| 28 | #define _STALLION_H | 26 | #define _STALLION_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 | ||
| 177 | static inline int | 178 | static 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 | ||
| 22 | struct vcr_info { | 22 | struct 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 | ||
| 31 | struct 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 | |||
| 36 | struct superhyway_bus { | ||
| 37 | struct superhyway_ops *ops; | ||
| 38 | }; | ||
| 39 | |||
| 40 | extern struct superhyway_bus superhyway_channels[]; | ||
| 41 | |||
| 31 | struct superhyway_device_id { | 42 | struct 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 | ||
| 68 | extern int superhyway_scan_bus(void); | 81 | static inline int |
| 82 | superhyway_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 | |||
| 88 | static inline int | ||
| 89 | superhyway_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 | |||
| 95 | extern int superhyway_scan_bus(struct superhyway_bus *); | ||
| 69 | 96 | ||
| 70 | /* drivers/sh/superhyway/superhyway.c */ | 97 | /* drivers/sh/superhyway/superhyway.c */ |
| 71 | int superhyway_register_driver(struct superhyway_driver *); | 98 | int superhyway_register_driver(struct superhyway_driver *); |
| 72 | void superhyway_unregister_driver(struct superhyway_driver *); | 99 | void superhyway_unregister_driver(struct superhyway_driver *); |
| 73 | int superhyway_add_device(unsigned int, unsigned long, unsigned long long); | 100 | int superhyway_add_device(unsigned long base, struct superhyway_device *, struct superhyway_bus *); |
| 101 | int 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 */ |
| 76 | extern struct device_attribute superhyway_dev_attrs[]; | 104 | extern struct device_attribute superhyway_dev_attrs[]; |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index fc8e367f671e..22cf5e1ac987 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/compiler.h> | 24 | #include <linux/compiler.h> |
| 25 | 25 | ||
| 26 | struct file; | 26 | struct file; |
| 27 | struct completion; | ||
| 27 | 28 | ||
| 28 | #define CTL_MAXNAME 10 /* how many path components do we allow in a | 29 | #define CTL_MAXNAME 10 /* how many path components do we allow in a |
| 29 | call to sysctl? In other words, what is | 30 | call to sysctl? In other words, what is |
| @@ -204,6 +205,7 @@ enum | |||
| 204 | NET_ECONET=16, | 205 | NET_ECONET=16, |
| 205 | NET_SCTP=17, | 206 | NET_SCTP=17, |
| 206 | NET_LLC=18, | 207 | NET_LLC=18, |
| 208 | NET_NETFILTER=19, | ||
| 207 | }; | 209 | }; |
| 208 | 210 | ||
| 209 | /* /proc/sys/kernel/random */ | 211 | /* /proc/sys/kernel/random */ |
| @@ -269,6 +271,42 @@ enum | |||
| 269 | NET_UNIX_MAX_DGRAM_QLEN=3, | 271 | NET_UNIX_MAX_DGRAM_QLEN=3, |
| 270 | }; | 272 | }; |
| 271 | 273 | ||
| 274 | /* /proc/sys/net/netfilter */ | ||
| 275 | enum | ||
| 276 | { | ||
| 277 | NET_NF_CONNTRACK_MAX=1, | ||
| 278 | NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2, | ||
| 279 | NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3, | ||
| 280 | NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4, | ||
| 281 | NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5, | ||
| 282 | NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6, | ||
| 283 | NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7, | ||
| 284 | NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8, | ||
| 285 | NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9, | ||
| 286 | NET_NF_CONNTRACK_UDP_TIMEOUT=10, | ||
| 287 | NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11, | ||
| 288 | NET_NF_CONNTRACK_ICMP_TIMEOUT=12, | ||
| 289 | NET_NF_CONNTRACK_GENERIC_TIMEOUT=13, | ||
| 290 | NET_NF_CONNTRACK_BUCKETS=14, | ||
| 291 | NET_NF_CONNTRACK_LOG_INVALID=15, | ||
| 292 | NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16, | ||
| 293 | NET_NF_CONNTRACK_TCP_LOOSE=17, | ||
| 294 | NET_NF_CONNTRACK_TCP_BE_LIBERAL=18, | ||
| 295 | NET_NF_CONNTRACK_TCP_MAX_RETRANS=19, | ||
| 296 | NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20, | ||
| 297 | NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21, | ||
| 298 | NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22, | ||
| 299 | NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23, | ||
| 300 | NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24, | ||
| 301 | NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25, | ||
| 302 | NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26, | ||
| 303 | NET_NF_CONNTRACK_COUNT=27, | ||
| 304 | NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28, | ||
| 305 | NET_NF_CONNTRACK_FRAG6_TIMEOUT=29, | ||
| 306 | NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30, | ||
| 307 | NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31, | ||
| 308 | }; | ||
| 309 | |||
| 272 | /* /proc/sys/net/ipv4 */ | 310 | /* /proc/sys/net/ipv4 */ |
| 273 | enum | 311 | enum |
| 274 | { | 312 | { |
| @@ -925,6 +963,8 @@ struct ctl_table_header | |||
| 925 | { | 963 | { |
| 926 | ctl_table *ctl_table; | 964 | ctl_table *ctl_table; |
| 927 | struct list_head ctl_entry; | 965 | struct list_head ctl_entry; |
| 966 | int used; | ||
| 967 | struct completion *unregistering; | ||
| 928 | }; | 968 | }; |
| 929 | 969 | ||
| 930 | struct ctl_table_header * register_sysctl_table(ctl_table * table, | 970 | struct ctl_table_header * register_sysctl_table(ctl_table * table, |
diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 1cc8c31b7988..91140091ced2 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h | |||
| @@ -1,57 +1,16 @@ | |||
| 1 | #ifndef __LINUX_VIDEODEV_H | 1 | #ifndef __LINUX_VIDEODEV_H |
| 2 | #define __LINUX_VIDEODEV_H | 2 | #define __LINUX_VIDEODEV_H |
| 3 | 3 | ||
| 4 | #include <linux/compiler.h> | ||
| 5 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 6 | 5 | ||
| 7 | #define HAVE_V4L2 1 | 6 | #define HAVE_V4L1 1 |
| 7 | |||
| 8 | #include <linux/videodev2.h> | 8 | #include <linux/videodev2.h> |
| 9 | 9 | ||
| 10 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
| 11 | 11 | ||
| 12 | #include <linux/poll.h> | ||
| 13 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
| 14 | #include <linux/device.h> | ||
| 15 | |||
| 16 | struct video_device | ||
| 17 | { | ||
| 18 | /* device info */ | ||
| 19 | struct device *dev; | ||
| 20 | char name[32]; | ||
| 21 | int type; /* v4l1 */ | ||
| 22 | int type2; /* v4l2 */ | ||
| 23 | int hardware; | ||
| 24 | int minor; | ||
| 25 | |||
| 26 | /* device ops + callbacks */ | ||
| 27 | struct file_operations *fops; | ||
| 28 | void (*release)(struct video_device *vfd); | ||
| 29 | |||
| 30 | |||
| 31 | /* obsolete -- fops->owner is used instead */ | ||
| 32 | struct module *owner; | ||
| 33 | /* dev->driver_data will be used instead some day. | ||
| 34 | * Use the video_{get|set}_drvdata() helper functions, | ||
| 35 | * so the switch over will be transparent for you. | ||
| 36 | * Or use {pci|usb}_{get|set}_drvdata() directly. */ | ||
| 37 | void *priv; | ||
| 38 | |||
| 39 | /* for videodev.c intenal usage -- please don't touch */ | ||
| 40 | int users; /* video_exclusive_{open|close} ... */ | ||
| 41 | struct semaphore lock; /* ... helper function uses these */ | ||
| 42 | char devfs_name[64]; /* devfs */ | ||
| 43 | struct class_device class_dev; /* sysfs */ | ||
| 44 | }; | ||
| 45 | |||
| 46 | #define VIDEO_MAJOR 81 | ||
| 47 | |||
| 48 | #define VFL_TYPE_GRABBER 0 | ||
| 49 | #define VFL_TYPE_VBI 1 | ||
| 50 | #define VFL_TYPE_RADIO 2 | ||
| 51 | #define VFL_TYPE_VTX 3 | ||
| 52 | 13 | ||
| 53 | extern int video_register_device(struct video_device *, int type, int nr); | ||
| 54 | extern void video_unregister_device(struct video_device *); | ||
| 55 | extern struct video_device* video_devdata(struct file*); | 14 | extern struct video_device* video_devdata(struct file*); |
| 56 | 15 | ||
| 57 | #define to_video_device(cd) container_of(cd, struct video_device, class_dev) | 16 | #define to_video_device(cd) container_of(cd, struct video_device, class_dev) |
| @@ -68,11 +27,7 @@ video_device_remove_file(struct video_device *vfd, | |||
| 68 | class_device_remove_file(&vfd->class_dev, attr); | 27 | class_device_remove_file(&vfd->class_dev, attr); |
| 69 | } | 28 | } |
| 70 | 29 | ||
| 71 | /* helper functions to alloc / release struct video_device, the | 30 | #if OBSOLETE_OWNER /* to be removed in 2.6.15 */ |
| 72 | later can be used for video_device->release() */ | ||
| 73 | struct video_device *video_device_alloc(void); | ||
| 74 | void video_device_release(struct video_device *vfd); | ||
| 75 | |||
| 76 | /* helper functions to access driver private data. */ | 31 | /* helper functions to access driver private data. */ |
| 77 | static inline void *video_get_drvdata(struct video_device *dev) | 32 | static inline void *video_get_drvdata(struct video_device *dev) |
| 78 | { | 33 | { |
| @@ -83,30 +38,12 @@ static inline void video_set_drvdata(struct video_device *dev, void *data) | |||
| 83 | { | 38 | { |
| 84 | dev->priv = data; | 39 | dev->priv = data; |
| 85 | } | 40 | } |
| 41 | #endif | ||
| 86 | 42 | ||
| 87 | extern int video_exclusive_open(struct inode *inode, struct file *file); | 43 | extern int video_exclusive_open(struct inode *inode, struct file *file); |
| 88 | extern int video_exclusive_release(struct inode *inode, struct file *file); | 44 | extern int video_exclusive_release(struct inode *inode, struct file *file); |
| 89 | extern int video_usercopy(struct inode *inode, struct file *file, | ||
| 90 | unsigned int cmd, unsigned long arg, | ||
| 91 | int (*func)(struct inode *inode, struct file *file, | ||
| 92 | unsigned int cmd, void *arg)); | ||
| 93 | #endif /* __KERNEL__ */ | 45 | #endif /* __KERNEL__ */ |
| 94 | 46 | ||
| 95 | #define VID_TYPE_CAPTURE 1 /* Can capture */ | ||
| 96 | #define VID_TYPE_TUNER 2 /* Can tune */ | ||
| 97 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ | ||
| 98 | #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ | ||
| 99 | #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ | ||
| 100 | #define VID_TYPE_CLIPPING 32 /* Can clip */ | ||
| 101 | #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ | ||
| 102 | #define VID_TYPE_SCALES 128 /* Scalable */ | ||
| 103 | #define VID_TYPE_MONOCHROME 256 /* Monochrome only */ | ||
| 104 | #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ | ||
| 105 | #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ | ||
| 106 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ | ||
| 107 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ | ||
| 108 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ | ||
| 109 | |||
| 110 | struct video_capability | 47 | struct video_capability |
| 111 | { | 48 | { |
| 112 | char name[32]; | 49 | char name[32]; |
| @@ -202,9 +139,9 @@ struct video_audio | |||
| 202 | #define VIDEO_SOUND_STEREO 2 | 139 | #define VIDEO_SOUND_STEREO 2 |
| 203 | #define VIDEO_SOUND_LANG1 4 | 140 | #define VIDEO_SOUND_LANG1 4 |
| 204 | #define VIDEO_SOUND_LANG2 8 | 141 | #define VIDEO_SOUND_LANG2 8 |
| 205 | __u16 mode; | 142 | __u16 mode; |
| 206 | __u16 balance; /* Stereo balance */ | 143 | __u16 balance; /* Stereo balance */ |
| 207 | __u16 step; /* Step actual volume uses */ | 144 | __u16 step; /* Step actual volume uses */ |
| 208 | }; | 145 | }; |
| 209 | 146 | ||
| 210 | struct video_clip | 147 | struct video_clip |
| @@ -260,9 +197,6 @@ struct video_key | |||
| 260 | __u32 flags; | 197 | __u32 flags; |
| 261 | }; | 198 | }; |
| 262 | 199 | ||
| 263 | |||
| 264 | #define VIDEO_MAX_FRAME 32 | ||
| 265 | |||
| 266 | struct video_mbuf | 200 | struct video_mbuf |
| 267 | { | 201 | { |
| 268 | int size; /* Total memory to map */ | 202 | int size; /* Total memory to map */ |
| @@ -270,10 +204,8 @@ struct video_mbuf | |||
| 270 | int offsets[VIDEO_MAX_FRAME]; | 204 | int offsets[VIDEO_MAX_FRAME]; |
| 271 | }; | 205 | }; |
| 272 | 206 | ||
| 273 | |||
| 274 | #define VIDEO_NO_UNIT (-1) | 207 | #define VIDEO_NO_UNIT (-1) |
| 275 | 208 | ||
| 276 | |||
| 277 | struct video_unit | 209 | struct video_unit |
| 278 | { | 210 | { |
| 279 | int video; /* Video minor */ | 211 | int video; /* Video minor */ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 89a055761bed..a114fff6568b 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
| @@ -15,16 +15,99 @@ | |||
| 15 | */ | 15 | */ |
| 16 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
| 17 | #include <linux/time.h> /* need struct timeval */ | 17 | #include <linux/time.h> /* need struct timeval */ |
| 18 | #include <linux/poll.h> | ||
| 19 | #include <linux/device.h> | ||
| 18 | #endif | 20 | #endif |
| 19 | #include <linux/compiler.h> /* need __user */ | 21 | #include <linux/compiler.h> /* need __user */ |
| 20 | 22 | ||
| 23 | |||
| 24 | #define OBSOLETE_OWNER 1 /* It will be removed for 2.6.15 */ | ||
| 25 | #define HAVE_V4L2 1 | ||
| 26 | |||
| 27 | /* | ||
| 28 | * Common stuff for both V4L1 and V4L2 | ||
| 29 | * Moved from videodev.h | ||
| 30 | */ | ||
| 31 | |||
| 32 | #define VIDEO_MAX_FRAME 32 | ||
| 33 | |||
| 34 | #define VID_TYPE_CAPTURE 1 /* Can capture */ | ||
| 35 | #define VID_TYPE_TUNER 2 /* Can tune */ | ||
| 36 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ | ||
| 37 | #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ | ||
| 38 | #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ | ||
| 39 | #define VID_TYPE_CLIPPING 32 /* Can clip */ | ||
| 40 | #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ | ||
| 41 | #define VID_TYPE_SCALES 128 /* Scalable */ | ||
| 42 | #define VID_TYPE_MONOCHROME 256 /* Monochrome only */ | ||
| 43 | #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ | ||
| 44 | #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ | ||
| 45 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ | ||
| 46 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ | ||
| 47 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ | ||
| 48 | |||
| 49 | #ifdef __KERNEL__ | ||
| 50 | |||
| 51 | #define VFL_TYPE_GRABBER 0 | ||
| 52 | #define VFL_TYPE_VBI 1 | ||
| 53 | #define VFL_TYPE_RADIO 2 | ||
| 54 | #define VFL_TYPE_VTX 3 | ||
| 55 | |||
| 56 | struct video_device | ||
| 57 | { | ||
| 58 | /* device info */ | ||
| 59 | struct device *dev; | ||
| 60 | char name[32]; | ||
| 61 | int type; /* v4l1 */ | ||
| 62 | int type2; /* v4l2 */ | ||
| 63 | int hardware; | ||
| 64 | int minor; | ||
| 65 | |||
| 66 | /* device ops + callbacks */ | ||
| 67 | struct file_operations *fops; | ||
| 68 | void (*release)(struct video_device *vfd); | ||
| 69 | |||
| 70 | |||
| 71 | #if OBSOLETE_OWNER /* to be removed in 2.6.15 */ | ||
| 72 | /* obsolete -- fops->owner is used instead */ | ||
| 73 | struct module *owner; | ||
| 74 | /* dev->driver_data will be used instead some day. | ||
| 75 | * Use the video_{get|set}_drvdata() helper functions, | ||
| 76 | * so the switch over will be transparent for you. | ||
| 77 | * Or use {pci|usb}_{get|set}_drvdata() directly. */ | ||
| 78 | void *priv; | ||
| 79 | #endif | ||
| 80 | |||
| 81 | /* for videodev.c intenal usage -- please don't touch */ | ||
| 82 | int users; /* video_exclusive_{open|close} ... */ | ||
| 83 | struct semaphore lock; /* ... helper function uses these */ | ||
| 84 | char devfs_name[64]; /* devfs */ | ||
| 85 | struct class_device class_dev; /* sysfs */ | ||
| 86 | }; | ||
| 87 | |||
| 88 | #define VIDEO_MAJOR 81 | ||
| 89 | |||
| 90 | extern int video_register_device(struct video_device *, int type, int nr); | ||
| 91 | extern void video_unregister_device(struct video_device *); | ||
| 92 | extern int video_usercopy(struct inode *inode, struct file *file, | ||
| 93 | unsigned int cmd, unsigned long arg, | ||
| 94 | int (*func)(struct inode *inode, struct file *file, | ||
| 95 | unsigned int cmd, void *arg)); | ||
| 96 | |||
| 97 | /* helper functions to alloc / release struct video_device, the | ||
| 98 | later can be used for video_device->release() */ | ||
| 99 | struct video_device *video_device_alloc(void); | ||
| 100 | void video_device_release(struct video_device *vfd); | ||
| 101 | |||
| 102 | #endif | ||
| 103 | |||
| 21 | /* | 104 | /* |
| 22 | * M I S C E L L A N E O U S | 105 | * M I S C E L L A N E O U S |
| 23 | */ | 106 | */ |
| 24 | 107 | ||
| 25 | /* Four-character-code (FOURCC) */ | 108 | /* Four-character-code (FOURCC) */ |
| 26 | #define v4l2_fourcc(a,b,c,d)\ | 109 | #define v4l2_fourcc(a,b,c,d)\ |
| 27 | (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24)) | 110 | (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24)) |
| 28 | 111 | ||
| 29 | /* | 112 | /* |
| 30 | * E N U M S | 113 | * E N U M S |
| @@ -154,20 +237,20 @@ struct v4l2_capability | |||
| 154 | }; | 237 | }; |
| 155 | 238 | ||
| 156 | /* Values for 'capabilities' field */ | 239 | /* Values for 'capabilities' field */ |
| 157 | #define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */ | 240 | #define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */ |
| 158 | #define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */ | 241 | #define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */ |
| 159 | #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ | 242 | #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ |
| 160 | #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ | 243 | #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ |
| 161 | #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ | 244 | #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ |
| 162 | #if 1 | 245 | #if 1 |
| 163 | #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ | 246 | #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ |
| 164 | #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ | 247 | #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ |
| 165 | #endif | 248 | #endif |
| 166 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ | 249 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ |
| 167 | 250 | ||
| 168 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ | 251 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ |
| 169 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ | 252 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ |
| 170 | #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ | 253 | #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ |
| 171 | 254 | ||
| 172 | #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ | 255 | #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ |
| 173 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ | 256 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ |
| @@ -179,13 +262,13 @@ struct v4l2_capability | |||
| 179 | 262 | ||
| 180 | struct v4l2_pix_format | 263 | struct v4l2_pix_format |
| 181 | { | 264 | { |
| 182 | __u32 width; | 265 | __u32 width; |
| 183 | __u32 height; | 266 | __u32 height; |
| 184 | __u32 pixelformat; | 267 | __u32 pixelformat; |
| 185 | enum v4l2_field field; | 268 | enum v4l2_field field; |
| 186 | __u32 bytesperline; /* for padding, zero if unused */ | 269 | __u32 bytesperline; /* for padding, zero if unused */ |
| 187 | __u32 sizeimage; | 270 | __u32 sizeimage; |
| 188 | enum v4l2_colorspace colorspace; | 271 | enum v4l2_colorspace colorspace; |
| 189 | __u32 priv; /* private data, depends on pixelformat */ | 272 | __u32 priv; /* private data, depends on pixelformat */ |
| 190 | }; | 273 | }; |
| 191 | 274 | ||
| @@ -238,12 +321,12 @@ struct v4l2_pix_format | |||
| 238 | */ | 321 | */ |
| 239 | struct v4l2_fmtdesc | 322 | struct v4l2_fmtdesc |
| 240 | { | 323 | { |
| 241 | __u32 index; /* Format number */ | 324 | __u32 index; /* Format number */ |
| 242 | enum v4l2_buf_type type; /* buffer type */ | 325 | enum v4l2_buf_type type; /* buffer type */ |
| 243 | __u32 flags; | 326 | __u32 flags; |
| 244 | __u8 description[32]; /* Description string */ | 327 | __u8 description[32]; /* Description string */ |
| 245 | __u32 pixelformat; /* Format fourcc */ | 328 | __u32 pixelformat; /* Format fourcc */ |
| 246 | __u32 reserved[4]; | 329 | __u32 reserved[4]; |
| 247 | }; | 330 | }; |
| 248 | 331 | ||
| 249 | #define V4L2_FMT_FLAG_COMPRESSED 0x0001 | 332 | #define V4L2_FMT_FLAG_COMPRESSED 0x0001 |
| @@ -393,7 +476,7 @@ struct v4l2_jpegcompression | |||
| 393 | #define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */ | 476 | #define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */ |
| 394 | #define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */ | 477 | #define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */ |
| 395 | #define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will | 478 | #define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will |
| 396 | * allways use APP0 */ | 479 | * allways use APP0 */ |
| 397 | }; | 480 | }; |
| 398 | 481 | ||
| 399 | 482 | ||
| @@ -402,10 +485,10 @@ struct v4l2_jpegcompression | |||
| 402 | */ | 485 | */ |
| 403 | struct v4l2_requestbuffers | 486 | struct v4l2_requestbuffers |
| 404 | { | 487 | { |
| 405 | __u32 count; | 488 | __u32 count; |
| 406 | enum v4l2_buf_type type; | 489 | enum v4l2_buf_type type; |
| 407 | enum v4l2_memory memory; | 490 | enum v4l2_memory memory; |
| 408 | __u32 reserved[2]; | 491 | __u32 reserved[2]; |
| 409 | }; | 492 | }; |
| 410 | 493 | ||
| 411 | struct v4l2_buffer | 494 | struct v4l2_buffer |
| @@ -511,9 +594,9 @@ struct v4l2_outputparm | |||
| 511 | 594 | ||
| 512 | struct v4l2_cropcap { | 595 | struct v4l2_cropcap { |
| 513 | enum v4l2_buf_type type; | 596 | enum v4l2_buf_type type; |
| 514 | struct v4l2_rect bounds; | 597 | struct v4l2_rect bounds; |
| 515 | struct v4l2_rect defrect; | 598 | struct v4l2_rect defrect; |
| 516 | struct v4l2_fract pixelaspect; | 599 | struct v4l2_fract pixelaspect; |
| 517 | }; | 600 | }; |
| 518 | 601 | ||
| 519 | struct v4l2_crop { | 602 | struct v4l2_crop { |
| @@ -544,6 +627,7 @@ typedef __u64 v4l2_std_id; | |||
| 544 | 627 | ||
| 545 | #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) | 628 | #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) |
| 546 | #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) | 629 | #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) |
| 630 | #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000) | ||
| 547 | 631 | ||
| 548 | #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000) | 632 | #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000) |
| 549 | #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000) | 633 | #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000) |
| @@ -581,13 +665,14 @@ typedef __u64 v4l2_std_id; | |||
| 581 | 665 | ||
| 582 | #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ | 666 | #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ |
| 583 | V4L2_STD_PAL_60 |\ | 667 | V4L2_STD_PAL_60 |\ |
| 584 | V4L2_STD_NTSC) | 668 | V4L2_STD_NTSC |\ |
| 669 | V4L2_STD_NTSC_443) | ||
| 585 | #define V4L2_STD_625_50 (V4L2_STD_PAL |\ | 670 | #define V4L2_STD_625_50 (V4L2_STD_PAL |\ |
| 586 | V4L2_STD_PAL_N |\ | 671 | V4L2_STD_PAL_N |\ |
| 587 | V4L2_STD_PAL_Nc |\ | 672 | V4L2_STD_PAL_Nc |\ |
| 588 | V4L2_STD_SECAM) | 673 | V4L2_STD_SECAM) |
| 589 | #define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\ | 674 | #define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\ |
| 590 | V4L2_STD_ATSC_16_VSB) | 675 | V4L2_STD_ATSC_16_VSB) |
| 591 | 676 | ||
| 592 | #define V4L2_STD_UNKNOWN 0 | 677 | #define V4L2_STD_UNKNOWN 0 |
| 593 | #define V4L2_STD_ALL (V4L2_STD_525_60 |\ | 678 | #define V4L2_STD_ALL (V4L2_STD_525_60 |\ |
| @@ -595,7 +680,7 @@ typedef __u64 v4l2_std_id; | |||
| 595 | 680 | ||
| 596 | struct v4l2_standard | 681 | struct v4l2_standard |
| 597 | { | 682 | { |
| 598 | __u32 index; | 683 | __u32 index; |
| 599 | v4l2_std_id id; | 684 | v4l2_std_id id; |
| 600 | __u8 name[24]; | 685 | __u8 name[24]; |
| 601 | struct v4l2_fract frameperiod; /* Frames, not fields */ | 686 | struct v4l2_fract frameperiod; /* Frames, not fields */ |
| @@ -610,9 +695,9 @@ struct v4l2_standard | |||
| 610 | struct v4l2_input | 695 | struct v4l2_input |
| 611 | { | 696 | { |
| 612 | __u32 index; /* Which input */ | 697 | __u32 index; /* Which input */ |
| 613 | __u8 name[32]; /* Label */ | 698 | __u8 name[32]; /* Label */ |
| 614 | __u32 type; /* Type of input */ | 699 | __u32 type; /* Type of input */ |
| 615 | __u32 audioset; /* Associated audios (bitfield) */ | 700 | __u32 audioset; /* Associated audios (bitfield) */ |
| 616 | __u32 tuner; /* Associated tuner */ | 701 | __u32 tuner; /* Associated tuner */ |
| 617 | v4l2_std_id std; | 702 | v4l2_std_id std; |
| 618 | __u32 status; | 703 | __u32 status; |
| @@ -647,9 +732,9 @@ struct v4l2_input | |||
| 647 | struct v4l2_output | 732 | struct v4l2_output |
| 648 | { | 733 | { |
| 649 | __u32 index; /* Which output */ | 734 | __u32 index; /* Which output */ |
| 650 | __u8 name[32]; /* Label */ | 735 | __u8 name[32]; /* Label */ |
| 651 | __u32 type; /* Type of output */ | 736 | __u32 type; /* Type of output */ |
| 652 | __u32 audioset; /* Associated audios (bitfield) */ | 737 | __u32 audioset; /* Associated audios (bitfield) */ |
| 653 | __u32 modulator; /* Associated modulator */ | 738 | __u32 modulator; /* Associated modulator */ |
| 654 | v4l2_std_id std; | 739 | v4l2_std_id std; |
| 655 | __u32 reserved[4]; | 740 | __u32 reserved[4]; |
| @@ -671,12 +756,12 @@ struct v4l2_control | |||
| 671 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ | 756 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ |
| 672 | struct v4l2_queryctrl | 757 | struct v4l2_queryctrl |
| 673 | { | 758 | { |
| 674 | __u32 id; | 759 | __u32 id; |
| 675 | enum v4l2_ctrl_type type; | 760 | enum v4l2_ctrl_type type; |
| 676 | __u8 name[32]; /* Whatever */ | 761 | __u8 name[32]; /* Whatever */ |
| 677 | __s32 minimum; /* Note signedness */ | 762 | __s32 minimum; /* Note signedness */ |
| 678 | __s32 maximum; | 763 | __s32 maximum; |
| 679 | __s32 step; | 764 | __s32 step; |
| 680 | __s32 default_value; | 765 | __s32 default_value; |
| 681 | __u32 flags; | 766 | __u32 flags; |
| 682 | __u32 reserved[2]; | 767 | __u32 reserved[2]; |
| @@ -779,10 +864,10 @@ struct v4l2_modulator | |||
| 779 | 864 | ||
| 780 | struct v4l2_frequency | 865 | struct v4l2_frequency |
| 781 | { | 866 | { |
| 782 | __u32 tuner; | 867 | __u32 tuner; |
| 783 | enum v4l2_tuner_type type; | 868 | enum v4l2_tuner_type type; |
| 784 | __u32 frequency; | 869 | __u32 frequency; |
| 785 | __u32 reserved[8]; | 870 | __u32 reserved[8]; |
| 786 | }; | 871 | }; |
| 787 | 872 | ||
| 788 | /* | 873 | /* |
| @@ -802,6 +887,7 @@ struct v4l2_audio | |||
| 802 | 887 | ||
| 803 | /* Flags for the 'mode' field */ | 888 | /* Flags for the 'mode' field */ |
| 804 | #define V4L2_AUDMODE_AVL 0x00001 | 889 | #define V4L2_AUDMODE_AVL 0x00001 |
| 890 | #define V4L2_AUDMODE_32BITS 0x00002 | ||
| 805 | 891 | ||
| 806 | struct v4l2_audioout | 892 | struct v4l2_audioout |
| 807 | { | 893 | { |
| @@ -846,14 +932,14 @@ struct v4l2_vbi_format | |||
| 846 | 932 | ||
| 847 | struct v4l2_sliced_vbi_format | 933 | struct v4l2_sliced_vbi_format |
| 848 | { | 934 | { |
| 849 | __u16 service_set; | 935 | __u16 service_set; |
| 850 | /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field | 936 | /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field |
| 851 | service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field | 937 | service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field |
| 852 | (equals frame lines 313-336 for 625 line video | 938 | (equals frame lines 313-336 for 625 line video |
| 853 | standards, 263-286 for 525 line standards) */ | 939 | standards, 263-286 for 525 line standards) */ |
| 854 | __u16 service_lines[2][24]; | 940 | __u16 service_lines[2][24]; |
| 855 | __u32 io_size; | 941 | __u32 io_size; |
| 856 | __u32 reserved[2]; /* must be zero */ | 942 | __u32 reserved[2]; /* must be zero */ |
| 857 | }; | 943 | }; |
| 858 | 944 | ||
| 859 | #define V4L2_SLICED_TELETEXT_B (0x0001) | 945 | #define V4L2_SLICED_TELETEXT_B (0x0001) |
| @@ -866,22 +952,22 @@ struct v4l2_sliced_vbi_format | |||
| 866 | 952 | ||
| 867 | struct v4l2_sliced_vbi_cap | 953 | struct v4l2_sliced_vbi_cap |
| 868 | { | 954 | { |
| 869 | __u16 service_set; | 955 | __u16 service_set; |
| 870 | /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field | 956 | /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field |
| 871 | service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field | 957 | service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field |
| 872 | (equals frame lines 313-336 for 625 line video | 958 | (equals frame lines 313-336 for 625 line video |
| 873 | standards, 263-286 for 525 line standards) */ | 959 | standards, 263-286 for 525 line standards) */ |
| 874 | __u16 service_lines[2][24]; | 960 | __u16 service_lines[2][24]; |
| 875 | __u32 reserved[4]; /* must be 0 */ | 961 | __u32 reserved[4]; /* must be 0 */ |
| 876 | }; | 962 | }; |
| 877 | 963 | ||
| 878 | struct v4l2_sliced_vbi_data | 964 | struct v4l2_sliced_vbi_data |
| 879 | { | 965 | { |
| 880 | __u32 id; | 966 | __u32 id; |
| 881 | __u32 field; /* 0: first field, 1: second field */ | 967 | __u32 field; /* 0: first field, 1: second field */ |
| 882 | __u32 line; /* 1-23 */ | 968 | __u32 line; /* 1-23 */ |
| 883 | __u32 reserved; /* must be 0 */ | 969 | __u32 reserved; /* must be 0 */ |
| 884 | __u8 data[48]; | 970 | __u8 data[48]; |
| 885 | }; | 971 | }; |
| 886 | #endif | 972 | #endif |
| 887 | 973 | ||
| @@ -896,9 +982,9 @@ struct v4l2_format | |||
| 896 | enum v4l2_buf_type type; | 982 | enum v4l2_buf_type type; |
| 897 | union | 983 | union |
| 898 | { | 984 | { |
| 899 | struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE | 985 | struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE |
| 900 | struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY | 986 | struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY |
| 901 | struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE | 987 | struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE |
| 902 | #if 1 | 988 | #if 1 |
| 903 | struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE | 989 | struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE |
| 904 | #endif | 990 | #endif |
| @@ -981,6 +1067,7 @@ struct v4l2_streamparm | |||
| 981 | #if 1 | 1067 | #if 1 |
| 982 | #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) | 1068 | #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) |
| 983 | #endif | 1069 | #endif |
| 1070 | #define VIDIOC_LOG_STATUS _IO ('V', 70) | ||
| 984 | 1071 | ||
| 985 | /* for compatibility, will go away some day */ | 1072 | /* for compatibility, will go away some day */ |
| 986 | #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) | 1073 | #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) |
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 | }; |
| 55 | typedef struct __wait_queue_head wait_queue_head_t; | 55 | typedef struct __wait_queue_head wait_queue_head_t; |
| 56 | 56 | ||
| 57 | struct task_struct; | ||
| 57 | 58 | ||
| 58 | /* | 59 | /* |
| 59 | * Macros for declaration and initialisaton of the datatypes | 60 | * Macros for declaration and initialisaton of the datatypes |
