aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm26/irq_regs.h1
-rw-r--r--include/asm-frv/irq.h3
-rw-r--r--include/asm-m68knommu/unistd.h4
-rw-r--r--include/asm-mips/i8253.h17
-rw-r--r--include/asm-mips/mach-au1x00/timex.h13
-rw-r--r--include/asm-mips/mach-cobalt/irq.h3
-rw-r--r--include/asm-mips/mach-generic/timex.h13
-rw-r--r--include/asm-mips/mach-jazz/timex.h16
-rw-r--r--include/asm-mips/mach-qemu/timex.h16
-rw-r--r--include/asm-mips/mach-rm/timex.h13
-rw-r--r--include/asm-mips/time.h18
-rw-r--r--include/asm-mips/timex.h25
-rw-r--r--include/asm-powerpc/commproc.h2
-rw-r--r--include/asm-sh/cache.h3
-rw-r--r--include/asm-sh/irq.h2
-rw-r--r--include/asm-sh/page.h1
-rw-r--r--include/asm-sh/pgtable.h2
-rw-r--r--include/asm-sh/processor.h2
-rw-r--r--include/asm-sh/setup.h14
-rw-r--r--include/asm-sh64/dma-mapping.h5
-rw-r--r--include/asm-sh64/pci.h9
-rw-r--r--include/asm-sh64/scatterlist.h9
-rw-r--r--include/asm-sparc64/vio.h4
-rw-r--r--include/asm-x86/irqflags_32.h21
-rw-r--r--include/asm-x86/irqflags_64.h20
-rw-r--r--include/asm-x86/lguest_hcall.h3
-rw-r--r--include/linux/ata.h17
-rw-r--r--include/linux/device-mapper.h1
-rw-r--r--include/linux/futex.h4
-rw-r--r--include/linux/ide.h9
-rw-r--r--include/linux/input.h3
-rw-r--r--include/linux/kallsyms.h1
-rw-r--r--include/linux/libata.h1
-rw-r--r--include/linux/mroute.h12
-rw-r--r--include/linux/netfilter/Kbuild18
-rw-r--r--include/linux/netfilter_ipv4/Kbuild28
-rw-r--r--include/linux/netfilter_ipv6/Kbuild2
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/pci.h14
-rw-r--r--include/linux/pci_ids.h5
-rw-r--r--include/linux/proc_fs.h3
-rw-r--r--include/linux/scatterlist.h60
-rw-r--r--include/linux/tty.h4
-rw-r--r--include/net/esp.h2
-rw-r--r--include/net/inet_hashtables.h71
-rw-r--r--include/net/ip_fib.h15
-rw-r--r--include/net/ip_vs.h8
-rw-r--r--include/net/sock.h63
-rw-r--r--include/rdma/ib_verbs.h2
-rw-r--r--include/scsi/libsas.h2
-rw-r--r--include/scsi/scsi_device.h25
51 files changed, 355 insertions, 256 deletions
diff --git a/include/asm-arm26/irq_regs.h b/include/asm-arm26/irq_regs.h
deleted file mode 100644
index 3dd9c0b70270..000000000000
--- a/include/asm-arm26/irq_regs.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/irq_regs.h>
diff --git a/include/asm-frv/irq.h b/include/asm-frv/irq.h
index 8fefd6b827aa..3a66ebd754bd 100644
--- a/include/asm-frv/irq.h
+++ b/include/asm-frv/irq.h
@@ -12,9 +12,6 @@
12#ifndef _ASM_IRQ_H_ 12#ifndef _ASM_IRQ_H_
13#define _ASM_IRQ_H_ 13#define _ASM_IRQ_H_
14 14
15/* this number is used when no interrupt has been assigned */
16#define NO_IRQ (-1)
17
18#define NR_IRQS 48 15#define NR_IRQS 48
19#define IRQ_BASE_CPU (0 * 16) 16#define IRQ_BASE_CPU (0 * 16)
20#define IRQ_BASE_FPGA (1 * 16) 17#define IRQ_BASE_FPGA (1 * 16)
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h
index eb1b566793fe..27c2f9bb4dbd 100644
--- a/include/asm-m68knommu/unistd.h
+++ b/include/asm-m68knommu/unistd.h
@@ -185,8 +185,8 @@
185#define __NR_rt_sigtimedwait 177 185#define __NR_rt_sigtimedwait 177
186#define __NR_rt_sigqueueinfo 178 186#define __NR_rt_sigqueueinfo 178
187#define __NR_rt_sigsuspend 179 187#define __NR_rt_sigsuspend 179
188#define __NR_pread 180 188#define __NR_pread64 180
189#define __NR_pwrite 181 189#define __NR_pwrite64 181
190#define __NR_lchown 182 190#define __NR_lchown 182
191#define __NR_getcwd 183 191#define __NR_getcwd 183
192#define __NR_capget 184 192#define __NR_capget 184
diff --git a/include/asm-mips/i8253.h b/include/asm-mips/i8253.h
index affb32ce4af9..032ca73f181b 100644
--- a/include/asm-mips/i8253.h
+++ b/include/asm-mips/i8253.h
@@ -5,25 +5,14 @@
5#ifndef __ASM_I8253_H 5#ifndef __ASM_I8253_H
6#define __ASM_I8253_H 6#define __ASM_I8253_H
7 7
8#include <linux/spinlock.h>
9
8/* i8253A PIT registers */ 10/* i8253A PIT registers */
9#define PIT_MODE 0x43 11#define PIT_MODE 0x43
10#define PIT_CH0 0x40 12#define PIT_CH0 0x40
11#define PIT_CH2 0x42 13#define PIT_CH2 0x42
12 14
13/* i8259A PIC registers */ 15extern spinlock_t i8253_lock;
14#define PIC_MASTER_CMD 0x20
15#define PIC_MASTER_IMR 0x21
16#define PIC_MASTER_ISR PIC_MASTER_CMD
17#define PIC_MASTER_POLL PIC_MASTER_ISR
18#define PIC_MASTER_OCW3 PIC_MASTER_ISR
19#define PIC_SLAVE_CMD 0xa0
20#define PIC_SLAVE_IMR 0xa1
21
22/* i8259A PIC related value */
23#define PIC_CASCADE_IR 2
24#define MASTER_ICW4_DEFAULT 0x01
25#define SLAVE_ICW4_DEFAULT 0x01
26#define PIC_ICW4_AEOI 2
27 16
28extern void setup_pit_timer(void); 17extern void setup_pit_timer(void);
29 18
diff --git a/include/asm-mips/mach-au1x00/timex.h b/include/asm-mips/mach-au1x00/timex.h
deleted file mode 100644
index e3ada66cb636..000000000000
--- a/include/asm-mips/mach-au1x00/timex.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_AU1X00_TIMEX_H
9#define __ASM_MACH_AU1X00_TIMEX_H
10
11#define CLOCK_TICK_RATE ((HZ * 100000UL) / 2)
12
13#endif /* __ASM_MACH_AU1X00_TIMEX_H */
diff --git a/include/asm-mips/mach-cobalt/irq.h b/include/asm-mips/mach-cobalt/irq.h
index 179d0e850b59..57c8c9ac5851 100644
--- a/include/asm-mips/mach-cobalt/irq.h
+++ b/include/asm-mips/mach-cobalt/irq.h
@@ -35,7 +35,7 @@
35 * 4 - ethernet 35 * 4 - ethernet
36 * 5 - 16550 UART 36 * 5 - 16550 UART
37 * 6 - cascade i8259 37 * 6 - cascade i8259
38 * 7 - CP0 counter (unused) 38 * 7 - CP0 counter
39 */ 39 */
40#define MIPS_CPU_IRQ_BASE 16 40#define MIPS_CPU_IRQ_BASE 16
41 41
@@ -48,7 +48,6 @@
48#define SCSI_IRQ (MIPS_CPU_IRQ_BASE + 5) 48#define SCSI_IRQ (MIPS_CPU_IRQ_BASE + 5)
49#define I8259_CASCADE_IRQ (MIPS_CPU_IRQ_BASE + 6) 49#define I8259_CASCADE_IRQ (MIPS_CPU_IRQ_BASE + 6)
50 50
51
52#define GT641XX_IRQ_BASE 24 51#define GT641XX_IRQ_BASE 24
53 52
54#include <asm/irq_gt641xx.h> 53#include <asm/irq_gt641xx.h>
diff --git a/include/asm-mips/mach-generic/timex.h b/include/asm-mips/mach-generic/timex.h
deleted file mode 100644
index 48b4cfaa0d50..000000000000
--- a/include/asm-mips/mach-generic/timex.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003, 2005 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_GENERIC_TIMEX_H
9#define __ASM_MACH_GENERIC_TIMEX_H
10
11#define CLOCK_TICK_RATE 500000
12
13#endif /* __ASM_MACH_GENERIC_TIMEX_H */
diff --git a/include/asm-mips/mach-jazz/timex.h b/include/asm-mips/mach-jazz/timex.h
deleted file mode 100644
index 93affa33dfa8..000000000000
--- a/include/asm-mips/mach-jazz/timex.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_JAZZ_TIMEX_H
9#define __ASM_MACH_JAZZ_TIMEX_H
10
11/*
12 * Jazz is still using the R4030 100Hz counter
13 */
14#define CLOCK_TICK_RATE 100
15
16#endif /* __ASM_MACH_JAZZ_TIMEX_H */
diff --git a/include/asm-mips/mach-qemu/timex.h b/include/asm-mips/mach-qemu/timex.h
deleted file mode 100644
index cd543693fb0a..000000000000
--- a/include/asm-mips/mach-qemu/timex.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005 Daniel Jacobowitz
7 */
8#ifndef __ASM_MACH_QEMU_TIMEX_H
9#define __ASM_MACH_QEMU_TIMEX_H
10
11/*
12 * We use a simulated i8254 PIC...
13 */
14#define CLOCK_TICK_RATE 1193182
15
16#endif /* __ASM_MACH_QEMU_TIMEX_H */
diff --git a/include/asm-mips/mach-rm/timex.h b/include/asm-mips/mach-rm/timex.h
deleted file mode 100644
index 11ff6cb0f214..000000000000
--- a/include/asm-mips/mach-rm/timex.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003, 2005 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_RM200_TIMEX_H
9#define __ASM_MACH_RM200_TIMEX_H
10
11#define CLOCK_TICK_RATE 1193182
12
13#endif /* __ASM_MACH_RM200_TIMEX_H */
diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h
index 0a6bc7dc158e..ee1663e64da1 100644
--- a/include/asm-mips/time.h
+++ b/include/asm-mips/time.h
@@ -10,15 +10,10 @@
10 * under the terms of the GNU General Public License as published by the 10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version. 12 * option) any later version.
13 *
14 * Please refer to Documentation/mips/time.README.
15 */ 13 */
16#ifndef _ASM_TIME_H 14#ifndef _ASM_TIME_H
17#define _ASM_TIME_H 15#define _ASM_TIME_H
18 16
19#include <linux/interrupt.h>
20#include <linux/linkage.h>
21#include <linux/ptrace.h>
22#include <linux/rtc.h> 17#include <linux/rtc.h>
23#include <linux/spinlock.h> 18#include <linux/spinlock.h>
24#include <linux/clockchips.h> 19#include <linux/clockchips.h>
@@ -38,25 +33,12 @@ extern int rtc_mips_set_mmss(unsigned long);
38/* 33/*
39 * Timer interrupt functions. 34 * Timer interrupt functions.
40 * mips_timer_state is needed for high precision timer calibration. 35 * mips_timer_state is needed for high precision timer calibration.
41 * mips_timer_ack may be NULL if the interrupt is self-recoverable.
42 */ 36 */
43extern int (*mips_timer_state)(void); 37extern int (*mips_timer_state)(void);
44 38
45/* 39/*
46 * High precision timer clocksource.
47 * If .read is NULL, an R4k-compatible timer setup is attempted.
48 */
49extern struct clocksource clocksource_mips;
50
51/*
52 * profiling and process accouting is done separately in local_timer_interrupt
53 */
54extern void local_timer_interrupt(int irq, void *dev_id);
55
56/*
57 * board specific routines required by time_init(). 40 * board specific routines required by time_init().
58 */ 41 */
59struct irqaction;
60extern void plat_time_init(void); 42extern void plat_time_init(void);
61 43
62/* 44/*
diff --git a/include/asm-mips/timex.h b/include/asm-mips/timex.h
index 87c68ae76ff8..5816ad1569d6 100644
--- a/include/asm-mips/timex.h
+++ b/include/asm-mips/timex.h
@@ -13,27 +13,12 @@
13#include <asm/mipsregs.h> 13#include <asm/mipsregs.h>
14 14
15/* 15/*
16 * This is the frequency of the timer used for Linux's timer interrupt. 16 * This is the clock rate of the i8253 PIT. A MIPS system may not have
17 * The value should be defined as accurate as possible or under certain 17 * a PIT by the symbol is used all over the kernel including some APIs.
18 * circumstances Linux timekeeping might become inaccurate or fail. 18 * So keeping it defined to the number for the PIT is the only sane thing
19 * 19 * for now.
20 * For many system the exact clockrate of the timer isn't known but due to
21 * the way this value is used we can get away with a wrong value as long
22 * as this value is:
23 *
24 * - a multiple of HZ
25 * - a divisor of the actual rate
26 *
27 * 500000 is a good such cheat value.
28 *
29 * The obscure number 1193182 is the same as used by the original i8254
30 * time in legacy PC hardware; the chip unfortunately also found in a
31 * bunch of MIPS systems. The last remaining user of the i8254 for the
32 * timer interrupt is the RM200; it's a very standard system so there is
33 * no reason to make this a separate architecture.
34 */ 20 */
35 21#define CLOCK_TICK_RATE 1193182
36#include <timex.h>
37 22
38/* 23/*
39 * Standard way to access the cycle counter. 24 * Standard way to access the cycle counter.
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h
index 0307c84a5c1d..a2328b8addd8 100644
--- a/include/asm-powerpc/commproc.h
+++ b/include/asm-powerpc/commproc.h
@@ -91,7 +91,7 @@ extern uint m8xx_cpm_hostalloc(uint size);
91extern int m8xx_cpm_hostfree(uint start); 91extern int m8xx_cpm_hostfree(uint start);
92extern void m8xx_cpm_hostdump(void); 92extern void m8xx_cpm_hostdump(void);
93 93
94extern void cpm_load_patch(volatile immap_t *immr); 94extern void cpm_load_patch(cpm8xx_t *cp);
95 95
96/* Buffer descriptors used by many of the CPM protocols. 96/* Buffer descriptors used by many of the CPM protocols.
97*/ 97*/
diff --git a/include/asm-sh/cache.h b/include/asm-sh/cache.h
index 7a18649d1ccb..01e5cf51ba9b 100644
--- a/include/asm-sh/cache.h
+++ b/include/asm-sh/cache.h
@@ -18,9 +18,8 @@
18#define SH_CACHE_ASSOC 8 18#define SH_CACHE_ASSOC 8
19 19
20#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 20#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
21#define SMP_CACHE_BYTES L1_CACHE_BYTES
22 21
23#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) 22#define __read_mostly __attribute__((__section__(".data.read_mostly")))
24 23
25#ifndef __ASSEMBLY__ 24#ifndef __ASSEMBLY__
26struct cache_info { 25struct cache_info {
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
index c61d902b8bff..11850f65c922 100644
--- a/include/asm-sh/irq.h
+++ b/include/asm-sh/irq.h
@@ -41,7 +41,7 @@ static inline int generic_irq_demux(int irq)
41#define irq_canonicalize(irq) (irq) 41#define irq_canonicalize(irq) (irq)
42#define irq_demux(irq) sh_mv.mv_irq_demux(irq) 42#define irq_demux(irq) sh_mv.mv_irq_demux(irq)
43 43
44#ifdef CONFIG_4KSTACKS 44#ifdef CONFIG_IRQSTACKS
45extern void irq_ctx_init(int cpu); 45extern void irq_ctx_init(int cpu);
46extern void irq_ctx_exit(int cpu); 46extern void irq_ctx_exit(int cpu);
47# define __ARCH_HAS_DO_SOFTIRQ 47# define __ARCH_HAS_DO_SOFTIRQ
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h
index cb3d46c59eab..3aa8b07da47d 100644
--- a/include/asm-sh/page.h
+++ b/include/asm-sh/page.h
@@ -128,7 +128,6 @@ typedef struct { unsigned long pgd; } pgd_t;
128#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) 128#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
129#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 129#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
130 130
131#define phys_to_page(phys) (pfn_to_page(phys >> PAGE_SHIFT))
132#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) 131#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
133 132
134/* PFN start number, because of __MEMORY_START */ 133/* PFN start number, because of __MEMORY_START */
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index cf0dd2b648c2..0b1d7c665659 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -399,7 +399,7 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
399#define pmd_bad(x) (pmd_val(x) & ~PAGE_MASK) 399#define pmd_bad(x) (pmd_val(x) & ~PAGE_MASK)
400 400
401#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) 401#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
402#define pte_page(x) phys_to_page(pte_val(x)&PTE_PHYS_MASK) 402#define pte_page(x) pfn_to_page(pte_pfn(x))
403 403
404/* 404/*
405 * The following only work if pte_present() is true. 405 * The following only work if pte_present() is true.
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index 4f2922a1979c..ab0028db645a 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -71,7 +71,7 @@ struct sh_cpuinfo {
71 struct cache_info scache; /* Secondary cache */ 71 struct cache_info scache; /* Secondary cache */
72 72
73 unsigned long flags; 73 unsigned long flags;
74} __attribute__ ((aligned(SMP_CACHE_BYTES))); 74} __attribute__ ((aligned(L1_CACHE_BYTES)));
75 75
76extern struct sh_cpuinfo cpu_data[]; 76extern struct sh_cpuinfo cpu_data[];
77#define boot_cpu_data cpu_data[0] 77#define boot_cpu_data cpu_data[0]
diff --git a/include/asm-sh/setup.h b/include/asm-sh/setup.h
index 586a9711a75d..55a2bd328d99 100644
--- a/include/asm-sh/setup.h
+++ b/include/asm-sh/setup.h
@@ -5,6 +5,20 @@
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7 7
8/*
9 * This is set up by the setup-routine at boot-time
10 */
11#define PARAM ((unsigned char *)empty_zero_page)
12
13#define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))
14#define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004))
15#define ORIG_ROOT_DEV (*(unsigned long *) (PARAM+0x008))
16#define LOADER_TYPE (*(unsigned long *) (PARAM+0x00c))
17#define INITRD_START (*(unsigned long *) (PARAM+0x010))
18#define INITRD_SIZE (*(unsigned long *) (PARAM+0x014))
19/* ... */
20#define COMMAND_LINE ((char *) (PARAM+0x100))
21
8int setup_early_printk(char *); 22int setup_early_printk(char *);
9void sh_mv_setup(void); 23void sh_mv_setup(void);
10 24
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h
index 1438b763a5ea..18f8dd642ac5 100644
--- a/include/asm-sh64/dma-mapping.h
+++ b/include/asm-sh64/dma-mapping.h
@@ -42,8 +42,9 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
42static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 42static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
43 enum dma_data_direction dir) 43 enum dma_data_direction dir)
44{ 44{
45 unsigned long s = (unsigned long) vaddr & L1_CACHE_ALIGN_MASK; 45 unsigned long start = (unsigned long) vaddr;
46 unsigned long e = (vaddr + size) & L1_CACHE_ALIGN_MASK; 46 unsigned long s = start & L1_CACHE_ALIGN_MASK;
47 unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK;
47 48
48 for (; s <= e; s += L1_CACHE_BYTES) 49 for (; s <= e; s += L1_CACHE_BYTES)
49 asm volatile ("ocbp %0, 0" : : "r" (s)); 50 asm volatile ("ocbp %0, 0" : : "r" (s));
diff --git a/include/asm-sh64/pci.h b/include/asm-sh64/pci.h
index 57a67cf7a5c4..18055dbbb4b5 100644
--- a/include/asm-sh64/pci.h
+++ b/include/asm-sh64/pci.h
@@ -72,15 +72,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
72#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) 72#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
73#endif 73#endif
74 74
75/* These macros should be used after a pci_map_sg call has been done
76 * to get bus addresses of each of the SG entries and their lengths.
77 * You should only work with the number of sg entries pci_map_sg
78 * returns, or alternatively stop on the first sg_dma_len(sg) which
79 * is 0.
80 */
81#define sg_dma_address(sg) ((sg)->dma_address)
82#define sg_dma_len(sg) ((sg)->length)
83
84#ifdef CONFIG_PCI 75#ifdef CONFIG_PCI
85static inline void pci_dma_burst_advice(struct pci_dev *pdev, 76static inline void pci_dma_burst_advice(struct pci_dev *pdev,
86 enum pci_dma_burst_strategy *strat, 77 enum pci_dma_burst_strategy *strat,
diff --git a/include/asm-sh64/scatterlist.h b/include/asm-sh64/scatterlist.h
index 5109251970e7..7f729bbfce43 100644
--- a/include/asm-sh64/scatterlist.h
+++ b/include/asm-sh64/scatterlist.h
@@ -23,6 +23,15 @@ struct scatterlist {
23 unsigned int length; 23 unsigned int length;
24}; 24};
25 25
26/* These macros should be used after a pci_map_sg call has been done
27 * to get bus addresses of each of the SG entries and their lengths.
28 * You should only work with the number of sg entries pci_map_sg
29 * returns, or alternatively stop on the first sg_dma_len(sg) which
30 * is 0.
31 */
32#define sg_dma_address(sg) ((sg)->dma_address)
33#define sg_dma_len(sg) ((sg)->length)
34
26#define ISA_DMA_THRESHOLD (0xffffffff) 35#define ISA_DMA_THRESHOLD (0xffffffff)
27 36
28#endif /* !__ASM_SH64_SCATTERLIST_H */ 37#endif /* !__ASM_SH64_SCATTERLIST_H */
diff --git a/include/asm-sparc64/vio.h b/include/asm-sparc64/vio.h
index f7417e91b170..d4de32f0f8af 100644
--- a/include/asm-sparc64/vio.h
+++ b/include/asm-sparc64/vio.h
@@ -8,6 +8,7 @@
8#include <linux/spinlock.h> 8#include <linux/spinlock.h>
9#include <linux/completion.h> 9#include <linux/completion.h>
10#include <linux/list.h> 10#include <linux/list.h>
11#include <linux/log2.h>
11 12
12#include <asm/ldc.h> 13#include <asm/ldc.h>
13#include <asm/mdesc.h> 14#include <asm/mdesc.h>
@@ -257,8 +258,7 @@ static inline void *vio_dring_entry(struct vio_dring_state *dr,
257static inline u32 vio_dring_avail(struct vio_dring_state *dr, 258static inline u32 vio_dring_avail(struct vio_dring_state *dr,
258 unsigned int ring_size) 259 unsigned int ring_size)
259{ 260{
260 /* Ensure build-time power-of-2. */ 261 BUILD_BUG_ON(!is_power_of_2(ring_size));
261 BUILD_BUG_ON(ring_size & (ring_size - 1));
262 262
263 return (dr->pending - 263 return (dr->pending -
264 ((dr->prod - dr->cons) & (ring_size - 1))); 264 ((dr->prod - dr->cons) & (ring_size - 1)));
diff --git a/include/asm-x86/irqflags_32.h b/include/asm-x86/irqflags_32.h
index d058b04e0083..4c7720089cb5 100644
--- a/include/asm-x86/irqflags_32.h
+++ b/include/asm-x86/irqflags_32.h
@@ -129,6 +129,27 @@ static inline int raw_irqs_disabled(void)
129 129
130 return raw_irqs_disabled_flags(flags); 130 return raw_irqs_disabled_flags(flags);
131} 131}
132
133/*
134 * makes the traced hardirq state match with the machine state
135 *
136 * should be a rarely used function, only in places where its
137 * otherwise impossible to know the irq state, like in traps.
138 */
139static inline void trace_hardirqs_fixup_flags(unsigned long flags)
140{
141 if (raw_irqs_disabled_flags(flags))
142 trace_hardirqs_off();
143 else
144 trace_hardirqs_on();
145}
146
147static inline void trace_hardirqs_fixup(void)
148{
149 unsigned long flags = __raw_local_save_flags();
150
151 trace_hardirqs_fixup_flags(flags);
152}
132#endif /* __ASSEMBLY__ */ 153#endif /* __ASSEMBLY__ */
133 154
134/* 155/*
diff --git a/include/asm-x86/irqflags_64.h b/include/asm-x86/irqflags_64.h
index 5341ea1f815a..bb9163bb29d1 100644
--- a/include/asm-x86/irqflags_64.h
+++ b/include/asm-x86/irqflags_64.h
@@ -112,6 +112,26 @@ static inline int raw_irqs_disabled(void)
112} 112}
113 113
114/* 114/*
115 * makes the traced hardirq state match with the machine state
116 *
117 * should be a rarely used function, only in places where its
118 * otherwise impossible to know the irq state, like in traps.
119 */
120static inline void trace_hardirqs_fixup_flags(unsigned long flags)
121{
122 if (raw_irqs_disabled_flags(flags))
123 trace_hardirqs_off();
124 else
125 trace_hardirqs_on();
126}
127
128static inline void trace_hardirqs_fixup(void)
129{
130 unsigned long flags = __raw_local_save_flags();
131
132 trace_hardirqs_fixup_flags(flags);
133}
134/*
115 * Used in the idle loop; sti takes one instruction cycle 135 * Used in the idle loop; sti takes one instruction cycle
116 * to complete: 136 * to complete:
117 */ 137 */
diff --git a/include/asm-x86/lguest_hcall.h b/include/asm-x86/lguest_hcall.h
index 9c5092b6aa9f..2091779e91fb 100644
--- a/include/asm-x86/lguest_hcall.h
+++ b/include/asm-x86/lguest_hcall.h
@@ -54,9 +54,6 @@ hcall(unsigned long call,
54} 54}
55/*:*/ 55/*:*/
56 56
57void async_hcall(unsigned long call,
58 unsigned long arg1, unsigned long arg2, unsigned long arg3);
59
60/* Can't use our min() macro here: needs to be a constant */ 57/* Can't use our min() macro here: needs to be a constant */
61#define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32) 58#define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32)
62 59
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 128dc7ad4901..5c4e54a2a8d6 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -43,6 +43,7 @@ enum {
43 ATA_MAX_SECTORS_128 = 128, 43 ATA_MAX_SECTORS_128 = 128,
44 ATA_MAX_SECTORS = 256, 44 ATA_MAX_SECTORS = 256,
45 ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ 45 ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */
46 ATA_MAX_SECTORS_TAPE = 65535,
46 47
47 ATA_ID_WORDS = 256, 48 ATA_ID_WORDS = 256,
48 ATA_ID_SERNO = 10, 49 ATA_ID_SERNO = 10,
@@ -424,6 +425,8 @@ static inline int ata_id_has_lba48(const u16 *id)
424{ 425{
425 if ((id[83] & 0xC000) != 0x4000) 426 if ((id[83] & 0xC000) != 0x4000)
426 return 0; 427 return 0;
428 if (!ata_id_u64(id, 100))
429 return 0;
427 return id[83] & (1 << 10); 430 return id[83] & (1 << 10);
428} 431}
429 432
@@ -534,6 +537,15 @@ static inline int ata_drive_40wire(const u16 *dev_id)
534 return 1; 537 return 1;
535} 538}
536 539
540static inline int ata_drive_40wire_relaxed(const u16 *dev_id)
541{
542 if (ata_id_is_sata(dev_id))
543 return 0; /* SATA */
544 if ((dev_id[93] & 0x2000) == 0x2000)
545 return 0; /* 80 wire */
546 return 1;
547}
548
537static inline int atapi_cdb_len(const u16 *dev_id) 549static inline int atapi_cdb_len(const u16 *dev_id)
538{ 550{
539 u16 tmp = dev_id[0] & 0x3; 551 u16 tmp = dev_id[0] & 0x3;
@@ -544,6 +556,11 @@ static inline int atapi_cdb_len(const u16 *dev_id)
544 } 556 }
545} 557}
546 558
559static inline int atapi_command_packet_set(const u16 *dev_id)
560{
561 return (dev_id[0] >> 8) & 0x1f;
562}
563
547static inline int is_atapi_taskfile(const struct ata_taskfile *tf) 564static inline int is_atapi_taskfile(const struct ata_taskfile *tf)
548{ 565{
549 return (tf->protocol == ATA_PROT_ATAPI) || 566 return (tf->protocol == ATA_PROT_ATAPI) ||
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 37c66d1254b5..b8b7c51389fe 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -116,6 +116,7 @@ struct io_restrictions {
116 unsigned short hardsect_size; 116 unsigned short hardsect_size;
117 unsigned int max_segment_size; 117 unsigned int max_segment_size;
118 unsigned long seg_boundary_mask; 118 unsigned long seg_boundary_mask;
119 unsigned long bounce_pfn;
119 unsigned char no_cluster; /* inverted so that 0 is default */ 120 unsigned char no_cluster; /* inverted so that 0 is default */
120}; 121};
121 122
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 99650353adfa..92d420fe03f8 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -149,10 +149,6 @@ union futex_key {
149 int offset; 149 int offset;
150 } both; 150 } both;
151}; 151};
152int get_futex_key(u32 __user *uaddr, struct rw_semaphore *shared,
153 union futex_key *key);
154void get_futex_key_refs(union futex_key *key);
155void drop_futex_key_refs(union futex_key *key);
156 152
157#ifdef CONFIG_FUTEX 153#ifdef CONFIG_FUTEX
158extern void exit_robust_list(struct task_struct *curr); 154extern void exit_robust_list(struct task_struct *curr);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 4ed4777bba67..dc75ccbcf991 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1031,14 +1031,7 @@ ide_startstop_t __ide_abort(ide_drive_t *, struct request *);
1031extern ide_startstop_t ide_abort(ide_drive_t *, const char *); 1031extern ide_startstop_t ide_abort(ide_drive_t *, const char *);
1032 1032
1033extern void ide_fix_driveid(struct hd_driveid *); 1033extern void ide_fix_driveid(struct hd_driveid *);
1034/* 1034
1035 * ide_fixstring() cleans up and (optionally) byte-swaps a text string,
1036 * removing leading/trailing blanks and compressing internal blanks.
1037 * It is primarily used to tidy up the model name/number fields as
1038 * returned by the WIN_[P]IDENTIFY commands.
1039 *
1040 * (s, bytecount, byteswap)
1041 */
1042extern void ide_fixstring(u8 *, const int, const int); 1035extern void ide_fixstring(u8 *, const int, const int);
1043 1036
1044int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); 1037int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
diff --git a/include/linux/input.h b/include/linux/input.h
index 62268929856c..b45f240a8c45 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -527,6 +527,9 @@ struct input_absinfo {
527#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */ 527#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */
528#define KEY_LOGOFF 0x1b1 /* AL Logoff */ 528#define KEY_LOGOFF 0x1b1 /* AL Logoff */
529 529
530#define KEY_DOLLAR 0x1b2
531#define KEY_EURO 0x1b3
532
530#define KEY_DEL_EOL 0x1c0 533#define KEY_DEL_EOL 0x1c0
531#define KEY_DEL_EOS 0x1c1 534#define KEY_DEL_EOS 0x1c1
532#define KEY_INS_LINE 0x1c2 535#define KEY_INS_LINE 0x1c2
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index f73de6fb5c68..82de2fb62cb7 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -6,6 +6,7 @@
6#define _LINUX_KALLSYMS_H 6#define _LINUX_KALLSYMS_H
7 7
8#include <linux/errno.h> 8#include <linux/errno.h>
9#include <linux/stddef.h>
9 10
10#define KSYM_NAME_LEN 128 11#define KSYM_NAME_LEN 128
11#define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \ 12#define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 1e277852ba42..56a5673aebad 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -339,6 +339,7 @@ enum {
339 ATA_HORKAGE_SKIP_PM = (1 << 5), /* Skip PM operations */ 339 ATA_HORKAGE_SKIP_PM = (1 << 5), /* Skip PM operations */
340 ATA_HORKAGE_HPA_SIZE = (1 << 6), /* native size off by one */ 340 ATA_HORKAGE_HPA_SIZE = (1 << 6), /* native size off by one */
341 ATA_HORKAGE_IPM = (1 << 7), /* Link PM problems */ 341 ATA_HORKAGE_IPM = (1 << 7), /* Link PM problems */
342 ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */
342 343
343 /* DMA mask for user DMA control: User visible values; DO NOT 344 /* DMA mask for user DMA control: User visible values; DO NOT
344 renumber */ 345 renumber */
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index 7da2cee8e132..35a8277ec1bd 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -128,6 +128,18 @@ struct igmpmsg
128#ifdef __KERNEL__ 128#ifdef __KERNEL__
129#include <net/sock.h> 129#include <net/sock.h>
130 130
131#ifdef CONFIG_IP_MROUTE
132static inline int ip_mroute_opt(int opt)
133{
134 return (opt >= MRT_BASE) && (opt <= MRT_BASE + 10);
135}
136#else
137static inline int ip_mroute_opt(int opt)
138{
139 return 0;
140}
141#endif
142
131extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); 143extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int);
132extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); 144extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
133extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); 145extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg);
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index f2eaea2234ec..b87e83a5e070 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -4,25 +4,28 @@ header-y += nfnetlink_conntrack.h
4header-y += nfnetlink_log.h 4header-y += nfnetlink_log.h
5header-y += nfnetlink_queue.h 5header-y += nfnetlink_queue.h
6header-y += xt_CLASSIFY.h 6header-y += xt_CLASSIFY.h
7header-y += xt_CONNMARK.h
8header-y += xt_CONNSECMARK.h
9header-y += xt_DSCP.h
10header-y += xt_MARK.h
11header-y += xt_NFLOG.h
12header-y += xt_NFQUEUE.h
13header-y += xt_SECMARK.h
14header-y += xt_TCPMSS.h
7header-y += xt_comment.h 15header-y += xt_comment.h
8header-y += xt_connbytes.h 16header-y += xt_connbytes.h
9header-y += xt_connmark.h 17header-y += xt_connmark.h
10header-y += xt_CONNMARK.h
11header-y += xt_conntrack.h 18header-y += xt_conntrack.h
12header-y += xt_dccp.h 19header-y += xt_dccp.h
13header-y += xt_dscp.h 20header-y += xt_dscp.h
14header-y += xt_DSCP.h
15header-y += xt_esp.h 21header-y += xt_esp.h
16header-y += xt_helper.h
17header-y += xt_hashlimit.h 22header-y += xt_hashlimit.h
23header-y += xt_helper.h
18header-y += xt_length.h 24header-y += xt_length.h
19header-y += xt_limit.h 25header-y += xt_limit.h
20header-y += xt_mac.h 26header-y += xt_mac.h
21header-y += xt_mark.h 27header-y += xt_mark.h
22header-y += xt_MARK.h
23header-y += xt_multiport.h 28header-y += xt_multiport.h
24header-y += xt_NFQUEUE.h
25header-y += xt_NFLOG.h
26header-y += xt_pkttype.h 29header-y += xt_pkttype.h
27header-y += xt_policy.h 30header-y += xt_policy.h
28header-y += xt_realm.h 31header-y += xt_realm.h
@@ -32,9 +35,6 @@ header-y += xt_statistic.h
32header-y += xt_string.h 35header-y += xt_string.h
33header-y += xt_tcpmss.h 36header-y += xt_tcpmss.h
34header-y += xt_tcpudp.h 37header-y += xt_tcpudp.h
35header-y += xt_SECMARK.h
36header-y += xt_CONNSECMARK.h
37header-y += xt_TCPMSS.h
38 38
39unifdef-y += nf_conntrack_common.h 39unifdef-y += nf_conntrack_common.h
40unifdef-y += nf_conntrack_ftp.h 40unifdef-y += nf_conntrack_ftp.h
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
index 7185792b900f..3a7105bb8f33 100644
--- a/include/linux/netfilter_ipv4/Kbuild
+++ b/include/linux/netfilter_ipv4/Kbuild
@@ -1,47 +1,47 @@
1header-y += ipt_addrtype.h
2header-y += ipt_ah.h
3header-y += ipt_CLASSIFY.h 1header-y += ipt_CLASSIFY.h
4header-y += ipt_CLUSTERIP.h 2header-y += ipt_CLUSTERIP.h
3header-y += ipt_CONNMARK.h
4header-y += ipt_DSCP.h
5header-y += ipt_ECN.h
6header-y += ipt_LOG.h
7header-y += ipt_MARK.h
8header-y += ipt_NFQUEUE.h
9header-y += ipt_REJECT.h
10header-y += ipt_SAME.h
11header-y += ipt_TCPMSS.h
12header-y += ipt_TOS.h
13header-y += ipt_TTL.h
14header-y += ipt_ULOG.h
15header-y += ipt_addrtype.h
16header-y += ipt_ah.h
5header-y += ipt_comment.h 17header-y += ipt_comment.h
6header-y += ipt_connbytes.h 18header-y += ipt_connbytes.h
7header-y += ipt_connmark.h 19header-y += ipt_connmark.h
8header-y += ipt_CONNMARK.h
9header-y += ipt_conntrack.h 20header-y += ipt_conntrack.h
10header-y += ipt_dccp.h 21header-y += ipt_dccp.h
11header-y += ipt_dscp.h 22header-y += ipt_dscp.h
12header-y += ipt_DSCP.h
13header-y += ipt_ecn.h 23header-y += ipt_ecn.h
14header-y += ipt_ECN.h
15header-y += ipt_esp.h 24header-y += ipt_esp.h
16header-y += ipt_hashlimit.h 25header-y += ipt_hashlimit.h
17header-y += ipt_helper.h 26header-y += ipt_helper.h
18header-y += ipt_iprange.h 27header-y += ipt_iprange.h
19header-y += ipt_length.h 28header-y += ipt_length.h
20header-y += ipt_limit.h 29header-y += ipt_limit.h
21header-y += ipt_LOG.h
22header-y += ipt_mac.h 30header-y += ipt_mac.h
23header-y += ipt_mark.h 31header-y += ipt_mark.h
24header-y += ipt_MARK.h
25header-y += ipt_multiport.h 32header-y += ipt_multiport.h
26header-y += ipt_NFQUEUE.h
27header-y += ipt_owner.h 33header-y += ipt_owner.h
28header-y += ipt_physdev.h 34header-y += ipt_physdev.h
29header-y += ipt_pkttype.h 35header-y += ipt_pkttype.h
30header-y += ipt_policy.h 36header-y += ipt_policy.h
31header-y += ipt_realm.h 37header-y += ipt_realm.h
32header-y += ipt_recent.h 38header-y += ipt_recent.h
33header-y += ipt_REJECT.h
34header-y += ipt_SAME.h
35header-y += ipt_sctp.h 39header-y += ipt_sctp.h
36header-y += ipt_state.h 40header-y += ipt_state.h
37header-y += ipt_string.h 41header-y += ipt_string.h
38header-y += ipt_tcpmss.h 42header-y += ipt_tcpmss.h
39header-y += ipt_TCPMSS.h
40header-y += ipt_tos.h 43header-y += ipt_tos.h
41header-y += ipt_TOS.h
42header-y += ipt_ttl.h 44header-y += ipt_ttl.h
43header-y += ipt_TTL.h
44header-y += ipt_ULOG.h
45 45
46unifdef-y += ip_queue.h 46unifdef-y += ip_queue.h
47unifdef-y += ip_tables.h 47unifdef-y += ip_tables.h
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild
index 9dd978d149ff..8887a5fcd1d0 100644
--- a/include/linux/netfilter_ipv6/Kbuild
+++ b/include/linux/netfilter_ipv6/Kbuild
@@ -14,8 +14,8 @@ header-y += ip6t_mark.h
14header-y += ip6t_multiport.h 14header-y += ip6t_multiport.h
15header-y += ip6t_opts.h 15header-y += ip6t_opts.h
16header-y += ip6t_owner.h 16header-y += ip6t_owner.h
17header-y += ip6t_policy.h
18header-y += ip6t_physdev.h 17header-y += ip6t_physdev.h
18header-y += ip6t_policy.h
19header-y += ip6t_rt.h 19header-y += ip6t_rt.h
20 20
21unifdef-y += ip6_tables.h 21unifdef-y += ip6_tables.h
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 7c1f3b1d2ee5..d5bfaba595c7 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -192,7 +192,7 @@ extern int netlink_unregister_notifier(struct notifier_block *nb);
192/* finegrained unicast helpers: */ 192/* finegrained unicast helpers: */
193struct sock *netlink_getsockbyfilp(struct file *filp); 193struct sock *netlink_getsockbyfilp(struct file *filp);
194int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, 194int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
195 long timeo, struct sock *ssk); 195 long *timeo, struct sock *ssk);
196void netlink_detachskb(struct sock *sk, struct sk_buff *skb); 196void netlink_detachskb(struct sock *sk, struct sk_buff *skb);
197int netlink_sendskb(struct sock *sk, struct sk_buff *skb); 197int netlink_sendskb(struct sock *sk, struct sk_buff *skb);
198 198
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5d2281f661f7..0dd93bb62fbe 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -109,6 +109,14 @@ enum pcie_reset_state {
109 pcie_hot_reset = (__force pcie_reset_state_t) 3 109 pcie_hot_reset = (__force pcie_reset_state_t) 3
110}; 110};
111 111
112typedef unsigned short __bitwise pci_dev_flags_t;
113enum pci_dev_flags {
114 /* INTX_DISABLE in PCI_COMMAND register disables MSI
115 * generation too.
116 */
117 PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1,
118};
119
112typedef unsigned short __bitwise pci_bus_flags_t; 120typedef unsigned short __bitwise pci_bus_flags_t;
113enum pci_bus_flags { 121enum pci_bus_flags {
114 PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, 122 PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1,
@@ -185,6 +193,7 @@ struct pci_dev {
185 unsigned int msix_enabled:1; 193 unsigned int msix_enabled:1;
186 unsigned int is_managed:1; 194 unsigned int is_managed:1;
187 unsigned int is_pcie:1; 195 unsigned int is_pcie:1;
196 pci_dev_flags_t dev_flags;
188 atomic_t enable_cnt; /* pci_enable_device has been called */ 197 atomic_t enable_cnt; /* pci_enable_device has been called */
189 198
190 u32 saved_config_space[16]; /* config space saved at suspend time */ 199 u32 saved_config_space[16]; /* config space saved at suspend time */
@@ -479,8 +488,11 @@ extern void pci_sort_breadthfirst(void);
479 488
480/* Generic PCI functions exported to card drivers */ 489/* Generic PCI functions exported to card drivers */
481 490
491#ifdef CONFIG_PCI_LEGACY
482struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from); 492struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from);
483struct pci_dev __deprecated *pci_find_slot (unsigned int bus, unsigned int devfn); 493struct pci_dev __deprecated *pci_find_slot (unsigned int bus, unsigned int devfn);
494#endif /* CONFIG_PCI_LEGACY */
495
484int pci_find_capability (struct pci_dev *dev, int cap); 496int pci_find_capability (struct pci_dev *dev, int cap);
485int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 497int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
486int pci_find_ext_capability (struct pci_dev *dev, int cap); 498int pci_find_ext_capability (struct pci_dev *dev, int cap);
@@ -622,7 +634,6 @@ static inline int __must_check pci_register_driver(struct pci_driver *driver)
622void pci_unregister_driver(struct pci_driver *); 634void pci_unregister_driver(struct pci_driver *);
623void pci_remove_behind_bridge(struct pci_dev *); 635void pci_remove_behind_bridge(struct pci_dev *);
624struct pci_driver *pci_dev_driver(const struct pci_dev *); 636struct pci_driver *pci_dev_driver(const struct pci_dev *);
625const struct pci_device_id *pci_match_device(struct pci_driver *drv, struct pci_dev *dev);
626const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev); 637const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev);
627int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass); 638int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass);
628 639
@@ -751,7 +762,6 @@ static inline void pci_unregister_driver(struct pci_driver *drv) { }
751static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } 762static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
752static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; } 763static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; }
753static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; } 764static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; }
754static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; }
755 765
756/* Power management related routines */ 766/* Power management related routines */
757static inline int pci_save_state(struct pci_dev *dev) { return 0; } 767static inline int pci_save_state(struct pci_dev *dev) { return 0; }
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index e44aac8cf5ff..fbe19648bf91 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -360,9 +360,6 @@
360#define PCI_DEVICE_ID_ATI_RS400_166 0x5a32 360#define PCI_DEVICE_ID_ATI_RS400_166 0x5a32
361#define PCI_DEVICE_ID_ATI_RS400_200 0x5a33 361#define PCI_DEVICE_ID_ATI_RS400_200 0x5a33
362#define PCI_DEVICE_ID_ATI_RS480 0x5950 362#define PCI_DEVICE_ID_ATI_RS480 0x5950
363#define PCI_DEVICE_ID_ATI_RD580 0x5952
364#define PCI_DEVICE_ID_ATI_RX790 0x5957
365#define PCI_DEVICE_ID_ATI_RS690 0x7910
366/* ATI IXP Chipset */ 363/* ATI IXP Chipset */
367#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349 364#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349
368#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353 365#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353
@@ -1436,8 +1433,8 @@
1436#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008 1433#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008
1437#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 1434#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009
1438#define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 1435#define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017
1436#define PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB 0x0036
1439#define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103 1437#define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103
1440#define PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX 0x0104
1441#define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE 0x0132 1438#define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE 0x0132
1442#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 1439#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200
1443#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 1440#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 1ff461672060..1273c6ec535c 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -196,8 +196,6 @@ static inline struct proc_dir_entry *create_proc_info_entry(const char *name,
196 return res; 196 return res;
197} 197}
198 198
199extern struct proc_dir_entry *proc_net_create(struct net *net,
200 const char *name, mode_t mode, get_info_t *get_info);
201extern struct proc_dir_entry *proc_net_fops_create(struct net *net, 199extern struct proc_dir_entry *proc_net_fops_create(struct net *net,
202 const char *name, mode_t mode, const struct file_operations *fops); 200 const char *name, mode_t mode, const struct file_operations *fops);
203extern void proc_net_remove(struct net *net, const char *name); 201extern void proc_net_remove(struct net *net, const char *name);
@@ -208,7 +206,6 @@ extern void proc_net_remove(struct net *net, const char *name);
208#define proc_bus NULL 206#define proc_bus NULL
209 207
210#define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; }) 208#define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; })
211#define proc_net_create(net, name, mode, info) ({ (void)(mode), NULL; })
212static inline void proc_net_remove(struct net *net, const char *name) {} 209static inline void proc_net_remove(struct net *net, const char *name) {}
213 210
214static inline void proc_flush_task(struct task_struct *task) 211static inline void proc_flush_task(struct task_struct *task)
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 32326c293d7b..259735044148 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -188,43 +188,23 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
188 188
189/** 189/**
190 * sg_mark_end - Mark the end of the scatterlist 190 * sg_mark_end - Mark the end of the scatterlist
191 * @sgl: Scatterlist 191 * @sg: SG entryScatterlist
192 * @nents: Number of entries in sgl
193 * 192 *
194 * Description: 193 * Description:
195 * Marks the last entry as the termination point for sg_next() 194 * Marks the passed in sg entry as the termination point for the sg
195 * table. A call to sg_next() on this entry will return NULL.
196 * 196 *
197 **/ 197 **/
198static inline void sg_mark_end(struct scatterlist *sgl, unsigned int nents) 198static inline void sg_mark_end(struct scatterlist *sg)
199{ 199{
200 sgl[nents - 1].page_link = 0x02;
201}
202
203static inline void __sg_mark_end(struct scatterlist *sg)
204{
205 sg->page_link |= 0x02;
206}
207
208/**
209 * sg_init_one - Initialize a single entry sg list
210 * @sg: SG entry
211 * @buf: Virtual address for IO
212 * @buflen: IO length
213 *
214 * Notes:
215 * This should not be used on a single entry that is part of a larger
216 * table. Use sg_init_table() for that.
217 *
218 **/
219static inline void sg_init_one(struct scatterlist *sg, const void *buf,
220 unsigned int buflen)
221{
222 memset(sg, 0, sizeof(*sg));
223#ifdef CONFIG_DEBUG_SG 200#ifdef CONFIG_DEBUG_SG
224 sg->sg_magic = SG_MAGIC; 201 BUG_ON(sg->sg_magic != SG_MAGIC);
225#endif 202#endif
226 sg_mark_end(sg, 1); 203 /*
227 sg_set_buf(sg, buf, buflen); 204 * Set termination bit, clear potential chain bit
205 */
206 sg->page_link |= 0x02;
207 sg->page_link &= ~0x01;
228} 208}
229 209
230/** 210/**
@@ -240,7 +220,6 @@ static inline void sg_init_one(struct scatterlist *sg, const void *buf,
240static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) 220static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
241{ 221{
242 memset(sgl, 0, sizeof(*sgl) * nents); 222 memset(sgl, 0, sizeof(*sgl) * nents);
243 sg_mark_end(sgl, nents);
244#ifdef CONFIG_DEBUG_SG 223#ifdef CONFIG_DEBUG_SG
245 { 224 {
246 unsigned int i; 225 unsigned int i;
@@ -248,6 +227,25 @@ static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
248 sgl[i].sg_magic = SG_MAGIC; 227 sgl[i].sg_magic = SG_MAGIC;
249 } 228 }
250#endif 229#endif
230 sg_mark_end(&sgl[nents - 1]);
231}
232
233/**
234 * sg_init_one - Initialize a single entry sg list
235 * @sg: SG entry
236 * @buf: Virtual address for IO
237 * @buflen: IO length
238 *
239 * Notes:
240 * This should not be used on a single entry that is part of a larger
241 * table. Use sg_init_table() for that.
242 *
243 **/
244static inline void sg_init_one(struct scatterlist *sg, const void *buf,
245 unsigned int buflen)
246{
247 sg_init_table(sg, 1);
248 sg_set_buf(sg, buf, buflen);
251} 249}
252 250
253/** 251/**
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 56164d7ba0ad..c555f5442bd7 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -332,7 +332,9 @@ extern void tty_ldisc_flush(struct tty_struct *tty);
332 332
333extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 333extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
334 unsigned long arg); 334 unsigned long arg);
335 335extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file,
336 unsigned int cmd, unsigned long arg);
337extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg);
336extern dev_t tty_devnum(struct tty_struct *tty); 338extern dev_t tty_devnum(struct tty_struct *tty);
337extern void proc_clear_tty(struct task_struct *p); 339extern void proc_clear_tty(struct task_struct *p);
338extern struct tty_struct *get_current_tty(void); 340extern struct tty_struct *get_current_tty(void);
diff --git a/include/net/esp.h b/include/net/esp.h
index c1bc529809da..c05f529bff28 100644
--- a/include/net/esp.h
+++ b/include/net/esp.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/crypto.h> 4#include <linux/crypto.h>
5#include <net/xfrm.h> 5#include <net/xfrm.h>
6#include <asm/scatterlist.h> 6#include <linux/scatterlist.h>
7 7
8#define ESP_NUM_FAST_SG 4 8#define ESP_NUM_FAST_SG 4
9 9
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 4427dcd1e53a..8461cda37490 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -37,7 +37,6 @@
37 * I'll experiment with dynamic table growth later. 37 * I'll experiment with dynamic table growth later.
38 */ 38 */
39struct inet_ehash_bucket { 39struct inet_ehash_bucket {
40 rwlock_t lock;
41 struct hlist_head chain; 40 struct hlist_head chain;
42 struct hlist_head twchain; 41 struct hlist_head twchain;
43}; 42};
@@ -100,6 +99,9 @@ struct inet_hashinfo {
100 * TIME_WAIT sockets use a separate chain (twchain). 99 * TIME_WAIT sockets use a separate chain (twchain).
101 */ 100 */
102 struct inet_ehash_bucket *ehash; 101 struct inet_ehash_bucket *ehash;
102 rwlock_t *ehash_locks;
103 unsigned int ehash_size;
104 unsigned int ehash_locks_mask;
103 105
104 /* Ok, let's try this, I give up, we do need a local binding 106 /* Ok, let's try this, I give up, we do need a local binding
105 * TCP hash as well as the others for fast bind/connect. 107 * TCP hash as well as the others for fast bind/connect.
@@ -107,7 +109,7 @@ struct inet_hashinfo {
107 struct inet_bind_hashbucket *bhash; 109 struct inet_bind_hashbucket *bhash;
108 110
109 unsigned int bhash_size; 111 unsigned int bhash_size;
110 unsigned int ehash_size; 112 /* Note : 4 bytes padding on 64 bit arches */
111 113
112 /* All sockets in TCP_LISTEN state will be in here. This is the only 114 /* All sockets in TCP_LISTEN state will be in here. This is the only
113 * table where wildcard'd TCP sockets can exist. Hash function here 115 * table where wildcard'd TCP sockets can exist. Hash function here
@@ -134,6 +136,62 @@ static inline struct inet_ehash_bucket *inet_ehash_bucket(
134 return &hashinfo->ehash[hash & (hashinfo->ehash_size - 1)]; 136 return &hashinfo->ehash[hash & (hashinfo->ehash_size - 1)];
135} 137}
136 138
139static inline rwlock_t *inet_ehash_lockp(
140 struct inet_hashinfo *hashinfo,
141 unsigned int hash)
142{
143 return &hashinfo->ehash_locks[hash & hashinfo->ehash_locks_mask];
144}
145
146static inline int inet_ehash_locks_alloc(struct inet_hashinfo *hashinfo)
147{
148 unsigned int i, size = 256;
149#if defined(CONFIG_PROVE_LOCKING)
150 unsigned int nr_pcpus = 2;
151#else
152 unsigned int nr_pcpus = num_possible_cpus();
153#endif
154 if (nr_pcpus >= 4)
155 size = 512;
156 if (nr_pcpus >= 8)
157 size = 1024;
158 if (nr_pcpus >= 16)
159 size = 2048;
160 if (nr_pcpus >= 32)
161 size = 4096;
162 if (sizeof(rwlock_t) != 0) {
163#ifdef CONFIG_NUMA
164 if (size * sizeof(rwlock_t) > PAGE_SIZE)
165 hashinfo->ehash_locks = vmalloc(size * sizeof(rwlock_t));
166 else
167#endif
168 hashinfo->ehash_locks = kmalloc(size * sizeof(rwlock_t),
169 GFP_KERNEL);
170 if (!hashinfo->ehash_locks)
171 return ENOMEM;
172 for (i = 0; i < size; i++)
173 rwlock_init(&hashinfo->ehash_locks[i]);
174 }
175 hashinfo->ehash_locks_mask = size - 1;
176 return 0;
177}
178
179static inline void inet_ehash_locks_free(struct inet_hashinfo *hashinfo)
180{
181 if (hashinfo->ehash_locks) {
182#ifdef CONFIG_NUMA
183 unsigned int size = (hashinfo->ehash_locks_mask + 1) *
184 sizeof(rwlock_t);
185 if (size > PAGE_SIZE)
186 vfree(hashinfo->ehash_locks);
187 else
188#else
189 kfree(hashinfo->ehash_locks);
190#endif
191 hashinfo->ehash_locks = NULL;
192 }
193}
194
137extern struct inet_bind_bucket * 195extern struct inet_bind_bucket *
138 inet_bind_bucket_create(struct kmem_cache *cachep, 196 inet_bind_bucket_create(struct kmem_cache *cachep,
139 struct inet_bind_hashbucket *head, 197 struct inet_bind_hashbucket *head,
@@ -222,7 +280,7 @@ static inline void __inet_hash(struct inet_hashinfo *hashinfo,
222 sk->sk_hash = inet_sk_ehashfn(sk); 280 sk->sk_hash = inet_sk_ehashfn(sk);
223 head = inet_ehash_bucket(hashinfo, sk->sk_hash); 281 head = inet_ehash_bucket(hashinfo, sk->sk_hash);
224 list = &head->chain; 282 list = &head->chain;
225 lock = &head->lock; 283 lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
226 write_lock(lock); 284 write_lock(lock);
227 } 285 }
228 __sk_add_node(sk, list); 286 __sk_add_node(sk, list);
@@ -253,7 +311,7 @@ static inline void inet_unhash(struct inet_hashinfo *hashinfo, struct sock *sk)
253 inet_listen_wlock(hashinfo); 311 inet_listen_wlock(hashinfo);
254 lock = &hashinfo->lhash_lock; 312 lock = &hashinfo->lhash_lock;
255 } else { 313 } else {
256 lock = &inet_ehash_bucket(hashinfo, sk->sk_hash)->lock; 314 lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
257 write_lock_bh(lock); 315 write_lock_bh(lock);
258 } 316 }
259 317
@@ -354,9 +412,10 @@ static inline struct sock *
354 */ 412 */
355 unsigned int hash = inet_ehashfn(daddr, hnum, saddr, sport); 413 unsigned int hash = inet_ehashfn(daddr, hnum, saddr, sport);
356 struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); 414 struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash);
415 rwlock_t *lock = inet_ehash_lockp(hashinfo, hash);
357 416
358 prefetch(head->chain.first); 417 prefetch(head->chain.first);
359 read_lock(&head->lock); 418 read_lock(lock);
360 sk_for_each(sk, node, &head->chain) { 419 sk_for_each(sk, node, &head->chain) {
361 if (INET_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) 420 if (INET_MATCH(sk, hash, acookie, saddr, daddr, ports, dif))
362 goto hit; /* You sunk my battleship! */ 421 goto hit; /* You sunk my battleship! */
@@ -369,7 +428,7 @@ static inline struct sock *
369 } 428 }
370 sk = NULL; 429 sk = NULL;
371out: 430out:
372 read_unlock(&head->lock); 431 read_unlock(lock);
373 return sk; 432 return sk;
374hit: 433hit:
375 sock_hold(sk); 434 sock_hold(sk);
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 8cadc77c7df4..ed514bfb61ba 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -185,6 +185,12 @@ static inline void fib_select_default(const struct flowi *flp, struct fib_result
185} 185}
186 186
187#else /* CONFIG_IP_MULTIPLE_TABLES */ 187#else /* CONFIG_IP_MULTIPLE_TABLES */
188extern void __init fib4_rules_init(void);
189
190#ifdef CONFIG_NET_CLS_ROUTE
191extern u32 fib_rules_tclass(struct fib_result *res);
192#endif
193
188#define ip_fib_local_table fib_get_table(RT_TABLE_LOCAL) 194#define ip_fib_local_table fib_get_table(RT_TABLE_LOCAL)
189#define ip_fib_main_table fib_get_table(RT_TABLE_MAIN) 195#define ip_fib_main_table fib_get_table(RT_TABLE_MAIN)
190 196
@@ -214,15 +220,6 @@ extern __be32 __fib_res_prefsrc(struct fib_result *res);
214/* Exported by fib_hash.c */ 220/* Exported by fib_hash.c */
215extern struct fib_table *fib_hash_init(u32 id); 221extern struct fib_table *fib_hash_init(u32 id);
216 222
217#ifdef CONFIG_IP_MULTIPLE_TABLES
218extern void __init fib4_rules_init(void);
219
220#ifdef CONFIG_NET_CLS_ROUTE
221extern u32 fib_rules_tclass(struct fib_result *res);
222#endif
223
224#endif
225
226static inline void fib_combine_itag(u32 *itag, struct fib_result *res) 223static inline void fib_combine_itag(u32 *itag, struct fib_result *res)
227{ 224{
228#ifdef CONFIG_NET_CLS_ROUTE 225#ifdef CONFIG_NET_CLS_ROUTE
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 41870564df8e..67ea2c0c0ab7 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -520,6 +520,10 @@ struct ip_vs_conn {
520 spinlock_t lock; /* lock for state transition */ 520 spinlock_t lock; /* lock for state transition */
521 volatile __u16 flags; /* status flags */ 521 volatile __u16 flags; /* status flags */
522 volatile __u16 state; /* state info */ 522 volatile __u16 state; /* state info */
523 volatile __u16 old_state; /* old state, to be used for
524 * state transition triggerd
525 * synchronization
526 */
523 527
524 /* Control members */ 528 /* Control members */
525 struct ip_vs_conn *control; /* Master control connection */ 529 struct ip_vs_conn *control; /* Master control connection */
@@ -901,6 +905,10 @@ extern int ip_vs_use_count_inc(void);
901extern void ip_vs_use_count_dec(void); 905extern void ip_vs_use_count_dec(void);
902extern int ip_vs_control_init(void); 906extern int ip_vs_control_init(void);
903extern void ip_vs_control_cleanup(void); 907extern void ip_vs_control_cleanup(void);
908extern struct ip_vs_dest *
909ip_vs_find_dest(__be32 daddr, __be16 dport,
910 __be32 vaddr, __be16 vport, __u16 protocol);
911extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp);
904 912
905 913
906/* 914/*
diff --git a/include/net/sock.h b/include/net/sock.h
index 20de3fa7ae40..5504fb9fa88a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -560,6 +560,14 @@ struct proto {
560 void (*unhash)(struct sock *sk); 560 void (*unhash)(struct sock *sk);
561 int (*get_port)(struct sock *sk, unsigned short snum); 561 int (*get_port)(struct sock *sk, unsigned short snum);
562 562
563#ifdef CONFIG_SMP
564 /* Keeping track of sockets in use */
565 void (*inuse_add)(struct proto *prot, int inc);
566 int (*inuse_getval)(const struct proto *prot);
567 int *inuse_ptr;
568#else
569 int inuse;
570#endif
563 /* Memory pressure */ 571 /* Memory pressure */
564 void (*enter_memory_pressure)(void); 572 void (*enter_memory_pressure)(void);
565 atomic_t *memory_allocated; /* Current allocated memory. */ 573 atomic_t *memory_allocated; /* Current allocated memory. */
@@ -592,12 +600,38 @@ struct proto {
592#ifdef SOCK_REFCNT_DEBUG 600#ifdef SOCK_REFCNT_DEBUG
593 atomic_t socks; 601 atomic_t socks;
594#endif 602#endif
595 struct {
596 int inuse;
597 u8 __pad[SMP_CACHE_BYTES - sizeof(int)];
598 } stats[NR_CPUS];
599}; 603};
600 604
605/*
606 * Special macros to let protos use a fast version of inuse{get|add}
607 * using a static percpu variable per proto instead of an allocated one,
608 * saving one dereference.
609 * This might be changed if/when dynamic percpu vars become fast.
610 */
611#ifdef CONFIG_SMP
612# define DEFINE_PROTO_INUSE(NAME) \
613static DEFINE_PER_CPU(int, NAME##_inuse); \
614static void NAME##_inuse_add(struct proto *prot, int inc) \
615{ \
616 __get_cpu_var(NAME##_inuse) += inc; \
617} \
618 \
619static int NAME##_inuse_getval(const struct proto *prot)\
620{ \
621 int res = 0, cpu; \
622 \
623 for_each_possible_cpu(cpu) \
624 res += per_cpu(NAME##_inuse, cpu); \
625 return res; \
626}
627# define REF_PROTO_INUSE(NAME) \
628 .inuse_add = NAME##_inuse_add, \
629 .inuse_getval = NAME##_inuse_getval,
630#else
631# define DEFINE_PROTO_INUSE(NAME)
632# define REF_PROTO_INUSE(NAME)
633#endif
634
601extern int proto_register(struct proto *prot, int alloc_slab); 635extern int proto_register(struct proto *prot, int alloc_slab);
602extern void proto_unregister(struct proto *prot); 636extern void proto_unregister(struct proto *prot);
603 637
@@ -629,12 +663,29 @@ static inline void sk_refcnt_debug_release(const struct sock *sk)
629/* Called with local bh disabled */ 663/* Called with local bh disabled */
630static __inline__ void sock_prot_inc_use(struct proto *prot) 664static __inline__ void sock_prot_inc_use(struct proto *prot)
631{ 665{
632 prot->stats[smp_processor_id()].inuse++; 666#ifdef CONFIG_SMP
667 prot->inuse_add(prot, 1);
668#else
669 prot->inuse++;
670#endif
633} 671}
634 672
635static __inline__ void sock_prot_dec_use(struct proto *prot) 673static __inline__ void sock_prot_dec_use(struct proto *prot)
636{ 674{
637 prot->stats[smp_processor_id()].inuse--; 675#ifdef CONFIG_SMP
676 prot->inuse_add(prot, -1);
677#else
678 prot->inuse--;
679#endif
680}
681
682static __inline__ int sock_prot_inuse(struct proto *proto)
683{
684#ifdef CONFIG_SMP
685 return proto->inuse_getval(proto);
686#else
687 return proto->inuse;
688#endif
638} 689}
639 690
640/* With per-bucket locks this operation is not-atomic, so that 691/* With per-bucket locks this operation is not-atomic, so that
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 4bea182d7116..11f39606e7d9 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -48,9 +48,9 @@
48#include <linux/kref.h> 48#include <linux/kref.h>
49#include <linux/list.h> 49#include <linux/list.h>
50#include <linux/rwsem.h> 50#include <linux/rwsem.h>
51#include <linux/scatterlist.h>
51 52
52#include <asm/atomic.h> 53#include <asm/atomic.h>
53#include <asm/scatterlist.h>
54#include <asm/uaccess.h> 54#include <asm/uaccess.h>
55 55
56union ib_gid { 56union ib_gid {
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 8dda2d66b5b9..a466c2cb8955 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -36,7 +36,7 @@
36#include <scsi/scsi_device.h> 36#include <scsi/scsi_device.h>
37#include <scsi/scsi_cmnd.h> 37#include <scsi/scsi_cmnd.h>
38#include <scsi/scsi_transport_sas.h> 38#include <scsi/scsi_transport_sas.h>
39#include <asm/scatterlist.h> 39#include <linux/scatterlist.h>
40 40
41struct block_device; 41struct block_device;
42 42
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index d5057bc338ff..66e9058357e0 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -46,6 +46,22 @@ enum scsi_device_state {
46 * to the scsi lld. */ 46 * to the scsi lld. */
47}; 47};
48 48
49enum scsi_device_event {
50 SDEV_EVT_MEDIA_CHANGE = 1, /* media has changed */
51
52 SDEV_EVT_LAST = SDEV_EVT_MEDIA_CHANGE,
53 SDEV_EVT_MAXBITS = SDEV_EVT_LAST + 1
54};
55
56struct scsi_event {
57 enum scsi_device_event evt_type;
58 struct list_head node;
59
60 /* put union of data structures, for non-simple event types,
61 * here
62 */
63};
64
49struct scsi_device { 65struct scsi_device {
50 struct Scsi_Host *host; 66 struct Scsi_Host *host;
51 struct request_queue *request_queue; 67 struct request_queue *request_queue;
@@ -127,6 +143,10 @@ struct scsi_device {
127 unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */ 143 unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */
128 unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ 144 unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */
129 145
146 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
147 struct list_head event_list; /* asserted events */
148 struct work_struct event_work;
149
130 unsigned int device_blocked; /* Device returned QUEUE_FULL. */ 150 unsigned int device_blocked; /* Device returned QUEUE_FULL. */
131 151
132 unsigned int max_device_blocked; /* what device_blocked counts down from */ 152 unsigned int max_device_blocked; /* what device_blocked counts down from */
@@ -275,6 +295,11 @@ extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout,
275 int retries); 295 int retries);
276extern int scsi_device_set_state(struct scsi_device *sdev, 296extern int scsi_device_set_state(struct scsi_device *sdev,
277 enum scsi_device_state state); 297 enum scsi_device_state state);
298extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type,
299 gfp_t gfpflags);
300extern void sdev_evt_send(struct scsi_device *sdev, struct scsi_event *evt);
301extern void sdev_evt_send_simple(struct scsi_device *sdev,
302 enum scsi_device_event evt_type, gfp_t gfpflags);
278extern int scsi_device_quiesce(struct scsi_device *sdev); 303extern int scsi_device_quiesce(struct scsi_device *sdev);
279extern void scsi_device_resume(struct scsi_device *sdev); 304extern void scsi_device_resume(struct scsi_device *sdev);
280extern void scsi_target_quiesce(struct scsi_target *); 305extern void scsi_target_quiesce(struct scsi_target *);