aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acct.h3
-rw-r--r--include/linux/acpi.h1
-rw-r--r--include/linux/affs_hardblocks.h72
-rw-r--r--include/linux/agpgart.h3
-rw-r--r--include/linux/amba/clcd.h1
-rw-r--r--include/linux/atmdev.h1
-rw-r--r--include/linux/audit.h103
-rw-r--r--include/linux/blkdev.h4
-rw-r--r--include/linux/blkpg.h1
-rw-r--r--include/linux/blktrace_api.h1
-rw-r--r--include/linux/blockgroup_lock.h1
-rw-r--r--include/linux/cache.h1
-rw-r--r--include/linux/coda.h1
-rw-r--r--include/linux/compat.h1
-rw-r--r--include/linux/compiler.h19
-rw-r--r--include/linux/connector.h5
-rw-r--r--include/linux/console.h4
-rw-r--r--include/linux/cpufreq.h1
-rw-r--r--include/linux/cramfs_fs.h34
-rw-r--r--include/linux/crypto.h1
-rw-r--r--include/linux/cyclomx.h1
-rw-r--r--include/linux/dcache.h2
-rw-r--r--include/linux/dcookies.h1
-rw-r--r--include/linux/devfs_fs_kernel.h1
-rw-r--r--include/linux/device.h26
-rw-r--r--include/linux/divert.h20
-rw-r--r--include/linux/dmaengine.h359
-rw-r--r--include/linux/dmi.h1
-rw-r--r--include/linux/dnotify.h1
-rw-r--r--include/linux/elf-em.h44
-rw-r--r--include/linux/elf.h59
-rw-r--r--include/linux/errqueue.h1
-rw-r--r--include/linux/ethtool.h169
-rw-r--r--include/linux/ext2_fs.h2
-rw-r--r--include/linux/ext3_fs.h10
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/fsnotify.h32
-rw-r--r--include/linux/ftape.h1
-rw-r--r--include/linux/gameport.h6
-rw-r--r--include/linux/generic_serial.h6
-rw-r--r--include/linux/genhd.h12
-rw-r--r--include/linux/gfp.h1
-rw-r--r--include/linux/hardirq.h1
-rw-r--r--include/linux/highmem.h1
-rw-r--r--include/linux/highuid.h1
-rw-r--r--include/linux/hrtimer.h2
-rw-r--r--include/linux/i2c-algo-ite.h7
-rw-r--r--include/linux/i2c-ocores.h19
-rw-r--r--include/linux/i2c.h13
-rw-r--r--include/linux/i2o-dev.h167
-rw-r--r--include/linux/ide.h1
-rw-r--r--include/linux/if_fddi.h2
-rw-r--r--include/linux/if_frad.h1
-rw-r--r--include/linux/if_tr.h1
-rw-r--r--include/linux/igmp.h2
-rw-r--r--include/linux/init.h1
-rw-r--r--include/linux/inotify.h109
-rw-r--r--include/linux/input.h1
-rw-r--r--include/linux/interrupt.h1
-rw-r--r--include/linux/io.h1
-rw-r--r--include/linux/ipmi.h2
-rw-r--r--include/linux/ipv6.h1
-rw-r--r--include/linux/irq.h1
-rw-r--r--include/linux/irq_cpustat.h1
-rw-r--r--include/linux/isa.h28
-rw-r--r--include/linux/isapnp.h1
-rw-r--r--include/linux/isdn.h1
-rw-r--r--include/linux/isdn/tpam.h1
-rw-r--r--include/linux/isdn_ppp.h1
-rw-r--r--include/linux/isdnif.h1
-rw-r--r--include/linux/jffs2.h56
-rw-r--r--include/linux/jffs2_fs_i.h50
-rw-r--r--include/linux/jffs2_fs_sb.h122
-rw-r--r--include/linux/joystick.h22
-rw-r--r--include/linux/kallsyms.h1
-rw-r--r--include/linux/kernel_stat.h1
-rw-r--r--include/linux/key.h23
-rw-r--r--include/linux/kmod.h1
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/kprobes.h1
-rw-r--r--include/linux/linkage.h1
-rw-r--r--include/linux/lockd/lockd.h1
-rw-r--r--include/linux/lockd/nlm.h1
-rw-r--r--include/linux/m41t00.h50
-rw-r--r--include/linux/mempolicy.h1
-rw-r--r--include/linux/migrate.h1
-rw-r--r--include/linux/mii.h30
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/mman.h12
-rw-r--r--include/linux/mmzone.h1
-rw-r--r--include/linux/module.h10
-rw-r--r--include/linux/msg.h2
-rw-r--r--include/linux/mtd/cfi.h1
-rw-r--r--include/linux/mtd/inftl.h2
-rw-r--r--include/linux/mtd/map.h1
-rw-r--r--include/linux/mtd/mtd.h98
-rw-r--r--include/linux/mtd/nand.h355
-rw-r--r--include/linux/mtd/ndfc.h67
-rw-r--r--include/linux/mtd/nftl.h2
-rw-r--r--include/linux/mtd/onenand.h11
-rw-r--r--include/linux/mtd/onenand_regs.h8
-rw-r--r--include/linux/mtd/partitions.h2
-rw-r--r--include/linux/mtd/physmap.h29
-rw-r--r--include/linux/mtd/xip.h1
-rw-r--r--include/linux/nbd.h12
-rw-r--r--include/linux/ncp_fs.h5
-rw-r--r--include/linux/net.h3
-rw-r--r--include/linux/netdevice.h47
-rw-r--r--include/linux/netfilter.h1
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h4
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h4
-rw-r--r--include/linux/netfilter/xt_CONNSECMARK.h13
-rw-r--r--include/linux/netfilter/xt_SECMARK.h26
-rw-r--r--include/linux/netfilter/xt_conntrack.h2
-rw-r--r--include/linux/netfilter/xt_quota.h16
-rw-r--r--include/linux/netfilter/xt_statistic.h32
-rw-r--r--include/linux/netfilter_arp.h1
-rw-r--r--include/linux/netfilter_bridge.h1
-rw-r--r--include/linux/netfilter_ipv4.h1
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h7
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_h323.h7
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h3
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_sip.h44
-rw-r--r--include/linux/netfilter_ipv4/listhelp.h1
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/nfs.h8
-rw-r--r--include/linux/nfs4.h6
-rw-r--r--include/linux/nfs_fs.h39
-rw-r--r--include/linux/nfsd/nfsd.h1
-rw-r--r--include/linux/nfsd/nfsfh.h1
-rw-r--r--include/linux/nfsd/syscall.h1
-rw-r--r--include/linux/numa.h1
-rw-r--r--include/linux/parport.h1
-rw-r--r--include/linux/pci.h11
-rw-r--r--include/linux/pci_ids.h28
-rw-r--r--include/linux/pci_regs.h1
-rw-r--r--include/linux/percpu_counter.h1
-rw-r--r--include/linux/pfkeyv2.h2
-rw-r--r--include/linux/pm.h1
-rw-r--r--include/linux/pm_legacy.h1
-rw-r--r--include/linux/pmu.h1
-rw-r--r--include/linux/ppp_defs.h14
-rw-r--r--include/linux/preempt.h1
-rw-r--r--include/linux/proc_fs.h1
-rw-r--r--include/linux/profile.h1
-rw-r--r--include/linux/quota.h4
-rw-r--r--include/linux/quotaops.h1
-rw-r--r--include/linux/rbtree.h26
-rw-r--r--include/linux/reiserfs_xattr.h3
-rw-r--r--include/linux/relay.h1
-rw-r--r--include/linux/rio.h1
-rw-r--r--include/linux/rio_drv.h1
-rw-r--r--include/linux/rmap.h1
-rw-r--r--include/linux/rtnetlink.h1
-rw-r--r--include/linux/rwsem.h1
-rw-r--r--include/linux/scc.h1
-rw-r--r--include/linux/sched.h92
-rw-r--r--include/linux/seccomp.h1
-rw-r--r--include/linux/security.h50
-rw-r--r--include/linux/selinux.h32
-rw-r--r--include/linux/sem.h2
-rw-r--r--include/linux/seqlock.h1
-rw-r--r--include/linux/serialP.h1
-rw-r--r--include/linux/serial_core.h5
-rw-r--r--include/linux/signal.h4
-rw-r--r--include/linux/skbuff.h75
-rw-r--r--include/linux/slab.h1
-rw-r--r--include/linux/smb_fs.h4
-rw-r--r--include/linux/smp.h1
-rw-r--r--include/linux/smp_lock.h1
-rw-r--r--include/linux/socket.h2
-rw-r--r--include/linux/spinlock.h1
-rw-r--r--include/linux/stop_machine.h1
-rw-r--r--include/linux/sunrpc/auth.h1
-rw-r--r--include/linux/sunrpc/debug.h24
-rw-r--r--include/linux/sunrpc/stats.h1
-rw-r--r--include/linux/suspend.h1
-rw-r--r--include/linux/swap.h1
-rw-r--r--include/linux/syscalls.h1
-rw-r--r--include/linux/sysctl.h4
-rw-r--r--include/linux/sysdev.h18
-rw-r--r--include/linux/sysrq.h1
-rw-r--r--include/linux/tcp.h9
-rw-r--r--include/linux/threads.h1
-rw-r--r--include/linux/timer.h1
-rw-r--r--include/linux/timex.h1
-rw-r--r--include/linux/tty.h5
-rw-r--r--include/linux/types.h1
-rw-r--r--include/linux/udp.h1
-rw-r--r--include/linux/ufs_fs.h1
-rw-r--r--include/linux/unistd.h2
-rw-r--r--include/linux/usb.h23
-rw-r--r--include/linux/usb/cdc.h (renamed from include/linux/usb_cdc.h)0
-rw-r--r--include/linux/usb/input.h (renamed from include/linux/usb_input.h)0
-rw-r--r--include/linux/usb/isp116x.h (renamed from include/linux/usb_isp116x.h)0
-rw-r--r--include/linux/usb/sl811.h (renamed from include/linux/usb_sl811.h)8
-rw-r--r--include/linux/usb_usual.h1
-rw-r--r--include/linux/usbdevice_fs.h2
-rw-r--r--include/linux/vt_buffer.h1
-rw-r--r--include/linux/vt_kern.h1
-rw-r--r--include/linux/wait.h1
-rw-r--r--include/linux/wanrouter.h4
-rw-r--r--include/linux/xfrm.h4
-rw-r--r--include/linux/zconf.h12
-rw-r--r--include/linux/zlib.h209
-rw-r--r--include/linux/zutil.h12
206 files changed, 2187 insertions, 1184 deletions
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 9a66401073fc..3d54fbcf969e 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -16,7 +16,6 @@
16#define _LINUX_ACCT_H 16#define _LINUX_ACCT_H
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/jiffies.h>
20 19
21#include <asm/param.h> 20#include <asm/param.h>
22#include <asm/byteorder.h> 21#include <asm/byteorder.h>
@@ -116,7 +115,6 @@ struct acct_v3
116 115
117#ifdef __KERNEL__ 116#ifdef __KERNEL__
118 117
119#include <linux/config.h>
120 118
121#ifdef CONFIG_BSD_PROCESS_ACCT 119#ifdef CONFIG_BSD_PROCESS_ACCT
122struct vfsmount; 120struct vfsmount;
@@ -165,6 +163,7 @@ typedef struct acct acct_t;
165#endif /* __KERNEL */ 163#endif /* __KERNEL */
166 164
167#ifdef __KERNEL__ 165#ifdef __KERNEL__
166#include <linux/jiffies.h>
168/* 167/*
169 * Yet another set of HZ to *HZ helper functions. 168 * Yet another set of HZ to *HZ helper functions.
170 * See <linux/jiffies.h> for the original. 169 * See <linux/jiffies.h> for the original.
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index d3bc25e6d27d..1cf0b91d05bd 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -25,7 +25,6 @@
25#ifndef _LINUX_ACPI_H 25#ifndef _LINUX_ACPI_H
26#define _LINUX_ACPI_H 26#define _LINUX_ACPI_H
27 27
28#include <linux/config.h>
29 28
30#ifdef CONFIG_ACPI 29#ifdef CONFIG_ACPI
31 30
diff --git a/include/linux/affs_hardblocks.h b/include/linux/affs_hardblocks.h
index 3fb869939d82..f1b948c1f592 100644
--- a/include/linux/affs_hardblocks.h
+++ b/include/linux/affs_hardblocks.h
@@ -1,45 +1,47 @@
1#ifndef AFFS_HARDBLOCKS_H 1#ifndef AFFS_HARDBLOCKS_H
2#define AFFS_HARDBLOCKS_H 2#define AFFS_HARDBLOCKS_H
3 3
4#include <linux/types.h>
5
4/* Just the needed definitions for the RDB of an Amiga HD. */ 6/* Just the needed definitions for the RDB of an Amiga HD. */
5 7
6struct RigidDiskBlock { 8struct RigidDiskBlock {
7 u32 rdb_ID; 9 __u32 rdb_ID;
8 __be32 rdb_SummedLongs; 10 __be32 rdb_SummedLongs;
9 s32 rdb_ChkSum; 11 __s32 rdb_ChkSum;
10 u32 rdb_HostID; 12 __u32 rdb_HostID;
11 __be32 rdb_BlockBytes; 13 __be32 rdb_BlockBytes;
12 u32 rdb_Flags; 14 __u32 rdb_Flags;
13 u32 rdb_BadBlockList; 15 __u32 rdb_BadBlockList;
14 __be32 rdb_PartitionList; 16 __be32 rdb_PartitionList;
15 u32 rdb_FileSysHeaderList; 17 __u32 rdb_FileSysHeaderList;
16 u32 rdb_DriveInit; 18 __u32 rdb_DriveInit;
17 u32 rdb_Reserved1[6]; 19 __u32 rdb_Reserved1[6];
18 u32 rdb_Cylinders; 20 __u32 rdb_Cylinders;
19 u32 rdb_Sectors; 21 __u32 rdb_Sectors;
20 u32 rdb_Heads; 22 __u32 rdb_Heads;
21 u32 rdb_Interleave; 23 __u32 rdb_Interleave;
22 u32 rdb_Park; 24 __u32 rdb_Park;
23 u32 rdb_Reserved2[3]; 25 __u32 rdb_Reserved2[3];
24 u32 rdb_WritePreComp; 26 __u32 rdb_WritePreComp;
25 u32 rdb_ReducedWrite; 27 __u32 rdb_ReducedWrite;
26 u32 rdb_StepRate; 28 __u32 rdb_StepRate;
27 u32 rdb_Reserved3[5]; 29 __u32 rdb_Reserved3[5];
28 u32 rdb_RDBBlocksLo; 30 __u32 rdb_RDBBlocksLo;
29 u32 rdb_RDBBlocksHi; 31 __u32 rdb_RDBBlocksHi;
30 u32 rdb_LoCylinder; 32 __u32 rdb_LoCylinder;
31 u32 rdb_HiCylinder; 33 __u32 rdb_HiCylinder;
32 u32 rdb_CylBlocks; 34 __u32 rdb_CylBlocks;
33 u32 rdb_AutoParkSeconds; 35 __u32 rdb_AutoParkSeconds;
34 u32 rdb_HighRDSKBlock; 36 __u32 rdb_HighRDSKBlock;
35 u32 rdb_Reserved4; 37 __u32 rdb_Reserved4;
36 char rdb_DiskVendor[8]; 38 char rdb_DiskVendor[8];
37 char rdb_DiskProduct[16]; 39 char rdb_DiskProduct[16];
38 char rdb_DiskRevision[4]; 40 char rdb_DiskRevision[4];
39 char rdb_ControllerVendor[8]; 41 char rdb_ControllerVendor[8];
40 char rdb_ControllerProduct[16]; 42 char rdb_ControllerProduct[16];
41 char rdb_ControllerRevision[4]; 43 char rdb_ControllerRevision[4];
42 u32 rdb_Reserved5[10]; 44 __u32 rdb_Reserved5[10];
43}; 45};
44 46
45#define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */ 47#define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */
@@ -47,16 +49,16 @@ struct RigidDiskBlock {
47struct PartitionBlock { 49struct PartitionBlock {
48 __be32 pb_ID; 50 __be32 pb_ID;
49 __be32 pb_SummedLongs; 51 __be32 pb_SummedLongs;
50 s32 pb_ChkSum; 52 __s32 pb_ChkSum;
51 u32 pb_HostID; 53 __u32 pb_HostID;
52 __be32 pb_Next; 54 __be32 pb_Next;
53 u32 pb_Flags; 55 __u32 pb_Flags;
54 u32 pb_Reserved1[2]; 56 __u32 pb_Reserved1[2];
55 u32 pb_DevFlags; 57 __u32 pb_DevFlags;
56 u8 pb_DriveName[32]; 58 __u8 pb_DriveName[32];
57 u32 pb_Reserved2[15]; 59 __u32 pb_Reserved2[15];
58 __be32 pb_Environment[17]; 60 __be32 pb_Environment[17];
59 u32 pb_EReserved[15]; 61 __u32 pb_EReserved[15];
60}; 62};
61 63
62#define IDNAME_PARTITION 0x50415254 /* "PART" */ 64#define IDNAME_PARTITION 0x50415254 /* "PART" */
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h
index 6d59c8efe3be..bfb8ec791b7b 100644
--- a/include/linux/agpgart.h
+++ b/include/linux/agpgart.h
@@ -27,8 +27,6 @@
27#ifndef _AGP_H 27#ifndef _AGP_H
28#define _AGP_H 1 28#define _AGP_H 1
29 29
30#include <linux/agp_backend.h>
31
32#define AGPIOC_BASE 'A' 30#define AGPIOC_BASE 'A'
33#define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*) 31#define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*)
34#define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1) 32#define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1)
@@ -112,6 +110,7 @@ typedef struct _agp_unbind {
112 110
113#else /* __KERNEL__ */ 111#else /* __KERNEL__ */
114#include <linux/mutex.h> 112#include <linux/mutex.h>
113#include <linux/agp_backend.h>
115 114
116#define AGPGART_MINOR 175 115#define AGPGART_MINOR 175
117 116
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h
index 9cf64b1b688b..29c0448265cf 100644
--- a/include/linux/amba/clcd.h
+++ b/include/linux/amba/clcd.h
@@ -9,7 +9,6 @@
9 * License. See the file COPYING in the main directory of this archive 9 * License. See the file COPYING in the main directory of this archive
10 * for more details. 10 * for more details.
11 */ 11 */
12#include <linux/config.h>
13#include <linux/fb.h> 12#include <linux/fb.h>
14 13
15/* 14/*
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index b203ea82a0a8..1eb238affb12 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -209,7 +209,6 @@ struct atm_cirange {
209 209
210#ifdef __KERNEL__ 210#ifdef __KERNEL__
211 211
212#include <linux/config.h>
213#include <linux/wait.h> /* wait_queue_head_t */ 212#include <linux/wait.h> /* wait_queue_head_t */
214#include <linux/time.h> /* struct timeval */ 213#include <linux/time.h> /* struct timeval */
215#include <linux/net.h> 214#include <linux/net.h>
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b74c148f14e3..e051ff9c5b50 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -24,8 +24,7 @@
24#ifndef _LINUX_AUDIT_H_ 24#ifndef _LINUX_AUDIT_H_
25#define _LINUX_AUDIT_H_ 25#define _LINUX_AUDIT_H_
26 26
27#include <linux/sched.h> 27#include <linux/elf-em.h>
28#include <linux/elf.h>
29 28
30/* The netlink messages for the audit system is divided into blocks: 29/* The netlink messages for the audit system is divided into blocks:
31 * 1000 - 1099 are for commanding the audit system 30 * 1000 - 1099 are for commanding the audit system
@@ -83,7 +82,12 @@
83#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */ 82#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */
84#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */ 83#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */
85#define AUDIT_CWD 1307 /* Current working directory */ 84#define AUDIT_CWD 1307 /* Current working directory */
85#define AUDIT_EXECVE 1309 /* execve arguments */
86#define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */ 86#define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */
87#define AUDIT_MQ_OPEN 1312 /* POSIX MQ open record type */
88#define AUDIT_MQ_SENDRECV 1313 /* POSIX MQ send/receive record type */
89#define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */
90#define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */
87 91
88#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 92#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
89#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ 93#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
@@ -151,6 +155,7 @@
151#define AUDIT_SE_TYPE 15 /* security label type */ 155#define AUDIT_SE_TYPE 15 /* security label type */
152#define AUDIT_SE_SEN 16 /* security label sensitivity label */ 156#define AUDIT_SE_SEN 16 /* security label sensitivity label */
153#define AUDIT_SE_CLR 17 /* security label clearance label */ 157#define AUDIT_SE_CLR 17 /* security label clearance label */
158#define AUDIT_PPID 18
154 159
155 /* These are ONLY useful when checking 160 /* These are ONLY useful when checking
156 * at syscall exit time (AUDIT_AT_EXIT). */ 161 * at syscall exit time (AUDIT_AT_EXIT). */
@@ -159,6 +164,7 @@
159#define AUDIT_INODE 102 164#define AUDIT_INODE 102
160#define AUDIT_EXIT 103 165#define AUDIT_EXIT 103
161#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */ 166#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */
167#define AUDIT_WATCH 105
162 168
163#define AUDIT_ARG0 200 169#define AUDIT_ARG0 200
164#define AUDIT_ARG1 (AUDIT_ARG0+1) 170#define AUDIT_ARG1 (AUDIT_ARG0+1)
@@ -273,16 +279,21 @@ struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */
273}; 279};
274 280
275#ifdef __KERNEL__ 281#ifdef __KERNEL__
282#include <linux/sched.h>
276 283
277struct audit_sig_info { 284struct audit_sig_info {
278 uid_t uid; 285 uid_t uid;
279 pid_t pid; 286 pid_t pid;
287 char ctx[0];
280}; 288};
281 289
282struct audit_buffer; 290struct audit_buffer;
283struct audit_context; 291struct audit_context;
284struct inode; 292struct inode;
285struct netlink_skb_parms; 293struct netlink_skb_parms;
294struct linux_binprm;
295struct mq_attr;
296struct mqstat;
286 297
287#define AUDITSC_INVALID 0 298#define AUDITSC_INVALID 0
288#define AUDITSC_SUCCESS 1 299#define AUDITSC_SUCCESS 1
@@ -297,15 +308,19 @@ extern void audit_syscall_entry(int arch,
297 int major, unsigned long a0, unsigned long a1, 308 int major, unsigned long a0, unsigned long a1,
298 unsigned long a2, unsigned long a3); 309 unsigned long a2, unsigned long a3);
299extern void audit_syscall_exit(int failed, long return_code); 310extern void audit_syscall_exit(int failed, long return_code);
300extern void audit_getname(const char *name); 311extern void __audit_getname(const char *name);
301extern void audit_putname(const char *name); 312extern void audit_putname(const char *name);
302extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags); 313extern void __audit_inode(const char *name, const struct inode *inode);
303extern void __audit_inode_child(const char *dname, const struct inode *inode, 314extern void __audit_inode_child(const char *dname, const struct inode *inode,
304 unsigned long pino); 315 unsigned long pino);
305static inline void audit_inode(const char *name, const struct inode *inode, 316static inline void audit_getname(const char *name)
306 unsigned flags) { 317{
307 if (unlikely(current->audit_context)) 318 if (unlikely(current->audit_context))
308 __audit_inode(name, inode, flags); 319 __audit_getname(name);
320}
321static inline void audit_inode(const char *name, const struct inode *inode) {
322 if (unlikely(current->audit_context))
323 __audit_inode(name, inode);
309} 324}
310static inline void audit_inode_child(const char *dname, 325static inline void audit_inode_child(const char *dname,
311 const struct inode *inode, 326 const struct inode *inode,
@@ -320,13 +335,61 @@ extern void auditsc_get_stamp(struct audit_context *ctx,
320 struct timespec *t, unsigned int *serial); 335 struct timespec *t, unsigned int *serial);
321extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); 336extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid);
322extern uid_t audit_get_loginuid(struct audit_context *ctx); 337extern uid_t audit_get_loginuid(struct audit_context *ctx);
323extern int audit_ipc_obj(struct kern_ipc_perm *ipcp); 338extern int __audit_ipc_obj(struct kern_ipc_perm *ipcp);
324extern int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp); 339extern int __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode);
340extern int audit_bprm(struct linux_binprm *bprm);
325extern int audit_socketcall(int nargs, unsigned long *args); 341extern int audit_socketcall(int nargs, unsigned long *args);
326extern int audit_sockaddr(int len, void *addr); 342extern int audit_sockaddr(int len, void *addr);
327extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); 343extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt);
328extern void audit_signal_info(int sig, struct task_struct *t);
329extern int audit_set_macxattr(const char *name); 344extern int audit_set_macxattr(const char *name);
345extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr);
346extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout);
347extern int __audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout);
348extern int __audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification);
349extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
350
351static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp)
352{
353 if (unlikely(current->audit_context))
354 return __audit_ipc_obj(ipcp);
355 return 0;
356}
357static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode)
358{
359 if (unlikely(current->audit_context))
360 return __audit_ipc_set_perm(qbytes, uid, gid, mode);
361 return 0;
362}
363static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr)
364{
365 if (unlikely(current->audit_context))
366 return __audit_mq_open(oflag, mode, u_attr);
367 return 0;
368}
369static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout)
370{
371 if (unlikely(current->audit_context))
372 return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout);
373 return 0;
374}
375static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout)
376{
377 if (unlikely(current->audit_context))
378 return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout);
379 return 0;
380}
381static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification)
382{
383 if (unlikely(current->audit_context))
384 return __audit_mq_notify(mqdes, u_notification);
385 return 0;
386}
387static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
388{
389 if (unlikely(current->audit_context))
390 return __audit_mq_getsetattr(mqdes, mqstat);
391 return 0;
392}
330#else 393#else
331#define audit_alloc(t) ({ 0; }) 394#define audit_alloc(t) ({ 0; })
332#define audit_free(t) do { ; } while (0) 395#define audit_free(t) do { ; } while (0)
@@ -334,19 +397,24 @@ extern int audit_set_macxattr(const char *name);
334#define audit_syscall_exit(f,r) do { ; } while (0) 397#define audit_syscall_exit(f,r) do { ; } while (0)
335#define audit_getname(n) do { ; } while (0) 398#define audit_getname(n) do { ; } while (0)
336#define audit_putname(n) do { ; } while (0) 399#define audit_putname(n) do { ; } while (0)
337#define __audit_inode(n,i,f) do { ; } while (0) 400#define __audit_inode(n,i) do { ; } while (0)
338#define __audit_inode_child(d,i,p) do { ; } while (0) 401#define __audit_inode_child(d,i,p) do { ; } while (0)
339#define audit_inode(n,i,f) do { ; } while (0) 402#define audit_inode(n,i) do { ; } while (0)
340#define audit_inode_child(d,i,p) do { ; } while (0) 403#define audit_inode_child(d,i,p) do { ; } while (0)
341#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) 404#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)
342#define audit_get_loginuid(c) ({ -1; }) 405#define audit_get_loginuid(c) ({ -1; })
343#define audit_ipc_obj(i) ({ 0; }) 406#define audit_ipc_obj(i) ({ 0; })
344#define audit_ipc_set_perm(q,u,g,m,i) ({ 0; }) 407#define audit_ipc_set_perm(q,u,g,m) ({ 0; })
408#define audit_bprm(p) ({ 0; })
345#define audit_socketcall(n,a) ({ 0; }) 409#define audit_socketcall(n,a) ({ 0; })
346#define audit_sockaddr(len, addr) ({ 0; }) 410#define audit_sockaddr(len, addr) ({ 0; })
347#define audit_avc_path(dentry, mnt) ({ 0; }) 411#define audit_avc_path(dentry, mnt) ({ 0; })
348#define audit_signal_info(s,t) do { ; } while (0)
349#define audit_set_macxattr(n) do { ; } while (0) 412#define audit_set_macxattr(n) do { ; } while (0)
413#define audit_mq_open(o,m,a) ({ 0; })
414#define audit_mq_timedsend(d,l,p,t) ({ 0; })
415#define audit_mq_timedreceive(d,l,p,t) ({ 0; })
416#define audit_mq_notify(d,n) ({ 0; })
417#define audit_mq_getsetattr(d,s) ({ 0; })
350#endif 418#endif
351 419
352#ifdef CONFIG_AUDIT 420#ifdef CONFIG_AUDIT
@@ -364,8 +432,11 @@ extern void audit_log_end(struct audit_buffer *ab);
364extern void audit_log_hex(struct audit_buffer *ab, 432extern void audit_log_hex(struct audit_buffer *ab,
365 const unsigned char *buf, 433 const unsigned char *buf,
366 size_t len); 434 size_t len);
367extern void audit_log_untrustedstring(struct audit_buffer *ab, 435extern const char * audit_log_untrustedstring(struct audit_buffer *ab,
368 const char *string); 436 const char *string);
437extern const char * audit_log_n_untrustedstring(struct audit_buffer *ab,
438 size_t n,
439 const char *string);
369extern void audit_log_d_path(struct audit_buffer *ab, 440extern void audit_log_d_path(struct audit_buffer *ab,
370 const char *prefix, 441 const char *prefix,
371 struct dentry *dentry, 442 struct dentry *dentry,
@@ -383,8 +454,8 @@ extern int audit_receive_filter(int type, int pid, int uid, int seq,
383#define audit_log_end(b) do { ; } while (0) 454#define audit_log_end(b) do { ; } while (0)
384#define audit_log_hex(a,b,l) do { ; } while (0) 455#define audit_log_hex(a,b,l) do { ; } while (0)
385#define audit_log_untrustedstring(a,s) do { ; } while (0) 456#define audit_log_untrustedstring(a,s) do { ; } while (0)
457#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0)
386#define audit_log_d_path(b,p,d,v) do { ; } while (0) 458#define audit_log_d_path(b,p,d,v) do { ; } while (0)
387#define audit_panic(m) do { ; } while (0)
388#endif 459#endif
389#endif 460#endif
390#endif 461#endif
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 59e1259b1c40..3457e7b97363 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_BLKDEV_H 1#ifndef _LINUX_BLKDEV_H
2#define _LINUX_BLKDEV_H 2#define _LINUX_BLKDEV_H
3 3
4#include <linux/config.h>
5#include <linux/major.h> 4#include <linux/major.h>
6#include <linux/genhd.h> 5#include <linux/genhd.h>
7#include <linux/list.h> 6#include <linux/list.h>
@@ -439,9 +438,6 @@ struct request_queue
439 438
440#define RQ_INACTIVE (-1) 439#define RQ_INACTIVE (-1)
441#define RQ_ACTIVE 1 440#define RQ_ACTIVE 1
442#define RQ_SCSI_BUSY 0xffff
443#define RQ_SCSI_DONE 0xfffe
444#define RQ_SCSI_DISCONNECTING 0xffe0
445 441
446#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 442#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
447#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ 443#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
diff --git a/include/linux/blkpg.h b/include/linux/blkpg.h
index be5d0f4ad24c..faf8a45af210 100644
--- a/include/linux/blkpg.h
+++ b/include/linux/blkpg.h
@@ -24,6 +24,7 @@
24 * 24 *
25 * For today, only the partition stuff - aeb, 990515 25 * For today, only the partition stuff - aeb, 990515
26 */ 26 */
27#include <linux/compiler.h>
27#include <linux/ioctl.h> 28#include <linux/ioctl.h>
28 29
29#define BLKPG _IO(0x12,105) 30#define BLKPG _IO(0x12,105)
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index b34d3e73d5ea..eb1a867ed245 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -1,7 +1,6 @@
1#ifndef BLKTRACE_H 1#ifndef BLKTRACE_H
2#define BLKTRACE_H 2#define BLKTRACE_H
3 3
4#include <linux/config.h>
5#include <linux/blkdev.h> 4#include <linux/blkdev.h>
6#include <linux/relay.h> 5#include <linux/relay.h>
7 6
diff --git a/include/linux/blockgroup_lock.h b/include/linux/blockgroup_lock.h
index 0137ee5dd43c..8607312983bd 100644
--- a/include/linux/blockgroup_lock.h
+++ b/include/linux/blockgroup_lock.h
@@ -6,7 +6,6 @@
6 * Simple hashed spinlocking. 6 * Simple hashed spinlocking.
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/spinlock.h> 9#include <linux/spinlock.h>
11#include <linux/cache.h> 10#include <linux/cache.h>
12 11
diff --git a/include/linux/cache.h b/include/linux/cache.h
index cc4b3aafad9a..4552504c0228 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -2,7 +2,6 @@
2#define __LINUX_CACHE_H 2#define __LINUX_CACHE_H
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/config.h>
6#include <asm/cache.h> 5#include <asm/cache.h>
7 6
8#ifndef L1_CACHE_ALIGN 7#ifndef L1_CACHE_ALIGN
diff --git a/include/linux/coda.h b/include/linux/coda.h
index bbc5afcd7db6..b5cf0780c51a 100644
--- a/include/linux/coda.h
+++ b/include/linux/coda.h
@@ -59,7 +59,6 @@ Mellon the rights to redistribute these changes without encumbrance.
59#ifndef _CODA_HEADER_ 59#ifndef _CODA_HEADER_
60#define _CODA_HEADER_ 60#define _CODA_HEADER_
61 61
62#include <linux/config.h>
63 62
64/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */ 63/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
65#if defined(__NetBSD__) || \ 64#if defined(__NetBSD__) || \
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 6d3a654be1ae..dda1697ec753 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -4,7 +4,6 @@
4 * These are the type definitions for the architecture specific 4 * These are the type definitions for the architecture specific
5 * syscall compatibility layer. 5 * syscall compatibility layer.
6 */ 6 */
7#include <linux/config.h>
8 7
9#ifdef CONFIG_COMPAT 8#ifdef CONFIG_COMPAT
10 9
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index f23d3c6fc2c0..9b4f11094937 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -78,6 +78,7 @@ extern void __chk_io_ptr(void __iomem *);
78 78
79#endif /* __ASSEMBLY__ */ 79#endif /* __ASSEMBLY__ */
80 80
81#ifdef __KERNEL__
81/* 82/*
82 * Allow us to mark functions as 'deprecated' and have gcc emit a nice 83 * Allow us to mark functions as 'deprecated' and have gcc emit a nice
83 * warning for each use, in hopes of speeding the functions removal. 84 * warning for each use, in hopes of speeding the functions removal.
@@ -127,6 +128,16 @@ extern void __chk_io_ptr(void __iomem *);
127# define __attribute_pure__ /* unimplemented */ 128# define __attribute_pure__ /* unimplemented */
128#endif 129#endif
129 130
131#ifndef noinline
132#define noinline
133#endif
134
135#ifndef __always_inline
136#define __always_inline inline
137#endif
138
139#endif /* __KERNEL__ */
140
130/* 141/*
131 * From the GCC manual: 142 * From the GCC manual:
132 * 143 *
@@ -145,12 +156,4 @@ extern void __chk_io_ptr(void __iomem *);
145# define __attribute_const__ /* unimplemented */ 156# define __attribute_const__ /* unimplemented */
146#endif 157#endif
147 158
148#ifndef noinline
149#define noinline
150#endif
151
152#ifndef __always_inline
153#define __always_inline inline
154#endif
155
156#endif /* __LINUX_COMPILER_H */ 159#endif /* __LINUX_COMPILER_H */
diff --git a/include/linux/connector.h b/include/linux/connector.h
index ad1a22c1c42e..4c02119c6ab9 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -34,8 +34,11 @@
34#define CN_VAL_PROC 0x1 34#define CN_VAL_PROC 0x1
35#define CN_IDX_CIFS 0x2 35#define CN_IDX_CIFS 0x2
36#define CN_VAL_CIFS 0x1 36#define CN_VAL_CIFS 0x1
37#define CN_W1_IDX 0x3 /* w1 communication */
38#define CN_W1_VAL 0x1
37 39
38#define CN_NETLINK_USERS 1 40
41#define CN_NETLINK_USERS 4
39 42
40/* 43/*
41 * Maximum connector's message size. 44 * Maximum connector's message size.
diff --git a/include/linux/console.h b/include/linux/console.h
index 721371382ae5..08734e660d41 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -117,6 +117,10 @@ extern void console_stop(struct console *);
117extern void console_start(struct console *); 117extern void console_start(struct console *);
118extern int is_console_locked(void); 118extern int is_console_locked(void);
119 119
120/* Suspend and resume console messages over PM events */
121extern void suspend_console(void);
122extern void resume_console(void);
123
120/* Some debug stub to catch some of the obvious races in the VT code */ 124/* Some debug stub to catch some of the obvious races in the VT code */
121#if 1 125#if 1
122#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) 126#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress)
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 17866d7e2b71..5aa95011f7e6 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -15,7 +15,6 @@
15#define _LINUX_CPUFREQ_H 15#define _LINUX_CPUFREQ_H
16 16
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/config.h>
19#include <linux/notifier.h> 18#include <linux/notifier.h>
20#include <linux/threads.h> 19#include <linux/threads.h>
21#include <linux/device.h> 20#include <linux/device.h>
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h
index a8948f34b776..a41f38428c37 100644
--- a/include/linux/cramfs_fs.h
+++ b/include/linux/cramfs_fs.h
@@ -1,13 +1,7 @@
1#ifndef __CRAMFS_H 1#ifndef __CRAMFS_H
2#define __CRAMFS_H 2#define __CRAMFS_H
3 3
4#ifndef __KERNEL__ 4#include <linux/types.h>
5
6typedef unsigned char u8;
7typedef unsigned short u16;
8typedef unsigned int u32;
9
10#endif
11 5
12#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */ 6#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
13#define CRAMFS_SIGNATURE "Compressed ROMFS" 7#define CRAMFS_SIGNATURE "Compressed ROMFS"
@@ -33,9 +27,9 @@ typedef unsigned int u32;
33 * Reasonably terse representation of the inode data. 27 * Reasonably terse representation of the inode data.
34 */ 28 */
35struct cramfs_inode { 29struct cramfs_inode {
36 u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH; 30 __u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH;
37 /* SIZE for device files is i_rdev */ 31 /* SIZE for device files is i_rdev */
38 u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH; 32 __u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH;
39 /* NAMELEN is the length of the file name, divided by 4 and 33 /* NAMELEN is the length of the file name, divided by 4 and
40 rounded up. (cramfs doesn't support hard links.) */ 34 rounded up. (cramfs doesn't support hard links.) */
41 /* OFFSET: For symlinks and non-empty regular files, this 35 /* OFFSET: For symlinks and non-empty regular files, this
@@ -44,27 +38,27 @@ struct cramfs_inode {
44 see README). For non-empty directories it is the offset 38 see README). For non-empty directories it is the offset
45 (divided by 4) of the inode of the first file in that 39 (divided by 4) of the inode of the first file in that
46 directory. For anything else, offset is zero. */ 40 directory. For anything else, offset is zero. */
47 u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH; 41 __u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH;
48}; 42};
49 43
50struct cramfs_info { 44struct cramfs_info {
51 u32 crc; 45 __u32 crc;
52 u32 edition; 46 __u32 edition;
53 u32 blocks; 47 __u32 blocks;
54 u32 files; 48 __u32 files;
55}; 49};
56 50
57/* 51/*
58 * Superblock information at the beginning of the FS. 52 * Superblock information at the beginning of the FS.
59 */ 53 */
60struct cramfs_super { 54struct cramfs_super {
61 u32 magic; /* 0x28cd3d45 - random number */ 55 __u32 magic; /* 0x28cd3d45 - random number */
62 u32 size; /* length in bytes */ 56 __u32 size; /* length in bytes */
63 u32 flags; /* feature flags */ 57 __u32 flags; /* feature flags */
64 u32 future; /* reserved for future use */ 58 __u32 future; /* reserved for future use */
65 u8 signature[16]; /* "Compressed ROMFS" */ 59 __u8 signature[16]; /* "Compressed ROMFS" */
66 struct cramfs_info fsid; /* unique filesystem info */ 60 struct cramfs_info fsid; /* unique filesystem info */
67 u8 name[16]; /* user-defined name */ 61 __u8 name[16]; /* user-defined name */
68 struct cramfs_inode root; /* root inode data */ 62 struct cramfs_inode root; /* root inode data */
69}; 63};
70 64
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 0ab1bc1152ca..5a0470e36111 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -17,7 +17,6 @@
17#ifndef _LINUX_CRYPTO_H 17#ifndef _LINUX_CRYPTO_H
18#define _LINUX_CRYPTO_H 18#define _LINUX_CRYPTO_H
19 19
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/types.h> 22#include <linux/types.h>
diff --git a/include/linux/cyclomx.h b/include/linux/cyclomx.h
index 300d704bdb9a..b88f7f428e58 100644
--- a/include/linux/cyclomx.h
+++ b/include/linux/cyclomx.h
@@ -24,7 +24,6 @@
24* 1998/08/08 acme Version 0.0.1 24* 1998/08/08 acme Version 0.0.1
25*/ 25*/
26 26
27#include <linux/config.h>
28#include <linux/wanrouter.h> 27#include <linux/wanrouter.h>
29#include <linux/spinlock.h> 28#include <linux/spinlock.h>
30 29
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 836325ee0931..46d0e079735d 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -217,7 +217,7 @@ extern struct dentry * d_alloc_anon(struct inode *);
217extern struct dentry * d_splice_alias(struct inode *, struct dentry *); 217extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
218extern void shrink_dcache_sb(struct super_block *); 218extern void shrink_dcache_sb(struct super_block *);
219extern void shrink_dcache_parent(struct dentry *); 219extern void shrink_dcache_parent(struct dentry *);
220extern void shrink_dcache_anon(struct hlist_head *); 220extern void shrink_dcache_anon(struct super_block *);
221extern int d_invalidate(struct dentry *); 221extern int d_invalidate(struct dentry *);
222 222
223/* only used at mount-time */ 223/* only used at mount-time */
diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h
index 1d68428c925d..0fe7cdf326f7 100644
--- a/include/linux/dcookies.h
+++ b/include/linux/dcookies.h
@@ -9,7 +9,6 @@
9#ifndef DCOOKIES_H 9#ifndef DCOOKIES_H
10#define DCOOKIES_H 10#define DCOOKIES_H
11 11
12#include <linux/config.h>
13 12
14#ifdef CONFIG_PROFILING 13#ifdef CONFIG_PROFILING
15 14
diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h
index 89810e73d256..0d74a6f22abc 100644
--- a/include/linux/devfs_fs_kernel.h
+++ b/include/linux/devfs_fs_kernel.h
@@ -2,7 +2,6 @@
2#define _LINUX_DEVFS_FS_KERNEL_H 2#define _LINUX_DEVFS_FS_KERNEL_H
3 3
4#include <linux/fs.h> 4#include <linux/fs.h>
5#include <linux/config.h>
6#include <linux/spinlock.h> 5#include <linux/spinlock.h>
7#include <linux/types.h> 6#include <linux/types.h>
8 7
diff --git a/include/linux/device.h b/include/linux/device.h
index e8e53b9accc6..1e5f30da98bc 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -11,7 +11,6 @@
11#ifndef _DEVICE_H_ 11#ifndef _DEVICE_H_
12#define _DEVICE_H_ 12#define _DEVICE_H_
13 13
14#include <linux/config.h>
15#include <linux/ioport.h> 14#include <linux/ioport.h>
16#include <linux/kobject.h> 15#include <linux/kobject.h>
17#include <linux/klist.h> 16#include <linux/klist.h>
@@ -61,11 +60,6 @@ extern void bus_unregister(struct bus_type * bus);
61 60
62extern void bus_rescan_devices(struct bus_type * bus); 61extern void bus_rescan_devices(struct bus_type * bus);
63 62
64extern struct bus_type * get_bus(struct bus_type * bus);
65extern void put_bus(struct bus_type * bus);
66
67extern struct bus_type * find_bus(char * name);
68
69/* iterator helpers for buses */ 63/* iterator helpers for buses */
70 64
71int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, 65int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data,
@@ -148,6 +142,7 @@ struct class {
148 142
149 struct subsystem subsys; 143 struct subsystem subsys;
150 struct list_head children; 144 struct list_head children;
145 struct list_head devices;
151 struct list_head interfaces; 146 struct list_head interfaces;
152 struct semaphore sem; /* locks both the children and interfaces lists */ 147 struct semaphore sem; /* locks both the children and interfaces lists */
153 148
@@ -164,9 +159,6 @@ struct class {
164extern int class_register(struct class *); 159extern int class_register(struct class *);
165extern void class_unregister(struct class *); 160extern void class_unregister(struct class *);
166 161
167extern struct class * class_get(struct class *);
168extern void class_put(struct class *);
169
170 162
171struct class_attribute { 163struct class_attribute {
172 struct attribute attr; 164 struct attribute attr;
@@ -314,6 +306,7 @@ struct device {
314 struct kobject kobj; 306 struct kobject kobj;
315 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 307 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
316 struct device_attribute uevent_attr; 308 struct device_attribute uevent_attr;
309 struct device_attribute *devt_attr;
317 310
318 struct semaphore sem; /* semaphore to synchronize calls to 311 struct semaphore sem; /* semaphore to synchronize calls to
319 * its driver. 312 * its driver.
@@ -341,6 +334,11 @@ struct device {
341 struct dma_coherent_mem *dma_mem; /* internal for coherent mem 334 struct dma_coherent_mem *dma_mem; /* internal for coherent mem
342 override */ 335 override */
343 336
337 /* class_device migration path */
338 struct list_head node;
339 struct class *class; /* optional*/
340 dev_t devt; /* dev_t, creates the sysfs "dev" */
341
344 void (*release)(struct device * dev); 342 void (*release)(struct device * dev);
345}; 343};
346 344
@@ -382,6 +380,13 @@ extern int device_attach(struct device * dev);
382extern void driver_attach(struct device_driver * drv); 380extern void driver_attach(struct device_driver * drv);
383extern void device_reprobe(struct device *dev); 381extern void device_reprobe(struct device *dev);
384 382
383/*
384 * Easy functions for dynamically creating devices on the fly
385 */
386extern struct device *device_create(struct class *cls, struct device *parent,
387 dev_t devt, char *fmt, ...)
388 __attribute__((format(printf,4,5)));
389extern void device_destroy(struct class *cls, dev_t devt);
385 390
386/* 391/*
387 * Platform "fixup" functions - allow the platform to have their say 392 * Platform "fixup" functions - allow the platform to have their say
@@ -411,8 +416,9 @@ extern int firmware_register(struct subsystem *);
411extern void firmware_unregister(struct subsystem *); 416extern void firmware_unregister(struct subsystem *);
412 417
413/* debugging and troubleshooting/diagnostic helpers. */ 418/* debugging and troubleshooting/diagnostic helpers. */
419extern const char *dev_driver_string(struct device *dev);
414#define dev_printk(level, dev, format, arg...) \ 420#define dev_printk(level, dev, format, arg...) \
415 printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg) 421 printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg)
416 422
417#ifdef DEBUG 423#ifdef DEBUG
418#define dev_dbg(dev, format, arg...) \ 424#define dev_dbg(dev, format, arg...) \
diff --git a/include/linux/divert.h b/include/linux/divert.h
index 6919b09133d4..8fb4e9de6843 100644
--- a/include/linux/divert.h
+++ b/include/linux/divert.h
@@ -27,10 +27,10 @@ struct divert_blk
27{ 27{
28 int divert; /* are we active */ 28 int divert; /* are we active */
29 unsigned int protos; /* protocols */ 29 unsigned int protos; /* protocols */
30 u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */ 30 __u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */
31 u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */ 31 __u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */
32 u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */ 32 __u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */
33 u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */ 33 __u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */
34}; 34};
35 35
36/* 36/*
@@ -40,12 +40,12 @@ struct divert_blk
40 40
41typedef union _divert_cf_arg 41typedef union _divert_cf_arg
42{ 42{
43 s16 int16; 43 __s16 int16;
44 u16 uint16; 44 __u16 uint16;
45 s32 int32; 45 __s32 int32;
46 u32 uint32; 46 __u32 uint32;
47 s64 int64; 47 __s64 int64;
48 u64 uint64; 48 __u64 uint64;
49 void __user *ptr; 49 void __user *ptr;
50} divert_cf_arg; 50} divert_cf_arg;
51 51
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
new file mode 100644
index 000000000000..78b236ca04f8
--- /dev/null
+++ b/include/linux/dmaengine.h
@@ -0,0 +1,359 @@
1/*
2 * Copyright(c) 2004 - 2006 Intel Corporation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59
16 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called COPYING.
20 */
21#ifndef DMAENGINE_H
22#define DMAENGINE_H
23#include <linux/config.h>
24#ifdef CONFIG_DMA_ENGINE
25
26#include <linux/device.h>
27#include <linux/uio.h>
28#include <linux/kref.h>
29#include <linux/completion.h>
30#include <linux/rcupdate.h>
31
32/**
33 * enum dma_event - resource PNP/power managment events
34 * @DMA_RESOURCE_SUSPEND: DMA device going into low power state
35 * @DMA_RESOURCE_RESUME: DMA device returning to full power
36 * @DMA_RESOURCE_ADDED: DMA device added to the system
37 * @DMA_RESOURCE_REMOVED: DMA device removed from the system
38 */
39enum dma_event {
40 DMA_RESOURCE_SUSPEND,
41 DMA_RESOURCE_RESUME,
42 DMA_RESOURCE_ADDED,
43 DMA_RESOURCE_REMOVED,
44};
45
46/**
47 * typedef dma_cookie_t
48 *
49 * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code
50 */
51typedef s32 dma_cookie_t;
52
53#define dma_submit_error(cookie) ((cookie) < 0 ? 1 : 0)
54
55/**
56 * enum dma_status - DMA transaction status
57 * @DMA_SUCCESS: transaction completed successfully
58 * @DMA_IN_PROGRESS: transaction not yet processed
59 * @DMA_ERROR: transaction failed
60 */
61enum dma_status {
62 DMA_SUCCESS,
63 DMA_IN_PROGRESS,
64 DMA_ERROR,
65};
66
67/**
68 * struct dma_chan_percpu - the per-CPU part of struct dma_chan
69 * @refcount: local_t used for open-coded "bigref" counting
70 * @memcpy_count: transaction counter
71 * @bytes_transferred: byte counter
72 */
73
74struct dma_chan_percpu {
75 local_t refcount;
76 /* stats */
77 unsigned long memcpy_count;
78 unsigned long bytes_transferred;
79};
80
81/**
82 * struct dma_chan - devices supply DMA channels, clients use them
83 * @client: ptr to the client user of this chan, will be NULL when unused
84 * @device: ptr to the dma device who supplies this channel, always !NULL
85 * @cookie: last cookie value returned to client
86 * @chan_id:
87 * @class_dev:
88 * @refcount: kref, used in "bigref" slow-mode
89 * @slow_ref:
90 * @rcu:
91 * @client_node: used to add this to the client chan list
92 * @device_node: used to add this to the device chan list
93 * @local: per-cpu pointer to a struct dma_chan_percpu
94 */
95struct dma_chan {
96 struct dma_client *client;
97 struct dma_device *device;
98 dma_cookie_t cookie;
99
100 /* sysfs */
101 int chan_id;
102 struct class_device class_dev;
103
104 struct kref refcount;
105 int slow_ref;
106 struct rcu_head rcu;
107
108 struct list_head client_node;
109 struct list_head device_node;
110 struct dma_chan_percpu *local;
111};
112
113void dma_chan_cleanup(struct kref *kref);
114
115static inline void dma_chan_get(struct dma_chan *chan)
116{
117 if (unlikely(chan->slow_ref))
118 kref_get(&chan->refcount);
119 else {
120 local_inc(&(per_cpu_ptr(chan->local, get_cpu())->refcount));
121 put_cpu();
122 }
123}
124
125static inline void dma_chan_put(struct dma_chan *chan)
126{
127 if (unlikely(chan->slow_ref))
128 kref_put(&chan->refcount, dma_chan_cleanup);
129 else {
130 local_dec(&(per_cpu_ptr(chan->local, get_cpu())->refcount));
131 put_cpu();
132 }
133}
134
135/*
136 * typedef dma_event_callback - function pointer to a DMA event callback
137 */
138typedef void (*dma_event_callback) (struct dma_client *client,
139 struct dma_chan *chan, enum dma_event event);
140
141/**
142 * struct dma_client - info on the entity making use of DMA services
143 * @event_callback: func ptr to call when something happens
144 * @chan_count: number of chans allocated
145 * @chans_desired: number of chans requested. Can be +/- chan_count
146 * @lock: protects access to the channels list
147 * @channels: the list of DMA channels allocated
148 * @global_node: list_head for global dma_client_list
149 */
150struct dma_client {
151 dma_event_callback event_callback;
152 unsigned int chan_count;
153 unsigned int chans_desired;
154
155 spinlock_t lock;
156 struct list_head channels;
157 struct list_head global_node;
158};
159
160/**
161 * struct dma_device - info on the entity supplying DMA services
162 * @chancnt: how many DMA channels are supported
163 * @channels: the list of struct dma_chan
164 * @global_node: list_head for global dma_device_list
165 * @refcount:
166 * @done:
167 * @dev_id:
168 * Other func ptrs: used to make use of this device's capabilities
169 */
170struct dma_device {
171
172 unsigned int chancnt;
173 struct list_head channels;
174 struct list_head global_node;
175
176 struct kref refcount;
177 struct completion done;
178
179 int dev_id;
180
181 int (*device_alloc_chan_resources)(struct dma_chan *chan);
182 void (*device_free_chan_resources)(struct dma_chan *chan);
183 dma_cookie_t (*device_memcpy_buf_to_buf)(struct dma_chan *chan,
184 void *dest, void *src, size_t len);
185 dma_cookie_t (*device_memcpy_buf_to_pg)(struct dma_chan *chan,
186 struct page *page, unsigned int offset, void *kdata,
187 size_t len);
188 dma_cookie_t (*device_memcpy_pg_to_pg)(struct dma_chan *chan,
189 struct page *dest_pg, unsigned int dest_off,
190 struct page *src_pg, unsigned int src_off, size_t len);
191 enum dma_status (*device_memcpy_complete)(struct dma_chan *chan,
192 dma_cookie_t cookie, dma_cookie_t *last,
193 dma_cookie_t *used);
194 void (*device_memcpy_issue_pending)(struct dma_chan *chan);
195};
196
197/* --- public DMA engine API --- */
198
199struct dma_client *dma_async_client_register(dma_event_callback event_callback);
200void dma_async_client_unregister(struct dma_client *client);
201void dma_async_client_chan_request(struct dma_client *client,
202 unsigned int number);
203
204/**
205 * dma_async_memcpy_buf_to_buf - offloaded copy between virtual addresses
206 * @chan: DMA channel to offload copy to
207 * @dest: destination address (virtual)
208 * @src: source address (virtual)
209 * @len: length
210 *
211 * Both @dest and @src must be mappable to a bus address according to the
212 * DMA mapping API rules for streaming mappings.
213 * Both @dest and @src must stay memory resident (kernel memory or locked
214 * user space pages)
215 */
216static inline dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
217 void *dest, void *src, size_t len)
218{
219 int cpu = get_cpu();
220 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len;
221 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
222 put_cpu();
223
224 return chan->device->device_memcpy_buf_to_buf(chan, dest, src, len);
225}
226
227/**
228 * dma_async_memcpy_buf_to_pg - offloaded copy
229 * @chan: DMA channel to offload copy to
230 * @page: destination page
231 * @offset: offset in page to copy to
232 * @kdata: source address (virtual)
233 * @len: length
234 *
235 * Both @page/@offset and @kdata must be mappable to a bus address according
236 * to the DMA mapping API rules for streaming mappings.
237 * Both @page/@offset and @kdata must stay memory resident (kernel memory or
238 * locked user space pages)
239 */
240static inline dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
241 struct page *page, unsigned int offset, void *kdata, size_t len)
242{
243 int cpu = get_cpu();
244 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len;
245 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
246 put_cpu();
247
248 return chan->device->device_memcpy_buf_to_pg(chan, page, offset,
249 kdata, len);
250}
251
252/**
253 * dma_async_memcpy_buf_to_pg - offloaded copy
254 * @chan: DMA channel to offload copy to
255 * @dest_page: destination page
256 * @dest_off: offset in page to copy to
257 * @src_page: source page
258 * @src_off: offset in page to copy from
259 * @len: length
260 *
261 * Both @dest_page/@dest_off and @src_page/@src_off must be mappable to a bus
262 * address according to the DMA mapping API rules for streaming mappings.
263 * Both @dest_page/@dest_off and @src_page/@src_off must stay memory resident
264 * (kernel memory or locked user space pages)
265 */
266static inline dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan,
267 struct page *dest_pg, unsigned int dest_off, struct page *src_pg,
268 unsigned int src_off, size_t len)
269{
270 int cpu = get_cpu();
271 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len;
272 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
273 put_cpu();
274
275 return chan->device->device_memcpy_pg_to_pg(chan, dest_pg, dest_off,
276 src_pg, src_off, len);
277}
278
279/**
280 * dma_async_memcpy_issue_pending - flush pending copies to HW
281 * @chan:
282 *
283 * This allows drivers to push copies to HW in batches,
284 * reducing MMIO writes where possible.
285 */
286static inline void dma_async_memcpy_issue_pending(struct dma_chan *chan)
287{
288 return chan->device->device_memcpy_issue_pending(chan);
289}
290
291/**
292 * dma_async_memcpy_complete - poll for transaction completion
293 * @chan: DMA channel
294 * @cookie: transaction identifier to check status of
295 * @last: returns last completed cookie, can be NULL
296 * @used: returns last issued cookie, can be NULL
297 *
298 * If @last and @used are passed in, upon return they reflect the driver
299 * internal state and can be used with dma_async_is_complete() to check
300 * the status of multiple cookies without re-checking hardware state.
301 */
302static inline enum dma_status dma_async_memcpy_complete(struct dma_chan *chan,
303 dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used)
304{
305 return chan->device->device_memcpy_complete(chan, cookie, last, used);
306}
307
308/**
309 * dma_async_is_complete - test a cookie against chan state
310 * @cookie: transaction identifier to test status of
311 * @last_complete: last know completed transaction
312 * @last_used: last cookie value handed out
313 *
314 * dma_async_is_complete() is used in dma_async_memcpy_complete()
315 * the test logic is seperated for lightweight testing of multiple cookies
316 */
317static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
318 dma_cookie_t last_complete, dma_cookie_t last_used)
319{
320 if (last_complete <= last_used) {
321 if ((cookie <= last_complete) || (cookie > last_used))
322 return DMA_SUCCESS;
323 } else {
324 if ((cookie <= last_complete) && (cookie > last_used))
325 return DMA_SUCCESS;
326 }
327 return DMA_IN_PROGRESS;
328}
329
330
331/* --- DMA device --- */
332
333int dma_async_device_register(struct dma_device *device);
334void dma_async_device_unregister(struct dma_device *device);
335
336/* --- Helper iov-locking functions --- */
337
338struct dma_page_list {
339 char *base_address;
340 int nr_pages;
341 struct page **pages;
342};
343
344struct dma_pinned_list {
345 int nr_iovecs;
346 struct dma_page_list page_list[0];
347};
348
349struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len);
350void dma_unpin_iovec_pages(struct dma_pinned_list* pinned_list);
351
352dma_cookie_t dma_memcpy_to_iovec(struct dma_chan *chan, struct iovec *iov,
353 struct dma_pinned_list *pinned_list, unsigned char *kdata, size_t len);
354dma_cookie_t dma_memcpy_pg_to_iovec(struct dma_chan *chan, struct iovec *iov,
355 struct dma_pinned_list *pinned_list, struct page *page,
356 unsigned int offset, size_t len);
357
358#endif /* CONFIG_DMA_ENGINE */
359#endif /* DMAENGINE_H */
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 64fd6c366604..b2cd2071d432 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -2,7 +2,6 @@
2#define __DMI_H__ 2#define __DMI_H__
3 3
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/config.h>
6 5
7enum dmi_field { 6enum dmi_field {
8 DMI_NONE, 7 DMI_NONE,
diff --git a/include/linux/dnotify.h b/include/linux/dnotify.h
index f134a01975c7..102a902b4396 100644
--- a/include/linux/dnotify.h
+++ b/include/linux/dnotify.h
@@ -18,7 +18,6 @@ struct dnotify_struct {
18 18
19#ifdef __KERNEL__ 19#ifdef __KERNEL__
20 20
21#include <linux/config.h>
22 21
23#ifdef CONFIG_DNOTIFY 22#ifdef CONFIG_DNOTIFY
24 23
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h
new file mode 100644
index 000000000000..114a96d25652
--- /dev/null
+++ b/include/linux/elf-em.h
@@ -0,0 +1,44 @@
1#ifndef _LINUX_ELF_EM_H
2#define _LINUX_ELF_EM_H
3
4/* These constants define the various ELF target machines */
5#define EM_NONE 0
6#define EM_M32 1
7#define EM_SPARC 2
8#define EM_386 3
9#define EM_68K 4
10#define EM_88K 5
11#define EM_486 6 /* Perhaps disused */
12#define EM_860 7
13#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
14#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */
15#define EM_PARISC 15 /* HPPA */
16#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
17#define EM_PPC 20 /* PowerPC */
18#define EM_PPC64 21 /* PowerPC64 */
19#define EM_SH 42 /* SuperH */
20#define EM_SPARCV9 43 /* SPARC v9 64-bit */
21#define EM_IA_64 50 /* HP/Intel IA-64 */
22#define EM_X86_64 62 /* AMD x86-64 */
23#define EM_S390 22 /* IBM S/390 */
24#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
25#define EM_V850 87 /* NEC v850 */
26#define EM_M32R 88 /* Renesas M32R */
27#define EM_H8_300 46 /* Renesas H8/300,300H,H8S */
28#define EM_FRV 0x5441 /* Fujitsu FR-V */
29
30/*
31 * This is an interim value that we will use until the committee comes
32 * up with a final number.
33 */
34#define EM_ALPHA 0x9026
35
36/* Bogus old v850 magic number, used by old tools. */
37#define EM_CYGNUS_V850 0x9080
38/* Bogus old m32r magic number, used by old tools. */
39#define EM_CYGNUS_M32R 0x9041
40/* This is the old interim value for S/390 architecture */
41#define EM_S390_OLD 0xA390
42
43
44#endif /* _LINUX_ELF_EM_H */
diff --git a/include/linux/elf.h b/include/linux/elf.h
index d3bfacb24496..b70d1d2c8d28 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/auxvec.h> 5#include <linux/auxvec.h>
6#include <linux/elf-em.h>
6#include <asm/elf.h> 7#include <asm/elf.h>
7 8
8#ifndef elf_read_implies_exec 9#ifndef elf_read_implies_exec
@@ -55,64 +56,6 @@ typedef __s64 Elf64_Sxword;
55#define ET_LOPROC 0xff00 56#define ET_LOPROC 0xff00
56#define ET_HIPROC 0xffff 57#define ET_HIPROC 0xffff
57 58
58/* These constants define the various ELF target machines */
59#define EM_NONE 0
60#define EM_M32 1
61#define EM_SPARC 2
62#define EM_386 3
63#define EM_68K 4
64#define EM_88K 5
65#define EM_486 6 /* Perhaps disused */
66#define EM_860 7
67
68#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
69
70#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */
71
72#define EM_PARISC 15 /* HPPA */
73
74#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
75
76#define EM_PPC 20 /* PowerPC */
77#define EM_PPC64 21 /* PowerPC64 */
78
79#define EM_SH 42 /* SuperH */
80
81#define EM_SPARCV9 43 /* SPARC v9 64-bit */
82
83#define EM_IA_64 50 /* HP/Intel IA-64 */
84
85#define EM_X86_64 62 /* AMD x86-64 */
86
87#define EM_S390 22 /* IBM S/390 */
88
89#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
90
91#define EM_V850 87 /* NEC v850 */
92
93#define EM_M32R 88 /* Renesas M32R */
94
95#define EM_H8_300 46 /* Renesas H8/300,300H,H8S */
96
97/*
98 * This is an interim value that we will use until the committee comes
99 * up with a final number.
100 */
101#define EM_ALPHA 0x9026
102
103/* Bogus old v850 magic number, used by old tools. */
104#define EM_CYGNUS_V850 0x9080
105
106/* Bogus old m32r magic number, used by old tools. */
107#define EM_CYGNUS_M32R 0x9041
108
109/*
110 * This is the old interim value for S/390 architecture
111 */
112#define EM_S390_OLD 0xA390
113
114#define EM_FRV 0x5441 /* Fujitsu FR-V */
115
116/* This is the info that is needed to parse the dynamic section of the file */ 59/* This is the info that is needed to parse the dynamic section of the file */
117#define DT_NULL 0 60#define DT_NULL 0
118#define DT_NEEDED 1 61#define DT_NEEDED 1
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h
index 174582fedb8b..408118a07763 100644
--- a/include/linux/errqueue.h
+++ b/include/linux/errqueue.h
@@ -21,7 +21,6 @@ struct sock_extended_err
21 21
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23 23
24#include <linux/config.h>
25#include <net/ip.h> 24#include <net/ip.h>
26#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 25#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
27#include <linux/ipv6.h> 26#include <linux/ipv6.h>
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 93535f093216..cf2abeca92a0 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -15,24 +15,24 @@
15 15
16/* This should work for both 32 and 64 bit userland. */ 16/* This should work for both 32 and 64 bit userland. */
17struct ethtool_cmd { 17struct ethtool_cmd {
18 u32 cmd; 18 __u32 cmd;
19 u32 supported; /* Features this interface supports */ 19 __u32 supported; /* Features this interface supports */
20 u32 advertising; /* Features this interface advertises */ 20 __u32 advertising; /* Features this interface advertises */
21 u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ 21 __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
22 u8 duplex; /* Duplex, half or full */ 22 __u8 duplex; /* Duplex, half or full */
23 u8 port; /* Which connector port */ 23 __u8 port; /* Which connector port */
24 u8 phy_address; 24 __u8 phy_address;
25 u8 transceiver; /* Which transceiver to use */ 25 __u8 transceiver; /* Which transceiver to use */
26 u8 autoneg; /* Enable or disable autonegotiation */ 26 __u8 autoneg; /* Enable or disable autonegotiation */
27 u32 maxtxpkt; /* Tx pkts before generating tx int */ 27 __u32 maxtxpkt; /* Tx pkts before generating tx int */
28 u32 maxrxpkt; /* Rx pkts before generating rx int */ 28 __u32 maxrxpkt; /* Rx pkts before generating rx int */
29 u32 reserved[4]; 29 __u32 reserved[4];
30}; 30};
31 31
32#define ETHTOOL_BUSINFO_LEN 32 32#define ETHTOOL_BUSINFO_LEN 32
33/* these strings are set to whatever the driver author decides... */ 33/* these strings are set to whatever the driver author decides... */
34struct ethtool_drvinfo { 34struct ethtool_drvinfo {
35 u32 cmd; 35 __u32 cmd;
36 char driver[32]; /* driver short name, "tulip", "eepro100" */ 36 char driver[32]; /* driver short name, "tulip", "eepro100" */
37 char version[32]; /* driver version string */ 37 char version[32]; /* driver version string */
38 char fw_version[32]; /* firmware version string, if applicable */ 38 char fw_version[32]; /* firmware version string, if applicable */
@@ -40,53 +40,53 @@ struct ethtool_drvinfo {
40 /* For PCI devices, use pci_name(pci_dev). */ 40 /* For PCI devices, use pci_name(pci_dev). */
41 char reserved1[32]; 41 char reserved1[32];
42 char reserved2[16]; 42 char reserved2[16];
43 u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ 43 __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
44 u32 testinfo_len; 44 __u32 testinfo_len;
45 u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ 45 __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
46 u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ 46 __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
47}; 47};
48 48
49#define SOPASS_MAX 6 49#define SOPASS_MAX 6
50/* wake-on-lan settings */ 50/* wake-on-lan settings */
51struct ethtool_wolinfo { 51struct ethtool_wolinfo {
52 u32 cmd; 52 __u32 cmd;
53 u32 supported; 53 __u32 supported;
54 u32 wolopts; 54 __u32 wolopts;
55 u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */ 55 __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
56}; 56};
57 57
58/* for passing single values */ 58/* for passing single values */
59struct ethtool_value { 59struct ethtool_value {
60 u32 cmd; 60 __u32 cmd;
61 u32 data; 61 __u32 data;
62}; 62};
63 63
64/* for passing big chunks of data */ 64/* for passing big chunks of data */
65struct ethtool_regs { 65struct ethtool_regs {
66 u32 cmd; 66 __u32 cmd;
67 u32 version; /* driver-specific, indicates different chips/revs */ 67 __u32 version; /* driver-specific, indicates different chips/revs */
68 u32 len; /* bytes */ 68 __u32 len; /* bytes */
69 u8 data[0]; 69 __u8 data[0];
70}; 70};
71 71
72/* for passing EEPROM chunks */ 72/* for passing EEPROM chunks */
73struct ethtool_eeprom { 73struct ethtool_eeprom {
74 u32 cmd; 74 __u32 cmd;
75 u32 magic; 75 __u32 magic;
76 u32 offset; /* in bytes */ 76 __u32 offset; /* in bytes */
77 u32 len; /* in bytes */ 77 __u32 len; /* in bytes */
78 u8 data[0]; 78 __u8 data[0];
79}; 79};
80 80
81/* for configuring coalescing parameters of chip */ 81/* for configuring coalescing parameters of chip */
82struct ethtool_coalesce { 82struct ethtool_coalesce {
83 u32 cmd; /* ETHTOOL_{G,S}COALESCE */ 83 __u32 cmd; /* ETHTOOL_{G,S}COALESCE */
84 84
85 /* How many usecs to delay an RX interrupt after 85 /* How many usecs to delay an RX interrupt after
86 * a packet arrives. If 0, only rx_max_coalesced_frames 86 * a packet arrives. If 0, only rx_max_coalesced_frames
87 * is used. 87 * is used.
88 */ 88 */
89 u32 rx_coalesce_usecs; 89 __u32 rx_coalesce_usecs;
90 90
91 /* How many packets to delay an RX interrupt after 91 /* How many packets to delay an RX interrupt after
92 * a packet arrives. If 0, only rx_coalesce_usecs is 92 * a packet arrives. If 0, only rx_coalesce_usecs is
@@ -94,21 +94,21 @@ struct ethtool_coalesce {
94 * to zero as this would cause RX interrupts to never be 94 * to zero as this would cause RX interrupts to never be
95 * generated. 95 * generated.
96 */ 96 */
97 u32 rx_max_coalesced_frames; 97 __u32 rx_max_coalesced_frames;
98 98
99 /* Same as above two parameters, except that these values 99 /* Same as above two parameters, except that these values
100 * apply while an IRQ is being serviced by the host. Not 100 * apply while an IRQ is being serviced by the host. Not
101 * all cards support this feature and the values are ignored 101 * all cards support this feature and the values are ignored
102 * in that case. 102 * in that case.
103 */ 103 */
104 u32 rx_coalesce_usecs_irq; 104 __u32 rx_coalesce_usecs_irq;
105 u32 rx_max_coalesced_frames_irq; 105 __u32 rx_max_coalesced_frames_irq;
106 106
107 /* How many usecs to delay a TX interrupt after 107 /* How many usecs to delay a TX interrupt after
108 * a packet is sent. If 0, only tx_max_coalesced_frames 108 * a packet is sent. If 0, only tx_max_coalesced_frames
109 * is used. 109 * is used.
110 */ 110 */
111 u32 tx_coalesce_usecs; 111 __u32 tx_coalesce_usecs;
112 112
113 /* How many packets to delay a TX interrupt after 113 /* How many packets to delay a TX interrupt after
114 * a packet is sent. If 0, only tx_coalesce_usecs is 114 * a packet is sent. If 0, only tx_coalesce_usecs is
@@ -116,22 +116,22 @@ struct ethtool_coalesce {
116 * to zero as this would cause TX interrupts to never be 116 * to zero as this would cause TX interrupts to never be
117 * generated. 117 * generated.
118 */ 118 */
119 u32 tx_max_coalesced_frames; 119 __u32 tx_max_coalesced_frames;
120 120
121 /* Same as above two parameters, except that these values 121 /* Same as above two parameters, except that these values
122 * apply while an IRQ is being serviced by the host. Not 122 * apply while an IRQ is being serviced by the host. Not
123 * all cards support this feature and the values are ignored 123 * all cards support this feature and the values are ignored
124 * in that case. 124 * in that case.
125 */ 125 */
126 u32 tx_coalesce_usecs_irq; 126 __u32 tx_coalesce_usecs_irq;
127 u32 tx_max_coalesced_frames_irq; 127 __u32 tx_max_coalesced_frames_irq;
128 128
129 /* How many usecs to delay in-memory statistics 129 /* How many usecs to delay in-memory statistics
130 * block updates. Some drivers do not have an in-memory 130 * block updates. Some drivers do not have an in-memory
131 * statistic block, and in such cases this value is ignored. 131 * statistic block, and in such cases this value is ignored.
132 * This value must not be zero. 132 * This value must not be zero.
133 */ 133 */
134 u32 stats_block_coalesce_usecs; 134 __u32 stats_block_coalesce_usecs;
135 135
136 /* Adaptive RX/TX coalescing is an algorithm implemented by 136 /* Adaptive RX/TX coalescing is an algorithm implemented by
137 * some drivers to improve latency under low packet rates and 137 * some drivers to improve latency under low packet rates and
@@ -140,18 +140,18 @@ struct ethtool_coalesce {
140 * not implemented by the driver causes these values to be 140 * not implemented by the driver causes these values to be
141 * silently ignored. 141 * silently ignored.
142 */ 142 */
143 u32 use_adaptive_rx_coalesce; 143 __u32 use_adaptive_rx_coalesce;
144 u32 use_adaptive_tx_coalesce; 144 __u32 use_adaptive_tx_coalesce;
145 145
146 /* When the packet rate (measured in packets per second) 146 /* When the packet rate (measured in packets per second)
147 * is below pkt_rate_low, the {rx,tx}_*_low parameters are 147 * is below pkt_rate_low, the {rx,tx}_*_low parameters are
148 * used. 148 * used.
149 */ 149 */
150 u32 pkt_rate_low; 150 __u32 pkt_rate_low;
151 u32 rx_coalesce_usecs_low; 151 __u32 rx_coalesce_usecs_low;
152 u32 rx_max_coalesced_frames_low; 152 __u32 rx_max_coalesced_frames_low;
153 u32 tx_coalesce_usecs_low; 153 __u32 tx_coalesce_usecs_low;
154 u32 tx_max_coalesced_frames_low; 154 __u32 tx_max_coalesced_frames_low;
155 155
156 /* When the packet rate is below pkt_rate_high but above 156 /* When the packet rate is below pkt_rate_high but above
157 * pkt_rate_low (both measured in packets per second) the 157 * pkt_rate_low (both measured in packets per second) the
@@ -162,43 +162,43 @@ struct ethtool_coalesce {
162 * is above pkt_rate_high, the {rx,tx}_*_high parameters are 162 * is above pkt_rate_high, the {rx,tx}_*_high parameters are
163 * used. 163 * used.
164 */ 164 */
165 u32 pkt_rate_high; 165 __u32 pkt_rate_high;
166 u32 rx_coalesce_usecs_high; 166 __u32 rx_coalesce_usecs_high;
167 u32 rx_max_coalesced_frames_high; 167 __u32 rx_max_coalesced_frames_high;
168 u32 tx_coalesce_usecs_high; 168 __u32 tx_coalesce_usecs_high;
169 u32 tx_max_coalesced_frames_high; 169 __u32 tx_max_coalesced_frames_high;
170 170
171 /* How often to do adaptive coalescing packet rate sampling, 171 /* How often to do adaptive coalescing packet rate sampling,
172 * measured in seconds. Must not be zero. 172 * measured in seconds. Must not be zero.
173 */ 173 */
174 u32 rate_sample_interval; 174 __u32 rate_sample_interval;
175}; 175};
176 176
177/* for configuring RX/TX ring parameters */ 177/* for configuring RX/TX ring parameters */
178struct ethtool_ringparam { 178struct ethtool_ringparam {
179 u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */ 179 __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
180 180
181 /* Read only attributes. These indicate the maximum number 181 /* Read only attributes. These indicate the maximum number
182 * of pending RX/TX ring entries the driver will allow the 182 * of pending RX/TX ring entries the driver will allow the
183 * user to set. 183 * user to set.
184 */ 184 */
185 u32 rx_max_pending; 185 __u32 rx_max_pending;
186 u32 rx_mini_max_pending; 186 __u32 rx_mini_max_pending;
187 u32 rx_jumbo_max_pending; 187 __u32 rx_jumbo_max_pending;
188 u32 tx_max_pending; 188 __u32 tx_max_pending;
189 189
190 /* Values changeable by the user. The valid values are 190 /* Values changeable by the user. The valid values are
191 * in the range 1 to the "*_max_pending" counterpart above. 191 * in the range 1 to the "*_max_pending" counterpart above.
192 */ 192 */
193 u32 rx_pending; 193 __u32 rx_pending;
194 u32 rx_mini_pending; 194 __u32 rx_mini_pending;
195 u32 rx_jumbo_pending; 195 __u32 rx_jumbo_pending;
196 u32 tx_pending; 196 __u32 tx_pending;
197}; 197};
198 198
199/* for configuring link flow control parameters */ 199/* for configuring link flow control parameters */
200struct ethtool_pauseparam { 200struct ethtool_pauseparam {
201 u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ 201 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
202 202
203 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg 203 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
204 * being true) the user may set 'autonet' here non-zero to have the 204 * being true) the user may set 'autonet' here non-zero to have the
@@ -210,9 +210,9 @@ struct ethtool_pauseparam {
210 * then {rx,tx}_pause force the driver to use/not-use pause 210 * then {rx,tx}_pause force the driver to use/not-use pause
211 * flow control. 211 * flow control.
212 */ 212 */
213 u32 autoneg; 213 __u32 autoneg;
214 u32 rx_pause; 214 __u32 rx_pause;
215 u32 tx_pause; 215 __u32 tx_pause;
216}; 216};
217 217
218#define ETH_GSTRING_LEN 32 218#define ETH_GSTRING_LEN 32
@@ -223,10 +223,10 @@ enum ethtool_stringset {
223 223
224/* for passing string sets for data tagging */ 224/* for passing string sets for data tagging */
225struct ethtool_gstrings { 225struct ethtool_gstrings {
226 u32 cmd; /* ETHTOOL_GSTRINGS */ 226 __u32 cmd; /* ETHTOOL_GSTRINGS */
227 u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/ 227 __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
228 u32 len; /* number of strings in the string set */ 228 __u32 len; /* number of strings in the string set */
229 u8 data[0]; 229 __u8 data[0];
230}; 230};
231 231
232enum ethtool_test_flags { 232enum ethtool_test_flags {
@@ -236,26 +236,28 @@ enum ethtool_test_flags {
236 236
237/* for requesting NIC test and getting results*/ 237/* for requesting NIC test and getting results*/
238struct ethtool_test { 238struct ethtool_test {
239 u32 cmd; /* ETHTOOL_TEST */ 239 __u32 cmd; /* ETHTOOL_TEST */
240 u32 flags; /* ETH_TEST_FL_xxx */ 240 __u32 flags; /* ETH_TEST_FL_xxx */
241 u32 reserved; 241 __u32 reserved;
242 u32 len; /* result length, in number of u64 elements */ 242 __u32 len; /* result length, in number of u64 elements */
243 u64 data[0]; 243 __u64 data[0];
244}; 244};
245 245
246/* for dumping NIC-specific statistics */ 246/* for dumping NIC-specific statistics */
247struct ethtool_stats { 247struct ethtool_stats {
248 u32 cmd; /* ETHTOOL_GSTATS */ 248 __u32 cmd; /* ETHTOOL_GSTATS */
249 u32 n_stats; /* number of u64's being returned */ 249 __u32 n_stats; /* number of u64's being returned */
250 u64 data[0]; 250 __u64 data[0];
251}; 251};
252 252
253struct ethtool_perm_addr { 253struct ethtool_perm_addr {
254 u32 cmd; /* ETHTOOL_GPERMADDR */ 254 __u32 cmd; /* ETHTOOL_GPERMADDR */
255 u32 size; 255 __u32 size;
256 u8 data[0]; 256 __u8 data[0];
257}; 257};
258 258
259#ifdef __KERNEL__
260
259struct net_device; 261struct net_device;
260 262
261/* Some generic methods drivers may use in their ethtool_ops */ 263/* Some generic methods drivers may use in their ethtool_ops */
@@ -371,6 +373,7 @@ struct ethtool_ops {
371 u32 (*get_ufo)(struct net_device *); 373 u32 (*get_ufo)(struct net_device *);
372 int (*set_ufo)(struct net_device *, u32); 374 int (*set_ufo)(struct net_device *, u32);
373}; 375};
376#endif /* __KERNEL__ */
374 377
375/* CMDs currently supported */ 378/* CMDs currently supported */
376#define ETHTOOL_GSET 0x00000001 /* Get settings. */ 379#define ETHTOOL_GSET 0x00000001 /* Get settings. */
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index f7bd1c7ebefb..facf34e98954 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -17,7 +17,6 @@
17#define _LINUX_EXT2_FS_H 17#define _LINUX_EXT2_FS_H
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/ext2_fs_sb.h>
21 20
22/* 21/*
23 * The second extended filesystem constants/structures 22 * The second extended filesystem constants/structures
@@ -70,6 +69,7 @@
70#define EXT2_SUPER_MAGIC 0xEF53 69#define EXT2_SUPER_MAGIC 0xEF53
71 70
72#ifdef __KERNEL__ 71#ifdef __KERNEL__
72#include <linux/ext2_fs_sb.h>
73static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) 73static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)
74{ 74{
75 return sb->s_fs_info; 75 return sb->s_fs_info;
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 3ade6a4e3bdd..757d54d8f1a5 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -17,11 +17,6 @@
17#define _LINUX_EXT3_FS_H 17#define _LINUX_EXT3_FS_H
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/ext3_fs_i.h>
21#include <linux/ext3_fs_sb.h>
22
23
24struct statfs;
25 20
26/* 21/*
27 * The second extended filesystem constants/structures 22 * The second extended filesystem constants/structures
@@ -487,6 +482,8 @@ struct ext3_super_block {
487}; 482};
488 483
489#ifdef __KERNEL__ 484#ifdef __KERNEL__
485#include <linux/ext3_fs_i.h>
486#include <linux/ext3_fs_sb.h>
490static inline struct ext3_sb_info * EXT3_SB(struct super_block *sb) 487static inline struct ext3_sb_info * EXT3_SB(struct super_block *sb)
491{ 488{
492 return sb->s_fs_info; 489 return sb->s_fs_info;
@@ -664,6 +661,8 @@ struct ext3_dir_entry_2 {
664#define DX_HASH_HALF_MD4 1 661#define DX_HASH_HALF_MD4 1
665#define DX_HASH_TEA 2 662#define DX_HASH_TEA 2
666 663
664#ifdef __KERNEL__
665
667/* hash info structure used by the directory hash */ 666/* hash info structure used by the directory hash */
668struct dx_hash_info 667struct dx_hash_info
669{ 668{
@@ -675,7 +674,6 @@ struct dx_hash_info
675 674
676#define EXT3_HTREE_EOF 0x7fffffff 675#define EXT3_HTREE_EOF 0x7fffffff
677 676
678#ifdef __KERNEL__
679/* 677/*
680 * Control parameters used by ext3_htree_next_block 678 * Control parameters used by ext3_htree_next_block
681 */ 679 */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f813bc8266aa..73c7d6f04b31 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -6,7 +6,6 @@
6 * structures etc. 6 * structures etc.
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/limits.h> 9#include <linux/limits.h>
11#include <linux/ioctl.h> 10#include <linux/ioctl.h>
12 11
@@ -783,7 +782,6 @@ extern int setlease(struct file *, long, struct file_lock **);
783extern int lease_modify(struct file_lock **, int); 782extern int lease_modify(struct file_lock **, int);
784extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 783extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
785extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 784extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
786extern void steal_locks(fl_owner_t from);
787 785
788struct fasync_struct { 786struct fasync_struct {
789 int magic; 787 int magic;
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 11438eff4d44..cc5dec70c32c 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -54,19 +54,20 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
54 54
55 if (isdir) 55 if (isdir)
56 isdir = IN_ISDIR; 56 isdir = IN_ISDIR;
57 inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name); 57 inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name,
58 inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name); 58 source);
59 inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name,
60 source);
59 61
60 if (target) { 62 if (target) {
61 inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL); 63 inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL, NULL);
62 inotify_inode_is_dead(target); 64 inotify_inode_is_dead(target);
63 } 65 }
64 66
65 if (source) { 67 if (source) {
66 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL); 68 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL);
67 } 69 }
68 audit_inode_child(old_name, source, old_dir->i_ino); 70 audit_inode_child(new_name, source, new_dir->i_ino);
69 audit_inode_child(new_name, target, new_dir->i_ino);
70} 71}
71 72
72/* 73/*
@@ -85,7 +86,7 @@ static inline void fsnotify_nameremove(struct dentry *dentry, int isdir)
85 */ 86 */
86static inline void fsnotify_inoderemove(struct inode *inode) 87static inline void fsnotify_inoderemove(struct inode *inode)
87{ 88{
88 inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL); 89 inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL, NULL);
89 inotify_inode_is_dead(inode); 90 inotify_inode_is_dead(inode);
90} 91}
91 92
@@ -95,7 +96,8 @@ static inline void fsnotify_inoderemove(struct inode *inode)
95static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) 96static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
96{ 97{
97 inode_dir_notify(inode, DN_CREATE); 98 inode_dir_notify(inode, DN_CREATE);
98 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name); 99 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name,
100 dentry->d_inode);
99 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); 101 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino);
100} 102}
101 103
@@ -106,7 +108,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
106{ 108{
107 inode_dir_notify(inode, DN_CREATE); 109 inode_dir_notify(inode, DN_CREATE);
108 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, 110 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0,
109 dentry->d_name.name); 111 dentry->d_name.name, dentry->d_inode);
110 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); 112 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino);
111} 113}
112 114
@@ -123,7 +125,7 @@ static inline void fsnotify_access(struct dentry *dentry)
123 125
124 dnotify_parent(dentry, DN_ACCESS); 126 dnotify_parent(dentry, DN_ACCESS);
125 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); 127 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
126 inotify_inode_queue_event(inode, mask, 0, NULL); 128 inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
127} 129}
128 130
129/* 131/*
@@ -139,7 +141,7 @@ static inline void fsnotify_modify(struct dentry *dentry)
139 141
140 dnotify_parent(dentry, DN_MODIFY); 142 dnotify_parent(dentry, DN_MODIFY);
141 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); 143 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
142 inotify_inode_queue_event(inode, mask, 0, NULL); 144 inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
143} 145}
144 146
145/* 147/*
@@ -154,7 +156,7 @@ static inline void fsnotify_open(struct dentry *dentry)
154 mask |= IN_ISDIR; 156 mask |= IN_ISDIR;
155 157
156 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); 158 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
157 inotify_inode_queue_event(inode, mask, 0, NULL); 159 inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
158} 160}
159 161
160/* 162/*
@@ -172,7 +174,7 @@ static inline void fsnotify_close(struct file *file)
172 mask |= IN_ISDIR; 174 mask |= IN_ISDIR;
173 175
174 inotify_dentry_parent_queue_event(dentry, mask, 0, name); 176 inotify_dentry_parent_queue_event(dentry, mask, 0, name);
175 inotify_inode_queue_event(inode, mask, 0, NULL); 177 inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
176} 178}
177 179
178/* 180/*
@@ -187,7 +189,7 @@ static inline void fsnotify_xattr(struct dentry *dentry)
187 mask |= IN_ISDIR; 189 mask |= IN_ISDIR;
188 190
189 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); 191 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
190 inotify_inode_queue_event(inode, mask, 0, NULL); 192 inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
191} 193}
192 194
193/* 195/*
@@ -234,7 +236,7 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid)
234 if (in_mask) { 236 if (in_mask) {
235 if (S_ISDIR(inode->i_mode)) 237 if (S_ISDIR(inode->i_mode))
236 in_mask |= IN_ISDIR; 238 in_mask |= IN_ISDIR;
237 inotify_inode_queue_event(inode, in_mask, 0, NULL); 239 inotify_inode_queue_event(inode, in_mask, 0, NULL, NULL);
238 inotify_dentry_parent_queue_event(dentry, in_mask, 0, 240 inotify_dentry_parent_queue_event(dentry, in_mask, 0,
239 dentry->d_name.name); 241 dentry->d_name.name);
240 } 242 }
diff --git a/include/linux/ftape.h b/include/linux/ftape.h
index 72faeec9f6e1..7e7038cba86a 100644
--- a/include/linux/ftape.h
+++ b/include/linux/ftape.h
@@ -35,7 +35,6 @@
35#include <linux/mm.h> 35#include <linux/mm.h>
36#endif 36#endif
37#include <linux/types.h> 37#include <linux/types.h>
38#include <linux/config.h>
39#include <linux/mtio.h> 38#include <linux/mtio.h>
40 39
41#define FT_SECTOR(x) (x+1) /* sector offset into real sector */ 40#define FT_SECTOR(x) (x+1) /* sector offset into real sector */
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 71e7b2847cb3..2cdba0c23957 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -9,6 +9,7 @@
9 * the Free Software Foundation. 9 * the Free Software Foundation.
10 */ 10 */
11 11
12#ifdef __KERNEL__
12#include <asm/io.h> 13#include <asm/io.h>
13#include <linux/list.h> 14#include <linux/list.h>
14#include <linux/mutex.h> 15#include <linux/mutex.h>
@@ -154,6 +155,8 @@ static inline void gameport_register_driver(struct gameport_driver *drv)
154 155
155void gameport_unregister_driver(struct gameport_driver *drv); 156void gameport_unregister_driver(struct gameport_driver *drv);
156 157
158#endif /* __KERNEL__ */
159
157#define GAMEPORT_MODE_DISABLED 0 160#define GAMEPORT_MODE_DISABLED 0
158#define GAMEPORT_MODE_RAW 1 161#define GAMEPORT_MODE_RAW 1
159#define GAMEPORT_MODE_COOKED 2 162#define GAMEPORT_MODE_COOKED 2
@@ -169,6 +172,8 @@ void gameport_unregister_driver(struct gameport_driver *drv);
169#define GAMEPORT_ID_VENDOR_GRAVIS 0x0009 172#define GAMEPORT_ID_VENDOR_GRAVIS 0x0009
170#define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a 173#define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a
171 174
175#ifdef __KERNEL__
176
172static inline void gameport_trigger(struct gameport *gameport) 177static inline void gameport_trigger(struct gameport *gameport)
173{ 178{
174 if (gameport->trigger) 179 if (gameport->trigger)
@@ -219,4 +224,5 @@ static inline void gameport_set_poll_interval(struct gameport *gameport, unsigne
219void gameport_start_polling(struct gameport *gameport); 224void gameport_start_polling(struct gameport *gameport);
220void gameport_stop_polling(struct gameport *gameport); 225void gameport_stop_polling(struct gameport *gameport);
221 226
227#endif /* __KERNEL__ */
222#endif 228#endif
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h
index 652611a4bdcd..e25384561955 100644
--- a/include/linux/generic_serial.h
+++ b/include/linux/generic_serial.h
@@ -12,6 +12,7 @@
12#ifndef GENERIC_SERIAL_H 12#ifndef GENERIC_SERIAL_H
13#define GENERIC_SERIAL_H 13#define GENERIC_SERIAL_H
14 14
15#ifdef __KERNEL__
15#include <linux/mutex.h> 16#include <linux/mutex.h>
16 17
17struct real_driver { 18struct real_driver {
@@ -54,6 +55,7 @@ struct gs_port {
54 spinlock_t driver_lock; 55 spinlock_t driver_lock;
55}; 56};
56 57
58#endif /* __KERNEL__ */
57 59
58/* Flags */ 60/* Flags */
59/* Warning: serial.h defines some ASYNC_ flags, they say they are "only" 61/* Warning: serial.h defines some ASYNC_ flags, they say they are "only"
@@ -75,7 +77,7 @@ struct gs_port {
75#define GS_DEBUG_FLOW 0x00000020 77#define GS_DEBUG_FLOW 0x00000020
76#define GS_DEBUG_WRITE 0x00000040 78#define GS_DEBUG_WRITE 0x00000040
77 79
78 80#ifdef __KERNEL__
79void gs_put_char(struct tty_struct *tty, unsigned char ch); 81void gs_put_char(struct tty_struct *tty, unsigned char ch);
80int gs_write(struct tty_struct *tty, 82int gs_write(struct tty_struct *tty,
81 const unsigned char *buf, int count); 83 const unsigned char *buf, int count);
@@ -94,5 +96,5 @@ int gs_init_port(struct gs_port *port);
94int gs_setserial(struct gs_port *port, struct serial_struct __user *sp); 96int gs_setserial(struct gs_port *port, struct serial_struct __user *sp);
95int gs_getserial(struct gs_port *port, struct serial_struct __user *sp); 97int gs_getserial(struct gs_port *port, struct serial_struct __user *sp);
96void gs_got_break(struct gs_port *port); 98void gs_got_break(struct gs_port *port);
97 99#endif /* __KERNEL__ */
98#endif 100#endif
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 2ef845b35175..3498a0c68184 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -9,13 +9,7 @@
9 * <drew@colorado.edu> 9 * <drew@colorado.edu>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/major.h>
15#include <linux/device.h>
16#include <linux/smp.h>
17#include <linux/string.h>
18#include <linux/fs.h>
19 13
20enum { 14enum {
21/* These three have identical behaviour; use the second one if DOS FDISK gets 15/* These three have identical behaviour; use the second one if DOS FDISK gets
@@ -61,6 +55,12 @@ struct partition {
61#endif 55#endif
62 56
63#ifdef __KERNEL__ 57#ifdef __KERNEL__
58#include <linux/major.h>
59#include <linux/device.h>
60#include <linux/smp.h>
61#include <linux/string.h>
62#include <linux/fs.h>
63
64struct partition { 64struct partition {
65 unsigned char boot_ind; /* 0x80 - active */ 65 unsigned char boot_ind; /* 0x80 - active */
66 unsigned char head; /* starting head */ 66 unsigned char head; /* starting head */
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 3ac452945a7d..cc9e60844484 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -4,7 +4,6 @@
4#include <linux/mmzone.h> 4#include <linux/mmzone.h>
5#include <linux/stddef.h> 5#include <linux/stddef.h>
6#include <linux/linkage.h> 6#include <linux/linkage.h>
7#include <linux/config.h>
8 7
9struct vm_area_struct; 8struct vm_area_struct;
10 9
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index eab537091f2a..114ae583cca9 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef LINUX_HARDIRQ_H 1#ifndef LINUX_HARDIRQ_H
2#define LINUX_HARDIRQ_H 2#define LINUX_HARDIRQ_H
3 3
4#include <linux/config.h>
5#include <linux/preempt.h> 4#include <linux/preempt.h>
6#include <linux/smp_lock.h> 5#include <linux/smp_lock.h>
7#include <asm/hardirq.h> 6#include <asm/hardirq.h>
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 892c4ea1b425..85ce7ef9a512 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_HIGHMEM_H 1#ifndef _LINUX_HIGHMEM_H
2#define _LINUX_HIGHMEM_H 2#define _LINUX_HIGHMEM_H
3 3
4#include <linux/config.h>
5#include <linux/fs.h> 4#include <linux/fs.h>
6#include <linux/mm.h> 5#include <linux/mm.h>
7 6
diff --git a/include/linux/highuid.h b/include/linux/highuid.h
index 53ecac3905e8..434e56246f67 100644
--- a/include/linux/highuid.h
+++ b/include/linux/highuid.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_HIGHUID_H 1#ifndef _LINUX_HIGHUID_H
2#define _LINUX_HIGHUID_H 2#define _LINUX_HIGHUID_H
3 3
4#include <linux/config.h>
5#include <linux/types.h> 4#include <linux/types.h>
6 5
7/* 6/*
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 306acf1dc6d5..7d2a1b974c5e 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -127,7 +127,7 @@ extern ktime_t hrtimer_get_next_event(void);
127 127
128static inline int hrtimer_active(const struct hrtimer *timer) 128static inline int hrtimer_active(const struct hrtimer *timer)
129{ 129{
130 return timer->node.rb_parent != HRTIMER_INACTIVE; 130 return rb_parent(&timer->node) != &timer->node;
131} 131}
132 132
133/* Forward a hrtimer so it expires after now: */ 133/* Forward a hrtimer so it expires after now: */
diff --git a/include/linux/i2c-algo-ite.h b/include/linux/i2c-algo-ite.h
index 26a8b89855f1..0073fe96c76e 100644
--- a/include/linux/i2c-algo-ite.h
+++ b/include/linux/i2c-algo-ite.h
@@ -29,7 +29,7 @@
29#ifndef I2C_ALGO_ITE_H 29#ifndef I2C_ALGO_ITE_H
30#define I2C_ALGO_ITE_H 1 30#define I2C_ALGO_ITE_H 1
31 31
32#include <linux/i2c.h> 32#include <linux/types.h>
33 33
34/* Example of a sequential read request: 34/* Example of a sequential read request:
35 struct i2c_iic_msg s_msg; 35 struct i2c_iic_msg s_msg;
@@ -49,6 +49,9 @@ struct i2c_iic_msg {
49 char *buf; /* pointer to msg data */ 49 char *buf; /* pointer to msg data */
50}; 50};
51 51
52#ifdef __KERNEL__
53struct i2c_adapter;
54
52struct i2c_algo_iic_data { 55struct i2c_algo_iic_data {
53 void *data; /* private data for lolevel routines */ 56 void *data; /* private data for lolevel routines */
54 void (*setiic) (void *data, int ctl, int val); 57 void (*setiic) (void *data, int ctl, int val);
@@ -65,5 +68,5 @@ struct i2c_algo_iic_data {
65 68
66int i2c_iic_add_bus(struct i2c_adapter *); 69int i2c_iic_add_bus(struct i2c_adapter *);
67int i2c_iic_del_bus(struct i2c_adapter *); 70int i2c_iic_del_bus(struct i2c_adapter *);
68 71#endif /* __KERNEL__ */
69#endif /* I2C_ALGO_ITE_H */ 72#endif /* I2C_ALGO_ITE_H */
diff --git a/include/linux/i2c-ocores.h b/include/linux/i2c-ocores.h
new file mode 100644
index 000000000000..8ed591b0887e
--- /dev/null
+++ b/include/linux/i2c-ocores.h
@@ -0,0 +1,19 @@
1/*
2 * i2c-ocores.h - definitions for the i2c-ocores interface
3 *
4 * Peter Korsgaard <jacmet@sunsite.dk>
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11#ifndef _LINUX_I2C_OCORES_H
12#define _LINUX_I2C_OCORES_H
13
14struct ocores_i2c_platform_data {
15 u32 regstep; /* distance between registers */
16 u32 clock_khz; /* input clock in kHz */
17};
18
19#endif /* _LINUX_I2C_OCORES_H */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 1635ee25918f..526ddc8eecfb 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -20,14 +20,15 @@
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ 20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
21/* ------------------------------------------------------------------------- */ 21/* ------------------------------------------------------------------------- */
22 22
23/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and 23/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
24 Frodo Looijaard <frodol@dds.nl> */ 24 Frodo Looijaard <frodol@dds.nl> */
25 25
26#ifndef _LINUX_I2C_H 26#ifndef _LINUX_I2C_H
27#define _LINUX_I2C_H 27#define _LINUX_I2C_H
28 28
29#include <linux/module.h>
30#include <linux/types.h> 29#include <linux/types.h>
30#ifdef __KERNEL__
31#include <linux/module.h>
31#include <linux/i2c-id.h> 32#include <linux/i2c-id.h>
32#include <linux/mod_devicetable.h> 33#include <linux/mod_devicetable.h>
33#include <linux/device.h> /* for struct device */ 34#include <linux/device.h> /* for struct device */
@@ -96,13 +97,13 @@ extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
96 u8 command, u16 value); 97 u8 command, u16 value);
97extern s32 i2c_smbus_write_block_data(struct i2c_client * client, 98extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
98 u8 command, u8 length, 99 u8 command, u8 length,
99 u8 *values); 100 const u8 *values);
100/* Returns the number of read bytes */ 101/* Returns the number of read bytes */
101extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, 102extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
102 u8 command, u8 *values); 103 u8 command, u8 *values);
103extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, 104extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
104 u8 command, u8 length, 105 u8 command, u8 length,
105 u8 *values); 106 const u8 *values);
106 107
107/* 108/*
108 * A driver is capable of handling one or more physical devices present on 109 * A driver is capable of handling one or more physical devices present on
@@ -354,6 +355,7 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
354{ 355{
355 return adap->nr; 356 return adap->nr;
356} 357}
358#endif /* __KERNEL__ */
357 359
358/* 360/*
359 * I2C Message - used for pure i2c transaction, also from /dev interface 361 * I2C Message - used for pure i2c transaction, also from /dev interface
@@ -469,6 +471,7 @@ union i2c_smbus_data {
469#define I2C_SMBUS 0x0720 /* SMBus-level access */ 471#define I2C_SMBUS 0x0720 /* SMBus-level access */
470 472
471/* ----- I2C-DEV: char device interface stuff ------------------------- */ 473/* ----- I2C-DEV: char device interface stuff ------------------------- */
474#ifdef __KERNEL__
472 475
473#define I2C_MAJOR 89 /* Device major number */ 476#define I2C_MAJOR 89 /* Device major number */
474 477
@@ -646,5 +649,5 @@ static unsigned short *forces[] = { force, force_##chip1, \
646 force_##chip6, force_##chip7, \ 649 force_##chip6, force_##chip7, \
647 force_##chip8, NULL }; \ 650 force_##chip8, NULL }; \
648I2C_CLIENT_INSMOD_COMMON 651I2C_CLIENT_INSMOD_COMMON
649 652#endif /* __KERNEL__ */
650#endif /* _LINUX_I2C_H */ 653#endif /* _LINUX_I2C_H */
diff --git a/include/linux/i2o-dev.h b/include/linux/i2o-dev.h
index 36fd18cdad28..c2519df1b6dc 100644
--- a/include/linux/i2o-dev.h
+++ b/include/linux/i2o-dev.h
@@ -13,7 +13,7 @@
13 * This header file defines the I2O APIs that are available to both 13 * This header file defines the I2O APIs that are available to both
14 * the kernel and user level applications. Kernel specific structures 14 * the kernel and user level applications. Kernel specific structures
15 * are defined in i2o_osm. OSMs should include _only_ i2o_osm.h which 15 * are defined in i2o_osm. OSMs should include _only_ i2o_osm.h which
16 * automatically includs this file. 16 * automatically includes this file.
17 * 17 *
18 */ 18 */
19 19
@@ -23,14 +23,7 @@
23/* How many controllers are we allowing */ 23/* How many controllers are we allowing */
24#define MAX_I2O_CONTROLLERS 32 24#define MAX_I2O_CONTROLLERS 32
25 25
26//#include <linux/ioctl.h> 26#include <linux/ioctl.h>
27#ifndef __KERNEL__
28
29typedef unsigned char u8;
30typedef unsigned short u16;
31typedef unsigned int u32;
32
33#endif /* __KERNEL__ */
34 27
35/* 28/*
36 * I2O Control IOCTLs and structures 29 * I2O Control IOCTLs and structures
@@ -53,7 +46,7 @@ typedef unsigned int u32;
53 46
54struct i2o_cmd_passthru32 { 47struct i2o_cmd_passthru32 {
55 unsigned int iop; /* IOP unit number */ 48 unsigned int iop; /* IOP unit number */
56 u32 msg; /* message */ 49 __u32 msg; /* message */
57}; 50};
58 51
59struct i2o_cmd_passthru { 52struct i2o_cmd_passthru {
@@ -138,53 +131,53 @@ typedef struct i2o_sg_io_hdr {
138#define I2O_BUS_UNKNOWN 0x80 131#define I2O_BUS_UNKNOWN 0x80
139 132
140typedef struct _i2o_pci_bus { 133typedef struct _i2o_pci_bus {
141 u8 PciFunctionNumber; 134 __u8 PciFunctionNumber;
142 u8 PciDeviceNumber; 135 __u8 PciDeviceNumber;
143 u8 PciBusNumber; 136 __u8 PciBusNumber;
144 u8 reserved; 137 __u8 reserved;
145 u16 PciVendorID; 138 __u16 PciVendorID;
146 u16 PciDeviceID; 139 __u16 PciDeviceID;
147} i2o_pci_bus; 140} i2o_pci_bus;
148 141
149typedef struct _i2o_local_bus { 142typedef struct _i2o_local_bus {
150 u16 LbBaseIOPort; 143 __u16 LbBaseIOPort;
151 u16 reserved; 144 __u16 reserved;
152 u32 LbBaseMemoryAddress; 145 __u32 LbBaseMemoryAddress;
153} i2o_local_bus; 146} i2o_local_bus;
154 147
155typedef struct _i2o_isa_bus { 148typedef struct _i2o_isa_bus {
156 u16 IsaBaseIOPort; 149 __u16 IsaBaseIOPort;
157 u8 CSN; 150 __u8 CSN;
158 u8 reserved; 151 __u8 reserved;
159 u32 IsaBaseMemoryAddress; 152 __u32 IsaBaseMemoryAddress;
160} i2o_isa_bus; 153} i2o_isa_bus;
161 154
162typedef struct _i2o_eisa_bus_info { 155typedef struct _i2o_eisa_bus_info {
163 u16 EisaBaseIOPort; 156 __u16 EisaBaseIOPort;
164 u8 reserved; 157 __u8 reserved;
165 u8 EisaSlotNumber; 158 __u8 EisaSlotNumber;
166 u32 EisaBaseMemoryAddress; 159 __u32 EisaBaseMemoryAddress;
167} i2o_eisa_bus; 160} i2o_eisa_bus;
168 161
169typedef struct _i2o_mca_bus { 162typedef struct _i2o_mca_bus {
170 u16 McaBaseIOPort; 163 __u16 McaBaseIOPort;
171 u8 reserved; 164 __u8 reserved;
172 u8 McaSlotNumber; 165 __u8 McaSlotNumber;
173 u32 McaBaseMemoryAddress; 166 __u32 McaBaseMemoryAddress;
174} i2o_mca_bus; 167} i2o_mca_bus;
175 168
176typedef struct _i2o_other_bus { 169typedef struct _i2o_other_bus {
177 u16 BaseIOPort; 170 __u16 BaseIOPort;
178 u16 reserved; 171 __u16 reserved;
179 u32 BaseMemoryAddress; 172 __u32 BaseMemoryAddress;
180} i2o_other_bus; 173} i2o_other_bus;
181 174
182typedef struct _i2o_hrt_entry { 175typedef struct _i2o_hrt_entry {
183 u32 adapter_id; 176 __u32 adapter_id;
184 u32 parent_tid:12; 177 __u32 parent_tid:12;
185 u32 state:4; 178 __u32 state:4;
186 u32 bus_num:8; 179 __u32 bus_num:8;
187 u32 bus_type:8; 180 __u32 bus_type:8;
188 union { 181 union {
189 i2o_pci_bus pci_bus; 182 i2o_pci_bus pci_bus;
190 i2o_local_bus local_bus; 183 i2o_local_bus local_bus;
@@ -196,66 +189,66 @@ typedef struct _i2o_hrt_entry {
196} i2o_hrt_entry; 189} i2o_hrt_entry;
197 190
198typedef struct _i2o_hrt { 191typedef struct _i2o_hrt {
199 u16 num_entries; 192 __u16 num_entries;
200 u8 entry_len; 193 __u8 entry_len;
201 u8 hrt_version; 194 __u8 hrt_version;
202 u32 change_ind; 195 __u32 change_ind;
203 i2o_hrt_entry hrt_entry[1]; 196 i2o_hrt_entry hrt_entry[1];
204} i2o_hrt; 197} i2o_hrt;
205 198
206typedef struct _i2o_lct_entry { 199typedef struct _i2o_lct_entry {
207 u32 entry_size:16; 200 __u32 entry_size:16;
208 u32 tid:12; 201 __u32 tid:12;
209 u32 reserved:4; 202 __u32 reserved:4;
210 u32 change_ind; 203 __u32 change_ind;
211 u32 device_flags; 204 __u32 device_flags;
212 u32 class_id:12; 205 __u32 class_id:12;
213 u32 version:4; 206 __u32 version:4;
214 u32 vendor_id:16; 207 __u32 vendor_id:16;
215 u32 sub_class; 208 __u32 sub_class;
216 u32 user_tid:12; 209 __u32 user_tid:12;
217 u32 parent_tid:12; 210 __u32 parent_tid:12;
218 u32 bios_info:8; 211 __u32 bios_info:8;
219 u8 identity_tag[8]; 212 __u8 identity_tag[8];
220 u32 event_capabilities; 213 __u32 event_capabilities;
221} i2o_lct_entry; 214} i2o_lct_entry;
222 215
223typedef struct _i2o_lct { 216typedef struct _i2o_lct {
224 u32 table_size:16; 217 __u32 table_size:16;
225 u32 boot_tid:12; 218 __u32 boot_tid:12;
226 u32 lct_ver:4; 219 __u32 lct_ver:4;
227 u32 iop_flags; 220 __u32 iop_flags;
228 u32 change_ind; 221 __u32 change_ind;
229 i2o_lct_entry lct_entry[1]; 222 i2o_lct_entry lct_entry[1];
230} i2o_lct; 223} i2o_lct;
231 224
232typedef struct _i2o_status_block { 225typedef struct _i2o_status_block {
233 u16 org_id; 226 __u16 org_id;
234 u16 reserved; 227 __u16 reserved;
235 u16 iop_id:12; 228 __u16 iop_id:12;
236 u16 reserved1:4; 229 __u16 reserved1:4;
237 u16 host_unit_id; 230 __u16 host_unit_id;
238 u16 segment_number:12; 231 __u16 segment_number:12;
239 u16 i2o_version:4; 232 __u16 i2o_version:4;
240 u8 iop_state; 233 __u8 iop_state;
241 u8 msg_type; 234 __u8 msg_type;
242 u16 inbound_frame_size; 235 __u16 inbound_frame_size;
243 u8 init_code; 236 __u8 init_code;
244 u8 reserved2; 237 __u8 reserved2;
245 u32 max_inbound_frames; 238 __u32 max_inbound_frames;
246 u32 cur_inbound_frames; 239 __u32 cur_inbound_frames;
247 u32 max_outbound_frames; 240 __u32 max_outbound_frames;
248 char product_id[24]; 241 char product_id[24];
249 u32 expected_lct_size; 242 __u32 expected_lct_size;
250 u32 iop_capabilities; 243 __u32 iop_capabilities;
251 u32 desired_mem_size; 244 __u32 desired_mem_size;
252 u32 current_mem_size; 245 __u32 current_mem_size;
253 u32 current_mem_base; 246 __u32 current_mem_base;
254 u32 desired_io_size; 247 __u32 desired_io_size;
255 u32 current_io_size; 248 __u32 current_io_size;
256 u32 current_io_base; 249 __u32 current_io_base;
257 u32 reserved3:24; 250 __u32 reserved3:24;
258 u32 cmd_status:8; 251 __u32 cmd_status:8;
259} i2o_status_block; 252} i2o_status_block;
260 253
261/* Event indicator mask flags */ 254/* Event indicator mask flags */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index a8bef1d1371c..77e66d055f5b 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -6,7 +6,6 @@
6 * Copyright (C) 1994-2002 Linus Torvalds & authors 6 * Copyright (C) 1994-2002 Linus Torvalds & authors
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/init.h> 9#include <linux/init.h>
11#include <linux/ioport.h> 10#include <linux/ioport.h>
12#include <linux/hdreg.h> 11#include <linux/hdreg.h>
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h
index 1288a161bc0b..e0a150046208 100644
--- a/include/linux/if_fddi.h
+++ b/include/linux/if_fddi.h
@@ -102,6 +102,7 @@ struct fddihdr
102 } hdr; 102 } hdr;
103 } __attribute__ ((packed)); 103 } __attribute__ ((packed));
104 104
105#ifdef __KERNEL__
105/* Define FDDI statistics structure */ 106/* Define FDDI statistics structure */
106struct fddi_statistics { 107struct fddi_statistics {
107 108
@@ -193,5 +194,6 @@ struct fddi_statistics {
193 __u32 port_ler_flag[2]; 194 __u32 port_ler_flag[2];
194 __u32 port_hardware_present[2]; 195 __u32 port_hardware_present[2];
195 }; 196 };
197#endif /* __KERNEL__ */
196 198
197#endif /* _LINUX_IF_FDDI_H */ 199#endif /* _LINUX_IF_FDDI_H */
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h
index 395f0aad9cbf..f272a80caa3e 100644
--- a/include/linux/if_frad.h
+++ b/include/linux/if_frad.h
@@ -24,7 +24,6 @@
24#ifndef _FRAD_H_ 24#ifndef _FRAD_H_
25#define _FRAD_H_ 25#define _FRAD_H_
26 26
27#include <linux/config.h>
28#include <linux/if.h> 27#include <linux/if.h>
29 28
30#if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE) 29#if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE)
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h
index 5502f597cf0e..2f94cf2c7abb 100644
--- a/include/linux/if_tr.h
+++ b/include/linux/if_tr.h
@@ -43,7 +43,6 @@ struct trh_hdr {
43}; 43};
44 44
45#ifdef __KERNEL__ 45#ifdef __KERNEL__
46#include <linux/config.h>
47#include <linux/skbuff.h> 46#include <linux/skbuff.h>
48 47
49static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb) 48static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb)
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 28f4f3b36950..899c3d4776f3 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -169,7 +169,7 @@ struct ip_sf_list
169struct ip_mc_list 169struct ip_mc_list
170{ 170{
171 struct in_device *interface; 171 struct in_device *interface;
172 unsigned long multiaddr; 172 __be32 multiaddr;
173 struct ip_sf_list *sources; 173 struct ip_sf_list *sources;
174 struct ip_sf_list *tomb; 174 struct ip_sf_list *tomb;
175 unsigned int sfmode; 175 unsigned int sfmode;
diff --git a/include/linux/init.h b/include/linux/init.h
index 93dcbe1abb4c..6667785dd1ff 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_INIT_H 1#ifndef _LINUX_INIT_H
2#define _LINUX_INIT_H 2#define _LINUX_INIT_H
3 3
4#include <linux/config.h>
5#include <linux/compiler.h> 4#include <linux/compiler.h>
6 5
7/* These macros are used to mark some functions or 6/* These macros are used to mark some functions or
diff --git a/include/linux/inotify.h b/include/linux/inotify.h
index 09e00433c78e..d4f48c6402e6 100644
--- a/include/linux/inotify.h
+++ b/include/linux/inotify.h
@@ -67,20 +67,66 @@ struct inotify_event {
67 67
68#include <linux/dcache.h> 68#include <linux/dcache.h>
69#include <linux/fs.h> 69#include <linux/fs.h>
70#include <linux/config.h> 70
71/*
72 * struct inotify_watch - represents a watch request on a specific inode
73 *
74 * h_list is protected by ih->mutex of the associated inotify_handle.
75 * i_list, mask are protected by inode->inotify_mutex of the associated inode.
76 * ih, inode, and wd are never written to once the watch is created.
77 *
78 * Callers must use the established inotify interfaces to access inotify_watch
79 * contents. The content of this structure is private to the inotify
80 * implementation.
81 */
82struct inotify_watch {
83 struct list_head h_list; /* entry in inotify_handle's list */
84 struct list_head i_list; /* entry in inode's list */
85 atomic_t count; /* reference count */
86 struct inotify_handle *ih; /* associated inotify handle */
87 struct inode *inode; /* associated inode */
88 __s32 wd; /* watch descriptor */
89 __u32 mask; /* event mask for this watch */
90};
91
92struct inotify_operations {
93 void (*handle_event)(struct inotify_watch *, u32, u32, u32,
94 const char *, struct inode *);
95 void (*destroy_watch)(struct inotify_watch *);
96};
71 97
72#ifdef CONFIG_INOTIFY 98#ifdef CONFIG_INOTIFY
73 99
100/* Kernel API for producing events */
101
74extern void inotify_d_instantiate(struct dentry *, struct inode *); 102extern void inotify_d_instantiate(struct dentry *, struct inode *);
75extern void inotify_d_move(struct dentry *); 103extern void inotify_d_move(struct dentry *);
76extern void inotify_inode_queue_event(struct inode *, __u32, __u32, 104extern void inotify_inode_queue_event(struct inode *, __u32, __u32,
77 const char *); 105 const char *, struct inode *);
78extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32, 106extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32,
79 const char *); 107 const char *);
80extern void inotify_unmount_inodes(struct list_head *); 108extern void inotify_unmount_inodes(struct list_head *);
81extern void inotify_inode_is_dead(struct inode *); 109extern void inotify_inode_is_dead(struct inode *);
82extern u32 inotify_get_cookie(void); 110extern u32 inotify_get_cookie(void);
83 111
112/* Kernel Consumer API */
113
114extern struct inotify_handle *inotify_init(const struct inotify_operations *);
115extern void inotify_init_watch(struct inotify_watch *);
116extern void inotify_destroy(struct inotify_handle *);
117extern __s32 inotify_find_watch(struct inotify_handle *, struct inode *,
118 struct inotify_watch **);
119extern __s32 inotify_find_update_watch(struct inotify_handle *, struct inode *,
120 u32);
121extern __s32 inotify_add_watch(struct inotify_handle *, struct inotify_watch *,
122 struct inode *, __u32);
123extern int inotify_rm_watch(struct inotify_handle *, struct inotify_watch *);
124extern int inotify_rm_wd(struct inotify_handle *, __u32);
125extern void inotify_remove_watch_locked(struct inotify_handle *,
126 struct inotify_watch *);
127extern void get_inotify_watch(struct inotify_watch *);
128extern void put_inotify_watch(struct inotify_watch *);
129
84#else 130#else
85 131
86static inline void inotify_d_instantiate(struct dentry *dentry, 132static inline void inotify_d_instantiate(struct dentry *dentry,
@@ -94,7 +140,8 @@ static inline void inotify_d_move(struct dentry *dentry)
94 140
95static inline void inotify_inode_queue_event(struct inode *inode, 141static inline void inotify_inode_queue_event(struct inode *inode,
96 __u32 mask, __u32 cookie, 142 __u32 mask, __u32 cookie,
97 const char *filename) 143 const char *filename,
144 struct inode *n_inode)
98{ 145{
99} 146}
100 147
@@ -117,6 +164,62 @@ static inline u32 inotify_get_cookie(void)
117 return 0; 164 return 0;
118} 165}
119 166
167static inline struct inotify_handle *inotify_init(const struct inotify_operations *ops)
168{
169 return ERR_PTR(-EOPNOTSUPP);
170}
171
172static inline void inotify_init_watch(struct inotify_watch *watch)
173{
174}
175
176static inline void inotify_destroy(struct inotify_handle *ih)
177{
178}
179
180static inline __s32 inotify_find_watch(struct inotify_handle *ih, struct inode *inode,
181 struct inotify_watch **watchp)
182{
183 return -EOPNOTSUPP;
184}
185
186static inline __s32 inotify_find_update_watch(struct inotify_handle *ih,
187 struct inode *inode, u32 mask)
188{
189 return -EOPNOTSUPP;
190}
191
192static inline __s32 inotify_add_watch(struct inotify_handle *ih,
193 struct inotify_watch *watch,
194 struct inode *inode, __u32 mask)
195{
196 return -EOPNOTSUPP;
197}
198
199static inline int inotify_rm_watch(struct inotify_handle *ih,
200 struct inotify_watch *watch)
201{
202 return -EOPNOTSUPP;
203}
204
205static inline int inotify_rm_wd(struct inotify_handle *ih, __u32 wd)
206{
207 return -EOPNOTSUPP;
208}
209
210static inline void inotify_remove_watch_locked(struct inotify_handle *ih,
211 struct inotify_watch *watch)
212{
213}
214
215static inline void get_inotify_watch(struct inotify_watch *watch)
216{
217}
218
219static inline void put_inotify_watch(struct inotify_watch *watch)
220{
221}
222
120#endif /* CONFIG_INOTIFY */ 223#endif /* CONFIG_INOTIFY */
121 224
122#endif /* __KERNEL __ */ 225#endif /* __KERNEL __ */
diff --git a/include/linux/input.h b/include/linux/input.h
index ce1a756c4c30..b32c2b6e53f6 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -15,6 +15,7 @@
15#else 15#else
16#include <sys/time.h> 16#include <sys/time.h>
17#include <sys/ioctl.h> 17#include <sys/ioctl.h>
18#include <sys/types.h>
18#include <asm/types.h> 19#include <asm/types.h>
19#endif 20#endif
20 21
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 2c08fdc2bdf7..9e0fefd7884a 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -2,7 +2,6 @@
2#ifndef _LINUX_INTERRUPT_H 2#ifndef _LINUX_INTERRUPT_H
3#define _LINUX_INTERRUPT_H 3#define _LINUX_INTERRUPT_H
4 4
5#include <linux/config.h>
6#include <linux/kernel.h> 5#include <linux/kernel.h>
7#include <linux/linkage.h> 6#include <linux/linkage.h>
8#include <linux/bitops.h> 7#include <linux/bitops.h>
diff --git a/include/linux/io.h b/include/linux/io.h
index 85533ec5aaa1..420e2fdf26f6 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -21,5 +21,6 @@
21#include <asm/io.h> 21#include <asm/io.h>
22 22
23void __iowrite32_copy(void __iomem *to, const void *from, size_t count); 23void __iowrite32_copy(void __iomem *to, const void *from, size_t count);
24void __iowrite64_copy(void __iomem *to, const void *from, size_t count);
24 25
25#endif /* _LINUX_IO_H */ 26#endif /* _LINUX_IO_H */
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 0a84b56935c2..5653b2f23b6a 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -36,7 +36,6 @@
36 36
37#include <linux/ipmi_msgdefs.h> 37#include <linux/ipmi_msgdefs.h>
38#include <linux/compiler.h> 38#include <linux/compiler.h>
39#include <linux/device.h>
40 39
41/* 40/*
42 * This file describes an interface to an IPMI driver. You have to 41 * This file describes an interface to an IPMI driver. You have to
@@ -210,6 +209,7 @@ struct kernel_ipmi_msg
210 */ 209 */
211#include <linux/list.h> 210#include <linux/list.h>
212#include <linux/module.h> 211#include <linux/module.h>
212#include <linux/device.h>
213 213
214#ifdef CONFIG_PROC_FS 214#ifdef CONFIG_PROC_FS
215#include <linux/proc_fs.h> 215#include <linux/proc_fs.h>
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 1263d8cb3c18..297853c841b4 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -1,7 +1,6 @@
1#ifndef _IPV6_H 1#ifndef _IPV6_H
2#define _IPV6_H 2#define _IPV6_H
3 3
4#include <linux/config.h>
5#include <linux/in6.h> 4#include <linux/in6.h>
6#include <asm/byteorder.h> 5#include <asm/byteorder.h>
7 6
diff --git a/include/linux/irq.h b/include/linux/irq.h
index ee2a82a572f7..42c9cd562860 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -9,7 +9,6 @@
9 * Thanks. --rmk 9 * Thanks. --rmk
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/smp.h> 12#include <linux/smp.h>
14 13
15#if !defined(CONFIG_S390) 14#if !defined(CONFIG_S390)
diff --git a/include/linux/irq_cpustat.h b/include/linux/irq_cpustat.h
index af93505ec2ec..77e4bac29287 100644
--- a/include/linux/irq_cpustat.h
+++ b/include/linux/irq_cpustat.h
@@ -9,7 +9,6 @@
9 * Keith Owens <kaos@ocs.com.au> July 2000. 9 * Keith Owens <kaos@ocs.com.au> July 2000.
10 */ 10 */
11 11
12#include <linux/config.h>
13 12
14/* 13/*
15 * Simple wrappers reducing source bloat. Define all irq_stat fields 14 * Simple wrappers reducing source bloat. Define all irq_stat fields
diff --git a/include/linux/isa.h b/include/linux/isa.h
new file mode 100644
index 000000000000..1b855335cb11
--- /dev/null
+++ b/include/linux/isa.h
@@ -0,0 +1,28 @@
1/*
2 * ISA bus.
3 */
4
5#ifndef __LINUX_ISA_H
6#define __LINUX_ISA_H
7
8#include <linux/device.h>
9#include <linux/kernel.h>
10
11struct isa_driver {
12 int (*match)(struct device *, unsigned int);
13 int (*probe)(struct device *, unsigned int);
14 int (*remove)(struct device *, unsigned int);
15 void (*shutdown)(struct device *, unsigned int);
16 int (*suspend)(struct device *, unsigned int, pm_message_t);
17 int (*resume)(struct device *, unsigned int);
18
19 struct device_driver driver;
20 struct device *devices;
21};
22
23#define to_isa_driver(x) container_of((x), struct isa_driver, driver)
24
25int isa_register_driver(struct isa_driver *, unsigned int);
26void isa_unregister_driver(struct isa_driver *);
27
28#endif /* __LINUX_ISA_H */
diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h
index 26c64c286f42..1e8728a9ee8a 100644
--- a/include/linux/isapnp.h
+++ b/include/linux/isapnp.h
@@ -22,7 +22,6 @@
22#ifndef LINUX_ISAPNP_H 22#ifndef LINUX_ISAPNP_H
23#define LINUX_ISAPNP_H 23#define LINUX_ISAPNP_H
24 24
25#include <linux/config.h>
26#include <linux/errno.h> 25#include <linux/errno.h>
27#include <linux/pnp.h> 26#include <linux/pnp.h>
28 27
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 53eaee96065b..62991148d5a5 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -146,7 +146,6 @@ typedef struct {
146 146
147#ifdef __KERNEL__ 147#ifdef __KERNEL__
148 148
149#include <linux/config.h>
150#include <linux/errno.h> 149#include <linux/errno.h>
151#include <linux/fs.h> 150#include <linux/fs.h>
152#include <linux/major.h> 151#include <linux/major.h>
diff --git a/include/linux/isdn/tpam.h b/include/linux/isdn/tpam.h
index 9f65bea49d11..d18dd0dc570d 100644
--- a/include/linux/isdn/tpam.h
+++ b/include/linux/isdn/tpam.h
@@ -26,7 +26,6 @@
26#define _TPAM_H_ 26#define _TPAM_H_
27 27
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/pci.h>
30 29
31/* IOCTL commands */ 30/* IOCTL commands */
32#define TPAM_CMD_DSPLOAD 0x0001 31#define TPAM_CMD_DSPLOAD 0x0001
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h
index 26b00a76e135..8687a7dc0632 100644
--- a/include/linux/isdn_ppp.h
+++ b/include/linux/isdn_ppp.h
@@ -67,7 +67,6 @@ struct isdn_ppp_comp_data {
67#ifdef __KERNEL__ 67#ifdef __KERNEL__
68 68
69 69
70#include <linux/config.h>
71 70
72#ifdef CONFIG_IPPP_FILTER 71#ifdef CONFIG_IPPP_FILTER
73#include <linux/filter.h> 72#include <linux/filter.h>
diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h
index 04e10f9f14f8..b9b5a684ed69 100644
--- a/include/linux/isdnif.h
+++ b/include/linux/isdnif.h
@@ -54,7 +54,6 @@
54 54
55#ifdef __KERNEL__ 55#ifdef __KERNEL__
56 56
57#include <linux/config.h>
58#include <linux/skbuff.h> 57#include <linux/skbuff.h>
59 58
60/***************************************************************************/ 59/***************************************************************************/
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
index cf792bb3c726..c6f70660b371 100644
--- a/include/linux/jffs2.h
+++ b/include/linux/jffs2.h
@@ -65,6 +65,18 @@
65 65
66#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6) 66#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
67 67
68#define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8)
69#define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9)
70
71/* XATTR Related */
72#define JFFS2_XPREFIX_USER 1 /* for "user." */
73#define JFFS2_XPREFIX_SECURITY 2 /* for "security." */
74#define JFFS2_XPREFIX_ACL_ACCESS 3 /* for "system.posix_acl_access" */
75#define JFFS2_XPREFIX_ACL_DEFAULT 4 /* for "system.posix_acl_default" */
76#define JFFS2_XPREFIX_TRUSTED 5 /* for "trusted.*" */
77
78#define JFFS2_ACL_VERSION 0x0001
79
68// Maybe later... 80// Maybe later...
69//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) 81//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
70//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) 82//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
@@ -82,11 +94,11 @@
82 94
83typedef struct { 95typedef struct {
84 uint32_t v32; 96 uint32_t v32;
85} __attribute__((packed)) jint32_t; 97} __attribute__((packed)) jint32_t;
86 98
87typedef struct { 99typedef struct {
88 uint32_t m; 100 uint32_t m;
89} __attribute__((packed)) jmode_t; 101} __attribute__((packed)) jmode_t;
90 102
91typedef struct { 103typedef struct {
92 uint16_t v16; 104 uint16_t v16;
@@ -99,7 +111,7 @@ struct jffs2_unknown_node
99 jint16_t nodetype; 111 jint16_t nodetype;
100 jint32_t totlen; /* So we can skip over nodes we don't grok */ 112 jint32_t totlen; /* So we can skip over nodes we don't grok */
101 jint32_t hdr_crc; 113 jint32_t hdr_crc;
102} __attribute__((packed)); 114};
103 115
104struct jffs2_raw_dirent 116struct jffs2_raw_dirent
105{ 117{
@@ -117,7 +129,7 @@ struct jffs2_raw_dirent
117 jint32_t node_crc; 129 jint32_t node_crc;
118 jint32_t name_crc; 130 jint32_t name_crc;
119 uint8_t name[0]; 131 uint8_t name[0];
120} __attribute__((packed)); 132};
121 133
122/* The JFFS2 raw inode structure: Used for storage on physical media. */ 134/* The JFFS2 raw inode structure: Used for storage on physical media. */
123/* The uid, gid, atime, mtime and ctime members could be longer, but 135/* The uid, gid, atime, mtime and ctime members could be longer, but
@@ -149,6 +161,32 @@ struct jffs2_raw_inode
149 jint32_t data_crc; /* CRC for the (compressed) data. */ 161 jint32_t data_crc; /* CRC for the (compressed) data. */
150 jint32_t node_crc; /* CRC for the raw inode (excluding data) */ 162 jint32_t node_crc; /* CRC for the raw inode (excluding data) */
151 uint8_t data[0]; 163 uint8_t data[0];
164};
165
166struct jffs2_raw_xattr {
167 jint16_t magic;
168 jint16_t nodetype; /* = JFFS2_NODETYPE_XATTR */
169 jint32_t totlen;
170 jint32_t hdr_crc;
171 jint32_t xid; /* XATTR identifier number */
172 jint32_t version;
173 uint8_t xprefix;
174 uint8_t name_len;
175 jint16_t value_len;
176 jint32_t data_crc;
177 jint32_t node_crc;
178 uint8_t data[0];
179} __attribute__((packed));
180
181struct jffs2_raw_xref
182{
183 jint16_t magic;
184 jint16_t nodetype; /* = JFFS2_NODETYPE_XREF */
185 jint32_t totlen;
186 jint32_t hdr_crc;
187 jint32_t ino; /* inode number */
188 jint32_t xid; /* XATTR identifier number */
189 jint32_t node_crc;
152} __attribute__((packed)); 190} __attribute__((packed));
153 191
154struct jffs2_raw_summary 192struct jffs2_raw_summary
@@ -163,14 +201,22 @@ struct jffs2_raw_summary
163 jint32_t sum_crc; /* summary information crc */ 201 jint32_t sum_crc; /* summary information crc */
164 jint32_t node_crc; /* node crc */ 202 jint32_t node_crc; /* node crc */
165 jint32_t sum[0]; /* inode summary info */ 203 jint32_t sum[0]; /* inode summary info */
166} __attribute__((packed)); 204};
167 205
168union jffs2_node_union 206union jffs2_node_union
169{ 207{
170 struct jffs2_raw_inode i; 208 struct jffs2_raw_inode i;
171 struct jffs2_raw_dirent d; 209 struct jffs2_raw_dirent d;
210 struct jffs2_raw_xattr x;
211 struct jffs2_raw_xref r;
172 struct jffs2_raw_summary s; 212 struct jffs2_raw_summary s;
173 struct jffs2_unknown_node u; 213 struct jffs2_unknown_node u;
174}; 214};
175 215
216/* Data payload for device nodes. */
217union jffs2_device_node {
218 jint16_t old;
219 jint32_t new;
220};
221
176#endif /* __LINUX_JFFS2_H__ */ 222#endif /* __LINUX_JFFS2_H__ */
diff --git a/include/linux/jffs2_fs_i.h b/include/linux/jffs2_fs_i.h
deleted file mode 100644
index ad565bf9dcc1..000000000000
--- a/include/linux/jffs2_fs_i.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/* $Id: jffs2_fs_i.h,v 1.19 2005/11/07 11:14:52 gleixner Exp $ */
2
3#ifndef _JFFS2_FS_I
4#define _JFFS2_FS_I
5
6#include <linux/version.h>
7#include <linux/rbtree.h>
8#include <asm/semaphore.h>
9
10struct jffs2_inode_info {
11 /* We need an internal mutex similar to inode->i_mutex.
12 Unfortunately, we can't used the existing one, because
13 either the GC would deadlock, or we'd have to release it
14 before letting GC proceed. Or we'd have to put ugliness
15 into the GC code so it didn't attempt to obtain the i_mutex
16 for the inode(s) which are already locked */
17 struct semaphore sem;
18
19 /* The highest (datanode) version number used for this ino */
20 uint32_t highest_version;
21
22 /* List of data fragments which make up the file */
23 struct rb_root fragtree;
24
25 /* There may be one datanode which isn't referenced by any of the
26 above fragments, if it contains a metadata update but no actual
27 data - or if this is a directory inode */
28 /* This also holds the _only_ dnode for symlinks/device nodes,
29 etc. */
30 struct jffs2_full_dnode *metadata;
31
32 /* Directory entries */
33 struct jffs2_full_dirent *dents;
34
35 /* The target path if this is the inode of a symlink */
36 unsigned char *target;
37
38 /* Some stuff we just have to keep in-core at all times, for each inode. */
39 struct jffs2_inode_cache *inocache;
40
41 uint16_t flags;
42 uint8_t usercompr;
43#if !defined (__ECOS)
44#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)
45 struct inode vfs_inode;
46#endif
47#endif
48};
49
50#endif /* _JFFS2_FS_I */
diff --git a/include/linux/jffs2_fs_sb.h b/include/linux/jffs2_fs_sb.h
deleted file mode 100644
index 4bcfb5570221..000000000000
--- a/include/linux/jffs2_fs_sb.h
+++ /dev/null
@@ -1,122 +0,0 @@
1/* $Id: jffs2_fs_sb.h,v 1.54 2005/09/21 13:37:34 dedekind Exp $ */
2
3#ifndef _JFFS2_FS_SB
4#define _JFFS2_FS_SB
5
6#include <linux/types.h>
7#include <linux/spinlock.h>
8#include <linux/workqueue.h>
9#include <linux/completion.h>
10#include <asm/semaphore.h>
11#include <linux/timer.h>
12#include <linux/wait.h>
13#include <linux/list.h>
14#include <linux/rwsem.h>
15
16#define JFFS2_SB_FLAG_RO 1
17#define JFFS2_SB_FLAG_SCANNING 2 /* Flash scanning is in progress */
18#define JFFS2_SB_FLAG_BUILDING 4 /* File system building is in progress */
19
20struct jffs2_inodirty;
21
22/* A struct for the overall file system control. Pointers to
23 jffs2_sb_info structs are named `c' in the source code.
24 Nee jffs_control
25*/
26struct jffs2_sb_info {
27 struct mtd_info *mtd;
28
29 uint32_t highest_ino;
30 uint32_t checked_ino;
31
32 unsigned int flags;
33
34 struct task_struct *gc_task; /* GC task struct */
35 struct completion gc_thread_start; /* GC thread start completion */
36 struct completion gc_thread_exit; /* GC thread exit completion port */
37
38 struct semaphore alloc_sem; /* Used to protect all the following
39 fields, and also to protect against
40 out-of-order writing of nodes. And GC. */
41 uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER
42 (i.e. zero for OOB CLEANMARKER */
43
44 uint32_t flash_size;
45 uint32_t used_size;
46 uint32_t dirty_size;
47 uint32_t wasted_size;
48 uint32_t free_size;
49 uint32_t erasing_size;
50 uint32_t bad_size;
51 uint32_t sector_size;
52 uint32_t unchecked_size;
53
54 uint32_t nr_free_blocks;
55 uint32_t nr_erasing_blocks;
56
57 /* Number of free blocks there must be before we... */
58 uint8_t resv_blocks_write; /* ... allow a normal filesystem write */
59 uint8_t resv_blocks_deletion; /* ... allow a normal filesystem deletion */
60 uint8_t resv_blocks_gctrigger; /* ... wake up the GC thread */
61 uint8_t resv_blocks_gcbad; /* ... pick a block from the bad_list to GC */
62 uint8_t resv_blocks_gcmerge; /* ... merge pages when garbage collecting */
63
64 uint32_t nospc_dirty_size;
65
66 uint32_t nr_blocks;
67 struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks
68 * from the offset (blocks[ofs / sector_size]) */
69 struct jffs2_eraseblock *nextblock; /* The block we're currently filling */
70
71 struct jffs2_eraseblock *gcblock; /* The block we're currently garbage-collecting */
72
73 struct list_head clean_list; /* Blocks 100% full of clean data */
74 struct list_head very_dirty_list; /* Blocks with lots of dirty space */
75 struct list_head dirty_list; /* Blocks with some dirty space */
76 struct list_head erasable_list; /* Blocks which are completely dirty, and need erasing */
77 struct list_head erasable_pending_wbuf_list; /* Blocks which need erasing but only after the current wbuf is flushed */
78 struct list_head erasing_list; /* Blocks which are currently erasing */
79 struct list_head erase_pending_list; /* Blocks which need erasing now */
80 struct list_head erase_complete_list; /* Blocks which are erased and need the clean marker written to them */
81 struct list_head free_list; /* Blocks which are free and ready to be used */
82 struct list_head bad_list; /* Bad blocks. */
83 struct list_head bad_used_list; /* Bad blocks with valid data in. */
84
85 spinlock_t erase_completion_lock; /* Protect free_list and erasing_list
86 against erase completion handler */
87 wait_queue_head_t erase_wait; /* For waiting for erases to complete */
88
89 wait_queue_head_t inocache_wq;
90 struct jffs2_inode_cache **inocache_list;
91 spinlock_t inocache_lock;
92
93 /* Sem to allow jffs2_garbage_collect_deletion_dirent to
94 drop the erase_completion_lock while it's holding a pointer
95 to an obsoleted node. I don't like this. Alternatives welcomed. */
96 struct semaphore erase_free_sem;
97
98 uint32_t wbuf_pagesize; /* 0 for NOR and other flashes with no wbuf */
99
100#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
101 /* Write-behind buffer for NAND flash */
102 unsigned char *wbuf;
103 uint32_t wbuf_ofs;
104 uint32_t wbuf_len;
105 struct jffs2_inodirty *wbuf_inodes;
106
107 struct rw_semaphore wbuf_sem; /* Protects the write buffer */
108
109 /* Information about out-of-band area usage... */
110 struct nand_oobinfo *oobinfo;
111 uint32_t badblock_pos;
112 uint32_t fsdata_pos;
113 uint32_t fsdata_len;
114#endif
115
116 struct jffs2_summary *summary; /* Summary information */
117
118 /* OS-private pointer for getting back to master superblock info */
119 void *os_priv;
120};
121
122#endif /* _JFFS2_FB_SB */
diff --git a/include/linux/joystick.h b/include/linux/joystick.h
index 5fd20ddd7ae3..e2d3a18af456 100644
--- a/include/linux/joystick.h
+++ b/include/linux/joystick.h
@@ -111,25 +111,25 @@ struct js_corr {
111#define JS_SET_ALL 8 111#define JS_SET_ALL 8
112 112
113struct JS_DATA_TYPE { 113struct JS_DATA_TYPE {
114 int32_t buttons; 114 __s32 buttons;
115 int32_t x; 115 __s32 x;
116 int32_t y; 116 __s32 y;
117}; 117};
118 118
119struct JS_DATA_SAVE_TYPE_32 { 119struct JS_DATA_SAVE_TYPE_32 {
120 int32_t JS_TIMEOUT; 120 __s32 JS_TIMEOUT;
121 int32_t BUSY; 121 __s32 BUSY;
122 int32_t JS_EXPIRETIME; 122 __s32 JS_EXPIRETIME;
123 int32_t JS_TIMELIMIT; 123 __s32 JS_TIMELIMIT;
124 struct JS_DATA_TYPE JS_SAVE; 124 struct JS_DATA_TYPE JS_SAVE;
125 struct JS_DATA_TYPE JS_CORR; 125 struct JS_DATA_TYPE JS_CORR;
126}; 126};
127 127
128struct JS_DATA_SAVE_TYPE_64 { 128struct JS_DATA_SAVE_TYPE_64 {
129 int32_t JS_TIMEOUT; 129 __s32 JS_TIMEOUT;
130 int32_t BUSY; 130 __s32 BUSY;
131 int64_t JS_EXPIRETIME; 131 __s64 JS_EXPIRETIME;
132 int64_t JS_TIMELIMIT; 132 __s64 JS_TIMELIMIT;
133 struct JS_DATA_TYPE JS_SAVE; 133 struct JS_DATA_TYPE JS_SAVE;
134 struct JS_DATA_TYPE JS_CORR; 134 struct JS_DATA_TYPE JS_CORR;
135}; 135};
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 9bbd04092365..54e2549f96ba 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -5,7 +5,6 @@
5#ifndef _LINUX_KALLSYMS_H 5#ifndef _LINUX_KALLSYMS_H
6#define _LINUX_KALLSYMS_H 6#define _LINUX_KALLSYMS_H
7 7
8#include <linux/config.h>
9 8
10#define KSYM_NAME_LEN 127 9#define KSYM_NAME_LEN 127
11 10
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index b46249082cca..43e895f1cabe 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_KERNEL_STAT_H 1#ifndef _LINUX_KERNEL_STAT_H
2#define _LINUX_KERNEL_STAT_H 2#define _LINUX_KERNEL_STAT_H
3 3
4#include <linux/config.h>
5#include <asm/irq.h> 4#include <asm/irq.h>
6#include <linux/smp.h> 5#include <linux/smp.h>
7#include <linux/threads.h> 6#include <linux/threads.h>
diff --git a/include/linux/key.h b/include/linux/key.h
index cbf464ad9589..e81ebf910d0b 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -205,6 +205,11 @@ struct key_type {
205 /* match a key against a description */ 205 /* match a key against a description */
206 int (*match)(const struct key *key, const void *desc); 206 int (*match)(const struct key *key, const void *desc);
207 207
208 /* clear some of the data from a key on revokation (optional)
209 * - the key's semaphore will be write-locked by the caller
210 */
211 void (*revoke)(struct key *key);
212
208 /* clear the data from a key (optional) */ 213 /* clear the data from a key (optional) */
209 void (*destroy)(struct key *key); 214 void (*destroy)(struct key *key);
210 215
@@ -241,8 +246,9 @@ extern void unregister_key_type(struct key_type *ktype);
241 246
242extern struct key *key_alloc(struct key_type *type, 247extern struct key *key_alloc(struct key_type *type,
243 const char *desc, 248 const char *desc,
244 uid_t uid, gid_t gid, key_perm_t perm, 249 uid_t uid, gid_t gid,
245 int not_in_quota); 250 struct task_struct *ctx,
251 key_perm_t perm, int not_in_quota);
246extern int key_payload_reserve(struct key *key, size_t datalen); 252extern int key_payload_reserve(struct key *key, size_t datalen);
247extern int key_instantiate_and_link(struct key *key, 253extern int key_instantiate_and_link(struct key *key,
248 const void *data, 254 const void *data,
@@ -292,7 +298,9 @@ extern int key_unlink(struct key *keyring,
292 struct key *key); 298 struct key *key);
293 299
294extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, 300extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
295 int not_in_quota, struct key *dest); 301 struct task_struct *ctx,
302 int not_in_quota,
303 struct key *dest);
296 304
297extern int keyring_clear(struct key *keyring); 305extern int keyring_clear(struct key *keyring);
298 306
@@ -313,7 +321,8 @@ extern void keyring_replace_payload(struct key *key, void *replacement);
313 * the userspace interface 321 * the userspace interface
314 */ 322 */
315extern struct key root_user_keyring, root_session_keyring; 323extern struct key root_user_keyring, root_session_keyring;
316extern int alloc_uid_keyring(struct user_struct *user); 324extern int alloc_uid_keyring(struct user_struct *user,
325 struct task_struct *ctx);
317extern void switch_uid_keyring(struct user_struct *new_user); 326extern void switch_uid_keyring(struct user_struct *new_user);
318extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk); 327extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk);
319extern int copy_thread_group_keys(struct task_struct *tsk); 328extern int copy_thread_group_keys(struct task_struct *tsk);
@@ -342,7 +351,7 @@ extern void key_init(void);
342#define make_key_ref(k) ({ NULL; }) 351#define make_key_ref(k) ({ NULL; })
343#define key_ref_to_ptr(k) ({ NULL; }) 352#define key_ref_to_ptr(k) ({ NULL; })
344#define is_key_possessed(k) 0 353#define is_key_possessed(k) 0
345#define alloc_uid_keyring(u) 0 354#define alloc_uid_keyring(u,c) 0
346#define switch_uid_keyring(u) do { } while(0) 355#define switch_uid_keyring(u) do { } while(0)
347#define __install_session_keyring(t, k) ({ NULL; }) 356#define __install_session_keyring(t, k) ({ NULL; })
348#define copy_keys(f,t) 0 357#define copy_keys(f,t) 0
@@ -355,6 +364,10 @@ extern void key_init(void);
355#define key_fsgid_changed(t) do { } while(0) 364#define key_fsgid_changed(t) do { } while(0)
356#define key_init() do { } while(0) 365#define key_init() do { } while(0)
357 366
367/* Initial keyrings */
368extern struct key root_user_keyring;
369extern struct key root_session_keyring;
370
358#endif /* CONFIG_KEYS */ 371#endif /* CONFIG_KEYS */
359#endif /* __KERNEL__ */ 372#endif /* __KERNEL__ */
360#endif /* _LINUX_KEY_H */ 373#endif /* _LINUX_KEY_H */
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index e4a231549407..0db22a1ab474 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -20,7 +20,6 @@
20 */ 20 */
21 21
22#include <linux/stddef.h> 22#include <linux/stddef.h>
23#include <linux/config.h>
24#include <linux/errno.h> 23#include <linux/errno.h>
25#include <linux/compiler.h> 24#include <linux/compiler.h>
26 25
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index c187c53cecd0..2d229327959e 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -190,6 +190,8 @@ struct subsystem _varname##_subsys = { \
190 190
191/* The global /sys/kernel/ subsystem for people to chain off of */ 191/* The global /sys/kernel/ subsystem for people to chain off of */
192extern struct subsystem kernel_subsys; 192extern struct subsystem kernel_subsys;
193/* The global /sys/hypervisor/ subsystem */
194extern struct subsystem hypervisor_subsys;
193 195
194/** 196/**
195 * Helpers for setting the kset of registered objects. 197 * Helpers for setting the kset of registered objects.
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 778adc0fa640..8bf6702da2a0 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -29,7 +29,6 @@
29 * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi 29 * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi
30 * <prasanna@in.ibm.com> added function-return probes. 30 * <prasanna@in.ibm.com> added function-return probes.
31 */ 31 */
32#include <linux/config.h>
33#include <linux/list.h> 32#include <linux/list.h>
34#include <linux/notifier.h> 33#include <linux/notifier.h>
35#include <linux/smp.h> 34#include <linux/smp.h>
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index c08c9983e840..932021f872d5 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_LINKAGE_H 1#ifndef _LINUX_LINKAGE_H
2#define _LINUX_LINKAGE_H 2#define _LINUX_LINKAGE_H
3 3
4#include <linux/config.h>
5#include <asm/linkage.h> 4#include <asm/linkage.h>
6 5
7#ifdef __cplusplus 6#ifdef __cplusplus
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 995f89dc8c04..a8876bc6513b 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -11,7 +11,6 @@
11 11
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13 13
14#include <linux/config.h>
15#include <linux/in.h> 14#include <linux/in.h>
16#include <linux/fs.h> 15#include <linux/fs.h>
17#include <linux/kref.h> 16#include <linux/kref.h>
diff --git a/include/linux/lockd/nlm.h b/include/linux/lockd/nlm.h
index 869b630cba24..d9d46e442538 100644
--- a/include/linux/lockd/nlm.h
+++ b/include/linux/lockd/nlm.h
@@ -9,7 +9,6 @@
9#ifndef LINUX_LOCKD_NLM_H 9#ifndef LINUX_LOCKD_NLM_H
10#define LINUX_LOCKD_NLM_H 10#define LINUX_LOCKD_NLM_H
11 11
12#include <linux/config.h>
13 12
14/* Maximum file offset in file_lock.fl_end */ 13/* Maximum file offset in file_lock.fl_end */
15# define NLM_OFFSET_MAX ((s32) 0x7fffffff) 14# define NLM_OFFSET_MAX ((s32) 0x7fffffff)
diff --git a/include/linux/m41t00.h b/include/linux/m41t00.h
new file mode 100644
index 000000000000..b423360ca38e
--- /dev/null
+++ b/include/linux/m41t00.h
@@ -0,0 +1,50 @@
1/*
2 * Definitions for the ST M41T00 family of i2c rtc chips.
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 *
6 * 2005, 2006 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#ifndef _M41T00_H
13#define _M41T00_H
14
15#define M41T00_DRV_NAME "m41t00"
16#define M41T00_I2C_ADDR 0x68
17
18#define M41T00_TYPE_M41T00 0
19#define M41T00_TYPE_M41T81 81
20#define M41T00_TYPE_M41T85 85
21
22struct m41t00_platform_data {
23 u8 type;
24 u8 i2c_addr;
25 u8 sqw_freq;
26};
27
28/* SQW output disabled, this is default value by power on */
29#define M41T00_SQW_DISABLE (0)
30
31#define M41T00_SQW_32KHZ (1<<4) /* 32.768 KHz */
32#define M41T00_SQW_8KHZ (2<<4) /* 8.192 KHz */
33#define M41T00_SQW_4KHZ (3<<4) /* 4.096 KHz */
34#define M41T00_SQW_2KHZ (4<<4) /* 2.048 KHz */
35#define M41T00_SQW_1KHZ (5<<4) /* 1.024 KHz */
36#define M41T00_SQW_512HZ (6<<4) /* 512 Hz */
37#define M41T00_SQW_256HZ (7<<4) /* 256 Hz */
38#define M41T00_SQW_128HZ (8<<4) /* 128 Hz */
39#define M41T00_SQW_64HZ (9<<4) /* 64 Hz */
40#define M41T00_SQW_32HZ (10<<4) /* 32 Hz */
41#define M41T00_SQW_16HZ (11<<4) /* 16 Hz */
42#define M41T00_SQW_8HZ (12<<4) /* 8 Hz */
43#define M41T00_SQW_4HZ (13<<4) /* 4 Hz */
44#define M41T00_SQW_2HZ (14<<4) /* 2 Hz */
45#define M41T00_SQW_1HZ (15<<4) /* 1 Hz */
46
47extern ulong m41t00_get_rtc_time(void);
48extern int m41t00_set_rtc_time(ulong nowtime);
49
50#endif /* _M41T00_H */
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index f5fdca1d67e6..72440f0a443d 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -28,7 +28,6 @@
28 28
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30 30
31#include <linux/config.h>
32#include <linux/mmzone.h> 31#include <linux/mmzone.h>
33#include <linux/slab.h> 32#include <linux/slab.h>
34#include <linux/rbtree.h> 33#include <linux/rbtree.h>
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index ff0a64073ebc..6789c4940c9c 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_MIGRATE_H 1#ifndef _LINUX_MIGRATE_H
2#define _LINUX_MIGRATE_H 2#define _LINUX_MIGRATE_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6 5
7#ifdef CONFIG_MIGRATION 6#ifdef CONFIG_MIGRATION
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 68f5a0f392dd..beddc6d3b0f6 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -9,7 +9,6 @@
9#define __LINUX_MII_H__ 9#define __LINUX_MII_H__
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/if.h>
13 12
14/* Generic MII registers. */ 13/* Generic MII registers. */
15 14
@@ -136,6 +135,20 @@
136#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */ 135#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */
137#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */ 136#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */
138 137
138/* This structure is used in all SIOCxMIIxxx ioctl calls */
139struct mii_ioctl_data {
140 __u16 phy_id;
141 __u16 reg_num;
142 __u16 val_in;
143 __u16 val_out;
144};
145
146#ifdef __KERNEL__
147
148#include <linux/if.h>
149
150struct ethtool_cmd;
151
139struct mii_if_info { 152struct mii_if_info {
140 int phy_id; 153 int phy_id;
141 int advertising; 154 int advertising;
@@ -151,9 +164,6 @@ struct mii_if_info {
151 void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val); 164 void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val);
152}; 165};
153 166
154struct ethtool_cmd;
155struct mii_ioctl_data;
156
157extern int mii_link_ok (struct mii_if_info *mii); 167extern int mii_link_ok (struct mii_if_info *mii);
158extern int mii_nway_restart (struct mii_if_info *mii); 168extern int mii_nway_restart (struct mii_if_info *mii);
159extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); 169extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
@@ -168,16 +178,6 @@ extern int generic_mii_ioctl(struct mii_if_info *mii_if,
168 unsigned int *duplex_changed); 178 unsigned int *duplex_changed);
169 179
170 180
171
172/* This structure is used in all SIOCxMIIxxx ioctl calls */
173struct mii_ioctl_data {
174 u16 phy_id;
175 u16 reg_num;
176 u16 val_in;
177 u16 val_out;
178};
179
180
181static inline struct mii_ioctl_data *if_mii(struct ifreq *rq) 181static inline struct mii_ioctl_data *if_mii(struct ifreq *rq)
182{ 182{
183 return (struct mii_ioctl_data *) &rq->ifr_ifru; 183 return (struct mii_ioctl_data *) &rq->ifr_ifru;
@@ -235,5 +235,5 @@ static inline unsigned int mii_duplex (unsigned int duplex_lock,
235 return 0; 235 return 0;
236} 236}
237 237
238 238#endif /* __KERNEL__ */
239#endif /* __LINUX_MII_H__ */ 239#endif /* __LINUX_MII_H__ */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1154684209a4..e2fa375e478e 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -7,7 +7,6 @@
7 7
8#ifdef __KERNEL__ 8#ifdef __KERNEL__
9 9
10#include <linux/config.h>
11#include <linux/gfp.h> 10#include <linux/gfp.h>
12#include <linux/list.h> 11#include <linux/list.h>
13#include <linux/mmzone.h> 12#include <linux/mmzone.h>
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 18a5689ef748..87920a0852a3 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -1,10 +1,6 @@
1#ifndef _LINUX_MMAN_H 1#ifndef _LINUX_MMAN_H
2#define _LINUX_MMAN_H 2#define _LINUX_MMAN_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h>
6
7#include <asm/atomic.h>
8#include <asm/mman.h> 4#include <asm/mman.h>
9 5
10#define MREMAP_MAYMOVE 1 6#define MREMAP_MAYMOVE 1
@@ -13,6 +9,12 @@
13#define OVERCOMMIT_GUESS 0 9#define OVERCOMMIT_GUESS 0
14#define OVERCOMMIT_ALWAYS 1 10#define OVERCOMMIT_ALWAYS 1
15#define OVERCOMMIT_NEVER 2 11#define OVERCOMMIT_NEVER 2
12
13#ifdef __KERNEL__
14#include <linux/mm.h>
15
16#include <asm/atomic.h>
17
16extern int sysctl_overcommit_memory; 18extern int sysctl_overcommit_memory;
17extern int sysctl_overcommit_ratio; 19extern int sysctl_overcommit_ratio;
18extern atomic_t vm_committed_space; 20extern atomic_t vm_committed_space;
@@ -63,5 +65,5 @@ calc_vm_flag_bits(unsigned long flags)
63 _calc_vm_trans(flags, MAP_EXECUTABLE, VM_EXECUTABLE) | 65 _calc_vm_trans(flags, MAP_EXECUTABLE, VM_EXECUTABLE) |
64 _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); 66 _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED );
65} 67}
66 68#endif /* __KERNEL__ */
67#endif /* _LINUX_MMAN_H */ 69#endif /* _LINUX_MMAN_H */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 2d8337150493..9742e3c16222 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -4,7 +4,6 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5#ifndef __ASSEMBLY__ 5#ifndef __ASSEMBLY__
6 6
7#include <linux/config.h>
8#include <linux/spinlock.h> 7#include <linux/spinlock.h>
9#include <linux/list.h> 8#include <linux/list.h>
10#include <linux/wait.h> 9#include <linux/wait.h>
diff --git a/include/linux/module.h b/include/linux/module.h
index eaec13ddd667..c2d89e037af0 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -6,7 +6,6 @@
6 * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996 6 * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
7 * Rewritten again by Rusty Russell, 2002 7 * Rewritten again by Rusty Russell, 2002
8 */ 8 */
9#include <linux/config.h>
10#include <linux/sched.h> 9#include <linux/sched.h>
11#include <linux/spinlock.h> 10#include <linux/spinlock.h>
12#include <linux/list.h> 11#include <linux/list.h>
@@ -557,13 +556,4 @@ static inline void module_remove_driver(struct device_driver *driver)
557 556
558#define __MODULE_STRING(x) __stringify(x) 557#define __MODULE_STRING(x) __stringify(x)
559 558
560/* Use symbol_get and symbol_put instead. You'll thank me. */
561#define HAVE_INTER_MODULE
562extern void __deprecated inter_module_register(const char *,
563 struct module *, const void *);
564extern void __deprecated inter_module_unregister(const char *);
565extern const void * __deprecated inter_module_get_request(const char *,
566 const char *);
567extern void __deprecated inter_module_put(const char *);
568
569#endif /* _LINUX_MODULE_H */ 559#endif /* _LINUX_MODULE_H */
diff --git a/include/linux/msg.h b/include/linux/msg.h
index 903e0ab8101f..acc7c174ff00 100644
--- a/include/linux/msg.h
+++ b/include/linux/msg.h
@@ -2,7 +2,6 @@
2#define _LINUX_MSG_H 2#define _LINUX_MSG_H
3 3
4#include <linux/ipc.h> 4#include <linux/ipc.h>
5#include <linux/list.h>
6 5
7/* ipcs ctl commands */ 6/* ipcs ctl commands */
8#define MSG_STAT 11 7#define MSG_STAT 11
@@ -63,6 +62,7 @@ struct msginfo {
63#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff) 62#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
64 63
65#ifdef __KERNEL__ 64#ifdef __KERNEL__
65#include <linux/list.h>
66 66
67/* one msg_msg structure for each message */ 67/* one msg_msg structure for each message */
68struct msg_msg { 68struct msg_msg {
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index 23a568910341..09bfae6938b3 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -7,7 +7,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>
11#include <linux/delay.h> 10#include <linux/delay.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/interrupt.h> 12#include <linux/interrupt.h>
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h
index d7eaa40e5ab0..6977780e548f 100644
--- a/include/linux/mtd/inftl.h
+++ b/include/linux/mtd/inftl.h
@@ -46,7 +46,7 @@ struct INFTLrecord {
46 unsigned int nb_blocks; /* number of physical blocks */ 46 unsigned int nb_blocks; /* number of physical blocks */
47 unsigned int nb_boot_blocks; /* number of blocks used by the bios */ 47 unsigned int nb_boot_blocks; /* number of blocks used by the bios */
48 struct erase_info instr; 48 struct erase_info instr;
49 struct nand_oobinfo oobinfo; 49 struct nand_ecclayout oobinfo;
50}; 50};
51 51
52int INFTL_mount(struct INFTLrecord *s); 52int INFTL_mount(struct INFTLrecord *s);
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 7dfd6e1fcde7..28d461d862bd 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -5,7 +5,6 @@
5#ifndef __LINUX_MTD_MAP_H__ 5#ifndef __LINUX_MTD_MAP_H__
6#define __LINUX_MTD_MAP_H__ 6#define __LINUX_MTD_MAP_H__
7 7
8#include <linux/config.h>
9#include <linux/types.h> 8#include <linux/types.h>
10#include <linux/list.h> 9#include <linux/list.h>
11#include <linux/string.h> 10#include <linux/string.h>
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index b6f2fdae65c6..9b7a2b525d63 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -13,7 +13,6 @@
13#error This is a kernel header. Perhaps include mtd-user.h instead? 13#error This is a kernel header. Perhaps include mtd-user.h instead?
14#endif 14#endif
15 15
16#include <linux/config.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/uio.h> 18#include <linux/uio.h>
@@ -56,18 +55,69 @@ struct mtd_erase_region_info {
56 u_int32_t numblocks; /* Number of blocks of erasesize in this region */ 55 u_int32_t numblocks; /* Number of blocks of erasesize in this region */
57}; 56};
58 57
58/*
59 * oob operation modes
60 *
61 * MTD_OOB_PLACE: oob data are placed at the given offset
62 * MTD_OOB_AUTO: oob data are automatically placed at the free areas
63 * which are defined by the ecclayout
64 * MTD_OOB_RAW: mode to read raw data+oob in one chunk. The oob data
65 * is inserted into the data. Thats a raw image of the
66 * flash contents.
67 */
68typedef enum {
69 MTD_OOB_PLACE,
70 MTD_OOB_AUTO,
71 MTD_OOB_RAW,
72} mtd_oob_mode_t;
73
74/**
75 * struct mtd_oob_ops - oob operation operands
76 * @mode: operation mode
77 *
78 * @len: number of bytes to write/read. When a data buffer is given
79 * (datbuf != NULL) this is the number of data bytes. When
80 + no data buffer is available this is the number of oob bytes.
81 *
82 * @retlen: number of bytes written/read. When a data buffer is given
83 * (datbuf != NULL) this is the number of data bytes. When
84 + no data buffer is available this is the number of oob bytes.
85 *
86 * @ooblen: number of oob bytes per page
87 * @ooboffs: offset of oob data in the oob area (only relevant when
88 * mode = MTD_OOB_PLACE)
89 * @datbuf: data buffer - if NULL only oob data are read/written
90 * @oobbuf: oob data buffer
91 */
92struct mtd_oob_ops {
93 mtd_oob_mode_t mode;
94 size_t len;
95 size_t retlen;
96 size_t ooblen;
97 uint32_t ooboffs;
98 uint8_t *datbuf;
99 uint8_t *oobbuf;
100};
101
59struct mtd_info { 102struct mtd_info {
60 u_char type; 103 u_char type;
61 u_int32_t flags; 104 u_int32_t flags;
62 u_int32_t size; // Total size of the MTD 105 u_int32_t size; // Total size of the MTD
63 106
64 /* "Major" erase size for the device. Naïve users may take this 107 /* "Major" erase size for the device. Naïve users may take this
65 * to be the only erase size available, or may use the more detailed 108 * to be the only erase size available, or may use the more detailed
66 * information below if they desire 109 * information below if they desire
67 */ 110 */
68 u_int32_t erasesize; 111 u_int32_t erasesize;
112 /* Minimal writable flash unit size. In case of NOR flash it is 1 (even
113 * though individual bits can be cleared), in case of NAND flash it is
114 * one NAND page (or half, or one-fourths of it), in case of ECC-ed NOR
115 * it is of ECC block size, etc. It is illegal to have writesize = 0.
116 * Any driver registering a struct mtd_info must ensure a writesize of
117 * 1 or larger.
118 */
119 u_int32_t writesize;
69 120
70 u_int32_t oobblock; // Size of OOB blocks (e.g. 512)
71 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) 121 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16)
72 u_int32_t ecctype; 122 u_int32_t ecctype;
73 u_int32_t eccsize; 123 u_int32_t eccsize;
@@ -79,7 +129,6 @@ struct mtd_info {
79 * MTD_PROGRAM_REGIONS flag is set. 129 * MTD_PROGRAM_REGIONS flag is set.
80 * (Maybe we should have an union for those?) 130 * (Maybe we should have an union for those?)
81 */ 131 */
82#define MTD_PROGREGION_SIZE(mtd) (mtd)->oobblock
83#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize 132#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize
84#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype 133#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype
85 134
@@ -87,9 +136,8 @@ struct mtd_info {
87 char *name; 136 char *name;
88 int index; 137 int index;
89 138
90 // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) 139 /* ecc layout structure pointer - read only ! */
91 struct nand_oobinfo oobinfo; 140 struct nand_ecclayout *ecclayout;
92 u_int32_t oobavail; // Number of bytes in OOB area available for fs
93 141
94 /* Data for variable erase regions. If numeraseregions is zero, 142 /* Data for variable erase regions. If numeraseregions is zero,
95 * it means that the whole device has erasesize as given above. 143 * it means that the whole device has erasesize as given above.
@@ -112,11 +160,10 @@ struct mtd_info {
112 int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 160 int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
113 int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); 161 int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
114 162
115 int (*read_ecc) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); 163 int (*read_oob) (struct mtd_info *mtd, loff_t from,
116 int (*write_ecc) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); 164 struct mtd_oob_ops *ops);
117 165 int (*write_oob) (struct mtd_info *mtd, loff_t to,
118 int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 166 struct mtd_oob_ops *ops);
119 int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
120 167
121 /* 168 /*
122 * Methods to access the protection register area, present in some 169 * Methods to access the protection register area, present in some
@@ -130,17 +177,11 @@ struct mtd_info {
130 int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 177 int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
131 int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len); 178 int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len);
132 179
133 /* kvec-based read/write methods. We need these especially for NAND flash, 180 /* kvec-based read/write methods.
134 with its limited number of write cycles per erase.
135 NB: The 'count' parameter is the number of _vectors_, each of 181 NB: The 'count' parameter is the number of _vectors_, each of
136 which contains an (ofs, len) tuple. 182 which contains an (ofs, len) tuple.
137 */ 183 */
138 int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen);
139 int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from,
140 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
141 int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); 184 int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen);
142 int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to,
143 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
144 185
145 /* Sync */ 186 /* Sync */
146 void (*sync) (struct mtd_info *mtd); 187 void (*sync) (struct mtd_info *mtd);
@@ -159,6 +200,9 @@ struct mtd_info {
159 200
160 struct notifier_block reboot_notifier; /* default mode before reboot */ 201 struct notifier_block reboot_notifier; /* default mode before reboot */
161 202
203 /* ECC status information */
204 struct mtd_ecc_stats ecc_stats;
205
162 void *priv; 206 void *priv;
163 207
164 struct module *owner; 208 struct module *owner;
@@ -192,20 +236,6 @@ int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
192int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, 236int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs,
193 unsigned long count, loff_t from, size_t *retlen); 237 unsigned long count, loff_t from, size_t *retlen);
194 238
195#define MTD_ERASE(mtd, args...) (*(mtd->erase))(mtd, args)
196#define MTD_POINT(mtd, a,b,c,d) (*(mtd->point))(mtd, a,b,c, (u_char **)(d))
197#define MTD_UNPOINT(mtd, arg) (*(mtd->unpoint))(mtd, (u_char *)arg)
198#define MTD_READ(mtd, args...) (*(mtd->read))(mtd, args)
199#define MTD_WRITE(mtd, args...) (*(mtd->write))(mtd, args)
200#define MTD_READV(mtd, args...) (*(mtd->readv))(mtd, args)
201#define MTD_WRITEV(mtd, args...) (*(mtd->writev))(mtd, args)
202#define MTD_READECC(mtd, args...) (*(mtd->read_ecc))(mtd, args)
203#define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args)
204#define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args)
205#define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args)
206#define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0)
207
208
209#ifdef CONFIG_MTD_PARTITIONS 239#ifdef CONFIG_MTD_PARTITIONS
210void mtd_erase_callback(struct erase_info *instr); 240void mtd_erase_callback(struct erase_info *instr);
211#else 241#else
@@ -226,7 +256,7 @@ static inline void mtd_erase_callback(struct erase_info *instr)
226 256
227#ifdef CONFIG_MTD_DEBUG 257#ifdef CONFIG_MTD_DEBUG
228#define DEBUG(n, args...) \ 258#define DEBUG(n, args...) \
229 do { \ 259 do { \
230 if (n <= CONFIG_MTD_DEBUG_VERBOSE) \ 260 if (n <= CONFIG_MTD_DEBUG_VERBOSE) \
231 printk(KERN_INFO args); \ 261 printk(KERN_INFO args); \
232 } while(0) 262 } while(0)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index da5e67b3fc70..66559272ebcb 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -11,52 +11,15 @@
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 * 13 *
14 * Info: 14 * Info:
15 * Contains standard defines and IDs for NAND flash devices 15 * Contains standard defines and IDs for NAND flash devices
16 * 16 *
17 * Changelog: 17 * Changelog:
18 * 01-31-2000 DMW Created 18 * See git changelog.
19 * 09-18-2000 SJH Moved structure out of the Disk-On-Chip drivers
20 * so it can be used by other NAND flash device
21 * drivers. I also changed the copyright since none
22 * of the original contents of this file are specific
23 * to DoC devices. David can whack me with a baseball
24 * bat later if I did something naughty.
25 * 10-11-2000 SJH Added private NAND flash structure for driver
26 * 10-24-2000 SJH Added prototype for 'nand_scan' function
27 * 10-29-2001 TG changed nand_chip structure to support
28 * hardwarespecific function for accessing control lines
29 * 02-21-2002 TG added support for different read/write adress and
30 * ready/busy line access function
31 * 02-26-2002 TG added chip_delay to nand_chip structure to optimize
32 * command delay times for different chips
33 * 04-28-2002 TG OOB config defines moved from nand.c to avoid duplicate
34 * defines in jffs2/wbuf.c
35 * 08-07-2002 TG forced bad block location to byte 5 of OOB, even if
36 * CONFIG_MTD_NAND_ECC_JFFS2 is not set
37 * 08-10-2002 TG extensions to nand_chip structure to support HW-ECC
38 *
39 * 08-29-2002 tglx nand_chip structure: data_poi for selecting
40 * internal / fs-driver buffer
41 * support for 6byte/512byte hardware ECC
42 * read_ecc, write_ecc extended for different oob-layout
43 * oob layout selections: NAND_NONE_OOB, NAND_JFFS2_OOB,
44 * NAND_YAFFS_OOB
45 * 11-25-2002 tglx Added Manufacturer code FUJITSU, NATIONAL
46 * Split manufacturer and device ID structures
47 *
48 * 02-08-2004 tglx added option field to nand structure for chip anomalities
49 * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id
50 * update of nand_chip structure description
51 * 01-17-2005 dmarlin added extended commands for AG-AND device and added option
52 * for BBT_AUTO_REFRESH.
53 * 01-20-2005 dmarlin added optional pointer to hardware specific callback for
54 * extra error status checks.
55 */ 19 */
56#ifndef __LINUX_MTD_NAND_H 20#ifndef __LINUX_MTD_NAND_H
57#define __LINUX_MTD_NAND_H 21#define __LINUX_MTD_NAND_H
58 22
59#include <linux/config.h>
60#include <linux/wait.h> 23#include <linux/wait.h>
61#include <linux/spinlock.h> 24#include <linux/spinlock.h>
62#include <linux/mtd/mtd.h> 25#include <linux/mtd/mtd.h>
@@ -67,10 +30,6 @@ extern int nand_scan (struct mtd_info *mtd, int max_chips);
67/* Free resources held by the NAND device */ 30/* Free resources held by the NAND device */
68extern void nand_release (struct mtd_info *mtd); 31extern void nand_release (struct mtd_info *mtd);
69 32
70/* Read raw data from the device without ECC */
71extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_t len, size_t ooblen);
72
73
74/* The maximum number of NAND chips in an array */ 33/* The maximum number of NAND chips in an array */
75#define NAND_MAX_CHIPS 8 34#define NAND_MAX_CHIPS 8
76 35
@@ -79,44 +38,45 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
79 * adjust this accordingly. 38 * adjust this accordingly.
80 */ 39 */
81#define NAND_MAX_OOBSIZE 64 40#define NAND_MAX_OOBSIZE 64
41#define NAND_MAX_PAGESIZE 2048
82 42
83/* 43/*
84 * Constants for hardware specific CLE/ALE/NCE function 44 * Constants for hardware specific CLE/ALE/NCE function
85*/ 45 *
46 * These are bits which can be or'ed to set/clear multiple
47 * bits in one go.
48 */
86/* Select the chip by setting nCE to low */ 49/* Select the chip by setting nCE to low */
87#define NAND_CTL_SETNCE 1 50#define NAND_NCE 0x01
88/* Deselect the chip by setting nCE to high */
89#define NAND_CTL_CLRNCE 2
90/* Select the command latch by setting CLE to high */ 51/* Select the command latch by setting CLE to high */
91#define NAND_CTL_SETCLE 3 52#define NAND_CLE 0x02
92/* Deselect the command latch by setting CLE to low */
93#define NAND_CTL_CLRCLE 4
94/* Select the address latch by setting ALE to high */ 53/* Select the address latch by setting ALE to high */
95#define NAND_CTL_SETALE 5 54#define NAND_ALE 0x04
96/* Deselect the address latch by setting ALE to low */ 55
97#define NAND_CTL_CLRALE 6 56#define NAND_CTRL_CLE (NAND_NCE | NAND_CLE)
98/* Set write protection by setting WP to high. Not used! */ 57#define NAND_CTRL_ALE (NAND_NCE | NAND_ALE)
99#define NAND_CTL_SETWP 7 58#define NAND_CTRL_CHANGE 0x80
100/* Clear write protection by setting WP to low. Not used! */
101#define NAND_CTL_CLRWP 8
102 59
103/* 60/*
104 * Standard NAND flash commands 61 * Standard NAND flash commands
105 */ 62 */
106#define NAND_CMD_READ0 0 63#define NAND_CMD_READ0 0
107#define NAND_CMD_READ1 1 64#define NAND_CMD_READ1 1
65#define NAND_CMD_RNDOUT 5
108#define NAND_CMD_PAGEPROG 0x10 66#define NAND_CMD_PAGEPROG 0x10
109#define NAND_CMD_READOOB 0x50 67#define NAND_CMD_READOOB 0x50
110#define NAND_CMD_ERASE1 0x60 68#define NAND_CMD_ERASE1 0x60
111#define NAND_CMD_STATUS 0x70 69#define NAND_CMD_STATUS 0x70
112#define NAND_CMD_STATUS_MULTI 0x71 70#define NAND_CMD_STATUS_MULTI 0x71
113#define NAND_CMD_SEQIN 0x80 71#define NAND_CMD_SEQIN 0x80
72#define NAND_CMD_RNDIN 0x85
114#define NAND_CMD_READID 0x90 73#define NAND_CMD_READID 0x90
115#define NAND_CMD_ERASE2 0xd0 74#define NAND_CMD_ERASE2 0xd0
116#define NAND_CMD_RESET 0xff 75#define NAND_CMD_RESET 0xff
117 76
118/* Extended commands for large page devices */ 77/* Extended commands for large page devices */
119#define NAND_CMD_READSTART 0x30 78#define NAND_CMD_READSTART 0x30
79#define NAND_CMD_RNDOUTSTART 0xE0
120#define NAND_CMD_CACHEDPROG 0x15 80#define NAND_CMD_CACHEDPROG 0x15
121 81
122/* Extended commands for AG-AND device */ 82/* Extended commands for AG-AND device */
@@ -138,6 +98,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
138#define NAND_CMD_STATUS_RESET 0x7f 98#define NAND_CMD_STATUS_RESET 0x7f
139#define NAND_CMD_STATUS_CLEAR 0xff 99#define NAND_CMD_STATUS_CLEAR 0xff
140 100
101#define NAND_CMD_NONE -1
102
141/* Status bits */ 103/* Status bits */
142#define NAND_STATUS_FAIL 0x01 104#define NAND_STATUS_FAIL 0x01
143#define NAND_STATUS_FAIL_N1 0x02 105#define NAND_STATUS_FAIL_N1 0x02
@@ -148,21 +110,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
148/* 110/*
149 * Constants for ECC_MODES 111 * Constants for ECC_MODES
150 */ 112 */
151 113typedef enum {
152/* No ECC. Usage is not recommended ! */ 114 NAND_ECC_NONE,
153#define NAND_ECC_NONE 0 115 NAND_ECC_SOFT,
154/* Software ECC 3 byte ECC per 256 Byte data */ 116 NAND_ECC_HW,
155#define NAND_ECC_SOFT 1 117 NAND_ECC_HW_SYNDROME,
156/* Hardware ECC 3 byte ECC per 256 Byte data */ 118} nand_ecc_modes_t;
157#define NAND_ECC_HW3_256 2
158/* Hardware ECC 3 byte ECC per 512 Byte data */
159#define NAND_ECC_HW3_512 3
160/* Hardware ECC 3 byte ECC per 512 Byte data */
161#define NAND_ECC_HW6_512 4
162/* Hardware ECC 8 byte ECC per 512 Byte data */
163#define NAND_ECC_HW8_512 6
164/* Hardware ECC 12 byte ECC per 2048 Byte data */
165#define NAND_ECC_HW12_2048 7
166 119
167/* 120/*
168 * Constants for Hardware ECC 121 * Constants for Hardware ECC
@@ -201,6 +154,10 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
201 * bits from adjacent blocks from 'leaking' in altering data. 154 * bits from adjacent blocks from 'leaking' in altering data.
202 * This happens with the Renesas AG-AND chips, possibly others. */ 155 * This happens with the Renesas AG-AND chips, possibly others. */
203#define BBT_AUTO_REFRESH 0x00000080 156#define BBT_AUTO_REFRESH 0x00000080
157/* Chip does not require ready check on read. True
158 * for all large page devices, as they do not support
159 * autoincrement.*/
160#define NAND_NO_READRDY 0x00000100
204 161
205/* Options valid for Samsung large page devices */ 162/* Options valid for Samsung large page devices */
206#define NAND_SAMSUNG_LP_OPTIONS \ 163#define NAND_SAMSUNG_LP_OPTIONS \
@@ -219,18 +176,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
219/* Use a flash based bad block table. This option is passed to the 176/* Use a flash based bad block table. This option is passed to the
220 * default bad block table function. */ 177 * default bad block table function. */
221#define NAND_USE_FLASH_BBT 0x00010000 178#define NAND_USE_FLASH_BBT 0x00010000
222/* The hw ecc generator provides a syndrome instead a ecc value on read
223 * This can only work if we have the ecc bytes directly behind the
224 * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */
225#define NAND_HWECC_SYNDROME 0x00020000
226/* This option skips the bbt scan during initialization. */ 179/* This option skips the bbt scan during initialization. */
227#define NAND_SKIP_BBTSCAN 0x00040000 180#define NAND_SKIP_BBTSCAN 0x00020000
228 181
229/* Options set by nand scan */ 182/* Options set by nand scan */
230/* Nand scan has allocated oob_buf */ 183/* Nand scan has allocated controller struct */
231#define NAND_OOBBUF_ALLOC 0x40000000 184#define NAND_CONTROLLER_ALLOC 0x80000000
232/* Nand scan has allocated data_buf */
233#define NAND_DATABUF_ALLOC 0x80000000
234 185
235 186
236/* 187/*
@@ -264,45 +215,102 @@ struct nand_hw_control {
264}; 215};
265 216
266/** 217/**
218 * struct nand_ecc_ctrl - Control structure for ecc
219 * @mode: ecc mode
220 * @steps: number of ecc steps per page
221 * @size: data bytes per ecc step
222 * @bytes: ecc bytes per step
223 * @total: total number of ecc bytes per page
224 * @prepad: padding information for syndrome based ecc generators
225 * @postpad: padding information for syndrome based ecc generators
226 * @hwctl: function to control hardware ecc generator. Must only
227 * be provided if an hardware ECC is available
228 * @calculate: function for ecc calculation or readback from ecc hardware
229 * @correct: function for ecc correction, matching to ecc generator (sw/hw)
230 * @read_page: function to read a page according to the ecc generator requirements
231 * @write_page: function to write a page according to the ecc generator requirements
232 */
233struct nand_ecc_ctrl {
234 nand_ecc_modes_t mode;
235 int steps;
236 int size;
237 int bytes;
238 int total;
239 int prepad;
240 int postpad;
241 struct nand_ecclayout *layout;
242 void (*hwctl)(struct mtd_info *mtd, int mode);
243 int (*calculate)(struct mtd_info *mtd,
244 const uint8_t *dat,
245 uint8_t *ecc_code);
246 int (*correct)(struct mtd_info *mtd, uint8_t *dat,
247 uint8_t *read_ecc,
248 uint8_t *calc_ecc);
249 int (*read_page)(struct mtd_info *mtd,
250 struct nand_chip *chip,
251 uint8_t *buf);
252 void (*write_page)(struct mtd_info *mtd,
253 struct nand_chip *chip,
254 const uint8_t *buf);
255 int (*read_oob)(struct mtd_info *mtd,
256 struct nand_chip *chip,
257 int page,
258 int sndcmd);
259 int (*write_oob)(struct mtd_info *mtd,
260 struct nand_chip *chip,
261 int page);
262};
263
264/**
265 * struct nand_buffers - buffer structure for read/write
266 * @ecccalc: buffer for calculated ecc
267 * @ecccode: buffer for ecc read from flash
268 * @oobwbuf: buffer for write oob data
269 * @databuf: buffer for data - dynamically sized
270 * @oobrbuf: buffer to read oob data
271 *
272 * Do not change the order of buffers. databuf and oobrbuf must be in
273 * consecutive order.
274 */
275struct nand_buffers {
276 uint8_t ecccalc[NAND_MAX_OOBSIZE];
277 uint8_t ecccode[NAND_MAX_OOBSIZE];
278 uint8_t oobwbuf[NAND_MAX_OOBSIZE];
279 uint8_t databuf[NAND_MAX_PAGESIZE];
280 uint8_t oobrbuf[NAND_MAX_OOBSIZE];
281};
282
283/**
267 * struct nand_chip - NAND Private Flash Chip Data 284 * struct nand_chip - NAND Private Flash Chip Data
268 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device 285 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device
269 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device 286 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device
270 * @read_byte: [REPLACEABLE] read one byte from the chip 287 * @read_byte: [REPLACEABLE] read one byte from the chip
271 * @write_byte: [REPLACEABLE] write one byte to the chip
272 * @read_word: [REPLACEABLE] read one word from the chip 288 * @read_word: [REPLACEABLE] read one word from the chip
273 * @write_word: [REPLACEABLE] write one word to the chip
274 * @write_buf: [REPLACEABLE] write data from the buffer to the chip 289 * @write_buf: [REPLACEABLE] write data from the buffer to the chip
275 * @read_buf: [REPLACEABLE] read data from the chip into the buffer 290 * @read_buf: [REPLACEABLE] read data from the chip into the buffer
276 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data 291 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data
277 * @select_chip: [REPLACEABLE] select chip nr 292 * @select_chip: [REPLACEABLE] select chip nr
278 * @block_bad: [REPLACEABLE] check, if the block is bad 293 * @block_bad: [REPLACEABLE] check, if the block is bad
279 * @block_markbad: [REPLACEABLE] mark the block bad 294 * @block_markbad: [REPLACEABLE] mark the block bad
280 * @hwcontrol: [BOARDSPECIFIC] hardwarespecific function for accesing control-lines 295 * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling
296 * ALE/CLE/nCE. Also used to write command and address
281 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line 297 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line
282 * If set to NULL no access to ready/busy is available and the ready/busy information 298 * If set to NULL no access to ready/busy is available and the ready/busy information
283 * is read from the chip status register 299 * is read from the chip status register
284 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip 300 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip
285 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready 301 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready
286 * @calculate_ecc: [REPLACEABLE] function for ecc calculation or readback from ecc hardware 302 * @ecc: [BOARDSPECIFIC] ecc control ctructure
287 * @correct_data: [REPLACEABLE] function for ecc correction, matching to ecc generator (sw/hw)
288 * @enable_hwecc: [BOARDSPECIFIC] function to enable (reset) hardware ecc generator. Must only
289 * be provided if a hardware ECC is available
290 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support 303 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support
291 * @scan_bbt: [REPLACEABLE] function to scan bad block table 304 * @scan_bbt: [REPLACEABLE] function to scan bad block table
292 * @eccmode: [BOARDSPECIFIC] mode of ecc, see defines
293 * @eccsize: [INTERN] databytes used per ecc-calculation
294 * @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step
295 * @eccsteps: [INTERN] number of ecc calculation steps per page
296 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) 305 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR)
297 * @chip_lock: [INTERN] spinlock used to protect access to this structure and the chip
298 * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress 306 * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress
299 * @state: [INTERN] the current state of the NAND device 307 * @state: [INTERN] the current state of the NAND device
300 * @page_shift: [INTERN] number of address bits in a page (column address bits) 308 * @page_shift: [INTERN] number of address bits in a page (column address bits)
301 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock 309 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock
302 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry 310 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry
303 * @chip_shift: [INTERN] number of address bits in one chip 311 * @chip_shift: [INTERN] number of address bits in one chip
304 * @data_buf: [INTERN] internal buffer for one page + oob 312 * @datbuf: [INTERN] internal buffer for one page + oob
305 * @oob_buf: [INTERN] oob buffer for one eraseblock 313 * @oobbuf: [INTERN] oob buffer for one eraseblock
306 * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized 314 * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized
307 * @data_poi: [INTERN] pointer to a data buffer 315 * @data_poi: [INTERN] pointer to a data buffer
308 * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about 316 * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about
@@ -312,12 +320,13 @@ struct nand_hw_control {
312 * @chipsize: [INTERN] the size of one chip for multichip arrays 320 * @chipsize: [INTERN] the size of one chip for multichip arrays
313 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 321 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
314 * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf 322 * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf
315 * @autooob: [REPLACEABLE] the default (auto)placement scheme 323 * @ecclayout: [REPLACEABLE] the default ecc placement scheme
316 * @bbt: [INTERN] bad block table pointer 324 * @bbt: [INTERN] bad block table pointer
317 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup 325 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup
318 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor 326 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor
319 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan 327 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan
320 * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices 328 * @controller: [REPLACEABLE] a pointer to a hardware controller structure
329 * which is shared among multiple independend devices
321 * @priv: [OPTIONAL] pointer to private chip date 330 * @priv: [OPTIONAL] pointer to private chip date
322 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks 331 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
323 * (determine if errors are correctable) 332 * (determine if errors are correctable)
@@ -325,58 +334,57 @@ struct nand_hw_control {
325 334
326struct nand_chip { 335struct nand_chip {
327 void __iomem *IO_ADDR_R; 336 void __iomem *IO_ADDR_R;
328 void __iomem *IO_ADDR_W; 337 void __iomem *IO_ADDR_W;
329 338
330 u_char (*read_byte)(struct mtd_info *mtd); 339 uint8_t (*read_byte)(struct mtd_info *mtd);
331 void (*write_byte)(struct mtd_info *mtd, u_char byte);
332 u16 (*read_word)(struct mtd_info *mtd); 340 u16 (*read_word)(struct mtd_info *mtd);
333 void (*write_word)(struct mtd_info *mtd, u16 word); 341 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
334 342 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
335 void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len); 343 int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
336 void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len);
337 int (*verify_buf)(struct mtd_info *mtd, const u_char *buf, int len);
338 void (*select_chip)(struct mtd_info *mtd, int chip); 344 void (*select_chip)(struct mtd_info *mtd, int chip);
339 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); 345 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
340 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); 346 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
341 void (*hwcontrol)(struct mtd_info *mtd, int cmd); 347 void (*cmd_ctrl)(struct mtd_info *mtd, int dat,
342 int (*dev_ready)(struct mtd_info *mtd); 348 unsigned int ctrl);
343 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); 349 int (*dev_ready)(struct mtd_info *mtd);
344 int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this, int state); 350 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr);
345 int (*calculate_ecc)(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); 351 int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
346 int (*correct_data)(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc);
347 void (*enable_hwecc)(struct mtd_info *mtd, int mode);
348 void (*erase_cmd)(struct mtd_info *mtd, int page); 352 void (*erase_cmd)(struct mtd_info *mtd, int page);
349 int (*scan_bbt)(struct mtd_info *mtd); 353 int (*scan_bbt)(struct mtd_info *mtd);
350 int eccmode; 354 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
351 int eccsize; 355
352 int eccbytes; 356 int chip_delay;
353 int eccsteps; 357 unsigned int options;
354 int chip_delay; 358
355 spinlock_t chip_lock; 359 int page_shift;
356 wait_queue_head_t wq;
357 nand_state_t state;
358 int page_shift;
359 int phys_erase_shift; 360 int phys_erase_shift;
360 int bbt_erase_shift; 361 int bbt_erase_shift;
361 int chip_shift; 362 int chip_shift;
362 u_char *data_buf;
363 u_char *oob_buf;
364 int oobdirty;
365 u_char *data_poi;
366 unsigned int options;
367 int badblockpos;
368 int numchips; 363 int numchips;
369 unsigned long chipsize; 364 unsigned long chipsize;
370 int pagemask; 365 int pagemask;
371 int pagebuf; 366 int pagebuf;
372 struct nand_oobinfo *autooob; 367 int badblockpos;
368
369 nand_state_t state;
370
371 uint8_t *oob_poi;
372 struct nand_hw_control *controller;
373 struct nand_ecclayout *ecclayout;
374
375 struct nand_ecc_ctrl ecc;
376 struct nand_buffers buffers;
377 struct nand_hw_control hwcontrol;
378
379 struct mtd_oob_ops ops;
380
373 uint8_t *bbt; 381 uint8_t *bbt;
374 struct nand_bbt_descr *bbt_td; 382 struct nand_bbt_descr *bbt_td;
375 struct nand_bbt_descr *bbt_md; 383 struct nand_bbt_descr *bbt_md;
384
376 struct nand_bbt_descr *badblock_pattern; 385 struct nand_bbt_descr *badblock_pattern;
377 struct nand_hw_control *controller; 386
378 void *priv; 387 void *priv;
379 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
380}; 388};
381 389
382/* 390/*
@@ -388,19 +396,19 @@ struct nand_chip {
388#define NAND_MFR_NATIONAL 0x8f 396#define NAND_MFR_NATIONAL 0x8f
389#define NAND_MFR_RENESAS 0x07 397#define NAND_MFR_RENESAS 0x07
390#define NAND_MFR_STMICRO 0x20 398#define NAND_MFR_STMICRO 0x20
391#define NAND_MFR_HYNIX 0xad 399#define NAND_MFR_HYNIX 0xad
392 400
393/** 401/**
394 * struct nand_flash_dev - NAND Flash Device ID Structure 402 * struct nand_flash_dev - NAND Flash Device ID Structure
395 * 403 *
396 * @name: Identify the device type 404 * @name: Identify the device type
397 * @id: device ID code 405 * @id: device ID code
398 * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 406 * @pagesize: Pagesize in bytes. Either 256 or 512 or 0
399 * If the pagesize is 0, then the real pagesize 407 * If the pagesize is 0, then the real pagesize
400 * and the eraseize are determined from the 408 * and the eraseize are determined from the
401 * extended id bytes in the chip 409 * extended id bytes in the chip
402 * @erasesize: Size of an erase block in the flash device. 410 * @erasesize: Size of an erase block in the flash device.
403 * @chipsize: Total chipsize in Mega Bytes 411 * @chipsize: Total chipsize in Mega Bytes
404 * @options: Bitfield to store chip relevant options 412 * @options: Bitfield to store chip relevant options
405 */ 413 */
406struct nand_flash_dev { 414struct nand_flash_dev {
@@ -415,7 +423,7 @@ struct nand_flash_dev {
415/** 423/**
416 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure 424 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure
417 * @name: Manufacturer name 425 * @name: Manufacturer name
418 * @id: manufacturer ID code of device. 426 * @id: manufacturer ID code of device.
419*/ 427*/
420struct nand_manufacturers { 428struct nand_manufacturers {
421 int id; 429 int id;
@@ -455,7 +463,7 @@ struct nand_bbt_descr {
455 int veroffs; 463 int veroffs;
456 uint8_t version[NAND_MAX_CHIPS]; 464 uint8_t version[NAND_MAX_CHIPS];
457 int len; 465 int len;
458 int maxblocks; 466 int maxblocks;
459 int reserved_block_code; 467 int reserved_block_code;
460 uint8_t *pattern; 468 uint8_t *pattern;
461}; 469};
@@ -494,14 +502,14 @@ struct nand_bbt_descr {
494/* The maximum number of blocks to scan for a bbt */ 502/* The maximum number of blocks to scan for a bbt */
495#define NAND_BBT_SCAN_MAXBLOCKS 4 503#define NAND_BBT_SCAN_MAXBLOCKS 4
496 504
497extern int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd); 505extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
498extern int nand_update_bbt (struct mtd_info *mtd, loff_t offs); 506extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs);
499extern int nand_default_bbt (struct mtd_info *mtd); 507extern int nand_default_bbt(struct mtd_info *mtd);
500extern int nand_isbad_bbt (struct mtd_info *mtd, loff_t offs, int allowbbt); 508extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt);
501extern int nand_erase_nand (struct mtd_info *mtd, struct erase_info *instr, int allowbbt); 509extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
502extern int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, 510 int allowbbt);
503 size_t * retlen, u_char * buf, u_char * oob_buf, 511extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
504 struct nand_oobinfo *oobsel, int flags); 512 size_t * retlen, uint8_t * buf);
505 513
506/* 514/*
507* Constants for oob configuration 515* Constants for oob configuration
@@ -509,4 +517,53 @@ extern int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
509#define NAND_SMALL_BADBLOCK_POS 5 517#define NAND_SMALL_BADBLOCK_POS 5
510#define NAND_LARGE_BADBLOCK_POS 0 518#define NAND_LARGE_BADBLOCK_POS 0
511 519
520/**
521 * struct platform_nand_chip - chip level device structure
522 *
523 * @nr_chips: max. number of chips to scan for
524 * @chip_offs: chip number offset
525 * @nr_partitions: number of partitions pointed to by partitions (or zero)
526 * @partitions: mtd partition list
527 * @chip_delay: R/B delay value in us
528 * @options: Option flags, e.g. 16bit buswidth
529 * @ecclayout: ecc layout info structure
530 * @priv: hardware controller specific settings
531 */
532struct platform_nand_chip {
533 int nr_chips;
534 int chip_offset;
535 int nr_partitions;
536 struct mtd_partition *partitions;
537 struct nand_ecclayout *ecclayout;
538 int chip_delay;
539 unsigned int options;
540 void *priv;
541};
542
543/**
544 * struct platform_nand_ctrl - controller level device structure
545 *
546 * @hwcontrol: platform specific hardware control structure
547 * @dev_ready: platform specific function to read ready/busy pin
548 * @select_chip: platform specific chip select function
549 * @priv_data: private data to transport driver specific settings
550 *
551 * All fields are optional and depend on the hardware driver requirements
552 */
553struct platform_nand_ctrl {
554 void (*hwcontrol)(struct mtd_info *mtd, int cmd);
555 int (*dev_ready)(struct mtd_info *mtd);
556 void (*select_chip)(struct mtd_info *mtd, int chip);
557 void *priv;
558};
559
560/* Some helpers to access the data structures */
561static inline
562struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd)
563{
564 struct nand_chip *chip = mtd->priv;
565
566 return chip->priv;
567}
568
512#endif /* __LINUX_MTD_NAND_H */ 569#endif /* __LINUX_MTD_NAND_H */
diff --git a/include/linux/mtd/ndfc.h b/include/linux/mtd/ndfc.h
new file mode 100644
index 000000000000..d0558a982628
--- /dev/null
+++ b/include/linux/mtd/ndfc.h
@@ -0,0 +1,67 @@
1/*
2 * linux/include/linux/mtd/ndfc.h
3 *
4 * Copyright (c) 2006 Thomas Gleixner <tglx@linutronix.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Info:
11 * Contains defines, datastructures for ndfc nand controller
12 *
13 */
14#ifndef __LINUX_MTD_NDFC_H
15#define __LINUX_MTD_NDFC_H
16
17/* NDFC Register definitions */
18#define NDFC_CMD 0x00
19#define NDFC_ALE 0x04
20#define NDFC_DATA 0x08
21#define NDFC_ECC 0x10
22#define NDFC_BCFG0 0x30
23#define NDFC_BCFG1 0x34
24#define NDFC_BCFG2 0x38
25#define NDFC_BCFG3 0x3c
26#define NDFC_CCR 0x40
27#define NDFC_STAT 0x44
28#define NDFC_HWCTL 0x48
29#define NDFC_REVID 0x50
30
31#define NDFC_STAT_IS_READY 0x01000000
32
33#define NDFC_CCR_RESET_CE 0x80000000 /* CE Reset */
34#define NDFC_CCR_RESET_ECC 0x40000000 /* ECC Reset */
35#define NDFC_CCR_RIE 0x20000000 /* Interrupt Enable on Device Rdy */
36#define NDFC_CCR_REN 0x10000000 /* Enable wait for Rdy in LinearR */
37#define NDFC_CCR_ROMEN 0x08000000 /* Enable ROM In LinearR */
38#define NDFC_CCR_ARE 0x04000000 /* Auto-Read Enable */
39#define NDFC_CCR_BS(x) (((x) & 0x3) << 24) /* Select Bank on CE[x] */
40#define NDFC_CCR_BS_MASK 0x03000000 /* Select Bank */
41#define NDFC_CCR_ARAC0 0x00000000 /* 3 Addr, 1 Col 2 Row 512b page */
42#define NDFC_CCR_ARAC1 0x00001000 /* 4 Addr, 1 Col 3 Row 512b page */
43#define NDFC_CCR_ARAC2 0x00002000 /* 4 Addr, 2 Col 2 Row 2K page */
44#define NDFC_CCR_ARAC3 0x00003000 /* 5 Addr, 2 Col 3 Row 2K page */
45#define NDFC_CCR_ARAC_MASK 0x00003000 /* Auto-Read mode Addr Cycles */
46#define NDFC_CCR_RPG 0x0000C000 /* Auto-Read Page */
47#define NDFC_CCR_EBCC 0x00000004 /* EBC Configuration Completed */
48#define NDFC_CCR_DHC 0x00000002 /* Direct Hardware Control Enable */
49
50#define NDFC_BxCFG_EN 0x80000000 /* Bank Enable */
51#define NDFC_BxCFG_CED 0x40000000 /* nCE Style */
52#define NDFC_BxCFG_SZ_MASK 0x08000000 /* Bank Size */
53#define NDFC_BxCFG_SZ_8BIT 0x00000000 /* 8bit */
54#define NDFC_BxCFG_SZ_16BIT 0x08000000 /* 16bit */
55
56#define NDFC_MAX_BANKS 4
57
58struct ndfc_controller_settings {
59 uint32_t ccr_settings;
60 uint64_t ndfc_erpn;
61};
62
63struct ndfc_chip_settings {
64 uint32_t bank_settings;
65};
66
67#endif
diff --git a/include/linux/mtd/nftl.h b/include/linux/mtd/nftl.h
index d35d2c21ff3e..bcf2fb3fa4a7 100644
--- a/include/linux/mtd/nftl.h
+++ b/include/linux/mtd/nftl.h
@@ -37,7 +37,7 @@ struct NFTLrecord {
37 unsigned int nb_blocks; /* number of physical blocks */ 37 unsigned int nb_blocks; /* number of physical blocks */
38 unsigned int nb_boot_blocks; /* number of blocks used by the bios */ 38 unsigned int nb_boot_blocks; /* number of blocks used by the bios */
39 struct erase_info instr; 39 struct erase_info instr;
40 struct nand_oobinfo oobinfo; 40 struct nand_ecclayout oobinfo;
41}; 41};
42 42
43int NFTL_mount(struct NFTLrecord *s); 43int NFTL_mount(struct NFTLrecord *s);
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 7419b5fab133..9ce9a48db444 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -35,6 +35,8 @@ typedef enum {
35 FL_SYNCING, 35 FL_SYNCING,
36 FL_UNLOCKING, 36 FL_UNLOCKING,
37 FL_LOCKING, 37 FL_LOCKING,
38 FL_RESETING,
39 FL_OTPING,
38 FL_PM_SUSPENDED, 40 FL_PM_SUSPENDED,
39} onenand_state_t; 41} onenand_state_t;
40 42
@@ -75,7 +77,7 @@ struct onenand_bufferram {
75 * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip 77 * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip
76 * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress 78 * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress
77 * @param state [INTERN] the current state of the OneNAND device 79 * @param state [INTERN] the current state of the OneNAND device
78 * @param autooob [REPLACEABLE] the default (auto)placement scheme 80 * @param ecclayout [REPLACEABLE] the default ecc placement scheme
79 * @param bbm [REPLACEABLE] pointer to Bad Block Management 81 * @param bbm [REPLACEABLE] pointer to Bad Block Management
80 * @param priv [OPTIONAL] pointer to private chip date 82 * @param priv [OPTIONAL] pointer to private chip date
81 */ 83 */
@@ -111,9 +113,9 @@ struct onenand_chip {
111 onenand_state_t state; 113 onenand_state_t state;
112 unsigned char *page_buf; 114 unsigned char *page_buf;
113 115
114 struct nand_oobinfo *autooob; 116 struct nand_ecclayout *ecclayout;
115 117
116 void *bbm; 118 void *bbm;
117 119
118 void *priv; 120 void *priv;
119}; 121};
@@ -130,6 +132,9 @@ struct onenand_chip {
130#define ONENAND_SET_SYS_CFG1(v, this) \ 132#define ONENAND_SET_SYS_CFG1(v, this) \
131 (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1)) 133 (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1))
132 134
135/* Check byte access in OneNAND */
136#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
137
133/* 138/*
134 * Options bits 139 * Options bits
135 */ 140 */
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index d7832ef8ed63..4a72818d2545 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -112,6 +112,7 @@
112#define ONENAND_CMD_LOCK_TIGHT (0x2C) 112#define ONENAND_CMD_LOCK_TIGHT (0x2C)
113#define ONENAND_CMD_ERASE (0x94) 113#define ONENAND_CMD_ERASE (0x94)
114#define ONENAND_CMD_RESET (0xF0) 114#define ONENAND_CMD_RESET (0xF0)
115#define ONENAND_CMD_OTP_ACCESS (0x65)
115#define ONENAND_CMD_READID (0x90) 116#define ONENAND_CMD_READID (0x90)
116 117
117/* NOTE: Those are not *REAL* commands */ 118/* NOTE: Those are not *REAL* commands */
@@ -152,6 +153,8 @@
152#define ONENAND_CTRL_ERASE (1 << 11) 153#define ONENAND_CTRL_ERASE (1 << 11)
153#define ONENAND_CTRL_ERROR (1 << 10) 154#define ONENAND_CTRL_ERROR (1 << 10)
154#define ONENAND_CTRL_RSTB (1 << 7) 155#define ONENAND_CTRL_RSTB (1 << 7)
156#define ONENAND_CTRL_OTP_L (1 << 6)
157#define ONENAND_CTRL_OTP_BL (1 << 5)
155 158
156/* 159/*
157 * Interrupt Status Register F241h (R) 160 * Interrupt Status Register F241h (R)
@@ -177,4 +180,9 @@
177#define ONENAND_ECC_2BIT (1 << 1) 180#define ONENAND_ECC_2BIT (1 << 1)
178#define ONENAND_ECC_2BIT_ALL (0xAAAA) 181#define ONENAND_ECC_2BIT_ALL (0xAAAA)
179 182
183/*
184 * One-Time Programmable (OTP)
185 */
186#define ONENAND_OTP_LOCK_OFFSET (14)
187
180#endif /* __ONENAND_REG_H */ 188#endif /* __ONENAND_REG_H */
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index b03f512d51b9..da6b3d6f12a7 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -41,7 +41,7 @@ struct mtd_partition {
41 u_int32_t size; /* partition size */ 41 u_int32_t size; /* partition size */
42 u_int32_t offset; /* offset within the master MTD space */ 42 u_int32_t offset; /* offset within the master MTD space */
43 u_int32_t mask_flags; /* master MTD flags to mask out for this partition */ 43 u_int32_t mask_flags; /* master MTD flags to mask out for this partition */
44 struct nand_oobinfo *oobsel; /* out of band layout for this partition (NAND only)*/ 44 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/
45 struct mtd_info **mtdp; /* pointer to store the MTD object */ 45 struct mtd_info **mtdp; /* pointer to store the MTD object */
46}; 46};
47 47
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index c7b8bcdef013..86831e3594f6 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -15,33 +15,26 @@
15 */ 15 */
16 16
17#ifndef __LINUX_MTD_PHYSMAP__ 17#ifndef __LINUX_MTD_PHYSMAP__
18 18#define __LINUX_MTD_PHYSMAP__
19#include <linux/config.h>
20
21#if defined(CONFIG_MTD_PHYSMAP)
22 19
23#include <linux/mtd/mtd.h> 20#include <linux/mtd/mtd.h>
24#include <linux/mtd/map.h> 21#include <linux/mtd/map.h>
25#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
26 23
27/* 24struct physmap_flash_data {
28 * The map_info for physmap. Board can override size, buswidth, phys, 25 unsigned int width;
29 * (*set_vpp)(), etc in their initial setup routine. 26 void (*set_vpp)(struct map_info *, int);
30 */ 27 unsigned int nr_parts;
31extern struct map_info physmap_map; 28 struct mtd_partition *parts;
29};
32 30
33/* 31/*
34 * Board needs to specify the exact mapping during their setup time. 32 * Board needs to specify the exact mapping during their setup time.
35 */ 33 */
36static inline void physmap_configure(unsigned long addr, unsigned long size, int bankwidth, void (*set_vpp)(struct map_info *, int) ) 34void physmap_configure(unsigned long addr, unsigned long size,
37{ 35 int bankwidth, void (*set_vpp)(struct map_info *, int) );
38 physmap_map.phys = addr;
39 physmap_map.size = size;
40 physmap_map.bankwidth = bankwidth;
41 physmap_map.set_vpp = set_vpp;
42}
43 36
44#if defined(CONFIG_MTD_PARTITIONS) 37#ifdef CONFIG_MTD_PARTITIONS
45 38
46/* 39/*
47 * Machines that wish to do flash partition may want to call this function in 40 * Machines that wish to do flash partition may want to call this function in
@@ -55,7 +48,5 @@ static inline void physmap_configure(unsigned long addr, unsigned long size, int
55void physmap_set_partitions(struct mtd_partition *parts, int num_parts); 48void physmap_set_partitions(struct mtd_partition *parts, int num_parts);
56 49
57#endif /* defined(CONFIG_MTD_PARTITIONS) */ 50#endif /* defined(CONFIG_MTD_PARTITIONS) */
58#endif /* defined(CONFIG_MTD) */
59 51
60#endif /* __LINUX_MTD_PHYSMAP__ */ 52#endif /* __LINUX_MTD_PHYSMAP__ */
61
diff --git a/include/linux/mtd/xip.h b/include/linux/mtd/xip.h
index 220d50bb71cd..e9d40bdde48c 100644
--- a/include/linux/mtd/xip.h
+++ b/include/linux/mtd/xip.h
@@ -18,7 +18,6 @@
18#ifndef __LINUX_MTD_XIP_H__ 18#ifndef __LINUX_MTD_XIP_H__
19#define __LINUX_MTD_XIP_H__ 19#define __LINUX_MTD_XIP_H__
20 20
21#include <linux/config.h>
22 21
23#ifdef CONFIG_MTD_XIP 22#ifdef CONFIG_MTD_XIP
24 23
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index a6ce409ec6fc..1d7cdd20b553 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -77,11 +77,11 @@ struct nbd_device {
77 * server. All data are in network byte order. 77 * server. All data are in network byte order.
78 */ 78 */
79struct nbd_request { 79struct nbd_request {
80 u32 magic; 80 __u32 magic;
81 u32 type; /* == READ || == WRITE */ 81 __u32 type; /* == READ || == WRITE */
82 char handle[8]; 82 char handle[8];
83 u64 from; 83 __u64 from;
84 u32 len; 84 __u32 len;
85} 85}
86#ifdef __GNUC__ 86#ifdef __GNUC__
87 __attribute__ ((packed)) 87 __attribute__ ((packed))
@@ -93,8 +93,8 @@ struct nbd_request {
93 * it has completed an I/O request (or an error occurs). 93 * it has completed an I/O request (or an error occurs).
94 */ 94 */
95struct nbd_reply { 95struct nbd_reply {
96 u32 magic; 96 __u32 magic;
97 u32 error; /* 0 = ok, else error */ 97 __u32 error; /* 0 = ok, else error */
98 char handle[8]; /* handle you got from request */ 98 char handle[8]; /* handle you got from request */
99}; 99};
100#endif 100#endif
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 96dc237b8f03..b208f0cd556b 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -12,8 +12,6 @@
12#include <linux/in.h> 12#include <linux/in.h>
13#include <linux/types.h> 13#include <linux/types.h>
14 14
15#include <linux/ncp_fs_i.h>
16#include <linux/ncp_fs_sb.h>
17#include <linux/ipx.h> 15#include <linux/ipx.h>
18#include <linux/ncp_no.h> 16#include <linux/ncp_no.h>
19 17
@@ -146,7 +144,8 @@ struct ncp_nls_ioctl
146 144
147#ifdef __KERNEL__ 145#ifdef __KERNEL__
148 146
149#include <linux/config.h> 147#include <linux/ncp_fs_i.h>
148#include <linux/ncp_fs_sb.h>
150 149
151/* undef because public define in umsdos_fs.h (ncp_fs.h isn't public) */ 150/* undef because public define in umsdos_fs.h (ncp_fs.h isn't public) */
152#undef PRINTK 151#undef PRINTK
diff --git a/include/linux/net.h b/include/linux/net.h
index 84a490e5f0a1..385e68f5bd93 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -18,9 +18,7 @@
18#ifndef _LINUX_NET_H 18#ifndef _LINUX_NET_H
19#define _LINUX_NET_H 19#define _LINUX_NET_H
20 20
21#include <linux/config.h>
22#include <linux/wait.h> 21#include <linux/wait.h>
23#include <linux/stringify.h>
24#include <asm/socket.h> 22#include <asm/socket.h>
25 23
26struct poll_table_struct; 24struct poll_table_struct;
@@ -57,6 +55,7 @@ typedef enum {
57#define __SO_ACCEPTCON (1 << 16) /* performed a listen */ 55#define __SO_ACCEPTCON (1 << 16) /* performed a listen */
58 56
59#ifdef __KERNEL__ 57#ifdef __KERNEL__
58#include <linux/stringify.h>
60 59
61#define SOCK_ASYNC_NOSPACE 0 60#define SOCK_ASYNC_NOSPACE 0
62#define SOCK_ASYNC_WAITDATA 1 61#define SOCK_ASYNC_WAITDATA 1
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f4169bbb60eb..cead6be467ed 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -34,9 +34,9 @@
34#include <asm/cache.h> 34#include <asm/cache.h>
35#include <asm/byteorder.h> 35#include <asm/byteorder.h>
36 36
37#include <linux/config.h>
38#include <linux/device.h> 37#include <linux/device.h>
39#include <linux/percpu.h> 38#include <linux/percpu.h>
39#include <linux/dmaengine.h>
40 40
41struct divert_blk; 41struct divert_blk;
42struct vlan_group; 42struct vlan_group;
@@ -232,6 +232,7 @@ enum netdev_state_t
232 __LINK_STATE_RX_SCHED, 232 __LINK_STATE_RX_SCHED,
233 __LINK_STATE_LINKWATCH_PENDING, 233 __LINK_STATE_LINKWATCH_PENDING,
234 __LINK_STATE_DORMANT, 234 __LINK_STATE_DORMANT,
235 __LINK_STATE_QDISC_RUNNING,
235}; 236};
236 237
237 238
@@ -311,6 +312,9 @@ struct net_device
311#define NETIF_F_LLTX 4096 /* LockLess TX */ 312#define NETIF_F_LLTX 4096 /* LockLess TX */
312#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ 313#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/
313 314
315#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
316#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
317
314 struct net_device *next_sched; 318 struct net_device *next_sched;
315 319
316 /* Interface index. Unique device identifier */ 320 /* Interface index. Unique device identifier */
@@ -406,7 +410,7 @@ struct net_device
406 * One part is mostly used on xmit path (device) 410 * One part is mostly used on xmit path (device)
407 */ 411 */
408 /* hard_start_xmit synchronizer */ 412 /* hard_start_xmit synchronizer */
409 spinlock_t xmit_lock ____cacheline_aligned_in_smp; 413 spinlock_t _xmit_lock ____cacheline_aligned_in_smp;
410 /* cpu id of processor entered to hard_start_xmit or -1, 414 /* cpu id of processor entered to hard_start_xmit or -1,
411 if nobody entered there. 415 if nobody entered there.
412 */ 416 */
@@ -593,6 +597,9 @@ struct softnet_data
593 struct sk_buff *completion_queue; 597 struct sk_buff *completion_queue;
594 598
595 struct net_device backlog_dev; /* Sorry. 8) */ 599 struct net_device backlog_dev; /* Sorry. 8) */
600#ifdef CONFIG_NET_DMA
601 struct dma_chan *net_dma;
602#endif
596}; 603};
597 604
598DECLARE_PER_CPU(struct softnet_data,softnet_data); 605DECLARE_PER_CPU(struct softnet_data,softnet_data);
@@ -889,11 +896,43 @@ static inline void __netif_rx_complete(struct net_device *dev)
889 clear_bit(__LINK_STATE_RX_SCHED, &dev->state); 896 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
890} 897}
891 898
899static inline void netif_tx_lock(struct net_device *dev)
900{
901 spin_lock(&dev->_xmit_lock);
902 dev->xmit_lock_owner = smp_processor_id();
903}
904
905static inline void netif_tx_lock_bh(struct net_device *dev)
906{
907 spin_lock_bh(&dev->_xmit_lock);
908 dev->xmit_lock_owner = smp_processor_id();
909}
910
911static inline int netif_tx_trylock(struct net_device *dev)
912{
913 int err = spin_trylock(&dev->_xmit_lock);
914 if (!err)
915 dev->xmit_lock_owner = smp_processor_id();
916 return err;
917}
918
919static inline void netif_tx_unlock(struct net_device *dev)
920{
921 dev->xmit_lock_owner = -1;
922 spin_unlock(&dev->_xmit_lock);
923}
924
925static inline void netif_tx_unlock_bh(struct net_device *dev)
926{
927 dev->xmit_lock_owner = -1;
928 spin_unlock_bh(&dev->_xmit_lock);
929}
930
892static inline void netif_tx_disable(struct net_device *dev) 931static inline void netif_tx_disable(struct net_device *dev)
893{ 932{
894 spin_lock_bh(&dev->xmit_lock); 933 netif_tx_lock_bh(dev);
895 netif_stop_queue(dev); 934 netif_stop_queue(dev);
896 spin_unlock_bh(&dev->xmit_lock); 935 netif_tx_unlock_bh(dev);
897} 936}
898 937
899/* These functions live elsewhere (drivers/net/net_init.c, but related) */ 938/* These functions live elsewhere (drivers/net/net_init.c, but related) */
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index b31a9bca9361..10168e26a846 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -40,7 +40,6 @@
40#endif 40#endif
41 41
42#ifdef __KERNEL__ 42#ifdef __KERNEL__
43#include <linux/config.h>
44#ifdef CONFIG_NETFILTER 43#ifdef CONFIG_NETFILTER
45 44
46extern void netfilter_init(void); 45extern void netfilter_init(void);
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index 3ff88c878308..d2e4bd7a7a14 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -69,6 +69,10 @@ enum ip_conntrack_status {
69 /* Connection is dying (removed from lists), can not be unset. */ 69 /* Connection is dying (removed from lists), can not be unset. */
70 IPS_DYING_BIT = 9, 70 IPS_DYING_BIT = 9,
71 IPS_DYING = (1 << IPS_DYING_BIT), 71 IPS_DYING = (1 << IPS_DYING_BIT),
72
73 /* Connection has fixed timeout. */
74 IPS_FIXED_TIMEOUT_BIT = 10,
75 IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
72}; 76};
73 77
74/* Connection tracking event bits */ 78/* Connection tracking event bits */
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index 668ec946c8e2..b5883ccee295 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -27,13 +27,15 @@ enum ctattr_type {
27 CTA_STATUS, 27 CTA_STATUS,
28 CTA_PROTOINFO, 28 CTA_PROTOINFO,
29 CTA_HELP, 29 CTA_HELP,
30 CTA_NAT, 30 CTA_NAT_SRC,
31#define CTA_NAT CTA_NAT_SRC /* backwards compatibility */
31 CTA_TIMEOUT, 32 CTA_TIMEOUT,
32 CTA_MARK, 33 CTA_MARK,
33 CTA_COUNTERS_ORIG, 34 CTA_COUNTERS_ORIG,
34 CTA_COUNTERS_REPLY, 35 CTA_COUNTERS_REPLY,
35 CTA_USE, 36 CTA_USE,
36 CTA_ID, 37 CTA_ID,
38 CTA_NAT_DST,
37 __CTA_MAX 39 __CTA_MAX
38}; 40};
39#define CTA_MAX (__CTA_MAX - 1) 41#define CTA_MAX (__CTA_MAX - 1)
diff --git a/include/linux/netfilter/xt_CONNSECMARK.h b/include/linux/netfilter/xt_CONNSECMARK.h
new file mode 100644
index 000000000000..c6bd75469ba2
--- /dev/null
+++ b/include/linux/netfilter/xt_CONNSECMARK.h
@@ -0,0 +1,13 @@
1#ifndef _XT_CONNSECMARK_H_target
2#define _XT_CONNSECMARK_H_target
3
4enum {
5 CONNSECMARK_SAVE = 1,
6 CONNSECMARK_RESTORE,
7};
8
9struct xt_connsecmark_target_info {
10 u_int8_t mode;
11};
12
13#endif /*_XT_CONNSECMARK_H_target */
diff --git a/include/linux/netfilter/xt_SECMARK.h b/include/linux/netfilter/xt_SECMARK.h
new file mode 100644
index 000000000000..c53fbffa997d
--- /dev/null
+++ b/include/linux/netfilter/xt_SECMARK.h
@@ -0,0 +1,26 @@
1#ifndef _XT_SECMARK_H_target
2#define _XT_SECMARK_H_target
3
4/*
5 * This is intended for use by various security subsystems (but not
6 * at the same time).
7 *
8 * 'mode' refers to the specific security subsystem which the
9 * packets are being marked for.
10 */
11#define SECMARK_MODE_SEL 0x01 /* SELinux */
12#define SECMARK_SELCTX_MAX 256
13
14struct xt_secmark_target_selinux_info {
15 u_int32_t selsid;
16 char selctx[SECMARK_SELCTX_MAX];
17};
18
19struct xt_secmark_target_info {
20 u_int8_t mode;
21 union {
22 struct xt_secmark_target_selinux_info sel;
23 } u;
24};
25
26#endif /*_XT_SECMARK_H_target */
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h
index 34f63cf2e293..4c2d9945ca54 100644
--- a/include/linux/netfilter/xt_conntrack.h
+++ b/include/linux/netfilter/xt_conntrack.h
@@ -42,7 +42,7 @@ struct ip_conntrack_old_tuple
42 } u; 42 } u;
43 43
44 /* The protocol. */ 44 /* The protocol. */
45 u16 protonum; 45 __u16 protonum;
46 } dst; 46 } dst;
47}; 47};
48 48
diff --git a/include/linux/netfilter/xt_quota.h b/include/linux/netfilter/xt_quota.h
new file mode 100644
index 000000000000..acd7fd77bbee
--- /dev/null
+++ b/include/linux/netfilter/xt_quota.h
@@ -0,0 +1,16 @@
1#ifndef _XT_QUOTA_H
2#define _XT_QUOTA_H
3
4enum xt_quota_flags {
5 XT_QUOTA_INVERT = 0x1,
6};
7#define XT_QUOTA_MASK 0x1
8
9struct xt_quota_info {
10 u_int32_t flags;
11 u_int32_t pad;
12 aligned_u64 quota;
13 struct xt_quota_info *master;
14};
15
16#endif /* _XT_QUOTA_H */
diff --git a/include/linux/netfilter/xt_statistic.h b/include/linux/netfilter/xt_statistic.h
new file mode 100644
index 000000000000..c344e9916e23
--- /dev/null
+++ b/include/linux/netfilter/xt_statistic.h
@@ -0,0 +1,32 @@
1#ifndef _XT_STATISTIC_H
2#define _XT_STATISTIC_H
3
4enum xt_statistic_mode {
5 XT_STATISTIC_MODE_RANDOM,
6 XT_STATISTIC_MODE_NTH,
7 __XT_STATISTIC_MODE_MAX
8};
9#define XT_STATISTIC_MODE_MAX (__XT_STATISTIC_MODE_MAX - 1)
10
11enum xt_statistic_flags {
12 XT_STATISTIC_INVERT = 0x1,
13};
14#define XT_STATISTIC_MASK 0x1
15
16struct xt_statistic_info {
17 u_int16_t mode;
18 u_int16_t flags;
19 union {
20 struct {
21 u_int32_t probability;
22 } random;
23 struct {
24 u_int32_t every;
25 u_int32_t packet;
26 u_int32_t count;
27 } nth;
28 } u;
29 struct xt_statistic_info *master __attribute__((aligned(8)));
30};
31
32#endif /* _XT_STATISTIC_H */
diff --git a/include/linux/netfilter_arp.h b/include/linux/netfilter_arp.h
index a3f8977f7f12..92bc6ddcbf73 100644
--- a/include/linux/netfilter_arp.h
+++ b/include/linux/netfilter_arp.h
@@ -5,7 +5,6 @@
5 * (C)2002 Rusty Russell IBM -- This code is GPL. 5 * (C)2002 Rusty Russell IBM -- This code is GPL.
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/netfilter.h> 8#include <linux/netfilter.h>
10 9
11/* There is no PF_ARP. */ 10/* There is no PF_ARP. */
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index a75b84bb9a88..87764022cc67 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -4,7 +4,6 @@
4/* bridge-specific defines for netfilter. 4/* bridge-specific defines for netfilter.
5 */ 5 */
6 6
7#include <linux/config.h>
8#include <linux/netfilter.h> 7#include <linux/netfilter.h>
9#if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER) 8#if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER)
10#include <asm/atomic.h> 9#include <asm/atomic.h>
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index 85301c5e8d24..ce02c984f3ba 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -5,7 +5,6 @@
5 * (C)1998 Rusty Russell -- This code is GPL. 5 * (C)1998 Rusty Russell -- This code is GPL.
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/netfilter.h> 8#include <linux/netfilter.h>
10 9
11/* only for userspace compatibility */ 10/* only for userspace compatibility */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index d54d7b278e96..51dbec1892c8 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -4,7 +4,6 @@
4#include <linux/netfilter/nf_conntrack_common.h> 4#include <linux/netfilter/nf_conntrack_common.h>
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7#include <linux/config.h>
8#include <linux/netfilter_ipv4/ip_conntrack_tuple.h> 7#include <linux/netfilter_ipv4/ip_conntrack_tuple.h>
9#include <linux/bitops.h> 8#include <linux/bitops.h>
10#include <linux/compiler.h> 9#include <linux/compiler.h>
@@ -121,6 +120,10 @@ struct ip_conntrack
121 u_int32_t mark; 120 u_int32_t mark;
122#endif 121#endif
123 122
123#ifdef CONFIG_IP_NF_CONNTRACK_SECMARK
124 u_int32_t secmark;
125#endif
126
124 /* Traversed often, so hopefully in different cacheline to top */ 127 /* Traversed often, so hopefully in different cacheline to top */
125 /* These are my tuples; original and reply */ 128 /* These are my tuples; original and reply */
126 struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX]; 129 struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX];
@@ -154,6 +157,7 @@ struct ip_conntrack_expect
154 unsigned int flags; 157 unsigned int flags;
155 158
156#ifdef CONFIG_IP_NF_NAT_NEEDED 159#ifdef CONFIG_IP_NF_NAT_NEEDED
160 u_int32_t saved_ip;
157 /* This is the original per-proto part, used to map the 161 /* This is the original per-proto part, used to map the
158 * expected connection the way the recipient expects. */ 162 * expected connection the way the recipient expects. */
159 union ip_conntrack_manip_proto saved_proto; 163 union ip_conntrack_manip_proto saved_proto;
@@ -293,6 +297,7 @@ static inline int is_dying(struct ip_conntrack *ct)
293} 297}
294 298
295extern unsigned int ip_conntrack_htable_size; 299extern unsigned int ip_conntrack_htable_size;
300extern int ip_conntrack_checksum;
296 301
297#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) 302#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++)
298 303
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
index eace86bd2adb..3cbff7379002 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
@@ -71,6 +71,13 @@ extern int (*nat_h245_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct,
71 unsigned char **data, int dataoff, 71 unsigned char **data, int dataoff,
72 TransportAddress * addr, u_int16_t port, 72 TransportAddress * addr, u_int16_t port,
73 struct ip_conntrack_expect * exp); 73 struct ip_conntrack_expect * exp);
74extern int (*nat_callforwarding_hook) (struct sk_buff ** pskb,
75 struct ip_conntrack * ct,
76 enum ip_conntrack_info ctinfo,
77 unsigned char **data, int dataoff,
78 TransportAddress * addr,
79 u_int16_t port,
80 struct ip_conntrack_expect * exp);
74extern int (*nat_q931_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct, 81extern int (*nat_q931_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct,
75 enum ip_conntrack_info ctinfo, 82 enum ip_conntrack_info ctinfo,
76 unsigned char **data, TransportAddress * addr, 83 unsigned char **data, TransportAddress * addr,
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h
index cc98f7aa5abe..3d4a773799fc 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h
@@ -1,4 +1,4 @@
1/* Generated by Jing Min Zhao's ASN.1 parser, Mar 15 2006 1/* Generated by Jing Min Zhao's ASN.1 parser, Apr 20 2006
2 * 2 *
3 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net> 3 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net>
4 * 4 *
@@ -412,6 +412,7 @@ typedef struct Facility_UUIE { /* SEQUENCE */
412 eFacility_UUIE_destinationInfo = (1 << 14), 412 eFacility_UUIE_destinationInfo = (1 << 14),
413 eFacility_UUIE_h245SecurityMode = (1 << 13), 413 eFacility_UUIE_h245SecurityMode = (1 << 13),
414 } options; 414 } options;
415 TransportAddress alternativeAddress;
415 FacilityReason reason; 416 FacilityReason reason;
416 TransportAddress h245Address; 417 TransportAddress h245Address;
417 Facility_UUIE_fastStart fastStart; 418 Facility_UUIE_fastStart fastStart;
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_sip.h b/include/linux/netfilter_ipv4/ip_conntrack_sip.h
new file mode 100644
index 000000000000..913dad66c0fb
--- /dev/null
+++ b/include/linux/netfilter_ipv4/ip_conntrack_sip.h
@@ -0,0 +1,44 @@
1#ifndef __IP_CONNTRACK_SIP_H__
2#define __IP_CONNTRACK_SIP_H__
3#ifdef __KERNEL__
4
5#define SIP_PORT 5060
6#define SIP_TIMEOUT 3600
7
8#define POS_VIA 0
9#define POS_CONTACT 1
10#define POS_CONTENT 2
11#define POS_MEDIA 3
12#define POS_OWNER 4
13#define POS_CONNECTION 5
14#define POS_REQ_HEADER 6
15#define POS_SDP_HEADER 7
16
17struct sip_header_nfo {
18 const char *lname;
19 const char *sname;
20 const char *ln_str;
21 size_t lnlen;
22 size_t snlen;
23 size_t ln_strlen;
24 int (*match_len)(const char *, const char *, int *);
25};
26
27extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb,
28 enum ip_conntrack_info ctinfo,
29 struct ip_conntrack *ct,
30 const char **dptr);
31extern unsigned int (*ip_nat_sdp_hook)(struct sk_buff **pskb,
32 enum ip_conntrack_info ctinfo,
33 struct ip_conntrack_expect *exp,
34 const char *dptr);
35
36extern int ct_sip_get_info(const char *dptr, size_t dlen,
37 unsigned int *matchoff,
38 unsigned int *matchlen,
39 struct sip_header_nfo *hnfo);
40extern int ct_sip_lnlen(const char *line, const char *limit);
41extern const char *ct_sip_search(const char *needle, const char *haystack,
42 size_t needle_len, size_t haystack_len);
43#endif /* __KERNEL__ */
44#endif /* __IP_CONNTRACK_SIP_H__ */
diff --git a/include/linux/netfilter_ipv4/listhelp.h b/include/linux/netfilter_ipv4/listhelp.h
index 360429f48737..5d92cf044d91 100644
--- a/include/linux/netfilter_ipv4/listhelp.h
+++ b/include/linux/netfilter_ipv4/listhelp.h
@@ -1,6 +1,5 @@
1#ifndef _LISTHELP_H 1#ifndef _LISTHELP_H
2#define _LISTHELP_H 2#define _LISTHELP_H
3#include <linux/config.h>
4#include <linux/list.h> 3#include <linux/list.h>
5 4
6/* Header to do more comprehensive job than linux/list.h; assume list 5/* Header to do more comprehensive job than linux/list.h; assume list
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 87b8a5703ebc..855b44668caa 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -5,7 +5,7 @@
5#include <linux/types.h> 5#include <linux/types.h>
6 6
7#define NETLINK_ROUTE 0 /* Routing/device hook */ 7#define NETLINK_ROUTE 0 /* Routing/device hook */
8#define NETLINK_W1 1 /* 1-wire subsystem */ 8#define NETLINK_UNUSED 1 /* Unused number */
9#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ 9#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
10#define NETLINK_FIREWALL 3 /* Firewalling hook */ 10#define NETLINK_FIREWALL 3 /* Firewalling hook */
11#define NETLINK_INET_DIAG 4 /* INET socket monitoring */ 11#define NETLINK_INET_DIAG 4 /* INET socket monitoring */
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index ca2ffa6ae1d5..54af92c1c70b 100644
--- a/include/linux/nfs.h
+++ b/include/linux/nfs.h
@@ -7,9 +7,6 @@
7#ifndef _LINUX_NFS_H 7#ifndef _LINUX_NFS_H
8#define _LINUX_NFS_H 8#define _LINUX_NFS_H
9 9
10#include <linux/sunrpc/msg_prot.h>
11#include <linux/string.h>
12
13#define NFS_PROGRAM 100003 10#define NFS_PROGRAM 100003
14#define NFS_PORT 2049 11#define NFS_PORT 2049
15#define NFS_MAXDATA 8192 12#define NFS_MAXDATA 8192
@@ -129,7 +126,10 @@ enum nfs_ftype {
129 NFFIFO = 8 126 NFFIFO = 8
130}; 127};
131 128
132#if defined(__KERNEL__) 129#ifdef __KERNEL__
130#include <linux/sunrpc/msg_prot.h>
131#include <linux/string.h>
132
133/* 133/*
134 * This is the kernel NFS client file handle representation 134 * This is the kernel NFS client file handle representation
135 */ 135 */
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 0c1c306cdaec..1059e6d69d3b 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -14,7 +14,6 @@
14#define _LINUX_NFS4_H 14#define _LINUX_NFS4_H
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/list.h>
18 17
19#define NFS4_VERIFIER_SIZE 8 18#define NFS4_VERIFIER_SIZE 8
20#define NFS4_FHSIZE 128 19#define NFS4_FHSIZE 128
@@ -97,6 +96,9 @@ enum nfs4_acl_whotype {
97 NFS4_ACL_WHO_EVERYONE, 96 NFS4_ACL_WHO_EVERYONE,
98}; 97};
99 98
99#ifdef __KERNEL__
100#include <linux/list.h>
101
100struct nfs4_ace { 102struct nfs4_ace {
101 uint32_t type; 103 uint32_t type;
102 uint32_t flag; 104 uint32_t flag;
@@ -345,8 +347,6 @@ enum lock_type4 {
345#define NFS4_MINOR_VERSION 0 347#define NFS4_MINOR_VERSION 0
346#define NFS4_DEBUG 1 348#define NFS4_DEBUG 1
347 349
348#ifdef __KERNEL__
349
350/* Index of predefined Linux client operations */ 350/* Index of predefined Linux client operations */
351 351
352enum { 352enum {
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index c71227dd4389..7e079f8ce18b 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -9,26 +9,6 @@
9#ifndef _LINUX_NFS_FS_H 9#ifndef _LINUX_NFS_FS_H
10#define _LINUX_NFS_FS_H 10#define _LINUX_NFS_FS_H
11 11
12#include <linux/config.h>
13#include <linux/in.h>
14#include <linux/mm.h>
15#include <linux/pagemap.h>
16#include <linux/rwsem.h>
17#include <linux/wait.h>
18
19#include <linux/nfs_fs_sb.h>
20
21#include <linux/sunrpc/debug.h>
22#include <linux/sunrpc/auth.h>
23#include <linux/sunrpc/clnt.h>
24
25#include <linux/nfs.h>
26#include <linux/nfs2.h>
27#include <linux/nfs3.h>
28#include <linux/nfs4.h>
29#include <linux/nfs_xdr.h>
30#include <linux/rwsem.h>
31#include <linux/mempool.h>
32 12
33/* 13/*
34 * Enable debugging support for nfs client. 14 * Enable debugging support for nfs client.
@@ -63,6 +43,25 @@
63#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */ 43#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */
64 44
65#ifdef __KERNEL__ 45#ifdef __KERNEL__
46#include <linux/in.h>
47#include <linux/mm.h>
48#include <linux/pagemap.h>
49#include <linux/rwsem.h>
50#include <linux/wait.h>
51
52#include <linux/nfs_fs_sb.h>
53
54#include <linux/sunrpc/debug.h>
55#include <linux/sunrpc/auth.h>
56#include <linux/sunrpc/clnt.h>
57
58#include <linux/nfs.h>
59#include <linux/nfs2.h>
60#include <linux/nfs3.h>
61#include <linux/nfs4.h>
62#include <linux/nfs_xdr.h>
63#include <linux/rwsem.h>
64#include <linux/mempool.h>
66 65
67/* 66/*
68 * NFSv3/v4 Access mode cache entry 67 * NFSv3/v4 Access mode cache entry
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index ec7c2e872d72..2dcad295fece 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -10,7 +10,6 @@
10#ifndef LINUX_NFSD_NFSD_H 10#ifndef LINUX_NFSD_NFSD_H
11#define LINUX_NFSD_NFSD_H 11#define LINUX_NFSD_NFSD_H
12 12
13#include <linux/config.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/unistd.h> 14#include <linux/unistd.h>
16#include <linux/dirent.h> 15#include <linux/dirent.h>
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 0798b7781a6e..f9edcd2ff3c8 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -16,7 +16,6 @@
16 16
17#include <asm/types.h> 17#include <asm/types.h>
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19# include <linux/config.h>
20# include <linux/types.h> 19# include <linux/types.h>
21# include <linux/string.h> 20# include <linux/string.h>
22# include <linux/fs.h> 21# include <linux/fs.h>
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
index 781efbf94ed3..dae0faea2807 100644
--- a/include/linux/nfsd/syscall.h
+++ b/include/linux/nfsd/syscall.h
@@ -11,7 +11,6 @@
11 11
12#include <asm/types.h> 12#include <asm/types.h>
13#ifdef __KERNEL__ 13#ifdef __KERNEL__
14# include <linux/config.h>
15# include <linux/types.h> 14# include <linux/types.h>
16# include <linux/in.h> 15# include <linux/in.h>
17#endif 16#endif
diff --git a/include/linux/numa.h b/include/linux/numa.h
index e481feb1bfd8..a31a7301b159 100644
--- a/include/linux/numa.h
+++ b/include/linux/numa.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_NUMA_H 1#ifndef _LINUX_NUMA_H
2#define _LINUX_NUMA_H 2#define _LINUX_NUMA_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_NODES_SHIFT 5#ifdef CONFIG_NODES_SHIFT
7#define NODES_SHIFT CONFIG_NODES_SHIFT 6#define NODES_SHIFT CONFIG_NODES_SHIFT
diff --git a/include/linux/parport.h b/include/linux/parport.h
index 008d736a6c9a..d42737eeee06 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -96,7 +96,6 @@ typedef enum {
96/* The rest is for the kernel only */ 96/* The rest is for the kernel only */
97#ifdef __KERNEL__ 97#ifdef __KERNEL__
98 98
99#include <linux/config.h>
100#include <linux/jiffies.h> 99#include <linux/jiffies.h>
101#include <linux/proc_fs.h> 100#include <linux/proc_fs.h>
102#include <linux/spinlock.h> 101#include <linux/spinlock.h>
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 3a6a4e37a482..62a8c22f5f60 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -17,8 +17,6 @@
17#ifndef LINUX_PCI_H 17#ifndef LINUX_PCI_H
18#define LINUX_PCI_H 18#define LINUX_PCI_H
19 19
20#include <linux/mod_devicetable.h>
21
22/* Include the pci register defines */ 20/* Include the pci register defines */
23#include <linux/pci_regs.h> 21#include <linux/pci_regs.h>
24 22
@@ -46,8 +44,9 @@
46 44
47#ifdef __KERNEL__ 45#ifdef __KERNEL__
48 46
47#include <linux/mod_devicetable.h>
48
49#include <linux/types.h> 49#include <linux/types.h>
50#include <linux/config.h>
51#include <linux/ioport.h> 50#include <linux/ioport.h>
52#include <linux/list.h> 51#include <linux/list.h>
53#include <linux/errno.h> 52#include <linux/errno.h>
@@ -163,6 +162,9 @@ struct pci_dev {
163 unsigned int is_busmaster:1; /* device is busmaster */ 162 unsigned int is_busmaster:1; /* device is busmaster */
164 unsigned int no_msi:1; /* device may not use msi */ 163 unsigned int no_msi:1; /* device may not use msi */
165 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ 164 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */
165 unsigned int broken_parity_status:1; /* Device generates false positive parity */
166 unsigned int msi_enabled:1;
167 unsigned int msix_enabled:1;
166 168
167 u32 saved_config_space[16]; /* config space saved at suspend time */ 169 u32 saved_config_space[16]; /* config space saved at suspend time */
168 struct hlist_head saved_cap_space; 170 struct hlist_head saved_cap_space;
@@ -442,6 +444,7 @@ struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int devic
442struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); 444struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
443int pci_find_capability (struct pci_dev *dev, int cap); 445int pci_find_capability (struct pci_dev *dev, int cap);
444int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 446int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
447int pci_find_ext_capability (struct pci_dev *dev, int cap);
445struct pci_bus * pci_find_next_bus(const struct pci_bus *from); 448struct pci_bus * pci_find_next_bus(const struct pci_bus *from);
446 449
447struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from); 450struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from);
@@ -496,6 +499,7 @@ int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
496int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); 499int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
497void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); 500void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
498int pci_assign_resource(struct pci_dev *dev, int i); 501int pci_assign_resource(struct pci_dev *dev, int i);
502int pci_assign_resource_fixed(struct pci_dev *dev, int i);
499void pci_restore_bars(struct pci_dev *dev); 503void pci_restore_bars(struct pci_dev *dev);
500 504
501/* ROM control related routines */ 505/* ROM control related routines */
@@ -662,6 +666,7 @@ static inline int pci_register_driver(struct pci_driver *drv) { return 0;}
662static inline void pci_unregister_driver(struct pci_driver *drv) { } 666static inline void pci_unregister_driver(struct pci_driver *drv) { }
663static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } 667static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
664static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; } 668static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; }
669static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; }
665static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; } 670static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; }
666 671
667/* Power management related routines */ 672/* Power management related routines */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 590dc6dca315..cde701c13c77 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -352,8 +352,11 @@
352#define PCI_DEVICE_ID_ATI_RS480 0x5950 352#define PCI_DEVICE_ID_ATI_RS480 0x5950
353/* ATI IXP Chipset */ 353/* ATI IXP Chipset */
354#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349 354#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349
355#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353
356#define PCI_DEVICE_ID_ATI_IXP300_SMBUS 0x4363
355#define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369 357#define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369
356#define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e 358#define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e
359#define PCI_DEVICE_ID_ATI_IXP400_SMBUS 0x4372
357#define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 360#define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376
358#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 361#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379
359#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a 362#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a
@@ -848,7 +851,12 @@
848 851
849 852
850#define PCI_VENDOR_ID_QLOGIC 0x1077 853#define PCI_VENDOR_ID_QLOGIC 0x1077
854#define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016
851#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 855#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020
856#define PCI_DEVICE_ID_QLOGIC_ISP1080 0x1080
857#define PCI_DEVICE_ID_QLOGIC_ISP12160 0x1216
858#define PCI_DEVICE_ID_QLOGIC_ISP1240 0x1240
859#define PCI_DEVICE_ID_QLOGIC_ISP1280 0x1280
852#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 860#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100
853#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 861#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200
854#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 862#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300
@@ -935,6 +943,7 @@
935#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151 943#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151
936#define PCI_DEVICE_ID_PLX_R753 0x1152 944#define PCI_DEVICE_ID_PLX_R753 0x1152
937#define PCI_DEVICE_ID_PLX_OLITEC 0x1187 945#define PCI_DEVICE_ID_PLX_OLITEC 0x1187
946#define PCI_DEVICE_ID_PLX_PCI200SYN 0x3196
938#define PCI_DEVICE_ID_PLX_9050 0x9050 947#define PCI_DEVICE_ID_PLX_9050 0x9050
939#define PCI_DEVICE_ID_PLX_9080 0x9080 948#define PCI_DEVICE_ID_PLX_9080 0x9080
940#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 949#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001
@@ -1017,6 +1026,7 @@
1017#define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056 1026#define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056
1018#define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057 1027#define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057
1019#define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059 1028#define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059
1029#define PCI_DEVICE_ID_NVIDIA_CK804_PCIE 0x005d
1020#define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064 1030#define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064
1021#define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065 1031#define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065
1022#define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066 1032#define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066
@@ -1126,9 +1136,11 @@
1126#define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258 1136#define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258
1127#define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259 1137#define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259
1128#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B 1138#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B
1139#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SMBUS 0x0264
1129#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265 1140#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265
1130#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 1141#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266
1131#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 1142#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267
1143#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SMBUS 0x0368
1132#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E 1144#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E
1133#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E 1145#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E
1134#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F 1146#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F
@@ -1182,6 +1194,14 @@
1182#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E 1194#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E
1183#define PCI_DEVICE_ID_NVIDIA_NVENET_14 0x0372 1195#define PCI_DEVICE_ID_NVIDIA_NVENET_14 0x0372
1184#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 1196#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
1197#define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5
1198#define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6
1199#define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE
1200#define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF
1201#define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450
1202#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451
1203#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452
1204#define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453
1185 1205
1186#define PCI_VENDOR_ID_IMS 0x10e0 1206#define PCI_VENDOR_ID_IMS 0x10e0
1187#define PCI_DEVICE_ID_IMS_TT128 0x9128 1207#define PCI_DEVICE_ID_IMS_TT128 0x9128
@@ -1827,6 +1847,7 @@
1827 1847
1828#define PCI_VENDOR_ID_SAMSUNG 0x144d 1848#define PCI_VENDOR_ID_SAMSUNG 0x144d
1829 1849
1850#define PCI_VENDOR_ID_MYRICOM 0x14c1
1830 1851
1831#define PCI_VENDOR_ID_TITAN 0x14D2 1852#define PCI_VENDOR_ID_TITAN 0x14D2
1832#define PCI_DEVICE_ID_TITAN_010L 0x8001 1853#define PCI_DEVICE_ID_TITAN_010L 0x8001
@@ -1887,6 +1908,7 @@
1887#define PCI_DEVICE_ID_TIGON3_5751F 0x167e 1908#define PCI_DEVICE_ID_TIGON3_5751F 0x167e
1888#define PCI_DEVICE_ID_TIGON3_5787M 0x1693 1909#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
1889#define PCI_DEVICE_ID_TIGON3_5782 0x1696 1910#define PCI_DEVICE_ID_TIGON3_5782 0x1696
1911#define PCI_DEVICE_ID_TIGON3_5786 0x169a
1890#define PCI_DEVICE_ID_TIGON3_5787 0x169b 1912#define PCI_DEVICE_ID_TIGON3_5787 0x169b
1891#define PCI_DEVICE_ID_TIGON3_5788 0x169c 1913#define PCI_DEVICE_ID_TIGON3_5788 0x169c
1892#define PCI_DEVICE_ID_TIGON3_5789 0x169d 1914#define PCI_DEVICE_ID_TIGON3_5789 0x169d
@@ -1935,6 +1957,7 @@
1935 1957
1936#define PCI_VENDOR_ID_MELLANOX 0x15b3 1958#define PCI_VENDOR_ID_MELLANOX 0x15b3
1937#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 1959#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44
1960#define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46
1938#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 1961#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278
1939#define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282 1962#define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282
1940#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c 1963#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c
@@ -1958,6 +1981,9 @@
1958#define PCI_VENDOR_ID_NETCELL 0x169c 1981#define PCI_VENDOR_ID_NETCELL 0x169c
1959#define PCI_DEVICE_ID_REVOLUTION 0x0044 1982#define PCI_DEVICE_ID_REVOLUTION 0x0044
1960 1983
1984#define PCI_VENDOR_ID_VITESSE 0x1725
1985#define PCI_DEVICE_ID_VITESSE_VSC7174 0x7174
1986
1961#define PCI_VENDOR_ID_LINKSYS 0x1737 1987#define PCI_VENDOR_ID_LINKSYS 0x1737
1962#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 1988#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064
1963 1989
@@ -2043,6 +2069,7 @@
2043#define PCI_DEVICE_ID_INTEL_80960_RP 0x1960 2069#define PCI_DEVICE_ID_INTEL_80960_RP 0x1960
2044#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 2070#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21
2045#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 2071#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30
2072#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38
2046#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 2073#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410
2047#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 2074#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411
2048#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 2075#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
@@ -2136,6 +2163,7 @@
2136#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 2163#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815
2137#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e 2164#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e
2138#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 2165#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850
2166#define PCI_DEVICE_ID_INTEL_GD31244 0x3200
2139#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 2167#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
2140#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 2168#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
2141#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 2169#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index d27a78b71297..6bce4a240364 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -197,6 +197,7 @@
197#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ 197#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
198#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ 198#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
199#define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */ 199#define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */
200#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */
200#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ 201#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
201#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ 202#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
202#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ 203#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 682525511c9e..66b5de404f22 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -6,7 +6,6 @@
6 * WARNING: these things are HUGE. 4 kbytes per counter on 32-way P4. 6 * WARNING: these things are HUGE. 4 kbytes per counter on 32-way P4.
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/spinlock.h> 9#include <linux/spinlock.h>
11#include <linux/smp.h> 10#include <linux/smp.h>
12#include <linux/threads.h> 11#include <linux/threads.h>
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index bac0fb389cf1..d5dd471da225 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -159,7 +159,7 @@ struct sadb_spirange {
159struct sadb_x_kmprivate { 159struct sadb_x_kmprivate {
160 uint16_t sadb_x_kmprivate_len; 160 uint16_t sadb_x_kmprivate_len;
161 uint16_t sadb_x_kmprivate_exttype; 161 uint16_t sadb_x_kmprivate_exttype;
162 u_int32_t sadb_x_kmprivate_reserved; 162 uint32_t sadb_x_kmprivate_reserved;
163} __attribute__((packed)); 163} __attribute__((packed));
164/* sizeof(struct sadb_x_kmprivate) == 8 */ 164/* sizeof(struct sadb_x_kmprivate) == 8 */
165 165
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 66be58902b17..658c1b93d5bb 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -23,7 +23,6 @@
23 23
24#ifdef __KERNEL__ 24#ifdef __KERNEL__
25 25
26#include <linux/config.h>
27#include <linux/list.h> 26#include <linux/list.h>
28#include <asm/atomic.h> 27#include <asm/atomic.h>
29 28
diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h
index 008932d73c35..78027c533b94 100644
--- a/include/linux/pm_legacy.h
+++ b/include/linux/pm_legacy.h
@@ -1,7 +1,6 @@
1#ifndef __LINUX_PM_LEGACY_H__ 1#ifndef __LINUX_PM_LEGACY_H__
2#define __LINUX_PM_LEGACY_H__ 2#define __LINUX_PM_LEGACY_H__
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_PM_LEGACY 5#ifdef CONFIG_PM_LEGACY
7 6
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index 217d3daf7336..ecce5912f4d6 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -6,7 +6,6 @@
6 * Copyright (C) 1998 Paul Mackerras. 6 * Copyright (C) 1998 Paul Mackerras.
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11#define PMU_DRIVER_VERSION 2 10#define PMU_DRIVER_VERSION 2
12 11
diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h
index 402056cd049d..c6b13ff85028 100644
--- a/include/linux/ppp_defs.h
+++ b/include/linux/ppp_defs.h
@@ -42,8 +42,6 @@
42#ifndef _PPP_DEFS_H_ 42#ifndef _PPP_DEFS_H_
43#define _PPP_DEFS_H_ 43#define _PPP_DEFS_H_
44 44
45#include <linux/crc-ccitt.h>
46
47/* 45/*
48 * The basic PPP frame. 46 * The basic PPP frame.
49 */ 47 */
@@ -97,7 +95,11 @@
97 95
98#define PPP_INITFCS 0xffff /* Initial FCS value */ 96#define PPP_INITFCS 0xffff /* Initial FCS value */
99#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */ 97#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */
98
99#ifdef __KERNEL__
100#include <linux/crc-ccitt.h>
100#define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c) 101#define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c)
102#endif
101 103
102/* 104/*
103 * Extended asyncmap - allows any character to be escaped. 105 * Extended asyncmap - allows any character to be escaped.
@@ -179,12 +181,4 @@ struct ppp_idle {
179 time_t recv_idle; /* time since last NP packet received */ 181 time_t recv_idle; /* time since last NP packet received */
180}; 182};
181 183
182#ifndef __P
183#ifdef __STDC__
184#define __P(x) x
185#else
186#define __P(x) ()
187#endif
188#endif
189
190#endif /* _PPP_DEFS_H_ */ 184#endif /* _PPP_DEFS_H_ */
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 5769d14d1e6a..d0926d63406c 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -6,7 +6,6 @@
6 * preempt_count (used for kernel preemption, interrupt count, etc.) 6 * preempt_count (used for kernel preemption, interrupt count, etc.)
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/thread_info.h> 9#include <linux/thread_info.h>
11#include <linux/linkage.h> 10#include <linux/linkage.h>
12 11
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 4b47a0253425..5810d28fbed9 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_PROC_FS_H 1#ifndef _LINUX_PROC_FS_H
2#define _LINUX_PROC_FS_H 2#define _LINUX_PROC_FS_H
3 3
4#include <linux/config.h>
5#include <linux/slab.h> 4#include <linux/slab.h>
6#include <linux/fs.h> 5#include <linux/fs.h>
7#include <linux/spinlock.h> 6#include <linux/spinlock.h>
diff --git a/include/linux/profile.h b/include/linux/profile.h
index 1f2fea6640a4..e633004ae052 100644
--- a/include/linux/profile.h
+++ b/include/linux/profile.h
@@ -4,7 +4,6 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/config.h>
8#include <linux/init.h> 7#include <linux/init.h>
9#include <linux/cpumask.h> 8#include <linux/cpumask.h>
10#include <asm/errno.h> 9#include <asm/errno.h>
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 2dab71e1c3d1..b8fbf26eb885 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -37,8 +37,6 @@
37 37
38#include <linux/errno.h> 38#include <linux/errno.h>
39#include <linux/types.h> 39#include <linux/types.h>
40#include <linux/spinlock.h>
41#include <linux/mutex.h>
42 40
43#define __DQUOT_VERSION__ "dquot_6.5.1" 41#define __DQUOT_VERSION__ "dquot_6.5.1"
44#define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 42#define __DQUOT_NUM_VERSION__ 6*10000+5*100+1
@@ -133,6 +131,8 @@ struct if_dqinfo {
133}; 131};
134 132
135#ifdef __KERNEL__ 133#ifdef __KERNEL__
134#include <linux/spinlock.h>
135#include <linux/mutex.h>
136 136
137#include <linux/dqblk_xfs.h> 137#include <linux/dqblk_xfs.h>
138#include <linux/dqblk_v1.h> 138#include <linux/dqblk_v1.h>
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 21e5a9124856..5110201a4159 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -10,7 +10,6 @@
10#ifndef _LINUX_QUOTAOPS_ 10#ifndef _LINUX_QUOTAOPS_
11#define _LINUX_QUOTAOPS_ 11#define _LINUX_QUOTAOPS_
12 12
13#include <linux/config.h>
14#include <linux/smp_lock.h> 13#include <linux/smp_lock.h>
15 14
16#include <linux/fs.h> 15#include <linux/fs.h>
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index 4b7cc4fe366d..f37006f21664 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -99,19 +99,36 @@ static inline struct page * rb_insert_page_cache(struct inode * inode,
99 99
100struct rb_node 100struct rb_node
101{ 101{
102 struct rb_node *rb_parent; 102 unsigned long rb_parent_color;
103 int rb_color;
104#define RB_RED 0 103#define RB_RED 0
105#define RB_BLACK 1 104#define RB_BLACK 1
106 struct rb_node *rb_right; 105 struct rb_node *rb_right;
107 struct rb_node *rb_left; 106 struct rb_node *rb_left;
108}; 107} __attribute__((aligned(sizeof(long))));
108 /* The alignment might seem pointless, but allegedly CRIS needs it */
109 109
110struct rb_root 110struct rb_root
111{ 111{
112 struct rb_node *rb_node; 112 struct rb_node *rb_node;
113}; 113};
114 114
115
116#define rb_parent(r) ((struct rb_node *)((r)->rb_parent_color & ~3))
117#define rb_color(r) ((r)->rb_parent_color & 1)
118#define rb_is_red(r) (!rb_color(r))
119#define rb_is_black(r) rb_color(r)
120#define rb_set_red(r) do { (r)->rb_parent_color &= ~1; } while (0)
121#define rb_set_black(r) do { (r)->rb_parent_color |= 1; } while (0)
122
123static inline void rb_set_parent(struct rb_node *rb, struct rb_node *p)
124{
125 rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p;
126}
127static inline void rb_set_color(struct rb_node *rb, int color)
128{
129 rb->rb_parent_color = (rb->rb_parent_color & ~1) | color;
130}
131
115#define RB_ROOT (struct rb_root) { NULL, } 132#define RB_ROOT (struct rb_root) { NULL, }
116#define rb_entry(ptr, type, member) container_of(ptr, type, member) 133#define rb_entry(ptr, type, member) container_of(ptr, type, member)
117 134
@@ -131,8 +148,7 @@ extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
131static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, 148static inline void rb_link_node(struct rb_node * node, struct rb_node * parent,
132 struct rb_node ** rb_link) 149 struct rb_node ** rb_link)
133{ 150{
134 node->rb_parent = parent; 151 node->rb_parent_color = (unsigned long )parent;
135 node->rb_color = RB_RED;
136 node->rb_left = node->rb_right = NULL; 152 node->rb_left = node->rb_right = NULL;
137 153
138 *rb_link = node; 154 *rb_link = node;
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 5353afb11db3..5e961035c725 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -2,8 +2,6 @@
2 File: linux/reiserfs_xattr.h 2 File: linux/reiserfs_xattr.h
3*/ 3*/
4 4
5#include <linux/config.h>
6#include <linux/init.h>
7#include <linux/xattr.h> 5#include <linux/xattr.h>
8 6
9/* Magic value in header */ 7/* Magic value in header */
@@ -15,6 +13,7 @@ struct reiserfs_xattr_header {
15}; 13};
16 14
17#ifdef __KERNEL__ 15#ifdef __KERNEL__
16#include <linux/init.h>
18 17
19struct reiserfs_xattr_handler { 18struct reiserfs_xattr_handler {
20 char *prefix; 19 char *prefix;
diff --git a/include/linux/relay.h b/include/linux/relay.h
index 4bcc1531d6a9..24accb483849 100644
--- a/include/linux/relay.h
+++ b/include/linux/relay.h
@@ -10,7 +10,6 @@
10#ifndef _LINUX_RELAY_H 10#ifndef _LINUX_RELAY_H
11#define _LINUX_RELAY_H 11#define _LINUX_RELAY_H
12 12
13#include <linux/config.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/sched.h> 14#include <linux/sched.h>
16#include <linux/wait.h> 15#include <linux/wait.h>
diff --git a/include/linux/rio.h b/include/linux/rio.h
index c7e907faae9c..d93857056cb9 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -17,7 +17,6 @@
17#ifdef __KERNEL__ 17#ifdef __KERNEL__
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/config.h>
21#include <linux/ioport.h> 20#include <linux/ioport.h>
22#include <linux/list.h> 21#include <linux/list.h>
23#include <linux/errno.h> 22#include <linux/errno.h>
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h
index f54772d0e7f8..7adb2a1aac92 100644
--- a/include/linux/rio_drv.h
+++ b/include/linux/rio_drv.h
@@ -16,7 +16,6 @@
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/config.h>
20#include <linux/ioport.h> 19#include <linux/ioport.h>
21#include <linux/list.h> 20#include <linux/list.h>
22#include <linux/errno.h> 21#include <linux/errno.h>
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index d6b9bcd1384c..2d4c81a220db 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -4,7 +4,6 @@
4 * Declarations for Reverse Mapping functions in mm/rmap.c 4 * Declarations for Reverse Mapping functions in mm/rmap.c
5 */ 5 */
6 6
7#include <linux/config.h>
8#include <linux/list.h> 7#include <linux/list.h>
9#include <linux/slab.h> 8#include <linux/slab.h>
10#include <linux/mm.h> 9#include <linux/mm.h>
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index df0cdd41085c..facd9ee37b76 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -909,7 +909,6 @@ struct tcamsg
909 909
910#ifdef __KERNEL__ 910#ifdef __KERNEL__
911 911
912#include <linux/config.h>
913#include <linux/mutex.h> 912#include <linux/mutex.h>
914 913
915extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); 914extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size);
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index bfb988885002..f99fe90732ab 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -13,7 +13,6 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/config.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <asm/system.h> 18#include <asm/system.h>
diff --git a/include/linux/scc.h b/include/linux/scc.h
index 885a4a02b23c..3495bd953cc6 100644
--- a/include/linux/scc.h
+++ b/include/linux/scc.h
@@ -3,7 +3,6 @@
3#ifndef _SCC_H 3#ifndef _SCC_H
4#define _SCC_H 4#define _SCC_H
5 5
6#include <linux/config.h>
7 6
8/* selection of hardware types */ 7/* selection of hardware types */
9 8
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 29b7d4f87d20..267f15257040 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1,9 +1,46 @@
1#ifndef _LINUX_SCHED_H 1#ifndef _LINUX_SCHED_H
2#define _LINUX_SCHED_H 2#define _LINUX_SCHED_H
3 3
4#include <linux/auxvec.h> /* For AT_VECTOR_SIZE */
5
6/*
7 * cloning flags:
8 */
9#define CSIGNAL 0x000000ff /* signal mask to be sent at exit */
10#define CLONE_VM 0x00000100 /* set if VM shared between processes */
11#define CLONE_FS 0x00000200 /* set if fs info shared between processes */
12#define CLONE_FILES 0x00000400 /* set if open files shared between processes */
13#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */
14#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
15#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
16#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
17#define CLONE_THREAD 0x00010000 /* Same thread group? */
18#define CLONE_NEWNS 0x00020000 /* New namespace group? */
19#define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */
20#define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
21#define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */
22#define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */
23#define CLONE_DETACHED 0x00400000 /* Unused, ignored */
24#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
25#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
26#define CLONE_STOPPED 0x02000000 /* Start in stopped state */
27
28/*
29 * Scheduling policies
30 */
31#define SCHED_NORMAL 0
32#define SCHED_FIFO 1
33#define SCHED_RR 2
34#define SCHED_BATCH 3
35
36#ifdef __KERNEL__
37
38struct sched_param {
39 int sched_priority;
40};
41
4#include <asm/param.h> /* for HZ */ 42#include <asm/param.h> /* for HZ */
5 43
6#include <linux/config.h>
7#include <linux/capability.h> 44#include <linux/capability.h>
8#include <linux/threads.h> 45#include <linux/threads.h>
9#include <linux/kernel.h> 46#include <linux/kernel.h>
@@ -37,31 +74,15 @@
37#include <linux/rcupdate.h> 74#include <linux/rcupdate.h>
38#include <linux/futex.h> 75#include <linux/futex.h>
39 76
40#include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ 77#include <linux/time.h>
78#include <linux/param.h>
79#include <linux/resource.h>
80#include <linux/timer.h>
81#include <linux/hrtimer.h>
41 82
42struct exec_domain; 83#include <asm/processor.h>
43 84
44/* 85struct exec_domain;
45 * cloning flags:
46 */
47#define CSIGNAL 0x000000ff /* signal mask to be sent at exit */
48#define CLONE_VM 0x00000100 /* set if VM shared between processes */
49#define CLONE_FS 0x00000200 /* set if fs info shared between processes */
50#define CLONE_FILES 0x00000400 /* set if open files shared between processes */
51#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */
52#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
53#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
54#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
55#define CLONE_THREAD 0x00010000 /* Same thread group? */
56#define CLONE_NEWNS 0x00020000 /* New namespace group? */
57#define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */
58#define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
59#define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */
60#define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */
61#define CLONE_DETACHED 0x00400000 /* Unused, ignored */
62#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
63#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
64#define CLONE_STOPPED 0x02000000 /* Start in stopped state */
65 86
66/* 87/*
67 * List of flags we want to share for kernel threads, 88 * List of flags we want to share for kernel threads,
@@ -103,13 +124,6 @@ extern unsigned long nr_uninterruptible(void);
103extern unsigned long nr_active(void); 124extern unsigned long nr_active(void);
104extern unsigned long nr_iowait(void); 125extern unsigned long nr_iowait(void);
105 126
106#include <linux/time.h>
107#include <linux/param.h>
108#include <linux/resource.h>
109#include <linux/timer.h>
110#include <linux/hrtimer.h>
111
112#include <asm/processor.h>
113 127
114/* 128/*
115 * Task state bitmask. NOTE! These bits are also 129 * Task state bitmask. NOTE! These bits are also
@@ -156,20 +170,6 @@ extern unsigned long nr_iowait(void);
156/* Task command name length */ 170/* Task command name length */
157#define TASK_COMM_LEN 16 171#define TASK_COMM_LEN 16
158 172
159/*
160 * Scheduling policies
161 */
162#define SCHED_NORMAL 0
163#define SCHED_FIFO 1
164#define SCHED_RR 2
165#define SCHED_BATCH 3
166
167struct sched_param {
168 int sched_priority;
169};
170
171#ifdef __KERNEL__
172
173#include <linux/spinlock.h> 173#include <linux/spinlock.h>
174 174
175/* 175/*
@@ -494,7 +494,7 @@ struct user_struct {
494 atomic_t processes; /* How many processes does this user have? */ 494 atomic_t processes; /* How many processes does this user have? */
495 atomic_t files; /* How many open files does this user have? */ 495 atomic_t files; /* How many open files does this user have? */
496 atomic_t sigpending; /* How many pending signals does this user have? */ 496 atomic_t sigpending; /* How many pending signals does this user have? */
497#ifdef CONFIG_INOTIFY 497#ifdef CONFIG_INOTIFY_USER
498 atomic_t inotify_watches; /* How many inotify watches does this user have? */ 498 atomic_t inotify_watches; /* How many inotify watches does this user have? */
499 atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ 499 atomic_t inotify_devs; /* How many inotify devs does this user have opened? */
500#endif 500#endif
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index cd2773b29a64..3e8b1cf54303 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_SECCOMP_H 1#ifndef _LINUX_SECCOMP_H
2#define _LINUX_SECCOMP_H 2#define _LINUX_SECCOMP_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_SECCOMP 5#ifdef CONFIG_SECCOMP
7 6
diff --git a/include/linux/security.h b/include/linux/security.h
index 1bab48f6aeac..47722d355532 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -805,31 +805,37 @@ struct swap_info_struct;
805 * used by the XFRM system. 805 * used by the XFRM system.
806 * @sec_ctx contains the security context information being provided by 806 * @sec_ctx contains the security context information being provided by
807 * the user-level policy update program (e.g., setkey). 807 * the user-level policy update program (e.g., setkey).
808 * Allocate a security structure to the xp->selector.security field. 808 * Allocate a security structure to the xp->security field.
809 * The security field is initialized to NULL when the xfrm_policy is 809 * The security field is initialized to NULL when the xfrm_policy is
810 * allocated. 810 * allocated.
811 * Return 0 if operation was successful (memory to allocate, legal context) 811 * Return 0 if operation was successful (memory to allocate, legal context)
812 * @xfrm_policy_clone_security: 812 * @xfrm_policy_clone_security:
813 * @old contains an existing xfrm_policy in the SPD. 813 * @old contains an existing xfrm_policy in the SPD.
814 * @new contains a new xfrm_policy being cloned from old. 814 * @new contains a new xfrm_policy being cloned from old.
815 * Allocate a security structure to the new->selector.security field 815 * Allocate a security structure to the new->security field
816 * that contains the information from the old->selector.security field. 816 * that contains the information from the old->security field.
817 * Return 0 if operation was successful (memory to allocate). 817 * Return 0 if operation was successful (memory to allocate).
818 * @xfrm_policy_free_security: 818 * @xfrm_policy_free_security:
819 * @xp contains the xfrm_policy 819 * @xp contains the xfrm_policy
820 * Deallocate xp->selector.security. 820 * Deallocate xp->security.
821 * @xfrm_policy_delete_security:
822 * @xp contains the xfrm_policy.
823 * Authorize deletion of xp->security.
821 * @xfrm_state_alloc_security: 824 * @xfrm_state_alloc_security:
822 * @x contains the xfrm_state being added to the Security Association 825 * @x contains the xfrm_state being added to the Security Association
823 * Database by the XFRM system. 826 * Database by the XFRM system.
824 * @sec_ctx contains the security context information being provided by 827 * @sec_ctx contains the security context information being provided by
825 * the user-level SA generation program (e.g., setkey or racoon). 828 * the user-level SA generation program (e.g., setkey or racoon).
826 * Allocate a security structure to the x->sel.security field. The 829 * Allocate a security structure to the x->security field. The
827 * security field is initialized to NULL when the xfrm_state is 830 * security field is initialized to NULL when the xfrm_state is
828 * allocated. 831 * allocated.
829 * Return 0 if operation was successful (memory to allocate, legal context). 832 * Return 0 if operation was successful (memory to allocate, legal context).
830 * @xfrm_state_free_security: 833 * @xfrm_state_free_security:
831 * @x contains the xfrm_state. 834 * @x contains the xfrm_state.
832 * Deallocate x>sel.security. 835 * Deallocate x->security.
836 * @xfrm_state_delete_security:
837 * @x contains the xfrm_state.
838 * Authorize deletion of x->security.
833 * @xfrm_policy_lookup: 839 * @xfrm_policy_lookup:
834 * @xp contains the xfrm_policy for which the access control is being 840 * @xp contains the xfrm_policy for which the access control is being
835 * checked. 841 * checked.
@@ -1298,14 +1304,16 @@ struct security_operations {
1298 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx); 1304 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx);
1299 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); 1305 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new);
1300 void (*xfrm_policy_free_security) (struct xfrm_policy *xp); 1306 void (*xfrm_policy_free_security) (struct xfrm_policy *xp);
1307 int (*xfrm_policy_delete_security) (struct xfrm_policy *xp);
1301 int (*xfrm_state_alloc_security) (struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx); 1308 int (*xfrm_state_alloc_security) (struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx);
1302 void (*xfrm_state_free_security) (struct xfrm_state *x); 1309 void (*xfrm_state_free_security) (struct xfrm_state *x);
1310 int (*xfrm_state_delete_security) (struct xfrm_state *x);
1303 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 sk_sid, u8 dir); 1311 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 sk_sid, u8 dir);
1304#endif /* CONFIG_SECURITY_NETWORK_XFRM */ 1312#endif /* CONFIG_SECURITY_NETWORK_XFRM */
1305 1313
1306 /* key management security hooks */ 1314 /* key management security hooks */
1307#ifdef CONFIG_KEYS 1315#ifdef CONFIG_KEYS
1308 int (*key_alloc)(struct key *key); 1316 int (*key_alloc)(struct key *key, struct task_struct *tsk);
1309 void (*key_free)(struct key *key); 1317 void (*key_free)(struct key *key);
1310 int (*key_permission)(key_ref_t key_ref, 1318 int (*key_permission)(key_ref_t key_ref,
1311 struct task_struct *context, 1319 struct task_struct *context,
@@ -2934,11 +2942,21 @@ static inline void security_xfrm_policy_free(struct xfrm_policy *xp)
2934 security_ops->xfrm_policy_free_security(xp); 2942 security_ops->xfrm_policy_free_security(xp);
2935} 2943}
2936 2944
2945static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
2946{
2947 return security_ops->xfrm_policy_delete_security(xp);
2948}
2949
2937static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) 2950static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx)
2938{ 2951{
2939 return security_ops->xfrm_state_alloc_security(x, sec_ctx); 2952 return security_ops->xfrm_state_alloc_security(x, sec_ctx);
2940} 2953}
2941 2954
2955static inline int security_xfrm_state_delete(struct xfrm_state *x)
2956{
2957 return security_ops->xfrm_state_delete_security(x);
2958}
2959
2942static inline void security_xfrm_state_free(struct xfrm_state *x) 2960static inline void security_xfrm_state_free(struct xfrm_state *x)
2943{ 2961{
2944 security_ops->xfrm_state_free_security(x); 2962 security_ops->xfrm_state_free_security(x);
@@ -2963,6 +2981,11 @@ static inline void security_xfrm_policy_free(struct xfrm_policy *xp)
2963{ 2981{
2964} 2982}
2965 2983
2984static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
2985{
2986 return 0;
2987}
2988
2966static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) 2989static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx)
2967{ 2990{
2968 return 0; 2991 return 0;
@@ -2972,6 +2995,11 @@ static inline void security_xfrm_state_free(struct xfrm_state *x)
2972{ 2995{
2973} 2996}
2974 2997
2998static inline int security_xfrm_state_delete(struct xfrm_state *x)
2999{
3000 return 0;
3001}
3002
2975static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir) 3003static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir)
2976{ 3004{
2977 return 0; 3005 return 0;
@@ -2980,9 +3008,10 @@ static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid
2980 3008
2981#ifdef CONFIG_KEYS 3009#ifdef CONFIG_KEYS
2982#ifdef CONFIG_SECURITY 3010#ifdef CONFIG_SECURITY
2983static inline int security_key_alloc(struct key *key) 3011static inline int security_key_alloc(struct key *key,
3012 struct task_struct *tsk)
2984{ 3013{
2985 return security_ops->key_alloc(key); 3014 return security_ops->key_alloc(key, tsk);
2986} 3015}
2987 3016
2988static inline void security_key_free(struct key *key) 3017static inline void security_key_free(struct key *key)
@@ -2999,7 +3028,8 @@ static inline int security_key_permission(key_ref_t key_ref,
2999 3028
3000#else 3029#else
3001 3030
3002static inline int security_key_alloc(struct key *key) 3031static inline int security_key_alloc(struct key *key,
3032 struct task_struct *tsk)
3003{ 3033{
3004 return 0; 3034 return 0;
3005} 3035}
diff --git a/include/linux/selinux.h b/include/linux/selinux.h
index 4047bcde4484..aad4e390d6a5 100644
--- a/include/linux/selinux.h
+++ b/include/linux/selinux.h
@@ -118,6 +118,27 @@ void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid);
118 */ 118 */
119void selinux_get_task_sid(struct task_struct *tsk, u32 *sid); 119void selinux_get_task_sid(struct task_struct *tsk, u32 *sid);
120 120
121/**
122 * selinux_string_to_sid - map a security context string to a security ID
123 * @str: the security context string to be mapped
124 * @sid: ID value returned via this.
125 *
126 * Returns 0 if successful, with the SID stored in sid. A value
127 * of zero for sid indicates no SID could be determined (but no error
128 * occurred).
129 */
130int selinux_string_to_sid(char *str, u32 *sid);
131
132/**
133 * selinux_relabel_packet_permission - check permission to relabel a packet
134 * @sid: ID value to be applied to network packet (via SECMARK, most likely)
135 *
136 * Returns 0 if the current task is allowed to label packets with the
137 * supplied security ID. Note that it is implicit that the packet is always
138 * being relabeled from the default unlabled value, and that the access
139 * control decision is made in the AVC.
140 */
141int selinux_relabel_packet_permission(u32 sid);
121 142
122#else 143#else
123 144
@@ -172,6 +193,17 @@ static inline void selinux_get_task_sid(struct task_struct *tsk, u32 *sid)
172 *sid = 0; 193 *sid = 0;
173} 194}
174 195
196static inline int selinux_string_to_sid(const char *str, u32 *sid)
197{
198 *sid = 0;
199 return 0;
200}
201
202static inline int selinux_relabel_packet_permission(u32 sid)
203{
204 return 0;
205}
206
175#endif /* CONFIG_SECURITY_SELINUX */ 207#endif /* CONFIG_SECURITY_SELINUX */
176 208
177#endif /* _LINUX_SELINUX_H */ 209#endif /* _LINUX_SELINUX_H */
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 3c1f1120fe88..9aaffb0b1d81 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -2,7 +2,6 @@
2#define _LINUX_SEM_H 2#define _LINUX_SEM_H
3 3
4#include <linux/ipc.h> 4#include <linux/ipc.h>
5#include <asm/atomic.h>
6 5
7/* semop flags */ 6/* semop flags */
8#define SEM_UNDO 0x1000 /* undo the operation on exit */ 7#define SEM_UNDO 0x1000 /* undo the operation on exit */
@@ -78,6 +77,7 @@ struct seminfo {
78#define SEMUSZ 20 /* sizeof struct sem_undo */ 77#define SEMUSZ 20 /* sizeof struct sem_undo */
79 78
80#ifdef __KERNEL__ 79#ifdef __KERNEL__
80#include <asm/atomic.h>
81 81
82struct task_struct; 82struct task_struct;
83 83
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index 5a095572881d..7bc5c7c12b54 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -26,7 +26,6 @@
26 * by Keith Owens and Andrea Arcangeli 26 * by Keith Owens and Andrea Arcangeli
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/spinlock.h> 29#include <linux/spinlock.h>
31#include <linux/preempt.h> 30#include <linux/preempt.h>
32 31
diff --git a/include/linux/serialP.h b/include/linux/serialP.h
index 2b9e6b9554d5..e811a615f696 100644
--- a/include/linux/serialP.h
+++ b/include/linux/serialP.h
@@ -19,7 +19,6 @@
19 * For definitions of the flags field, see tty.h 19 * For definitions of the flags field, see tty.h
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/termios.h> 22#include <linux/termios.h>
24#include <linux/workqueue.h> 23#include <linux/workqueue.h>
25#include <linux/interrupt.h> 24#include <linux/interrupt.h>
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index bd14858121ea..0ef50baa7da6 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -67,8 +67,8 @@
67/* Parisc type numbers. */ 67/* Parisc type numbers. */
68#define PORT_MUX 48 68#define PORT_MUX 48
69 69
70/* Atmel AT91RM9200 SoC */ 70/* Atmel AT91xxx SoC */
71#define PORT_AT91RM9200 49 71#define PORT_AT91 49
72 72
73/* Macintosh Zilog type numbers */ 73/* Macintosh Zilog type numbers */
74#define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */ 74#define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */
@@ -132,7 +132,6 @@
132 132
133#ifdef __KERNEL__ 133#ifdef __KERNEL__
134 134
135#include <linux/config.h>
136#include <linux/compiler.h> 135#include <linux/compiler.h>
137#include <linux/interrupt.h> 136#include <linux/interrupt.h>
138#include <linux/circ_buf.h> 137#include <linux/circ_buf.h>
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 70739f51a09f..1e4ce7225eee 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -1,12 +1,12 @@
1#ifndef _LINUX_SIGNAL_H 1#ifndef _LINUX_SIGNAL_H
2#define _LINUX_SIGNAL_H 2#define _LINUX_SIGNAL_H
3 3
4#include <linux/list.h>
5#include <linux/spinlock.h>
6#include <asm/signal.h> 4#include <asm/signal.h>
7#include <asm/siginfo.h> 5#include <asm/siginfo.h>
8 6
9#ifdef __KERNEL__ 7#ifdef __KERNEL__
8#include <linux/list.h>
9#include <linux/spinlock.h>
10 10
11/* 11/*
12 * These values of sa_flags are used only by the kernel as part of the 12 * These values of sa_flags are used only by the kernel as part of the
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f8f234708b98..66f8819f9568 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -14,7 +14,6 @@
14#ifndef _LINUX_SKBUFF_H 14#ifndef _LINUX_SKBUFF_H
15#define _LINUX_SKBUFF_H 15#define _LINUX_SKBUFF_H
16 16
17#include <linux/config.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/compiler.h> 18#include <linux/compiler.h>
20#include <linux/time.h> 19#include <linux/time.h>
@@ -29,6 +28,7 @@
29#include <linux/net.h> 28#include <linux/net.h>
30#include <linux/textsearch.h> 29#include <linux/textsearch.h>
31#include <net/checksum.h> 30#include <net/checksum.h>
31#include <linux/dmaengine.h>
32 32
33#define HAVE_ALLOC_SKB /* For the drivers to know */ 33#define HAVE_ALLOC_SKB /* For the drivers to know */
34#define HAVE_ALIGNABLE_SKB /* Ditto 8) */ 34#define HAVE_ALIGNABLE_SKB /* Ditto 8) */
@@ -209,6 +209,7 @@ enum {
209 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 209 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
210 * @tc_index: Traffic control index 210 * @tc_index: Traffic control index
211 * @tc_verd: traffic control verdict 211 * @tc_verd: traffic control verdict
212 * @secmark: security marking
212 */ 213 */
213 214
214struct sk_buff { 215struct sk_buff {
@@ -285,6 +286,12 @@ struct sk_buff {
285 __u16 tc_verd; /* traffic control verdict */ 286 __u16 tc_verd; /* traffic control verdict */
286#endif 287#endif
287#endif 288#endif
289#ifdef CONFIG_NET_DMA
290 dma_cookie_t dma_cookie;
291#endif
292#ifdef CONFIG_NETWORK_SECMARK
293 __u32 secmark;
294#endif
288 295
289 296
290 /* These elements must be at the end, see alloc_skb() for details. */ 297 /* These elements must be at the end, see alloc_skb() for details. */
@@ -967,15 +974,16 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
967#define NET_SKB_PAD 16 974#define NET_SKB_PAD 16
968#endif 975#endif
969 976
970extern int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc); 977extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
971 978
972static inline void __skb_trim(struct sk_buff *skb, unsigned int len) 979static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
973{ 980{
974 if (!skb->data_len) { 981 if (unlikely(skb->data_len)) {
975 skb->len = len; 982 WARN_ON(1);
976 skb->tail = skb->data + len; 983 return;
977 } else 984 }
978 ___pskb_trim(skb, len, 0); 985 skb->len = len;
986 skb->tail = skb->data + len;
979} 987}
980 988
981/** 989/**
@@ -985,6 +993,7 @@ static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
985 * 993 *
986 * Cut the length of a buffer down by removing data from the tail. If 994 * Cut the length of a buffer down by removing data from the tail. If
987 * the buffer is already under the length specified it is not modified. 995 * the buffer is already under the length specified it is not modified.
996 * The skb must be linear.
988 */ 997 */
989static inline void skb_trim(struct sk_buff *skb, unsigned int len) 998static inline void skb_trim(struct sk_buff *skb, unsigned int len)
990{ 999{
@@ -995,12 +1004,10 @@ static inline void skb_trim(struct sk_buff *skb, unsigned int len)
995 1004
996static inline int __pskb_trim(struct sk_buff *skb, unsigned int len) 1005static inline int __pskb_trim(struct sk_buff *skb, unsigned int len)
997{ 1006{
998 if (!skb->data_len) { 1007 if (skb->data_len)
999 skb->len = len; 1008 return ___pskb_trim(skb, len);
1000 skb->tail = skb->data+len; 1009 __skb_trim(skb, len);
1001 return 0; 1010 return 0;
1002 }
1003 return ___pskb_trim(skb, len, 1);
1004} 1011}
1005 1012
1006static inline int pskb_trim(struct sk_buff *skb, unsigned int len) 1013static inline int pskb_trim(struct sk_buff *skb, unsigned int len)
@@ -1161,18 +1168,34 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i,
1161 return 0; 1168 return 0;
1162} 1169}
1163 1170
1171static inline int __skb_linearize(struct sk_buff *skb)
1172{
1173 return __pskb_pull_tail(skb, skb->data_len) ? 0 : -ENOMEM;
1174}
1175
1164/** 1176/**
1165 * skb_linearize - convert paged skb to linear one 1177 * skb_linearize - convert paged skb to linear one
1166 * @skb: buffer to linarize 1178 * @skb: buffer to linarize
1167 * @gfp: allocation mode
1168 * 1179 *
1169 * If there is no free memory -ENOMEM is returned, otherwise zero 1180 * If there is no free memory -ENOMEM is returned, otherwise zero
1170 * is returned and the old skb data released. 1181 * is returned and the old skb data released.
1171 */ 1182 */
1172extern int __skb_linearize(struct sk_buff *skb, gfp_t gfp); 1183static inline int skb_linearize(struct sk_buff *skb)
1173static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp) 1184{
1185 return skb_is_nonlinear(skb) ? __skb_linearize(skb) : 0;
1186}
1187
1188/**
1189 * skb_linearize_cow - make sure skb is linear and writable
1190 * @skb: buffer to process
1191 *
1192 * If there is no free memory -ENOMEM is returned, otherwise zero
1193 * is returned and the old skb data released.
1194 */
1195static inline int skb_linearize_cow(struct sk_buff *skb)
1174{ 1196{
1175 return __skb_linearize(skb, gfp); 1197 return skb_is_nonlinear(skb) || skb_cloned(skb) ?
1198 __skb_linearize(skb) : 0;
1176} 1199}
1177 1200
1178/** 1201/**
@@ -1396,5 +1419,23 @@ static inline void nf_reset(struct sk_buff *skb)
1396static inline void nf_reset(struct sk_buff *skb) {} 1419static inline void nf_reset(struct sk_buff *skb) {}
1397#endif /* CONFIG_NETFILTER */ 1420#endif /* CONFIG_NETFILTER */
1398 1421
1422#ifdef CONFIG_NETWORK_SECMARK
1423static inline void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from)
1424{
1425 to->secmark = from->secmark;
1426}
1427
1428static inline void skb_init_secmark(struct sk_buff *skb)
1429{
1430 skb->secmark = 0;
1431}
1432#else
1433static inline void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from)
1434{ }
1435
1436static inline void skb_init_secmark(struct sk_buff *skb)
1437{ }
1438#endif
1439
1399#endif /* __KERNEL__ */ 1440#endif /* __KERNEL__ */
1400#endif /* _LINUX_SKBUFF_H */ 1441#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 2d985d59c7b8..9dc93163e065 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -11,7 +11,6 @@
11 11
12typedef struct kmem_cache kmem_cache_t; 12typedef struct kmem_cache kmem_cache_t;
13 13
14#include <linux/config.h> /* kmalloc_sizes.h needs CONFIG_ options */
15#include <linux/gfp.h> 14#include <linux/gfp.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/types.h> 16#include <linux/types.h>
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h
index 621a3d3662f3..367d6c3e8ed4 100644
--- a/include/linux/smb_fs.h
+++ b/include/linux/smb_fs.h
@@ -10,8 +10,6 @@
10#define _LINUX_SMB_FS_H 10#define _LINUX_SMB_FS_H
11 11
12#include <linux/smb.h> 12#include <linux/smb.h>
13#include <linux/smb_fs_i.h>
14#include <linux/smb_fs_sb.h>
15 13
16/* 14/*
17 * ioctl commands 15 * ioctl commands
@@ -24,6 +22,8 @@
24 22
25 23
26#ifdef __KERNEL__ 24#ifdef __KERNEL__
25#include <linux/smb_fs_i.h>
26#include <linux/smb_fs_sb.h>
27 27
28#include <linux/fs.h> 28#include <linux/fs.h>
29#include <linux/pagemap.h> 29#include <linux/pagemap.h>
diff --git a/include/linux/smp.h b/include/linux/smp.h
index e2fa3ab4afc5..c93c3fe4308c 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -6,7 +6,6 @@
6 * Alan Cox. <alan@redhat.com> 6 * Alan Cox. <alan@redhat.com>
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11extern void cpu_idle(void); 10extern void cpu_idle(void);
12 11
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h
index fa1ff3b165fe..cf715a40d833 100644
--- a/include/linux/smp_lock.h
+++ b/include/linux/smp_lock.h
@@ -1,7 +1,6 @@
1#ifndef __LINUX_SMPLOCK_H 1#ifndef __LINUX_SMPLOCK_H
2#define __LINUX_SMPLOCK_H 2#define __LINUX_SMPLOCK_H
3 3
4#include <linux/config.h>
5#ifdef CONFIG_LOCK_KERNEL 4#ifdef CONFIG_LOCK_KERNEL
6#include <linux/sched.h> 5#include <linux/sched.h>
7#include <linux/spinlock.h> 6#include <linux/spinlock.h>
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 9ab2ddd80221..361409094649 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -18,8 +18,6 @@ struct __kernel_sockaddr_storage {
18 18
19#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) 19#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
20 20
21#include <linux/config.h> /* for CONFIG_COMPAT */
22#include <linux/linkage.h>
23#include <asm/socket.h> /* arch-dependent defines */ 21#include <asm/socket.h> /* arch-dependent defines */
24#include <linux/sockios.h> /* the SIOCxxx I/O controls */ 22#include <linux/sockios.h> /* the SIOCxxx I/O controls */
25#include <linux/uio.h> /* iovec support */ 23#include <linux/uio.h> /* iovec support */
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 799be6747944..ae23beef9cc9 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -46,7 +46,6 @@
46 * linux/spinlock.h: builds the final spin_*() APIs. 46 * linux/spinlock.h: builds the final spin_*() APIs.
47 */ 47 */
48 48
49#include <linux/config.h>
50#include <linux/preempt.h> 49#include <linux/preempt.h>
51#include <linux/linkage.h> 50#include <linux/linkage.h>
52#include <linux/compiler.h> 51#include <linux/compiler.h>
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index 151a803ed0ed..5bfc553bdb21 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -4,7 +4,6 @@
4 very heavy lock, which is equivalent to grabbing every spinlock 4 very heavy lock, which is equivalent to grabbing every spinlock
5 (and more). So the "read" side to such a lock is anything which 5 (and more). So the "read" side to such a lock is anything which
6 diables preeempt. */ 6 diables preeempt. */
7#include <linux/config.h>
8#include <linux/cpu.h> 7#include <linux/cpu.h>
9#include <asm/system.h> 8#include <asm/system.h>
10 9
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index be4772ed43c0..a6de332e57d4 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -11,7 +11,6 @@
11 11
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13 13
14#include <linux/config.h>
15#include <linux/sunrpc/sched.h> 14#include <linux/sunrpc/sched.h>
16#include <linux/sunrpc/msg_prot.h> 15#include <linux/sunrpc/msg_prot.h>
17#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index 1a42d902bc11..e4729aa67654 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -9,19 +9,6 @@
9#ifndef _LINUX_SUNRPC_DEBUG_H_ 9#ifndef _LINUX_SUNRPC_DEBUG_H_
10#define _LINUX_SUNRPC_DEBUG_H_ 10#define _LINUX_SUNRPC_DEBUG_H_
11 11
12#include <linux/config.h>
13
14#include <linux/timer.h>
15#include <linux/workqueue.h>
16
17/*
18 * Enable RPC debugging/profiling.
19 */
20#ifdef CONFIG_SYSCTL
21#define RPC_DEBUG
22#endif
23/* #define RPC_PROFILE */
24
25/* 12/*
26 * RPC debug facilities 13 * RPC debug facilities
27 */ 14 */
@@ -41,6 +28,17 @@
41 28
42#ifdef __KERNEL__ 29#ifdef __KERNEL__
43 30
31#include <linux/timer.h>
32#include <linux/workqueue.h>
33
34/*
35 * Enable RPC debugging/profiling.
36 */
37#ifdef CONFIG_SYSCTL
38#define RPC_DEBUG
39#endif
40/* #define RPC_PROFILE */
41
44/* 42/*
45 * Debugging macros etc 43 * Debugging macros etc
46 */ 44 */
diff --git a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h
index d93c24b47f3f..5fa0f2084307 100644
--- a/include/linux/sunrpc/stats.h
+++ b/include/linux/sunrpc/stats.h
@@ -9,7 +9,6 @@
9#ifndef _LINUX_SUNRPC_STATS_H 9#ifndef _LINUX_SUNRPC_STATS_H
10#define _LINUX_SUNRPC_STATS_H 10#define _LINUX_SUNRPC_STATS_H
11 11
12#include <linux/config.h>
13#include <linux/proc_fs.h> 12#include <linux/proc_fs.h>
14 13
15struct rpc_stat { 14struct rpc_stat {
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 37c1c76fd547..96e31aa64cc7 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -6,7 +6,6 @@
6#endif 6#endif
7#include <linux/swap.h> 7#include <linux/swap.h>
8#include <linux/notifier.h> 8#include <linux/notifier.h>
9#include <linux/config.h>
10#include <linux/init.h> 9#include <linux/init.h>
11#include <linux/pm.h> 10#include <linux/pm.h>
12 11
diff --git a/include/linux/swap.h b/include/linux/swap.h
index f03c24719302..aca9bfae208f 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_SWAP_H 1#ifndef _LINUX_SWAP_H
2#define _LINUX_SWAP_H 2#define _LINUX_SWAP_H
3 3
4#include <linux/config.h>
5#include <linux/spinlock.h> 4#include <linux/spinlock.h>
6#include <linux/linkage.h> 5#include <linux/linkage.h>
7#include <linux/mmzone.h> 6#include <linux/mmzone.h>
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 60d49e5456e7..bd67a4413df7 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -54,7 +54,6 @@ struct compat_stat;
54struct compat_timeval; 54struct compat_timeval;
55struct robust_list_head; 55struct robust_list_head;
56 56
57#include <linux/config.h>
58#include <linux/types.h> 57#include <linux/types.h>
59#include <linux/aio_abi.h> 58#include <linux/aio_abi.h>
60#include <linux/capability.h> 59#include <linux/capability.h>
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 76eaeff76f82..cee944dbdcd4 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -313,6 +313,7 @@ enum
313 NET_NF_CONNTRACK_FRAG6_TIMEOUT=29, 313 NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
314 NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30, 314 NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
315 NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31, 315 NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
316 NET_NF_CONNTRACK_CHECKSUM=32,
316}; 317};
317 318
318/* /proc/sys/net/ipv4 */ 319/* /proc/sys/net/ipv4 */
@@ -403,6 +404,8 @@ enum
403 NET_TCP_MTU_PROBING=113, 404 NET_TCP_MTU_PROBING=113,
404 NET_TCP_BASE_MSS=114, 405 NET_TCP_BASE_MSS=114,
405 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115, 406 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
407 NET_TCP_DMA_COPYBREAK=116,
408 NET_TCP_SLOW_START_AFTER_IDLE=117,
406}; 409};
407 410
408enum { 411enum {
@@ -491,6 +494,7 @@ enum
491 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25, 494 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
492 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26, 495 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
493 NET_IPV4_NF_CONNTRACK_COUNT=27, 496 NET_IPV4_NF_CONNTRACK_COUNT=27,
497 NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
494}; 498};
495 499
496/* /proc/sys/net/ipv6 */ 500/* /proc/sys/net/ipv6 */
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index 2a4b432e1176..166a2e58c287 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -37,11 +37,27 @@ struct sysdev_class {
37 struct kset kset; 37 struct kset kset;
38}; 38};
39 39
40struct sysdev_class_attribute {
41 struct attribute attr;
42 ssize_t (*show)(struct sysdev_class *, char *);
43 ssize_t (*store)(struct sysdev_class *, const char *, size_t);
44};
45
46#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
47struct sysdev_class_attribute attr_##_name = { \
48 .attr = {.name = __stringify(_name), .mode = _mode }, \
49 .show = _show, \
50 .store = _store, \
51};
52
40 53
41extern int sysdev_class_register(struct sysdev_class *); 54extern int sysdev_class_register(struct sysdev_class *);
42extern void sysdev_class_unregister(struct sysdev_class *); 55extern void sysdev_class_unregister(struct sysdev_class *);
43 56
44 57extern int sysdev_class_create_file(struct sysdev_class *,
58 struct sysdev_class_attribute *);
59extern void sysdev_class_remove_file(struct sysdev_class *,
60 struct sysdev_class_attribute *);
45/** 61/**
46 * Auxillary system device drivers. 62 * Auxillary system device drivers.
47 */ 63 */
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h
index ea819b89c235..4812ff60561c 100644
--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -11,7 +11,6 @@
11 * based upon discusions in irc://irc.openprojects.net/#kernelnewbies 11 * based upon discusions in irc://irc.openprojects.net/#kernelnewbies
12 */ 12 */
13 13
14#include <linux/config.h>
15 14
16struct pt_regs; 15struct pt_regs;
17struct tty_struct; 16struct tty_struct;
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 542d39596bd8..420a689c3fb4 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -18,6 +18,7 @@
18#define _LINUX_TCP_H 18#define _LINUX_TCP_H
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/dmaengine.h>
21#include <asm/byteorder.h> 22#include <asm/byteorder.h>
22 23
23struct tcphdr { 24struct tcphdr {
@@ -159,7 +160,6 @@ struct tcp_info
159 160
160#ifdef __KERNEL__ 161#ifdef __KERNEL__
161 162
162#include <linux/config.h>
163#include <linux/skbuff.h> 163#include <linux/skbuff.h>
164#include <net/sock.h> 164#include <net/sock.h>
165#include <net/inet_connection_sock.h> 165#include <net/inet_connection_sock.h>
@@ -233,6 +233,13 @@ struct tcp_sock {
233 struct iovec *iov; 233 struct iovec *iov;
234 int memory; 234 int memory;
235 int len; 235 int len;
236#ifdef CONFIG_NET_DMA
237 /* members for async copy */
238 struct dma_chan *dma_chan;
239 int wakeup;
240 struct dma_pinned_list *pinned_list;
241 dma_cookie_t dma_cookie;
242#endif
236 } ucopy; 243 } ucopy;
237 244
238 __u32 snd_wl1; /* Sequence for window update */ 245 __u32 snd_wl1; /* Sequence for window update */
diff --git a/include/linux/threads.h b/include/linux/threads.h
index e646bcdf2614..38d1a5d6568e 100644
--- a/include/linux/threads.h
+++ b/include/linux/threads.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_THREADS_H 1#ifndef _LINUX_THREADS_H
2#define _LINUX_THREADS_H 2#define _LINUX_THREADS_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * The default limit for the nr of threads is now in 6 * The default limit for the nr of threads is now in
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 0a485beba9f5..c982304dbafd 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_TIMER_H 1#ifndef _LINUX_TIMER_H
2#define _LINUX_TIMER_H 2#define _LINUX_TIMER_H
3 3
4#include <linux/config.h>
5#include <linux/list.h> 4#include <linux/list.h>
6#include <linux/spinlock.h> 5#include <linux/spinlock.h>
7#include <linux/stddef.h> 6#include <linux/stddef.h>
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 03914b7e41b1..34d3ccff7bbb 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -53,7 +53,6 @@
53#ifndef _LINUX_TIMEX_H 53#ifndef _LINUX_TIMEX_H
54#define _LINUX_TIMEX_H 54#define _LINUX_TIMEX_H
55 55
56#include <linux/config.h>
57#include <linux/compiler.h> 56#include <linux/compiler.h>
58#include <linux/time.h> 57#include <linux/time.h>
59 58
diff --git a/include/linux/tty.h b/include/linux/tty.h
index f13f49afe198..cb35ca50a0a6 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -16,7 +16,6 @@
16 consoles 16 and higher (since it returns a short) */ 16 consoles 16 and higher (since it returns a short) */
17 17
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19#include <linux/config.h>
20#include <linux/fs.h> 19#include <linux/fs.h>
21#include <linux/major.h> 20#include <linux/major.h>
22#include <linux/termios.h> 21#include <linux/termios.h>
@@ -291,7 +290,9 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc);
291extern int tty_unregister_ldisc(int disc); 290extern int tty_unregister_ldisc(int disc);
292extern int tty_register_driver(struct tty_driver *driver); 291extern int tty_register_driver(struct tty_driver *driver);
293extern int tty_unregister_driver(struct tty_driver *driver); 292extern int tty_unregister_driver(struct tty_driver *driver);
294extern void tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev); 293extern struct class_device *tty_register_device(struct tty_driver *driver,
294 unsigned index,
295 struct device *dev);
295extern void tty_unregister_device(struct tty_driver *driver, unsigned index); 296extern void tty_unregister_device(struct tty_driver *driver, unsigned index);
296extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, 297extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
297 int buflen); 298 int buflen);
diff --git a/include/linux/types.h b/include/linux/types.h
index 1046c7ad86d9..a5e46e783ffa 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -2,7 +2,6 @@
2#define _LINUX_TYPES_H 2#define _LINUX_TYPES_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5#include <linux/config.h>
6 5
7#define BITS_TO_LONGS(bits) \ 6#define BITS_TO_LONGS(bits) \
8 (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) 7 (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 85a55658831c..bdd39be09406 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -35,7 +35,6 @@ struct udphdr {
35#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ 35#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
36 36
37#ifdef __KERNEL__ 37#ifdef __KERNEL__
38#include <linux/config.h>
39#include <linux/types.h> 38#include <linux/types.h>
40 39
41#include <net/inet_sock.h> 40#include <net/inet_sock.h>
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 843aeaaa79d4..86b5b4271b5a 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -32,7 +32,6 @@
32 32
33#include <linux/types.h> 33#include <linux/types.h>
34#include <linux/kernel.h> 34#include <linux/kernel.h>
35#include <linux/time.h>
36#include <linux/stat.h> 35#include <linux/stat.h>
37#include <linux/fs.h> 36#include <linux/fs.h>
38 37
diff --git a/include/linux/unistd.h b/include/linux/unistd.h
index 10ed9834b822..c18c60f3254e 100644
--- a/include/linux/unistd.h
+++ b/include/linux/unistd.h
@@ -1,7 +1,9 @@
1#ifndef _LINUX_UNISTD_H_ 1#ifndef _LINUX_UNISTD_H_
2#define _LINUX_UNISTD_H_ 2#define _LINUX_UNISTD_H_
3 3
4#ifdef __KERNEL__
4extern int errno; 5extern int errno;
6#endif
5 7
6/* 8/*
7 * Include machine specific syscallX macros 9 * Include machine specific syscallX macros
diff --git a/include/linux/usb.h b/include/linux/usb.h
index e34e5e3dce52..8dead32e7ebf 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -10,7 +10,6 @@
10 10
11#ifdef __KERNEL__ 11#ifdef __KERNEL__
12 12
13#include <linux/config.h>
14#include <linux/errno.h> /* for -ENODEV */ 13#include <linux/errno.h> /* for -ENODEV */
15#include <linux/delay.h> /* for mdelay() */ 14#include <linux/delay.h> /* for mdelay() */
16#include <linux/interrupt.h> /* for in_interrupt() */ 15#include <linux/interrupt.h> /* for in_interrupt() */
@@ -41,6 +40,8 @@ struct usb_driver;
41 * Devices may also have class-specific or vendor-specific descriptors. 40 * Devices may also have class-specific or vendor-specific descriptors.
42 */ 41 */
43 42
43struct ep_device;
44
44/** 45/**
45 * struct usb_host_endpoint - host-side endpoint descriptor and queue 46 * struct usb_host_endpoint - host-side endpoint descriptor and queue
46 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder 47 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder
@@ -58,7 +59,7 @@ struct usb_host_endpoint {
58 struct usb_endpoint_descriptor desc; 59 struct usb_endpoint_descriptor desc;
59 struct list_head urb_list; 60 struct list_head urb_list;
60 void *hcpriv; 61 void *hcpriv;
61 struct kobject *kobj; /* For sysfs info */ 62 struct ep_device *ep_dev; /* For sysfs info */
62 63
63 unsigned char *extra; /* Extra descriptors */ 64 unsigned char *extra; /* Extra descriptors */
64 int extralen; 65 int extralen;
@@ -102,7 +103,8 @@ enum usb_interface_condition {
102 * @condition: binding state of the interface: not bound, binding 103 * @condition: binding state of the interface: not bound, binding
103 * (in probe()), bound to a driver, or unbinding (in disconnect()) 104 * (in probe()), bound to a driver, or unbinding (in disconnect())
104 * @dev: driver model's view of this device 105 * @dev: driver model's view of this device
105 * @class_dev: driver model's class view of this device. 106 * @usb_dev: if an interface is bound to the USB major, this will point
107 * to the sysfs representation for that device.
106 * 108 *
107 * USB device drivers attach to interfaces on a physical device. Each 109 * USB device drivers attach to interfaces on a physical device. Each
108 * interface encapsulates a single high level function, such as feeding 110 * interface encapsulates a single high level function, such as feeding
@@ -142,7 +144,7 @@ struct usb_interface {
142 * bound to */ 144 * bound to */
143 enum usb_interface_condition condition; /* state of binding */ 145 enum usb_interface_condition condition; /* state of binding */
144 struct device dev; /* interface specific device info */ 146 struct device dev; /* interface specific device info */
145 struct class_device *class_dev; 147 struct device *usb_dev; /* pointer to the usb class's device, if any */
146}; 148};
147#define to_usb_interface(d) container_of(d, struct usb_interface, dev) 149#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
148#define interface_to_usbdev(intf) \ 150#define interface_to_usbdev(intf) \
@@ -359,7 +361,7 @@ struct usb_device {
359 char *serial; /* iSerialNumber string, if present */ 361 char *serial; /* iSerialNumber string, if present */
360 362
361 struct list_head filelist; 363 struct list_head filelist;
362 struct class_device *class_dev; 364 struct device *usbfs_dev;
363 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 365 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
364 366
365 /* 367 /*
@@ -387,6 +389,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,
387 389
388/* USB port reset for device reinitialization */ 390/* USB port reset for device reinitialization */
389extern int usb_reset_device(struct usb_device *dev); 391extern int usb_reset_device(struct usb_device *dev);
392extern int usb_reset_composite_device(struct usb_device *dev,
393 struct usb_interface *iface);
390 394
391extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); 395extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
392 396
@@ -555,6 +559,10 @@ struct usb_dynids {
555 * do (or don't) show up otherwise in the filesystem. 559 * do (or don't) show up otherwise in the filesystem.
556 * @suspend: Called when the device is going to be suspended by the system. 560 * @suspend: Called when the device is going to be suspended by the system.
557 * @resume: Called when the device is being resumed by the system. 561 * @resume: Called when the device is being resumed by the system.
562 * @pre_reset: Called by usb_reset_composite_device() when the device
563 * is about to be reset.
564 * @post_reset: Called by usb_reset_composite_device() after the device
565 * has been reset.
558 * @id_table: USB drivers use ID table to support hotplugging. 566 * @id_table: USB drivers use ID table to support hotplugging.
559 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set 567 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
560 * or your driver's probe function will never get called. 568 * or your driver's probe function will never get called.
@@ -593,6 +601,9 @@ struct usb_driver {
593 int (*suspend) (struct usb_interface *intf, pm_message_t message); 601 int (*suspend) (struct usb_interface *intf, pm_message_t message);
594 int (*resume) (struct usb_interface *intf); 602 int (*resume) (struct usb_interface *intf);
595 603
604 void (*pre_reset) (struct usb_interface *intf);
605 void (*post_reset) (struct usb_interface *intf);
606
596 const struct usb_device_id *id_table; 607 const struct usb_device_id *id_table;
597 608
598 struct usb_dynids dynids; 609 struct usb_dynids dynids;
@@ -1009,6 +1020,8 @@ void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe,
1009extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, 1020extern int usb_control_msg(struct usb_device *dev, unsigned int pipe,
1010 __u8 request, __u8 requesttype, __u16 value, __u16 index, 1021 __u8 request, __u8 requesttype, __u16 value, __u16 index,
1011 void *data, __u16 size, int timeout); 1022 void *data, __u16 size, int timeout);
1023extern int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe,
1024 void *data, int len, int *actual_length, int timeout);
1012extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, 1025extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
1013 void *data, int len, int *actual_length, 1026 void *data, int len, int *actual_length,
1014 int timeout); 1027 int timeout);
diff --git a/include/linux/usb_cdc.h b/include/linux/usb/cdc.h
index ba617c372455..ba617c372455 100644
--- a/include/linux/usb_cdc.h
+++ b/include/linux/usb/cdc.h
diff --git a/include/linux/usb_input.h b/include/linux/usb/input.h
index 716e0cc16043..716e0cc16043 100644
--- a/include/linux/usb_input.h
+++ b/include/linux/usb/input.h
diff --git a/include/linux/usb_isp116x.h b/include/linux/usb/isp116x.h
index 436dd8a2b64a..436dd8a2b64a 100644
--- a/include/linux/usb_isp116x.h
+++ b/include/linux/usb/isp116x.h
diff --git a/include/linux/usb_sl811.h b/include/linux/usb/sl811.h
index 4f2d012d7309..397ee3b3d7f3 100644
--- a/include/linux/usb_sl811.h
+++ b/include/linux/usb/sl811.h
@@ -14,13 +14,13 @@ struct sl811_platform_data {
14 u8 power; 14 u8 power;
15 15
16 /* sl811 relies on an external source of VBUS current */ 16 /* sl811 relies on an external source of VBUS current */
17 void (*port_power)(struct device *dev, int is_on); 17 void (*port_power)(struct device *dev, int is_on);
18 18
19 /* pulse sl811 nRST (probably with a GPIO) */ 19 /* pulse sl811 nRST (probably with a GPIO) */
20 void (*reset)(struct device *dev); 20 void (*reset)(struct device *dev);
21 21
22 // some boards need something like these: 22 // some boards need something like these:
23 // int (*check_overcurrent)(struct device *dev); 23 // int (*check_overcurrent)(struct device *dev);
24 // void (*clock_enable)(struct device *dev, int is_on); 24 // void (*clock_enable)(struct device *dev, int is_on);
25}; 25};
26 26
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index b2d08984a9f7..608487a62c98 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -9,7 +9,6 @@
9#ifndef __LINUX_USB_USUAL_H 9#ifndef __LINUX_USB_USUAL_H
10#define __LINUX_USB_USUAL_H 10#define __LINUX_USB_USUAL_H
11 11
12#include <linux/config.h>
13 12
14/* We should do this for cleanliness... But other usb_foo.h do not do this. */ 13/* We should do this for cleanliness... But other usb_foo.h do not do this. */
15/* #include <linux/usb.h> */ 14/* #include <linux/usb.h> */
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 8859f0b41543..7b7aadb69092 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -123,6 +123,7 @@ struct usbdevfs_hub_portinfo {
123 char port [127]; /* e.g. port 3 connects to device 27 */ 123 char port [127]; /* e.g. port 3 connects to device 27 */
124}; 124};
125 125
126#ifdef __KERNEL__
126#ifdef CONFIG_COMPAT 127#ifdef CONFIG_COMPAT
127#include <linux/compat.h> 128#include <linux/compat.h>
128struct usbdevfs_urb32 { 129struct usbdevfs_urb32 {
@@ -147,6 +148,7 @@ struct usbdevfs_ioctl32 {
147 compat_caddr_t data; 148 compat_caddr_t data;
148}; 149};
149#endif 150#endif
151#endif /* __KERNEL__ */
150 152
151#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) 153#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
152#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) 154#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer)
diff --git a/include/linux/vt_buffer.h b/include/linux/vt_buffer.h
index 1f7ba3629053..057db7d2f448 100644
--- a/include/linux/vt_buffer.h
+++ b/include/linux/vt_buffer.h
@@ -13,7 +13,6 @@
13#ifndef _LINUX_VT_BUFFER_H_ 13#ifndef _LINUX_VT_BUFFER_H_
14#define _LINUX_VT_BUFFER_H_ 14#define _LINUX_VT_BUFFER_H_
15 15
16#include <linux/config.h>
17 16
18#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE) 17#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE)
19#include <asm/vga.h> 18#include <asm/vga.h>
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index fab5aed8ca31..940d0261a545 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -6,7 +6,6 @@
6 * with information needed by the vt package 6 * with information needed by the vt package
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/vt.h> 9#include <linux/vt.h>
11#include <linux/kd.h> 10#include <linux/kd.h>
12#include <linux/tty.h> 11#include <linux/tty.h>
diff --git a/include/linux/wait.h b/include/linux/wait.h
index d28518236b62..544e855c7c02 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -19,7 +19,6 @@
19 19
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#include <linux/config.h>
23#include <linux/list.h> 22#include <linux/list.h>
24#include <linux/stddef.h> 23#include <linux/stddef.h>
25#include <linux/spinlock.h> 24#include <linux/spinlock.h>
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index 1b6b76a4eb54..2cd05013edfc 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -44,8 +44,6 @@
44* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h). 44* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h).
45*****************************************************************************/ 45*****************************************************************************/
46 46
47#include <linux/spinlock.h> /* Support for SMP Locking */
48
49#ifndef _ROUTER_H 47#ifndef _ROUTER_H
50#define _ROUTER_H 48#define _ROUTER_H
51 49
@@ -457,6 +455,8 @@ typedef struct wanif_conf
457#include <linux/fs.h> /* support for device drivers */ 455#include <linux/fs.h> /* support for device drivers */
458#include <linux/proc_fs.h> /* proc filesystem pragmatics */ 456#include <linux/proc_fs.h> /* proc filesystem pragmatics */
459#include <linux/netdevice.h> /* support for network drivers */ 457#include <linux/netdevice.h> /* support for network drivers */
458#include <linux/spinlock.h> /* Support for SMP Locking */
459
460/*---------------------------------------------------------------------------- 460/*----------------------------------------------------------------------------
461 * WAN device data space. 461 * WAN device data space.
462 */ 462 */
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 6b42cc474c01..46a15c7a1a13 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -118,6 +118,10 @@ enum
118 XFRM_SHARE_UNIQUE /* Use once */ 118 XFRM_SHARE_UNIQUE /* Use once */
119}; 119};
120 120
121#define XFRM_MODE_TRANSPORT 0
122#define XFRM_MODE_TUNNEL 1
123#define XFRM_MODE_MAX 2
124
121/* Netlink configuration messages. */ 125/* Netlink configuration messages. */
122enum { 126enum {
123 XFRM_MSG_BASE = 0x10, 127 XFRM_MSG_BASE = 0x10,
diff --git a/include/linux/zconf.h b/include/linux/zconf.h
index f1cfd66b9554..0beb75e38caa 100644
--- a/include/linux/zconf.h
+++ b/include/linux/zconf.h
@@ -35,6 +35,18 @@
35# define MAX_WBITS 15 /* 32K LZ77 window */ 35# define MAX_WBITS 15 /* 32K LZ77 window */
36#endif 36#endif
37 37
38/* default windowBits for decompression. MAX_WBITS is for compression only */
39#ifndef DEF_WBITS
40# define DEF_WBITS MAX_WBITS
41#endif
42
43/* default memLevel */
44#if MAX_MEM_LEVEL >= 8
45# define DEF_MEM_LEVEL 8
46#else
47# define DEF_MEM_LEVEL MAX_MEM_LEVEL
48#endif
49
38 /* Type declarations */ 50 /* Type declarations */
39 51
40typedef unsigned char Byte; /* 8 bits */ 52typedef unsigned char Byte; /* 8 bits */
diff --git a/include/linux/zlib.h b/include/linux/zlib.h
index 4fa32f0d4df8..9e3192a7dc6f 100644
--- a/include/linux/zlib.h
+++ b/include/linux/zlib.h
@@ -1,7 +1,6 @@
1/* zlib.h -- interface of the 'zlib' general purpose compression library 1/* zlib.h -- interface of the 'zlib' general purpose compression library
2 version 1.1.3, July 9th, 1998
3 2
4 Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler 3 Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
5 4
6 This software is provided 'as-is', without any express or implied 5 This software is provided 'as-is', without any express or implied
7 warranty. In no event will the authors be held liable for any damages 6 warranty. In no event will the authors be held liable for any damages
@@ -24,7 +23,7 @@
24 23
25 24
26 The data format used by the zlib library is described by RFCs (Request for 25 The data format used by the zlib library is described by RFCs (Request for
27 Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt 26 Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
28 (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). 27 (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
29*/ 28*/
30 29
@@ -33,7 +32,22 @@
33 32
34#include <linux/zconf.h> 33#include <linux/zconf.h>
35 34
36#define ZLIB_VERSION "1.1.3" 35/* zlib deflate based on ZLIB_VERSION "1.1.3" */
36/* zlib inflate based on ZLIB_VERSION "1.2.3" */
37
38/*
39 This is a modified version of zlib for use inside the Linux kernel.
40 The main changes are to perform all memory allocation in advance.
41
42 Inflation Changes:
43 * Z_PACKET_FLUSH is added and used by ppp_deflate. Before returning
44 this checks there is no more input data available and the next data
45 is a STORED block. It also resets the mode to be read for the next
46 data, all as per PPP requirements.
47 * Addition of zlib_inflateIncomp which copies incompressible data into
48 the history window and adjusts the accoutning without calling
49 zlib_inflate itself to inflate the data.
50*/
37 51
38/* 52/*
39 The 'zlib' compression library provides in-memory compression and 53 The 'zlib' compression library provides in-memory compression and
@@ -48,9 +62,18 @@
48 application must provide more input and/or consume the output 62 application must provide more input and/or consume the output
49 (providing more output space) before each call. 63 (providing more output space) before each call.
50 64
65 The compressed data format used by default by the in-memory functions is
66 the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
67 around a deflate stream, which is itself documented in RFC 1951.
68
51 The library also supports reading and writing files in gzip (.gz) format 69 The library also supports reading and writing files in gzip (.gz) format
52 with an interface similar to that of stdio. 70 with an interface similar to that of stdio.
53 71
72 The zlib format was designed to be compact and fast for use in memory
73 and on communications channels. The gzip format was designed for single-
74 file compression on file systems, has a larger header than zlib to maintain
75 directory information, and uses a different, slower check method than zlib.
76
54 The library does not install any signal handler. The decoder checks 77 The library does not install any signal handler. The decoder checks
55 the consistency of the compressed data, so the library should never 78 the consistency of the compressed data, so the library should never
56 crash even in case of corrupted input. 79 crash even in case of corrupted input.
@@ -119,7 +142,8 @@ typedef z_stream *z_streamp;
119#define Z_SYNC_FLUSH 3 142#define Z_SYNC_FLUSH 3
120#define Z_FULL_FLUSH 4 143#define Z_FULL_FLUSH 4
121#define Z_FINISH 5 144#define Z_FINISH 5
122/* Allowed flush values; see deflate() below for details */ 145#define Z_BLOCK 6 /* Only for inflate at present */
146/* Allowed flush values; see deflate() and inflate() below for details */
123 147
124#define Z_OK 0 148#define Z_OK 0
125#define Z_STREAM_END 1 149#define Z_STREAM_END 1
@@ -155,13 +179,6 @@ typedef z_stream *z_streamp;
155 179
156 /* basic functions */ 180 /* basic functions */
157 181
158extern const char * zlib_zlibVersion (void);
159/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
160 If the first character differs, the library code actually used is
161 not compatible with the zlib.h header file used by the application.
162 This check is automatically made by deflateInit and inflateInit.
163 */
164
165extern int zlib_deflate_workspacesize (void); 182extern int zlib_deflate_workspacesize (void);
166/* 183/*
167 Returns the number of bytes that needs to be allocated for a per- 184 Returns the number of bytes that needs to be allocated for a per-
@@ -315,9 +332,9 @@ extern int zlib_inflateInit (z_streamp strm);
315extern int zlib_inflate (z_streamp strm, int flush); 332extern int zlib_inflate (z_streamp strm, int flush);
316/* 333/*
317 inflate decompresses as much data as possible, and stops when the input 334 inflate decompresses as much data as possible, and stops when the input
318 buffer becomes empty or the output buffer becomes full. It may some 335 buffer becomes empty or the output buffer becomes full. It may introduce
319 introduce some output latency (reading input without producing any output) 336 some output latency (reading input without producing any output) except when
320 except when forced to flush. 337 forced to flush.
321 338
322 The detailed semantics are as follows. inflate performs one or both of the 339 The detailed semantics are as follows. inflate performs one or both of the
323 following actions: 340 following actions:
@@ -341,11 +358,26 @@ extern int zlib_inflate (z_streamp strm, int flush);
341 must be called again after making room in the output buffer because there 358 must be called again after making room in the output buffer because there
342 might be more output pending. 359 might be more output pending.
343 360
344 If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much 361 The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
345 output as possible to the output buffer. The flushing behavior of inflate is 362 Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
346 not specified for values of the flush parameter other than Z_SYNC_FLUSH 363 output as possible to the output buffer. Z_BLOCK requests that inflate() stop
347 and Z_FINISH, but the current implementation actually flushes as much output 364 if and when it gets to the next deflate block boundary. When decoding the
348 as possible anyway. 365 zlib or gzip format, this will cause inflate() to return immediately after
366 the header and before the first block. When doing a raw inflate, inflate()
367 will go ahead and process the first block, and will return when it gets to
368 the end of that block, or when it runs out of data.
369
370 The Z_BLOCK option assists in appending to or combining deflate streams.
371 Also to assist in this, on return inflate() will set strm->data_type to the
372 number of unused bits in the last byte taken from strm->next_in, plus 64
373 if inflate() is currently decoding the last block in the deflate stream,
374 plus 128 if inflate() returned immediately after decoding an end-of-block
375 code or decoding the complete header up to just before the first byte of the
376 deflate stream. The end-of-block will not be indicated until all of the
377 uncompressed data from that block has been written to strm->next_out. The
378 number of unused bits may in general be greater than seven, except when
379 bit 7 of data_type is set, in which case the number of unused bits will be
380 less than eight.
349 381
350 inflate() should normally be called until it returns Z_STREAM_END or an 382 inflate() should normally be called until it returns Z_STREAM_END or an
351 error. However if all decompression is to be performed in a single step 383 error. However if all decompression is to be performed in a single step
@@ -355,29 +387,44 @@ extern int zlib_inflate (z_streamp strm, int flush);
355 uncompressed data. (The size of the uncompressed data may have been saved 387 uncompressed data. (The size of the uncompressed data may have been saved
356 by the compressor for this purpose.) The next operation on this stream must 388 by the compressor for this purpose.) The next operation on this stream must
357 be inflateEnd to deallocate the decompression state. The use of Z_FINISH 389 be inflateEnd to deallocate the decompression state. The use of Z_FINISH
358 is never required, but can be used to inform inflate that a faster routine 390 is never required, but can be used to inform inflate that a faster approach
359 may be used for the single inflate() call. 391 may be used for the single inflate() call.
360 392
361 If a preset dictionary is needed at this point (see inflateSetDictionary 393 In this implementation, inflate() always flushes as much output as
362 below), inflate sets strm-adler to the adler32 checksum of the 394 possible to the output buffer, and always uses the faster approach on the
363 dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise 395 first call. So the only effect of the flush parameter in this implementation
364 it sets strm->adler to the adler32 checksum of all output produced 396 is on the return value of inflate(), as noted below, or when it returns early
365 so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or 397 because Z_BLOCK is used.
366 an error code as described below. At the end of the stream, inflate() 398
367 checks that its computed adler32 checksum is equal to that saved by the 399 If a preset dictionary is needed after this call (see inflateSetDictionary
368 compressor and returns Z_STREAM_END only if the checksum is correct. 400 below), inflate sets strm->adler to the adler32 checksum of the dictionary
401 chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
402 strm->adler to the adler32 checksum of all output produced so far (that is,
403 total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
404 below. At the end of the stream, inflate() checks that its computed adler32
405 checksum is equal to that saved by the compressor and returns Z_STREAM_END
406 only if the checksum is correct.
407
408 inflate() will decompress and check either zlib-wrapped or gzip-wrapped
409 deflate data. The header type is detected automatically. Any information
410 contained in the gzip header is not retained, so applications that need that
411 information should instead use raw inflate, see inflateInit2() below, or
412 inflateBack() and perform their own processing of the gzip header and
413 trailer.
369 414
370 inflate() returns Z_OK if some progress has been made (more input processed 415 inflate() returns Z_OK if some progress has been made (more input processed
371 or more output produced), Z_STREAM_END if the end of the compressed data has 416 or more output produced), Z_STREAM_END if the end of the compressed data has
372 been reached and all uncompressed output has been produced, Z_NEED_DICT if a 417 been reached and all uncompressed output has been produced, Z_NEED_DICT if a
373 preset dictionary is needed at this point, Z_DATA_ERROR if the input data was 418 preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
374 corrupted (input stream not conforming to the zlib format or incorrect 419 corrupted (input stream not conforming to the zlib format or incorrect check
375 adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent 420 value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
376 (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not 421 if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
377 enough memory, Z_BUF_ERROR if no progress is possible or if there was not 422 Z_BUF_ERROR if no progress is possible or if there was not enough room in the
378 enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR 423 output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
379 case, the application may then call inflateSync to look for a good 424 inflate() can be called again with more input and more output space to
380 compression block. 425 continue decompressing. If Z_DATA_ERROR is returned, the application may then
426 call inflateSync() to look for a good compression block if a partial recovery
427 of the data is desired.
381*/ 428*/
382 429
383 430
@@ -547,16 +594,36 @@ extern int inflateInit2 (z_streamp strm, int windowBits);
547 The windowBits parameter is the base two logarithm of the maximum window 594 The windowBits parameter is the base two logarithm of the maximum window
548 size (the size of the history buffer). It should be in the range 8..15 for 595 size (the size of the history buffer). It should be in the range 8..15 for
549 this version of the library. The default value is 15 if inflateInit is used 596 this version of the library. The default value is 15 if inflateInit is used
550 instead. If a compressed stream with a larger window size is given as 597 instead. windowBits must be greater than or equal to the windowBits value
551 input, inflate() will return with the error code Z_DATA_ERROR instead of 598 provided to deflateInit2() while compressing, or it must be equal to 15 if
552 trying to allocate a larger window. 599 deflateInit2() was not used. If a compressed stream with a larger window
553 600 size is given as input, inflate() will return with the error code
554 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 601 Z_DATA_ERROR instead of trying to allocate a larger window.
555 memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative 602
556 memLevel). msg is set to null if there is no error message. inflateInit2 603 windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
557 does not perform any decompression apart from reading the zlib header if 604 determines the window size. inflate() will then process raw deflate data,
558 present: this will be done by inflate(). (So next_in and avail_in may be 605 not looking for a zlib or gzip header, not generating a check value, and not
559 modified, but next_out and avail_out are unchanged.) 606 looking for any check values for comparison at the end of the stream. This
607 is for use with other formats that use the deflate compressed data format
608 such as zip. Those formats provide their own check values. If a custom
609 format is developed using the raw deflate format for compressed data, it is
610 recommended that a check value such as an adler32 or a crc32 be applied to
611 the uncompressed data as is done in the zlib, gzip, and zip formats. For
612 most applications, the zlib format should be used as is. Note that comments
613 above on the use in deflateInit2() applies to the magnitude of windowBits.
614
615 windowBits can also be greater than 15 for optional gzip decoding. Add
616 32 to windowBits to enable zlib and gzip decoding with automatic header
617 detection, or add 16 to decode only the gzip format (the zlib format will
618 return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is
619 a crc32 instead of an adler32.
620
621 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
622 memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
623 is set to null if there is no error message. inflateInit2 does not perform
624 any decompression apart from reading the zlib header if present: this will
625 be done by inflate(). (So next_in and avail_in may be modified, but next_out
626 and avail_out are unchanged.)
560*/ 627*/
561 628
562extern int zlib_inflateSetDictionary (z_streamp strm, 629extern int zlib_inflateSetDictionary (z_streamp strm,
@@ -564,16 +631,19 @@ extern int zlib_inflateSetDictionary (z_streamp strm,
564 uInt dictLength); 631 uInt dictLength);
565/* 632/*
566 Initializes the decompression dictionary from the given uncompressed byte 633 Initializes the decompression dictionary from the given uncompressed byte
567 sequence. This function must be called immediately after a call of inflate 634 sequence. This function must be called immediately after a call of inflate,
568 if this call returned Z_NEED_DICT. The dictionary chosen by the compressor 635 if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
569 can be determined from the Adler32 value returned by this call of 636 can be determined from the adler32 value returned by that call of inflate.
570 inflate. The compressor and decompressor must use exactly the same 637 The compressor and decompressor must use exactly the same dictionary (see
571 dictionary (see deflateSetDictionary). 638 deflateSetDictionary). For raw inflate, this function can be called
639 immediately after inflateInit2() or inflateReset() and before any call of
640 inflate() to set the dictionary. The application must insure that the
641 dictionary that was used for compression is provided.
572 642
573 inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a 643 inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
574 parameter is invalid (such as NULL dictionary) or the stream state is 644 parameter is invalid (such as NULL dictionary) or the stream state is
575 inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the 645 inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
576 expected one (incorrect Adler32 value). inflateSetDictionary does not 646 expected one (incorrect adler32 value). inflateSetDictionary does not
577 perform any decompression: this will be done by subsequent calls of 647 perform any decompression: this will be done by subsequent calls of
578 inflate(). 648 inflate().
579*/ 649*/
@@ -614,40 +684,19 @@ extern int zlib_inflateIncomp (z_stream *strm);
614 containing the data at next_in (except that the data is not output). 684 containing the data at next_in (except that the data is not output).
615*/ 685*/
616 686
617 /* various hacks, don't look :) */
618
619/* deflateInit and inflateInit are macros to allow checking the zlib version
620 * and the compiler's view of z_stream:
621 */
622extern int zlib_deflateInit_ (z_streamp strm, int level,
623 const char *version, int stream_size);
624extern int zlib_inflateInit_ (z_streamp strm,
625 const char *version, int stream_size);
626extern int zlib_deflateInit2_ (z_streamp strm, int level, int method,
627 int windowBits, int memLevel,
628 int strategy, const char *version,
629 int stream_size);
630extern int zlib_inflateInit2_ (z_streamp strm, int windowBits,
631 const char *version, int stream_size);
632#define zlib_deflateInit(strm, level) \ 687#define zlib_deflateInit(strm, level) \
633 zlib_deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 688 zlib_deflateInit2((strm), (level), Z_DEFLATED, MAX_WBITS, \
689 DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY)
634#define zlib_inflateInit(strm) \ 690#define zlib_inflateInit(strm) \
635 zlib_inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 691 zlib_inflateInit2((strm), DEF_WBITS)
636#define zlib_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
637 zlib_deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
638 (strategy), ZLIB_VERSION, sizeof(z_stream))
639#define zlib_inflateInit2(strm, windowBits) \
640 zlib_inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
641 692
693extern int zlib_deflateInit2(z_streamp strm, int level, int method,
694 int windowBits, int memLevel,
695 int strategy);
696extern int zlib_inflateInit2(z_streamp strm, int windowBits);
642 697
643#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) 698#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
644 struct internal_state {int dummy;}; /* hack for buggy compilers */ 699 struct internal_state {int dummy;}; /* hack for buggy compilers */
645#endif 700#endif
646 701
647extern const char * zlib_zError (int err);
648#if 0
649extern int zlib_inflateSyncPoint (z_streamp z);
650#endif
651extern const uLong * zlib_get_crc_table (void);
652
653#endif /* _ZLIB_H */ 702#endif /* _ZLIB_H */
diff --git a/include/linux/zutil.h b/include/linux/zutil.h
index ee0c59cf2136..6adfa9a6ffe9 100644
--- a/include/linux/zutil.h
+++ b/include/linux/zutil.h
@@ -23,18 +23,6 @@ typedef unsigned long ulg;
23 23
24 /* common constants */ 24 /* common constants */
25 25
26#ifndef DEF_WBITS
27# define DEF_WBITS MAX_WBITS
28#endif
29/* default windowBits for decompression. MAX_WBITS is for compression only */
30
31#if MAX_MEM_LEVEL >= 8
32# define DEF_MEM_LEVEL 8
33#else
34# define DEF_MEM_LEVEL MAX_MEM_LEVEL
35#endif
36/* default memLevel */
37
38#define STORED_BLOCK 0 26#define STORED_BLOCK 0
39#define STATIC_TREES 1 27#define STATIC_TREES 1
40#define DYN_TREES 2 28#define DYN_TREES 2