diff options
Diffstat (limited to 'include')
69 files changed, 1633 insertions, 397 deletions
diff --git a/include/asm-alpha/agp.h b/include/asm-alpha/agp.h index c99dbbb5bcb5..ef855a3bc0f5 100644 --- a/include/asm-alpha/agp.h +++ b/include/asm-alpha/agp.h | |||
@@ -10,4 +10,14 @@ | |||
10 | #define flush_agp_mappings() | 10 | #define flush_agp_mappings() |
11 | #define flush_agp_cache() mb() | 11 | #define flush_agp_cache() mb() |
12 | 12 | ||
13 | /* Convert a physical address to an address suitable for the GART. */ | ||
14 | #define phys_to_gart(x) (x) | ||
15 | #define gart_to_phys(x) (x) | ||
16 | |||
17 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
18 | #define alloc_gatt_pages(order) \ | ||
19 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
20 | #define free_gatt_pages(table, order) \ | ||
21 | free_pages((unsigned long)(table), (order)) | ||
22 | |||
13 | #endif | 23 | #endif |
diff --git a/include/asm-arm/arch-integrator/platform.h b/include/asm-arm/arch-integrator/platform.h index bd364f5a99bc..96ad3d2a66d1 100644 --- a/include/asm-arm/arch-integrator/platform.h +++ b/include/asm-arm/arch-integrator/platform.h | |||
@@ -293,7 +293,11 @@ | |||
293 | #define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET) | 293 | #define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET) |
294 | 294 | ||
295 | 295 | ||
296 | #if defined(CONFIG_ARCH_INTEGRATOR_AP) | ||
296 | #define INTEGRATOR_GPIO_BASE 0x1B000000 /* GPIO */ | 297 | #define INTEGRATOR_GPIO_BASE 0x1B000000 /* GPIO */ |
298 | #elif defined(CONFIG_ARCH_INTEGRATOR_CP) | ||
299 | #define INTEGRATOR_GPIO_BASE 0xC9000000 /* GPIO */ | ||
300 | #endif | ||
297 | 301 | ||
298 | /* ------------------------------------------------------------------------ | 302 | /* ------------------------------------------------------------------------ |
299 | * KMI keyboard/mouse definitions | 303 | * KMI keyboard/mouse definitions |
diff --git a/include/asm-arm/arch-integrator/smp.h b/include/asm-arm/arch-integrator/smp.h new file mode 100644 index 000000000000..0ec7093f7c37 --- /dev/null +++ b/include/asm-arm/arch-integrator/smp.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef ASMARM_ARCH_SMP_H | ||
2 | #define ASMARM_ARCH_SMP_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #include <asm/arch/hardware.h> | ||
7 | #include <asm/io.h> | ||
8 | |||
9 | #define hard_smp_processor_id() \ | ||
10 | ({ \ | ||
11 | unsigned int cpunum; \ | ||
12 | __asm__("mrc p15, 0, %0, c0, c0, 5" \ | ||
13 | : "=r" (cpunum)); \ | ||
14 | cpunum &= 0x0F; \ | ||
15 | }) | ||
16 | |||
17 | extern void secondary_scan_irqs(void); | ||
18 | |||
19 | #endif | ||
diff --git a/include/asm-arm/arch-ixp2000/io.h b/include/asm-arm/arch-ixp2000/io.h index a8e3c2daefd6..083462668e18 100644 --- a/include/asm-arm/arch-ixp2000/io.h +++ b/include/asm-arm/arch-ixp2000/io.h | |||
@@ -75,8 +75,8 @@ static inline void insw(u32 ptr, void *buf, int length) | |||
75 | * Is this cycle meant for the CS8900? | 75 | * Is this cycle meant for the CS8900? |
76 | */ | 76 | */ |
77 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && | 77 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && |
78 | ((port >= IXDP2X01_CS8900_VIRT_BASE) && | 78 | (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) && |
79 | (port <= IXDP2X01_CS8900_VIRT_END))) { | 79 | ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) { |
80 | u8 *buf8 = (u8*)buf; | 80 | u8 *buf8 = (u8*)buf; |
81 | register u32 tmp32; | 81 | register u32 tmp32; |
82 | 82 | ||
@@ -100,8 +100,8 @@ static inline void outsw(u32 ptr, void *buf, int length) | |||
100 | * Is this cycle meant for the CS8900? | 100 | * Is this cycle meant for the CS8900? |
101 | */ | 101 | */ |
102 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && | 102 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && |
103 | ((port >= IXDP2X01_CS8900_VIRT_BASE) && | 103 | (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) && |
104 | (port <= IXDP2X01_CS8900_VIRT_END))) { | 104 | ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) { |
105 | register u32 tmp32; | 105 | register u32 tmp32; |
106 | u8 *buf8 = (u8*)buf; | 106 | u8 *buf8 = (u8*)buf; |
107 | do { | 107 | do { |
@@ -124,8 +124,8 @@ static inline u16 inw(u32 ptr) | |||
124 | * Is this cycle meant for the CS8900? | 124 | * Is this cycle meant for the CS8900? |
125 | */ | 125 | */ |
126 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && | 126 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && |
127 | ((port >= IXDP2X01_CS8900_VIRT_BASE) && | 127 | (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) && |
128 | (port <= IXDP2X01_CS8900_VIRT_END))) { | 128 | ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) { |
129 | return (u16)(*port); | 129 | return (u16)(*port); |
130 | } | 130 | } |
131 | 131 | ||
@@ -137,8 +137,8 @@ static inline void outw(u16 value, u32 ptr) | |||
137 | register volatile u32 *port = (volatile u32 *)ptr; | 137 | register volatile u32 *port = (volatile u32 *)ptr; |
138 | 138 | ||
139 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && | 139 | if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && |
140 | ((port >= IXDP2X01_CS8900_VIRT_BASE) && | 140 | (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) && |
141 | (port <= IXDP2X01_CS8900_VIRT_END))) { | 141 | ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) { |
142 | *port = value; | 142 | *port = value; |
143 | return; | 143 | return; |
144 | } | 144 | } |
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index 39741d3c9a34..b5e54a9e9fa7 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -1296,6 +1296,7 @@ | |||
1296 | #define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */ | 1296 | #define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */ |
1297 | #define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */ | 1297 | #define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */ |
1298 | #define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */ | 1298 | #define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */ |
1299 | #define GPIO113_I2S_SYSCLK 113 /* I2S System Clock (PXA27x) */ | ||
1299 | #define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */ | 1300 | #define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */ |
1300 | 1301 | ||
1301 | /* GPIO alternate function mode & direction */ | 1302 | /* GPIO alternate function mode & direction */ |
@@ -1428,6 +1429,7 @@ | |||
1428 | #define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT) | 1429 | #define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT) |
1429 | #define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT) | 1430 | #define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT) |
1430 | #define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT) | 1431 | #define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT) |
1432 | #define GPIO113_I2S_SYSCLK_MD (113 | GPIO_ALT_FN_1_OUT) | ||
1431 | #define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT) | 1433 | #define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT) |
1432 | #define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_OUT) | 1434 | #define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_OUT) |
1433 | #define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN) | 1435 | #define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN) |
diff --git a/include/asm-arm/arch-versatile/platform.h b/include/asm-arm/arch-versatile/platform.h index 2598d1f08548..a71093e44c58 100644 --- a/include/asm-arm/arch-versatile/platform.h +++ b/include/asm-arm/arch-versatile/platform.h | |||
@@ -498,11 +498,17 @@ | |||
498 | /* | 498 | /* |
499 | * IB2 Versatile/AB expansion board definitions | 499 | * IB2 Versatile/AB expansion board definitions |
500 | */ | 500 | */ |
501 | #define VERSATILE_IB2_CAMERA_BANK 0x24000000 | 501 | #define VERSATILE_IB2_CAMERA_BANK VERSATILE_IB2_BASE |
502 | #define VERSATILE_IB2_KBD_DATAREG 0x25000000 | 502 | #define VERSATILE_IB2_KBD_DATAREG (VERSATILE_IB2_BASE + 0x01000000) |
503 | #define VERSATILE_IB2_IER 0x26000000 /* for VICINTSOURCE27 */ | 503 | |
504 | #define VERSATILE_IB2_CTRL 0x27000000 | 504 | /* VICINTSOURCE27 */ |
505 | #define VERSATILE_IB2_STAT 0x27000004 | 505 | #define VERSATILE_IB2_INT_BASE (VERSATILE_IB2_BASE + 0x02000000) |
506 | #define VERSATILE_IB2_IER (VERSATILE_IB2_INT_BASE + 0) | ||
507 | #define VERSATILE_IB2_ISR (VERSATILE_IB2_INT_BASE + 4) | ||
508 | |||
509 | #define VERSATILE_IB2_CTL_BASE (VERSATILE_IB2_BASE + 0x03000000) | ||
510 | #define VERSATILE_IB2_CTRL (VERSATILE_IB2_CTL_BASE + 0) | ||
511 | #define VERSATILE_IB2_STAT (VERSATILE_IB2_CTL_BASE + 4) | ||
506 | #endif | 512 | #endif |
507 | 513 | ||
508 | #endif | 514 | #endif |
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h index cbceacbe5afa..a1696ba238d3 100644 --- a/include/asm-arm/elf.h +++ b/include/asm-arm/elf.h | |||
@@ -38,9 +38,9 @@ typedef struct user_fp elf_fpregset_t; | |||
38 | */ | 38 | */ |
39 | #define ELF_CLASS ELFCLASS32 | 39 | #define ELF_CLASS ELFCLASS32 |
40 | #ifdef __ARMEB__ | 40 | #ifdef __ARMEB__ |
41 | #define ELF_DATA ELFDATA2MSB; | 41 | #define ELF_DATA ELFDATA2MSB |
42 | #else | 42 | #else |
43 | #define ELF_DATA ELFDATA2LSB; | 43 | #define ELF_DATA ELFDATA2LSB |
44 | #endif | 44 | #endif |
45 | #define ELF_ARCH EM_ARM | 45 | #define ELF_ARCH EM_ARM |
46 | 46 | ||
diff --git a/include/asm-arm/smp.h b/include/asm-arm/smp.h index f21fd8f6bcdd..bd44f894690f 100644 --- a/include/asm-arm/smp.h +++ b/include/asm-arm/smp.h | |||
@@ -55,4 +55,18 @@ extern void smp_cross_call(cpumask_t callmap); | |||
55 | */ | 55 | */ |
56 | extern int boot_secondary(unsigned int cpu, struct task_struct *); | 56 | extern int boot_secondary(unsigned int cpu, struct task_struct *); |
57 | 57 | ||
58 | /* | ||
59 | * Perform platform specific initialisation of the specified CPU. | ||
60 | */ | ||
61 | extern void platform_secondary_init(unsigned int cpu); | ||
62 | |||
63 | /* | ||
64 | * Initial data for bringing up a secondary CPU. | ||
65 | */ | ||
66 | struct secondary_data { | ||
67 | unsigned long pgdir; | ||
68 | void *stack; | ||
69 | }; | ||
70 | extern struct secondary_data secondary_data; | ||
71 | |||
58 | #endif /* ifndef __ASM_ARM_SMP_H */ | 72 | #endif /* ifndef __ASM_ARM_SMP_H */ |
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index b13a8da4847b..8405eb6558ed 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -104,6 +104,7 @@ extern void show_pte(struct mm_struct *mm, unsigned long addr); | |||
104 | extern void __show_regs(struct pt_regs *); | 104 | extern void __show_regs(struct pt_regs *); |
105 | 105 | ||
106 | extern int cpu_architecture(void); | 106 | extern int cpu_architecture(void); |
107 | extern void cpu_init(void); | ||
107 | 108 | ||
108 | #define set_cr(x) \ | 109 | #define set_cr(x) \ |
109 | __asm__ __volatile__( \ | 110 | __asm__ __volatile__( \ |
diff --git a/include/asm-arm26/elf.h b/include/asm-arm26/elf.h index 8b149474db24..5a47fdb3015d 100644 --- a/include/asm-arm26/elf.h +++ b/include/asm-arm26/elf.h | |||
@@ -36,7 +36,7 @@ typedef struct { void *null; } elf_fpregset_t; | |||
36 | * These are used to set parameters in the core dumps. | 36 | * These are used to set parameters in the core dumps. |
37 | */ | 37 | */ |
38 | #define ELF_CLASS ELFCLASS32 | 38 | #define ELF_CLASS ELFCLASS32 |
39 | #define ELF_DATA ELFDATA2LSB; | 39 | #define ELF_DATA ELFDATA2LSB |
40 | #define ELF_ARCH EM_ARM | 40 | #define ELF_ARCH EM_ARM |
41 | 41 | ||
42 | #define USE_ELF_CORE_DUMP | 42 | #define USE_ELF_CORE_DUMP |
diff --git a/include/asm-arm26/signal.h b/include/asm-arm26/signal.h index dedb29280303..37ad25355591 100644 --- a/include/asm-arm26/signal.h +++ b/include/asm-arm26/signal.h | |||
@@ -166,9 +166,6 @@ typedef struct sigaltstack { | |||
166 | #include <asm/sigcontext.h> | 166 | #include <asm/sigcontext.h> |
167 | 167 | ||
168 | #define sigmask(sig) (1UL << ((sig) - 1)) | 168 | #define sigmask(sig) (1UL << ((sig) - 1)) |
169 | //FIXME!!! | ||
170 | //#define HAVE_ARCH_GET_SIGNAL_TO_DELIVER | ||
171 | |||
172 | #endif | 169 | #endif |
173 | 170 | ||
174 | 171 | ||
diff --git a/include/asm-h8300/kmap_types.h b/include/asm-h8300/kmap_types.h index 82431edeb2a1..1ec8a3427120 100644 --- a/include/asm-h8300/kmap_types.h +++ b/include/asm-h8300/kmap_types.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _ASM_KMAP_TYPES_H | 1 | #ifndef _ASM_H8300_KMAP_TYPES_H |
2 | #define _ASM_KMAP_TYPES_H | 2 | #define _ASM_H8300_KMAP_TYPES_H |
3 | 3 | ||
4 | enum km_type { | 4 | enum km_type { |
5 | KM_BOUNCE_READ, | 5 | KM_BOUNCE_READ, |
@@ -13,6 +13,8 @@ enum km_type { | |||
13 | KM_PTE1, | 13 | KM_PTE1, |
14 | KM_IRQ0, | 14 | KM_IRQ0, |
15 | KM_IRQ1, | 15 | KM_IRQ1, |
16 | KM_SOFTIRQ0, | ||
17 | KM_SOFTIRQ1, | ||
16 | KM_TYPE_NR | 18 | KM_TYPE_NR |
17 | }; | 19 | }; |
18 | 20 | ||
diff --git a/include/asm-h8300/mman.h b/include/asm-h8300/mman.h index abe08856c84f..63f727a59850 100644 --- a/include/asm-h8300/mman.h +++ b/include/asm-h8300/mman.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #define PROT_READ 0x1 /* page can be read */ | 4 | #define PROT_READ 0x1 /* page can be read */ |
5 | #define PROT_WRITE 0x2 /* page can be written */ | 5 | #define PROT_WRITE 0x2 /* page can be written */ |
6 | #define PROT_EXEC 0x4 /* page can be executed */ | 6 | #define PROT_EXEC 0x4 /* page can be executed */ |
7 | #define PROT_SEM 0x8 /* page may be used for atomic ops */ | ||
7 | #define PROT_NONE 0x0 /* page can not be accessed */ | 8 | #define PROT_NONE 0x0 /* page can not be accessed */ |
8 | #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ | 9 | #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ |
9 | #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ | 10 | #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ |
@@ -19,6 +20,8 @@ | |||
19 | #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ | 20 | #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ |
20 | #define MAP_LOCKED 0x2000 /* pages are locked */ | 21 | #define MAP_LOCKED 0x2000 /* pages are locked */ |
21 | #define MAP_NORESERVE 0x4000 /* don't check for reservations */ | 22 | #define MAP_NORESERVE 0x4000 /* don't check for reservations */ |
23 | #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ | ||
24 | #define MAP_NONBLOCK 0x10000 /* do not block on IO */ | ||
22 | 25 | ||
23 | #define MS_ASYNC 1 /* sync memory asynchronously */ | 26 | #define MS_ASYNC 1 /* sync memory asynchronously */ |
24 | #define MS_INVALIDATE 2 /* invalidate the caches */ | 27 | #define MS_INVALIDATE 2 /* invalidate the caches */ |
diff --git a/include/asm-i386/agp.h b/include/asm-i386/agp.h index a917ff50354f..b82f5f3ab887 100644 --- a/include/asm-i386/agp.h +++ b/include/asm-i386/agp.h | |||
@@ -21,4 +21,14 @@ int unmap_page_from_agp(struct page *page); | |||
21 | worth it. Would need a page for it. */ | 21 | worth it. Would need a page for it. */ |
22 | #define flush_agp_cache() asm volatile("wbinvd":::"memory") | 22 | #define flush_agp_cache() asm volatile("wbinvd":::"memory") |
23 | 23 | ||
24 | /* Convert a physical address to an address suitable for the GART. */ | ||
25 | #define phys_to_gart(x) (x) | ||
26 | #define gart_to_phys(x) (x) | ||
27 | |||
28 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
29 | #define alloc_gatt_pages(order) \ | ||
30 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
31 | #define free_gatt_pages(table, order) \ | ||
32 | free_pages((unsigned long)(table), (order)) | ||
33 | |||
24 | #endif | 34 | #endif |
diff --git a/include/asm-i386/mach-numaq/mach_ipi.h b/include/asm-i386/mach-numaq/mach_ipi.h index 1b46fd3f2ae3..c6044488e9e6 100644 --- a/include/asm-i386/mach-numaq/mach_ipi.h +++ b/include/asm-i386/mach-numaq/mach_ipi.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __ASM_MACH_IPI_H | 1 | #ifndef __ASM_MACH_IPI_H |
2 | #define __ASM_MACH_IPI_H | 2 | #define __ASM_MACH_IPI_H |
3 | 3 | ||
4 | inline void send_IPI_mask_sequence(cpumask_t, int vector); | 4 | void send_IPI_mask_sequence(cpumask_t, int vector); |
5 | 5 | ||
6 | static inline void send_IPI_mask(cpumask_t mask, int vector) | 6 | static inline void send_IPI_mask(cpumask_t mask, int vector) |
7 | { | 7 | { |
diff --git a/include/asm-ia64/agp.h b/include/asm-ia64/agp.h index d1316f1e6ee1..4e517f0e6afa 100644 --- a/include/asm-ia64/agp.h +++ b/include/asm-ia64/agp.h | |||
@@ -18,4 +18,14 @@ | |||
18 | #define flush_agp_mappings() /* nothing */ | 18 | #define flush_agp_mappings() /* nothing */ |
19 | #define flush_agp_cache() mb() | 19 | #define flush_agp_cache() mb() |
20 | 20 | ||
21 | /* Convert a physical address to an address suitable for the GART. */ | ||
22 | #define phys_to_gart(x) (x) | ||
23 | #define gart_to_phys(x) (x) | ||
24 | |||
25 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
26 | #define alloc_gatt_pages(order) \ | ||
27 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
28 | #define free_gatt_pages(table, order) \ | ||
29 | free_pages((unsigned long)(table), (order)) | ||
30 | |||
21 | #endif /* _ASM_IA64_AGP_H */ | 31 | #endif /* _ASM_IA64_AGP_H */ |
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index ea121a002309..fcc9c3344ab4 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * This hopefully works with any (fixed) IA-64 page-size, as defined | 8 | * This hopefully works with any (fixed) IA-64 page-size, as defined |
9 | * in <asm/page.h>. | 9 | * in <asm/page.h>. |
10 | * | 10 | * |
11 | * Copyright (C) 1998-2004 Hewlett-Packard Co | 11 | * Copyright (C) 1998-2005 Hewlett-Packard Co |
12 | * David Mosberger-Tang <davidm@hpl.hp.com> | 12 | * David Mosberger-Tang <davidm@hpl.hp.com> |
13 | */ | 13 | */ |
14 | 14 | ||
@@ -551,7 +551,11 @@ do { \ | |||
551 | 551 | ||
552 | /* These tell get_user_pages() that the first gate page is accessible from user-level. */ | 552 | /* These tell get_user_pages() that the first gate page is accessible from user-level. */ |
553 | #define FIXADDR_USER_START GATE_ADDR | 553 | #define FIXADDR_USER_START GATE_ADDR |
554 | #define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) | 554 | #ifdef HAVE_BUGGY_SEGREL |
555 | # define FIXADDR_USER_END (GATE_ADDR + 2*PAGE_SIZE) | ||
556 | #else | ||
557 | # define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) | ||
558 | #endif | ||
555 | 559 | ||
556 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 560 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
557 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | 561 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY |
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h index 9e1ba8b7fb68..91bbd1f22461 100644 --- a/include/asm-ia64/processor.h +++ b/include/asm-ia64/processor.h | |||
@@ -403,7 +403,10 @@ extern void ia64_setreg_unknown_kr (void); | |||
403 | * task_struct at this point. | 403 | * task_struct at this point. |
404 | */ | 404 | */ |
405 | 405 | ||
406 | /* Return TRUE if task T owns the fph partition of the CPU we're running on. */ | 406 | /* |
407 | * Return TRUE if task T owns the fph partition of the CPU we're running on. | ||
408 | * Must be called from code that has preemption disabled. | ||
409 | */ | ||
407 | #define ia64_is_local_fpu_owner(t) \ | 410 | #define ia64_is_local_fpu_owner(t) \ |
408 | ({ \ | 411 | ({ \ |
409 | struct task_struct *__ia64_islfo_task = (t); \ | 412 | struct task_struct *__ia64_islfo_task = (t); \ |
@@ -411,7 +414,10 @@ extern void ia64_setreg_unknown_kr (void); | |||
411 | && __ia64_islfo_task == (struct task_struct *) ia64_get_kr(IA64_KR_FPU_OWNER)); \ | 414 | && __ia64_islfo_task == (struct task_struct *) ia64_get_kr(IA64_KR_FPU_OWNER)); \ |
412 | }) | 415 | }) |
413 | 416 | ||
414 | /* Mark task T as owning the fph partition of the CPU we're running on. */ | 417 | /* |
418 | * Mark task T as owning the fph partition of the CPU we're running on. | ||
419 | * Must be called from code that has preemption disabled. | ||
420 | */ | ||
415 | #define ia64_set_local_fpu_owner(t) do { \ | 421 | #define ia64_set_local_fpu_owner(t) do { \ |
416 | struct task_struct *__ia64_slfo_task = (t); \ | 422 | struct task_struct *__ia64_slfo_task = (t); \ |
417 | __ia64_slfo_task->thread.last_fph_cpu = smp_processor_id(); \ | 423 | __ia64_slfo_task->thread.last_fph_cpu = smp_processor_id(); \ |
diff --git a/include/asm-ppc/agp.h b/include/asm-ppc/agp.h index be27cfa8c5b0..ca9e423307f4 100644 --- a/include/asm-ppc/agp.h +++ b/include/asm-ppc/agp.h | |||
@@ -10,4 +10,14 @@ | |||
10 | #define flush_agp_mappings() | 10 | #define flush_agp_mappings() |
11 | #define flush_agp_cache() mb() | 11 | #define flush_agp_cache() mb() |
12 | 12 | ||
13 | /* Convert a physical address to an address suitable for the GART. */ | ||
14 | #define phys_to_gart(x) (x) | ||
15 | #define gart_to_phys(x) (x) | ||
16 | |||
17 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
18 | #define alloc_gatt_pages(order) \ | ||
19 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
20 | #define free_gatt_pages(table, order) \ | ||
21 | free_pages((unsigned long)(table), (order)) | ||
22 | |||
13 | #endif | 23 | #endif |
diff --git a/include/asm-ppc/seccomp.h b/include/asm-ppc/seccomp.h new file mode 100644 index 000000000000..666c4da96d87 --- /dev/null +++ b/include/asm-ppc/seccomp.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef _ASM_SECCOMP_H | ||
2 | |||
3 | #include <linux/unistd.h> | ||
4 | |||
5 | #define __NR_seccomp_read __NR_read | ||
6 | #define __NR_seccomp_write __NR_write | ||
7 | #define __NR_seccomp_exit __NR_exit | ||
8 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
9 | |||
10 | #endif /* _ASM_SECCOMP_H */ | ||
diff --git a/include/asm-ppc/sigcontext.h b/include/asm-ppc/sigcontext.h index f82dcccdee1e..b7a417e0a921 100644 --- a/include/asm-ppc/sigcontext.h +++ b/include/asm-ppc/sigcontext.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _ASM_PPC_SIGCONTEXT_H | 2 | #define _ASM_PPC_SIGCONTEXT_H |
3 | 3 | ||
4 | #include <asm/ptrace.h> | 4 | #include <asm/ptrace.h> |
5 | 5 | #include <linux/compiler.h> | |
6 | 6 | ||
7 | struct sigcontext { | 7 | struct sigcontext { |
8 | unsigned long _unused[4]; | 8 | unsigned long _unused[4]; |
diff --git a/include/asm-ppc/thread_info.h b/include/asm-ppc/thread_info.h index f7f01524e8a8..e3b5284a6f91 100644 --- a/include/asm-ppc/thread_info.h +++ b/include/asm-ppc/thread_info.h | |||
@@ -77,12 +77,19 @@ static inline struct thread_info *current_thread_info(void) | |||
77 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling | 77 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling |
78 | TIF_NEED_RESCHED */ | 78 | TIF_NEED_RESCHED */ |
79 | #define TIF_MEMDIE 5 | 79 | #define TIF_MEMDIE 5 |
80 | #define TIF_SYSCALL_AUDIT 6 /* syscall auditing active */ | ||
81 | #define TIF_SECCOMP 7 /* secure computing */ | ||
82 | |||
80 | /* as above, but as bit values */ | 83 | /* as above, but as bit values */ |
81 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 84 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
82 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | 85 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) |
83 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | 86 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) |
84 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 87 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
85 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 88 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
89 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | ||
90 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | ||
91 | |||
92 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) | ||
86 | 93 | ||
87 | /* | 94 | /* |
88 | * Non racy (local) flags bit numbers | 95 | * Non racy (local) flags bit numbers |
diff --git a/include/asm-ppc64/agp.h b/include/asm-ppc64/agp.h index be27cfa8c5b0..ca9e423307f4 100644 --- a/include/asm-ppc64/agp.h +++ b/include/asm-ppc64/agp.h | |||
@@ -10,4 +10,14 @@ | |||
10 | #define flush_agp_mappings() | 10 | #define flush_agp_mappings() |
11 | #define flush_agp_cache() mb() | 11 | #define flush_agp_cache() mb() |
12 | 12 | ||
13 | /* Convert a physical address to an address suitable for the GART. */ | ||
14 | #define phys_to_gart(x) (x) | ||
15 | #define gart_to_phys(x) (x) | ||
16 | |||
17 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
18 | #define alloc_gatt_pages(order) \ | ||
19 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
20 | #define free_gatt_pages(table, order) \ | ||
21 | free_pages((unsigned long)(table), (order)) | ||
22 | |||
13 | #endif | 23 | #endif |
diff --git a/include/asm-ppc64/elf.h b/include/asm-ppc64/elf.h index 6c42d61bedd1..085eedb956fe 100644 --- a/include/asm-ppc64/elf.h +++ b/include/asm-ppc64/elf.h | |||
@@ -221,9 +221,7 @@ do { \ | |||
221 | set_thread_flag(TIF_ABI_PENDING); \ | 221 | set_thread_flag(TIF_ABI_PENDING); \ |
222 | else \ | 222 | else \ |
223 | clear_thread_flag(TIF_ABI_PENDING); \ | 223 | clear_thread_flag(TIF_ABI_PENDING); \ |
224 | if (ibcs2) \ | 224 | if (personality(current->personality) != PER_LINUX32) \ |
225 | set_personality(PER_SVR4); \ | ||
226 | else if (current->personality != PER_LINUX32) \ | ||
227 | set_personality(PER_LINUX); \ | 225 | set_personality(PER_LINUX); \ |
228 | } while (0) | 226 | } while (0) |
229 | 227 | ||
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h index 0035efe2db2b..809c634ba1df 100644 --- a/include/asm-ppc64/processor.h +++ b/include/asm-ppc64/processor.h | |||
@@ -120,103 +120,18 @@ | |||
120 | 120 | ||
121 | /* Special Purpose Registers (SPRNs)*/ | 121 | /* Special Purpose Registers (SPRNs)*/ |
122 | 122 | ||
123 | #define SPRN_CDBCR 0x3D7 /* Cache Debug Control Register */ | ||
124 | #define SPRN_CTR 0x009 /* Count Register */ | 123 | #define SPRN_CTR 0x009 /* Count Register */ |
125 | #define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ | 124 | #define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ |
126 | #define SPRN_DAC1 0x3F6 /* Data Address Compare 1 */ | 125 | #define DABR_TRANSLATION (1UL << 2) |
127 | #define SPRN_DAC2 0x3F7 /* Data Address Compare 2 */ | ||
128 | #define SPRN_DAR 0x013 /* Data Address Register */ | 126 | #define SPRN_DAR 0x013 /* Data Address Register */ |
129 | #define SPRN_DBCR 0x3F2 /* Debug Control Regsiter */ | ||
130 | #define DBCR_EDM 0x80000000 | ||
131 | #define DBCR_IDM 0x40000000 | ||
132 | #define DBCR_RST(x) (((x) & 0x3) << 28) | ||
133 | #define DBCR_RST_NONE 0 | ||
134 | #define DBCR_RST_CORE 1 | ||
135 | #define DBCR_RST_CHIP 2 | ||
136 | #define DBCR_RST_SYSTEM 3 | ||
137 | #define DBCR_IC 0x08000000 /* Instruction Completion Debug Evnt */ | ||
138 | #define DBCR_BT 0x04000000 /* Branch Taken Debug Event */ | ||
139 | #define DBCR_EDE 0x02000000 /* Exception Debug Event */ | ||
140 | #define DBCR_TDE 0x01000000 /* TRAP Debug Event */ | ||
141 | #define DBCR_FER 0x00F80000 /* First Events Remaining Mask */ | ||
142 | #define DBCR_FT 0x00040000 /* Freeze Timers on Debug Event */ | ||
143 | #define DBCR_IA1 0x00020000 /* Instr. Addr. Compare 1 Enable */ | ||
144 | #define DBCR_IA2 0x00010000 /* Instr. Addr. Compare 2 Enable */ | ||
145 | #define DBCR_D1R 0x00008000 /* Data Addr. Compare 1 Read Enable */ | ||
146 | #define DBCR_D1W 0x00004000 /* Data Addr. Compare 1 Write Enable */ | ||
147 | #define DBCR_D1S(x) (((x) & 0x3) << 12) /* Data Adrr. Compare 1 Size */ | ||
148 | #define DAC_BYTE 0 | ||
149 | #define DAC_HALF 1 | ||
150 | #define DAC_WORD 2 | ||
151 | #define DAC_QUAD 3 | ||
152 | #define DBCR_D2R 0x00000800 /* Data Addr. Compare 2 Read Enable */ | ||
153 | #define DBCR_D2W 0x00000400 /* Data Addr. Compare 2 Write Enable */ | ||
154 | #define DBCR_D2S(x) (((x) & 0x3) << 8) /* Data Addr. Compare 2 Size */ | ||
155 | #define DBCR_SBT 0x00000040 /* Second Branch Taken Debug Event */ | ||
156 | #define DBCR_SED 0x00000020 /* Second Exception Debug Event */ | ||
157 | #define DBCR_STD 0x00000010 /* Second Trap Debug Event */ | ||
158 | #define DBCR_SIA 0x00000008 /* Second IAC Enable */ | ||
159 | #define DBCR_SDA 0x00000004 /* Second DAC Enable */ | ||
160 | #define DBCR_JOI 0x00000002 /* JTAG Serial Outbound Int. Enable */ | ||
161 | #define DBCR_JII 0x00000001 /* JTAG Serial Inbound Int. Enable */ | ||
162 | #define SPRN_DBCR0 0x3F2 /* Debug Control Register 0 */ | ||
163 | #define SPRN_DBCR1 0x3BD /* Debug Control Register 1 */ | ||
164 | #define SPRN_DBSR 0x3F0 /* Debug Status Register */ | ||
165 | #define SPRN_DCCR 0x3FA /* Data Cache Cacheability Register */ | ||
166 | #define DCCR_NOCACHE 0 /* Noncacheable */ | ||
167 | #define DCCR_CACHE 1 /* Cacheable */ | ||
168 | #define SPRN_DCMP 0x3D1 /* Data TLB Compare Register */ | ||
169 | #define SPRN_DCWR 0x3BA /* Data Cache Write-thru Register */ | ||
170 | #define DCWR_COPY 0 /* Copy-back */ | ||
171 | #define DCWR_WRITE 1 /* Write-through */ | ||
172 | #define SPRN_DEAR 0x3D5 /* Data Error Address Register */ | ||
173 | #define SPRN_DEC 0x016 /* Decrement Register */ | 127 | #define SPRN_DEC 0x016 /* Decrement Register */ |
174 | #define SPRN_DMISS 0x3D0 /* Data TLB Miss Register */ | ||
175 | #define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ | 128 | #define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ |
176 | #define DSISR_NOHPTE 0x40000000 /* no translation found */ | 129 | #define DSISR_NOHPTE 0x40000000 /* no translation found */ |
177 | #define DSISR_PROTFAULT 0x08000000 /* protection fault */ | 130 | #define DSISR_PROTFAULT 0x08000000 /* protection fault */ |
178 | #define DSISR_ISSTORE 0x02000000 /* access was a store */ | 131 | #define DSISR_ISSTORE 0x02000000 /* access was a store */ |
179 | #define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */ | 132 | #define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */ |
180 | #define DSISR_NOSEGMENT 0x00200000 /* STAB/SLB miss */ | 133 | #define DSISR_NOSEGMENT 0x00200000 /* STAB/SLB miss */ |
181 | #define SPRN_EAR 0x11A /* External Address Register */ | ||
182 | #define SPRN_ESR 0x3D4 /* Exception Syndrome Register */ | ||
183 | #define ESR_IMCP 0x80000000 /* Instr. Machine Check - Protection */ | ||
184 | #define ESR_IMCN 0x40000000 /* Instr. Machine Check - Non-config */ | ||
185 | #define ESR_IMCB 0x20000000 /* Instr. Machine Check - Bus error */ | ||
186 | #define ESR_IMCT 0x10000000 /* Instr. Machine Check - Timeout */ | ||
187 | #define ESR_PIL 0x08000000 /* Program Exception - Illegal */ | ||
188 | #define ESR_PPR 0x04000000 /* Program Exception - Priveleged */ | ||
189 | #define ESR_PTR 0x02000000 /* Program Exception - Trap */ | ||
190 | #define ESR_DST 0x00800000 /* Storage Exception - Data miss */ | ||
191 | #define ESR_DIZ 0x00400000 /* Storage Exception - Zone fault */ | ||
192 | #define SPRN_EVPR 0x3D6 /* Exception Vector Prefix Register */ | ||
193 | #define SPRN_HASH1 0x3D2 /* Primary Hash Address Register */ | ||
194 | #define SPRN_HASH2 0x3D3 /* Secondary Hash Address Resgister */ | ||
195 | #define SPRN_HID0 0x3F0 /* Hardware Implementation Register 0 */ | 134 | #define SPRN_HID0 0x3F0 /* Hardware Implementation Register 0 */ |
196 | #define HID0_EMCP (1<<31) /* Enable Machine Check pin */ | ||
197 | #define HID0_EBA (1<<29) /* Enable Bus Address Parity */ | ||
198 | #define HID0_EBD (1<<28) /* Enable Bus Data Parity */ | ||
199 | #define HID0_SBCLK (1<<27) | ||
200 | #define HID0_EICE (1<<26) | ||
201 | #define HID0_ECLK (1<<25) | ||
202 | #define HID0_PAR (1<<24) | ||
203 | #define HID0_DOZE (1<<23) | ||
204 | #define HID0_NAP (1<<22) | ||
205 | #define HID0_SLEEP (1<<21) | ||
206 | #define HID0_DPM (1<<20) | ||
207 | #define HID0_ICE (1<<15) /* Instruction Cache Enable */ | ||
208 | #define HID0_DCE (1<<14) /* Data Cache Enable */ | ||
209 | #define HID0_ILOCK (1<<13) /* Instruction Cache Lock */ | ||
210 | #define HID0_DLOCK (1<<12) /* Data Cache Lock */ | ||
211 | #define HID0_ICFI (1<<11) /* Instr. Cache Flash Invalidate */ | ||
212 | #define HID0_DCI (1<<10) /* Data Cache Invalidate */ | ||
213 | #define HID0_SPD (1<<9) /* Speculative disable */ | ||
214 | #define HID0_SGE (1<<7) /* Store Gathering Enable */ | ||
215 | #define HID0_SIED (1<<7) /* Serial Instr. Execution [Disable] */ | ||
216 | #define HID0_BTIC (1<<5) /* Branch Target Instruction Cache Enable */ | ||
217 | #define HID0_ABE (1<<3) /* Address Broadcast Enable */ | ||
218 | #define HID0_BHTE (1<<2) /* Branch History Table Enable */ | ||
219 | #define HID0_BTCD (1<<1) /* Branch target cache disable */ | ||
220 | #define SPRN_MSRDORM 0x3F1 /* Hardware Implementation Register 1 */ | 135 | #define SPRN_MSRDORM 0x3F1 /* Hardware Implementation Register 1 */ |
221 | #define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */ | 136 | #define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */ |
222 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ | 137 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ |
@@ -225,23 +140,8 @@ | |||
225 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ | 140 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ |
226 | #define SPRN_TSC 0x3FD /* Thread switch control */ | 141 | #define SPRN_TSC 0x3FD /* Thread switch control */ |
227 | #define SPRN_TST 0x3FC /* Thread switch timeout */ | 142 | #define SPRN_TST 0x3FC /* Thread switch timeout */ |
228 | #define SPRN_IAC1 0x3F4 /* Instruction Address Compare 1 */ | ||
229 | #define SPRN_IAC2 0x3F5 /* Instruction Address Compare 2 */ | ||
230 | #define SPRN_ICCR 0x3FB /* Instruction Cache Cacheability Register */ | ||
231 | #define ICCR_NOCACHE 0 /* Noncacheable */ | ||
232 | #define ICCR_CACHE 1 /* Cacheable */ | ||
233 | #define SPRN_ICDBDR 0x3D3 /* Instruction Cache Debug Data Register */ | ||
234 | #define SPRN_ICMP 0x3D5 /* Instruction TLB Compare Register */ | ||
235 | #define SPRN_ICTC 0x3FB /* Instruction Cache Throttling Control Reg */ | ||
236 | #define SPRN_IMISS 0x3D4 /* Instruction TLB Miss Register */ | ||
237 | #define SPRN_IMMR 0x27E /* Internal Memory Map Register */ | ||
238 | #define SPRN_L2CR 0x3F9 /* Level 2 Cache Control Regsiter */ | 143 | #define SPRN_L2CR 0x3F9 /* Level 2 Cache Control Regsiter */ |
239 | #define SPRN_LR 0x008 /* Link Register */ | 144 | #define SPRN_LR 0x008 /* Link Register */ |
240 | #define SPRN_PBL1 0x3FC /* Protection Bound Lower 1 */ | ||
241 | #define SPRN_PBL2 0x3FE /* Protection Bound Lower 2 */ | ||
242 | #define SPRN_PBU1 0x3FD /* Protection Bound Upper 1 */ | ||
243 | #define SPRN_PBU2 0x3FF /* Protection Bound Upper 2 */ | ||
244 | #define SPRN_PID 0x3B1 /* Process ID */ | ||
245 | #define SPRN_PIR 0x3FF /* Processor Identification Register */ | 145 | #define SPRN_PIR 0x3FF /* Processor Identification Register */ |
246 | #define SPRN_PIT 0x3DB /* Programmable Interval Timer */ | 146 | #define SPRN_PIT 0x3DB /* Programmable Interval Timer */ |
247 | #define SPRN_PURR 0x135 /* Processor Utilization of Resources Register */ | 147 | #define SPRN_PURR 0x135 /* Processor Utilization of Resources Register */ |
@@ -249,9 +149,6 @@ | |||
249 | #define SPRN_RPA 0x3D6 /* Required Physical Address Register */ | 149 | #define SPRN_RPA 0x3D6 /* Required Physical Address Register */ |
250 | #define SPRN_SDA 0x3BF /* Sampled Data Address Register */ | 150 | #define SPRN_SDA 0x3BF /* Sampled Data Address Register */ |
251 | #define SPRN_SDR1 0x019 /* MMU Hash Base Register */ | 151 | #define SPRN_SDR1 0x019 /* MMU Hash Base Register */ |
252 | #define SPRN_SGR 0x3B9 /* Storage Guarded Register */ | ||
253 | #define SGR_NORMAL 0 | ||
254 | #define SGR_GUARDED 1 | ||
255 | #define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */ | 152 | #define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */ |
256 | #define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */ | 153 | #define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */ |
257 | #define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */ | 154 | #define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */ |
@@ -264,50 +161,12 @@ | |||
264 | #define SPRN_TBWL 0x11C /* Time Base Lower Register (super, W/O) */ | 161 | #define SPRN_TBWL 0x11C /* Time Base Lower Register (super, W/O) */ |
265 | #define SPRN_TBWU 0x11D /* Time Base Write Upper Register (super, W/O) */ | 162 | #define SPRN_TBWU 0x11D /* Time Base Write Upper Register (super, W/O) */ |
266 | #define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */ | 163 | #define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */ |
267 | #define SPRN_TCR 0x3DA /* Timer Control Register */ | ||
268 | #define TCR_WP(x) (((x)&0x3)<<30) /* WDT Period */ | ||
269 | #define WP_2_17 0 /* 2^17 clocks */ | ||
270 | #define WP_2_21 1 /* 2^21 clocks */ | ||
271 | #define WP_2_25 2 /* 2^25 clocks */ | ||
272 | #define WP_2_29 3 /* 2^29 clocks */ | ||
273 | #define TCR_WRC(x) (((x)&0x3)<<28) /* WDT Reset Control */ | ||
274 | #define WRC_NONE 0 /* No reset will occur */ | ||
275 | #define WRC_CORE 1 /* Core reset will occur */ | ||
276 | #define WRC_CHIP 2 /* Chip reset will occur */ | ||
277 | #define WRC_SYSTEM 3 /* System reset will occur */ | ||
278 | #define TCR_WIE 0x08000000 /* WDT Interrupt Enable */ | ||
279 | #define TCR_PIE 0x04000000 /* PIT Interrupt Enable */ | ||
280 | #define TCR_FP(x) (((x)&0x3)<<24) /* FIT Period */ | ||
281 | #define FP_2_9 0 /* 2^9 clocks */ | ||
282 | #define FP_2_13 1 /* 2^13 clocks */ | ||
283 | #define FP_2_17 2 /* 2^17 clocks */ | ||
284 | #define FP_2_21 3 /* 2^21 clocks */ | ||
285 | #define TCR_FIE 0x00800000 /* FIT Interrupt Enable */ | ||
286 | #define TCR_ARE 0x00400000 /* Auto Reload Enable */ | ||
287 | #define SPRN_THRM1 0x3FC /* Thermal Management Register 1 */ | ||
288 | #define THRM1_TIN (1<<0) | ||
289 | #define THRM1_TIV (1<<1) | ||
290 | #define THRM1_THRES (0x7f<<2) | ||
291 | #define THRM1_TID (1<<29) | ||
292 | #define THRM1_TIE (1<<30) | ||
293 | #define THRM1_V (1<<31) | ||
294 | #define SPRN_THRM2 0x3FD /* Thermal Management Register 2 */ | ||
295 | #define SPRN_THRM3 0x3FE /* Thermal Management Register 3 */ | ||
296 | #define THRM3_E (1<<31) | ||
297 | #define SPRN_TSR 0x3D8 /* Timer Status Register */ | ||
298 | #define TSR_ENW 0x80000000 /* Enable Next Watchdog */ | ||
299 | #define TSR_WIS 0x40000000 /* WDT Interrupt Status */ | ||
300 | #define TSR_WRS(x) (((x)&0x3)<<28) /* WDT Reset Status */ | ||
301 | #define WRS_NONE 0 /* No WDT reset occurred */ | ||
302 | #define WRS_CORE 1 /* WDT forced core reset */ | ||
303 | #define WRS_CHIP 2 /* WDT forced chip reset */ | ||
304 | #define WRS_SYSTEM 3 /* WDT forced system reset */ | ||
305 | #define TSR_PIS 0x08000000 /* PIT Interrupt Status */ | ||
306 | #define TSR_FIS 0x04000000 /* FIT Interrupt Status */ | ||
307 | #define SPRN_USIA 0x3AB /* User Sampled Instruction Address Register */ | 164 | #define SPRN_USIA 0x3AB /* User Sampled Instruction Address Register */ |
308 | #define SPRN_XER 0x001 /* Fixed Point Exception Register */ | 165 | #define SPRN_XER 0x001 /* Fixed Point Exception Register */ |
309 | #define SPRN_ZPR 0x3B0 /* Zone Protection Register */ | ||
310 | #define SPRN_VRSAVE 0x100 /* Vector save */ | 166 | #define SPRN_VRSAVE 0x100 /* Vector save */ |
167 | #define SPRN_CTRLF 0x088 | ||
168 | #define SPRN_CTRLT 0x098 | ||
169 | #define CTRL_RUNLATCH 0x1 | ||
311 | 170 | ||
312 | /* Performance monitor SPRs */ | 171 | /* Performance monitor SPRs */ |
313 | #define SPRN_SIAR 780 | 172 | #define SPRN_SIAR 780 |
@@ -352,28 +211,19 @@ | |||
352 | #define CTR SPRN_CTR /* Counter Register */ | 211 | #define CTR SPRN_CTR /* Counter Register */ |
353 | #define DAR SPRN_DAR /* Data Address Register */ | 212 | #define DAR SPRN_DAR /* Data Address Register */ |
354 | #define DABR SPRN_DABR /* Data Address Breakpoint Register */ | 213 | #define DABR SPRN_DABR /* Data Address Breakpoint Register */ |
355 | #define DCMP SPRN_DCMP /* Data TLB Compare Register */ | ||
356 | #define DEC SPRN_DEC /* Decrement Register */ | 214 | #define DEC SPRN_DEC /* Decrement Register */ |
357 | #define DMISS SPRN_DMISS /* Data TLB Miss Register */ | ||
358 | #define DSISR SPRN_DSISR /* Data Storage Interrupt Status Register */ | 215 | #define DSISR SPRN_DSISR /* Data Storage Interrupt Status Register */ |
359 | #define EAR SPRN_EAR /* External Address Register */ | ||
360 | #define HASH1 SPRN_HASH1 /* Primary Hash Address Register */ | ||
361 | #define HASH2 SPRN_HASH2 /* Secondary Hash Address Register */ | ||
362 | #define HID0 SPRN_HID0 /* Hardware Implementation Register 0 */ | 216 | #define HID0 SPRN_HID0 /* Hardware Implementation Register 0 */ |
363 | #define MSRDORM SPRN_MSRDORM /* MSR Dormant Register */ | 217 | #define MSRDORM SPRN_MSRDORM /* MSR Dormant Register */ |
364 | #define NIADORM SPRN_NIADORM /* NIA Dormant Register */ | 218 | #define NIADORM SPRN_NIADORM /* NIA Dormant Register */ |
365 | #define TSC SPRN_TSC /* Thread switch control */ | 219 | #define TSC SPRN_TSC /* Thread switch control */ |
366 | #define TST SPRN_TST /* Thread switch timeout */ | 220 | #define TST SPRN_TST /* Thread switch timeout */ |
367 | #define IABR SPRN_IABR /* Instruction Address Breakpoint Register */ | 221 | #define IABR SPRN_IABR /* Instruction Address Breakpoint Register */ |
368 | #define ICMP SPRN_ICMP /* Instruction TLB Compare Register */ | ||
369 | #define IMISS SPRN_IMISS /* Instruction TLB Miss Register */ | ||
370 | #define IMMR SPRN_IMMR /* PPC 860/821 Internal Memory Map Register */ | ||
371 | #define L2CR SPRN_L2CR /* PPC 750 L2 control register */ | 222 | #define L2CR SPRN_L2CR /* PPC 750 L2 control register */ |
372 | #define __LR SPRN_LR | 223 | #define __LR SPRN_LR |
373 | #define PVR SPRN_PVR /* Processor Version */ | 224 | #define PVR SPRN_PVR /* Processor Version */ |
374 | #define PIR SPRN_PIR /* Processor ID */ | 225 | #define PIR SPRN_PIR /* Processor ID */ |
375 | #define PURR SPRN_PURR /* Processor Utilization of Resource Register */ | 226 | #define PURR SPRN_PURR /* Processor Utilization of Resource Register */ |
376 | //#define RPA SPRN_RPA /* Required Physical Address Register */ | ||
377 | #define SDR1 SPRN_SDR1 /* MMU hash base register */ | 227 | #define SDR1 SPRN_SDR1 /* MMU hash base register */ |
378 | #define SPR0 SPRN_SPRG0 /* Supervisor Private Registers */ | 228 | #define SPR0 SPRN_SPRG0 /* Supervisor Private Registers */ |
379 | #define SPR1 SPRN_SPRG1 | 229 | #define SPR1 SPRN_SPRG1 |
@@ -389,10 +239,6 @@ | |||
389 | #define TBRU SPRN_TBRU /* Time Base Read Upper Register */ | 239 | #define TBRU SPRN_TBRU /* Time Base Read Upper Register */ |
390 | #define TBWL SPRN_TBWL /* Time Base Write Lower Register */ | 240 | #define TBWL SPRN_TBWL /* Time Base Write Lower Register */ |
391 | #define TBWU SPRN_TBWU /* Time Base Write Upper Register */ | 241 | #define TBWU SPRN_TBWU /* Time Base Write Upper Register */ |
392 | #define ICTC 1019 | ||
393 | #define THRM1 SPRN_THRM1 /* Thermal Management Register 1 */ | ||
394 | #define THRM2 SPRN_THRM2 /* Thermal Management Register 2 */ | ||
395 | #define THRM3 SPRN_THRM3 /* Thermal Management Register 3 */ | ||
396 | #define XER SPRN_XER | 242 | #define XER SPRN_XER |
397 | 243 | ||
398 | /* Processor Version Register (PVR) field extraction */ | 244 | /* Processor Version Register (PVR) field extraction */ |
@@ -436,12 +282,6 @@ | |||
436 | #define XGLUE(a,b) a##b | 282 | #define XGLUE(a,b) a##b |
437 | #define GLUE(a,b) XGLUE(a,b) | 283 | #define GLUE(a,b) XGLUE(a,b) |
438 | 284 | ||
439 | /* iSeries CTRL register (for runlatch) */ | ||
440 | |||
441 | #define CTRLT 0x098 | ||
442 | #define CTRLF 0x088 | ||
443 | #define RUNLATCH 0x0001 | ||
444 | |||
445 | #ifdef __ASSEMBLY__ | 285 | #ifdef __ASSEMBLY__ |
446 | 286 | ||
447 | #define _GLOBAL(name) \ | 287 | #define _GLOBAL(name) \ |
@@ -656,6 +496,24 @@ static inline void prefetchw(const void *x) | |||
656 | 496 | ||
657 | #define HAVE_ARCH_PICK_MMAP_LAYOUT | 497 | #define HAVE_ARCH_PICK_MMAP_LAYOUT |
658 | 498 | ||
499 | static inline void ppc64_runlatch_on(void) | ||
500 | { | ||
501 | unsigned long ctrl; | ||
502 | |||
503 | ctrl = mfspr(SPRN_CTRLF); | ||
504 | ctrl |= CTRL_RUNLATCH; | ||
505 | mtspr(SPRN_CTRLT, ctrl); | ||
506 | } | ||
507 | |||
508 | static inline void ppc64_runlatch_off(void) | ||
509 | { | ||
510 | unsigned long ctrl; | ||
511 | |||
512 | ctrl = mfspr(SPRN_CTRLF); | ||
513 | ctrl &= ~CTRL_RUNLATCH; | ||
514 | mtspr(SPRN_CTRLT, ctrl); | ||
515 | } | ||
516 | |||
659 | #endif /* __KERNEL__ */ | 517 | #endif /* __KERNEL__ */ |
660 | 518 | ||
661 | #endif /* __ASSEMBLY__ */ | 519 | #endif /* __ASSEMBLY__ */ |
diff --git a/include/asm-ppc64/thread_info.h b/include/asm-ppc64/thread_info.h index 037b5e06083c..48b7900e90ec 100644 --- a/include/asm-ppc64/thread_info.h +++ b/include/asm-ppc64/thread_info.h | |||
@@ -96,7 +96,7 @@ static inline struct thread_info *current_thread_info(void) | |||
96 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling | 96 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling |
97 | TIF_NEED_RESCHED */ | 97 | TIF_NEED_RESCHED */ |
98 | #define TIF_32BIT 5 /* 32 bit binary */ | 98 | #define TIF_32BIT 5 /* 32 bit binary */ |
99 | #define TIF_RUN_LIGHT 6 /* iSeries run light */ | 99 | /* #define SPARE 6 */ |
100 | #define TIF_ABI_PENDING 7 /* 32/64 bit switch needed */ | 100 | #define TIF_ABI_PENDING 7 /* 32/64 bit switch needed */ |
101 | #define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */ | 101 | #define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */ |
102 | #define TIF_SINGLESTEP 9 /* singlestepping active */ | 102 | #define TIF_SINGLESTEP 9 /* singlestepping active */ |
@@ -110,7 +110,7 @@ static inline struct thread_info *current_thread_info(void) | |||
110 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 110 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
111 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 111 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
112 | #define _TIF_32BIT (1<<TIF_32BIT) | 112 | #define _TIF_32BIT (1<<TIF_32BIT) |
113 | #define _TIF_RUN_LIGHT (1<<TIF_RUN_LIGHT) | 113 | /* #define _SPARE (1<<SPARE) */ |
114 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) | 114 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) |
115 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 115 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) |
116 | #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) | 116 | #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) |
diff --git a/include/asm-s390/user.h b/include/asm-s390/user.h index c64f8c181df3..1dc74baf03c4 100644 --- a/include/asm-s390/user.h +++ b/include/asm-s390/user.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #define _S390_USER_H | 10 | #define _S390_USER_H |
11 | 11 | ||
12 | #include <asm/page.h> | 12 | #include <asm/page.h> |
13 | #include <linux/ptrace.h> | 13 | #include <asm/ptrace.h> |
14 | /* Core file format: The core file is written in such a way that gdb | 14 | /* Core file format: The core file is written in such a way that gdb |
15 | can understand it and provide useful information to the user (under | 15 | can understand it and provide useful information to the user (under |
16 | linux we use the 'trad-core' bfd). There are quite a number of | 16 | linux we use the 'trad-core' bfd). There are quite a number of |
diff --git a/include/asm-sparc/uaccess.h b/include/asm-sparc/uaccess.h index f461144067ee..0a780e84a12b 100644 --- a/include/asm-sparc/uaccess.h +++ b/include/asm-sparc/uaccess.h | |||
@@ -41,10 +41,11 @@ | |||
41 | * No one can read/write anything from userland in the kernel space by setting | 41 | * No one can read/write anything from userland in the kernel space by setting |
42 | * large size and address near to PAGE_OFFSET - a fault will break his intentions. | 42 | * large size and address near to PAGE_OFFSET - a fault will break his intentions. |
43 | */ | 43 | */ |
44 | #define __user_ok(addr,size) ((addr) < STACK_TOP) | 44 | #define __user_ok(addr, size) ({ (void)(size); (addr) < STACK_TOP; }) |
45 | #define __kernel_ok (segment_eq(get_fs(), KERNEL_DS)) | 45 | #define __kernel_ok (segment_eq(get_fs(), KERNEL_DS)) |
46 | #define __access_ok(addr,size) (__user_ok((addr) & get_fs().seg,(size))) | 46 | #define __access_ok(addr,size) (__user_ok((addr) & get_fs().seg,(size))) |
47 | #define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) | 47 | #define access_ok(type, addr, size) \ |
48 | ({ (void)(type); __access_ok((unsigned long)(addr), size); }) | ||
48 | 49 | ||
49 | /* this function will go away soon - use access_ok() instead */ | 50 | /* this function will go away soon - use access_ok() instead */ |
50 | static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) | 51 | static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) |
diff --git a/include/asm-sparc64/agp.h b/include/asm-sparc64/agp.h index ba05bdf9a211..58f8cb6ae767 100644 --- a/include/asm-sparc64/agp.h +++ b/include/asm-sparc64/agp.h | |||
@@ -8,4 +8,14 @@ | |||
8 | #define flush_agp_mappings() | 8 | #define flush_agp_mappings() |
9 | #define flush_agp_cache() mb() | 9 | #define flush_agp_cache() mb() |
10 | 10 | ||
11 | /* Convert a physical address to an address suitable for the GART. */ | ||
12 | #define phys_to_gart(x) (x) | ||
13 | #define gart_to_phys(x) (x) | ||
14 | |||
15 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
16 | #define alloc_gatt_pages(order) \ | ||
17 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
18 | #define free_gatt_pages(table, order) \ | ||
19 | free_pages((unsigned long)(table), (order)) | ||
20 | |||
11 | #endif | 21 | #endif |
diff --git a/include/asm-x86_64/agp.h b/include/asm-x86_64/agp.h index 0bb9019d58aa..06c52ee9c06b 100644 --- a/include/asm-x86_64/agp.h +++ b/include/asm-x86_64/agp.h | |||
@@ -19,4 +19,14 @@ int unmap_page_from_agp(struct page *page); | |||
19 | worth it. Would need a page for it. */ | 19 | worth it. Would need a page for it. */ |
20 | #define flush_agp_cache() asm volatile("wbinvd":::"memory") | 20 | #define flush_agp_cache() asm volatile("wbinvd":::"memory") |
21 | 21 | ||
22 | /* Convert a physical address to an address suitable for the GART. */ | ||
23 | #define phys_to_gart(x) (x) | ||
24 | #define gart_to_phys(x) (x) | ||
25 | |||
26 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
27 | #define alloc_gatt_pages(order) \ | ||
28 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
29 | #define free_gatt_pages(table, order) \ | ||
30 | free_pages((unsigned long)(table), (order)) | ||
31 | |||
22 | #endif | 32 | #endif |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d5a55bdb9c3c..b123cc08773d 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -25,6 +25,8 @@ | |||
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 | #ifdef CONFIG_ACPI | 30 | #ifdef CONFIG_ACPI |
29 | 31 | ||
30 | #ifndef _LINUX | 32 | #ifndef _LINUX |
diff --git a/include/linux/ata.h b/include/linux/ata.h index f178894edd04..ca5fcadf9981 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -224,6 +224,7 @@ struct ata_taskfile { | |||
224 | }; | 224 | }; |
225 | 225 | ||
226 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) | 226 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) |
227 | #define ata_id_is_sata(id) ((id)[93] == 0) | ||
227 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) | 228 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) |
228 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) | 229 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) |
229 | #define ata_id_has_flush(id) ((id)[83] & (1 << 12)) | 230 | #define ata_id_has_flush(id) ((id)[83] & (1 << 12)) |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 19f04b049798..bf2ad3ba72eb 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -27,15 +27,52 @@ | |||
27 | #include <linux/sched.h> | 27 | #include <linux/sched.h> |
28 | #include <linux/elf.h> | 28 | #include <linux/elf.h> |
29 | 29 | ||
30 | /* Request and reply types */ | 30 | /* The netlink messages for the audit system is divided into blocks: |
31 | #define AUDIT_GET 1000 /* Get status */ | 31 | * 1000 - 1099 are for commanding the audit system |
32 | #define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */ | 32 | * 1100 - 1199 user space trusted application messages |
33 | #define AUDIT_LIST 1002 /* List filtering rules */ | 33 | * 1200 - 1299 messages internal to the audit daemon |
34 | #define AUDIT_ADD 1003 /* Add filtering rule */ | 34 | * 1300 - 1399 audit event messages |
35 | #define AUDIT_DEL 1004 /* Delete filtering rule */ | 35 | * 1400 - 1499 SE Linux use |
36 | #define AUDIT_USER 1005 /* Send a message from user-space */ | 36 | * 1500 - 1999 future use |
37 | #define AUDIT_LOGIN 1006 /* Define the login id and informaiton */ | 37 | * 2000 is for otherwise unclassified kernel audit messages |
38 | #define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */ | 38 | * |
39 | * Messages from 1000-1199 are bi-directional. 1200-1299 are exclusively user | ||
40 | * space. Anything over that is kernel --> user space communication. | ||
41 | */ | ||
42 | #define AUDIT_GET 1000 /* Get status */ | ||
43 | #define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */ | ||
44 | #define AUDIT_LIST 1002 /* List syscall filtering rules */ | ||
45 | #define AUDIT_ADD 1003 /* Add syscall filtering rule */ | ||
46 | #define AUDIT_DEL 1004 /* Delete syscall filtering rule */ | ||
47 | #define AUDIT_USER 1005 /* Message from userspace -- deprecated */ | ||
48 | #define AUDIT_LOGIN 1006 /* Define the login id and information */ | ||
49 | #define AUDIT_WATCH_INS 1007 /* Insert file/dir watch entry */ | ||
50 | #define AUDIT_WATCH_REM 1008 /* Remove file/dir watch entry */ | ||
51 | #define AUDIT_WATCH_LIST 1009 /* List all file/dir watches */ | ||
52 | #define AUDIT_SIGNAL_INFO 1010 /* Get info about sender of signal to auditd */ | ||
53 | |||
54 | #define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages uninteresting to kernel */ | ||
55 | #define AUDIT_LAST_USER_MSG 1199 | ||
56 | |||
57 | #define AUDIT_DAEMON_START 1200 /* Daemon startup record */ | ||
58 | #define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */ | ||
59 | #define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */ | ||
60 | #define AUDIT_DAEMON_CONFIG 1203 /* Daemon config change */ | ||
61 | |||
62 | #define AUDIT_SYSCALL 1300 /* Syscall event */ | ||
63 | #define AUDIT_FS_WATCH 1301 /* Filesystem watch event */ | ||
64 | #define AUDIT_PATH 1302 /* Filename path information */ | ||
65 | #define AUDIT_IPC 1303 /* IPC record */ | ||
66 | #define AUDIT_SOCKETCALL 1304 /* sys_socketcall arguments */ | ||
67 | #define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */ | ||
68 | #define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */ | ||
69 | #define AUDIT_CWD 1307 /* Current working directory */ | ||
70 | |||
71 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | ||
72 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | ||
73 | #define AUDIT_AVC_PATH 1402 /* dentry, vfsmount pair from avc */ | ||
74 | |||
75 | #define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */ | ||
39 | 76 | ||
40 | /* Rule flags */ | 77 | /* Rule flags */ |
41 | #define AUDIT_PER_TASK 0x01 /* Apply rule at task creation (not syscall) */ | 78 | #define AUDIT_PER_TASK 0x01 /* Apply rule at task creation (not syscall) */ |
@@ -132,16 +169,9 @@ | |||
132 | #define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE) | 169 | #define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE) |
133 | #define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | 170 | #define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) |
134 | 171 | ||
135 | #ifndef __KERNEL__ | ||
136 | struct audit_message { | ||
137 | struct nlmsghdr nlh; | ||
138 | char data[1200]; | ||
139 | }; | ||
140 | #endif | ||
141 | |||
142 | struct audit_status { | 172 | struct audit_status { |
143 | __u32 mask; /* Bit mask for valid entries */ | 173 | __u32 mask; /* Bit mask for valid entries */ |
144 | __u32 enabled; /* 1 = enabled, 0 = disbaled */ | 174 | __u32 enabled; /* 1 = enabled, 0 = disabled */ |
145 | __u32 failure; /* Failure-to-log action */ | 175 | __u32 failure; /* Failure-to-log action */ |
146 | __u32 pid; /* pid of auditd process */ | 176 | __u32 pid; /* pid of auditd process */ |
147 | __u32 rate_limit; /* messages rate limit (per second) */ | 177 | __u32 rate_limit; /* messages rate limit (per second) */ |
@@ -161,6 +191,11 @@ struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */ | |||
161 | 191 | ||
162 | #ifdef __KERNEL__ | 192 | #ifdef __KERNEL__ |
163 | 193 | ||
194 | struct audit_sig_info { | ||
195 | uid_t uid; | ||
196 | pid_t pid; | ||
197 | }; | ||
198 | |||
164 | struct audit_buffer; | 199 | struct audit_buffer; |
165 | struct audit_context; | 200 | struct audit_context; |
166 | struct inode; | 201 | struct inode; |
@@ -185,11 +220,16 @@ extern void audit_inode(const char *name, const struct inode *inode); | |||
185 | /* Private API (for audit.c only) */ | 220 | /* Private API (for audit.c only) */ |
186 | extern int audit_receive_filter(int type, int pid, int uid, int seq, | 221 | extern int audit_receive_filter(int type, int pid, int uid, int seq, |
187 | void *data, uid_t loginuid); | 222 | void *data, uid_t loginuid); |
188 | extern void audit_get_stamp(struct audit_context *ctx, | 223 | extern unsigned int audit_serial(void); |
189 | struct timespec *t, unsigned int *serial); | 224 | extern void auditsc_get_stamp(struct audit_context *ctx, |
225 | struct timespec *t, unsigned int *serial); | ||
190 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); | 226 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); |
191 | extern uid_t audit_get_loginuid(struct audit_context *ctx); | 227 | extern uid_t audit_get_loginuid(struct audit_context *ctx); |
192 | extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); | 228 | extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); |
229 | extern int audit_socketcall(int nargs, unsigned long *args); | ||
230 | extern int audit_sockaddr(int len, void *addr); | ||
231 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); | ||
232 | extern void audit_signal_info(int sig, struct task_struct *t); | ||
193 | #else | 233 | #else |
194 | #define audit_alloc(t) ({ 0; }) | 234 | #define audit_alloc(t) ({ 0; }) |
195 | #define audit_free(t) do { ; } while (0) | 235 | #define audit_free(t) do { ; } while (0) |
@@ -198,18 +238,24 @@ extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mo | |||
198 | #define audit_getname(n) do { ; } while (0) | 238 | #define audit_getname(n) do { ; } while (0) |
199 | #define audit_putname(n) do { ; } while (0) | 239 | #define audit_putname(n) do { ; } while (0) |
200 | #define audit_inode(n,i) do { ; } while (0) | 240 | #define audit_inode(n,i) do { ; } while (0) |
241 | #define audit_receive_filter(t,p,u,s,d,l) ({ -EOPNOTSUPP; }) | ||
242 | #define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) | ||
201 | #define audit_get_loginuid(c) ({ -1; }) | 243 | #define audit_get_loginuid(c) ({ -1; }) |
202 | #define audit_ipc_perms(q,u,g,m) ({ 0; }) | 244 | #define audit_ipc_perms(q,u,g,m) ({ 0; }) |
245 | #define audit_socketcall(n,a) ({ 0; }) | ||
246 | #define audit_sockaddr(len, addr) ({ 0; }) | ||
247 | #define audit_avc_path(dentry, mnt) ({ 0; }) | ||
248 | #define audit_signal_info(s,t) do { ; } while (0) | ||
203 | #endif | 249 | #endif |
204 | 250 | ||
205 | #ifdef CONFIG_AUDIT | 251 | #ifdef CONFIG_AUDIT |
206 | /* These are defined in audit.c */ | 252 | /* These are defined in audit.c */ |
207 | /* Public API */ | 253 | /* Public API */ |
208 | extern void audit_log(struct audit_context *ctx, | 254 | extern void audit_log(struct audit_context *ctx, int type, |
209 | const char *fmt, ...) | 255 | const char *fmt, ...) |
210 | __attribute__((format(printf,2,3))); | 256 | __attribute__((format(printf,3,4))); |
211 | 257 | ||
212 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx); | 258 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx,int type); |
213 | extern void audit_log_format(struct audit_buffer *ab, | 259 | extern void audit_log_format(struct audit_buffer *ab, |
214 | const char *fmt, ...) | 260 | const char *fmt, ...) |
215 | __attribute__((format(printf,2,3))); | 261 | __attribute__((format(printf,2,3))); |
@@ -229,8 +275,8 @@ extern void audit_send_reply(int pid, int seq, int type, | |||
229 | void *payload, int size); | 275 | void *payload, int size); |
230 | extern void audit_log_lost(const char *message); | 276 | extern void audit_log_lost(const char *message); |
231 | #else | 277 | #else |
232 | #define audit_log(t,f,...) do { ; } while (0) | 278 | #define audit_log(c,t,f,...) do { ; } while (0) |
233 | #define audit_log_start(t) ({ NULL; }) | 279 | #define audit_log_start(c,t) ({ NULL; }) |
234 | #define audit_log_vformat(b,f,a) do { ; } while (0) | 280 | #define audit_log_vformat(b,f,a) do { ; } while (0) |
235 | #define audit_log_format(b,f,...) do { ; } while (0) | 281 | #define audit_log_format(b,f,...) do { ; } while (0) |
236 | #define audit_log_end(b) do { ; } while (0) | 282 | #define audit_log_end(b) do { ; } while (0) |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ef1afc178c0a..4a99b76c5a33 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -544,7 +544,7 @@ extern void blk_end_sync_rq(struct request *rq); | |||
544 | extern void blk_attempt_remerge(request_queue_t *, struct request *); | 544 | extern void blk_attempt_remerge(request_queue_t *, struct request *); |
545 | extern void __blk_attempt_remerge(request_queue_t *, struct request *); | 545 | extern void __blk_attempt_remerge(request_queue_t *, struct request *); |
546 | extern struct request *blk_get_request(request_queue_t *, int, int); | 546 | extern struct request *blk_get_request(request_queue_t *, int, int); |
547 | extern void blk_insert_request(request_queue_t *, struct request *, int, void *, int); | 547 | extern void blk_insert_request(request_queue_t *, struct request *, int, void *); |
548 | extern void blk_requeue_request(request_queue_t *, struct request *); | 548 | extern void blk_requeue_request(request_queue_t *, struct request *); |
549 | extern void blk_plug_device(request_queue_t *); | 549 | extern void blk_plug_device(request_queue_t *); |
550 | extern int blk_remove_plug(request_queue_t *); | 550 | extern int blk_remove_plug(request_queue_t *); |
diff --git a/include/linux/chio.h b/include/linux/chio.h new file mode 100644 index 000000000000..63035ae67e63 --- /dev/null +++ b/include/linux/chio.h | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | * ioctl interface for the scsi media changer driver | ||
3 | */ | ||
4 | |||
5 | /* changer element types */ | ||
6 | #define CHET_MT 0 /* media transport element (robot) */ | ||
7 | #define CHET_ST 1 /* storage element (media slots) */ | ||
8 | #define CHET_IE 2 /* import/export element */ | ||
9 | #define CHET_DT 3 /* data transfer element (tape/cdrom/whatever) */ | ||
10 | #define CHET_V1 4 /* vendor specific #1 */ | ||
11 | #define CHET_V2 5 /* vendor specific #2 */ | ||
12 | #define CHET_V3 6 /* vendor specific #3 */ | ||
13 | #define CHET_V4 7 /* vendor specific #4 */ | ||
14 | |||
15 | |||
16 | /* | ||
17 | * CHIOGPARAMS | ||
18 | * query changer properties | ||
19 | * | ||
20 | * CHIOVGPARAMS | ||
21 | * query vendor-specific element types | ||
22 | * | ||
23 | * accessing elements works by specifing type and unit of the element. | ||
24 | * for eample, storage elements are addressed with type = CHET_ST and | ||
25 | * unit = 0 .. cp_nslots-1 | ||
26 | * | ||
27 | */ | ||
28 | struct changer_params { | ||
29 | int cp_curpicker; /* current transport element */ | ||
30 | int cp_npickers; /* number of transport elements (CHET_MT) */ | ||
31 | int cp_nslots; /* number of storage elements (CHET_ST) */ | ||
32 | int cp_nportals; /* number of import/export elements (CHET_IE) */ | ||
33 | int cp_ndrives; /* number of data transfer elements (CHET_DT) */ | ||
34 | }; | ||
35 | struct changer_vendor_params { | ||
36 | int cvp_n1; /* number of vendor specific elems (CHET_V1) */ | ||
37 | char cvp_label1[16]; | ||
38 | int cvp_n2; /* number of vendor specific elems (CHET_V2) */ | ||
39 | char cvp_label2[16]; | ||
40 | int cvp_n3; /* number of vendor specific elems (CHET_V3) */ | ||
41 | char cvp_label3[16]; | ||
42 | int cvp_n4; /* number of vendor specific elems (CHET_V4) */ | ||
43 | char cvp_label4[16]; | ||
44 | int reserved[8]; | ||
45 | }; | ||
46 | |||
47 | |||
48 | /* | ||
49 | * CHIOMOVE | ||
50 | * move a medium from one element to another | ||
51 | */ | ||
52 | struct changer_move { | ||
53 | int cm_fromtype; /* type/unit of source element */ | ||
54 | int cm_fromunit; | ||
55 | int cm_totype; /* type/unit of destination element */ | ||
56 | int cm_tounit; | ||
57 | int cm_flags; | ||
58 | }; | ||
59 | #define CM_INVERT 1 /* flag: rotate media (for double-sided like MOD) */ | ||
60 | |||
61 | |||
62 | /* | ||
63 | * CHIOEXCHANGE | ||
64 | * move one medium from element #1 to element #2, | ||
65 | * and another one from element #2 to element #3. | ||
66 | * element #1 and #3 are allowed to be identical. | ||
67 | */ | ||
68 | struct changer_exchange { | ||
69 | int ce_srctype; /* type/unit of element #1 */ | ||
70 | int ce_srcunit; | ||
71 | int ce_fdsttype; /* type/unit of element #2 */ | ||
72 | int ce_fdstunit; | ||
73 | int ce_sdsttype; /* type/unit of element #3 */ | ||
74 | int ce_sdstunit; | ||
75 | int ce_flags; | ||
76 | }; | ||
77 | #define CE_INVERT1 1 | ||
78 | #define CE_INVERT2 2 | ||
79 | |||
80 | |||
81 | /* | ||
82 | * CHIOPOSITION | ||
83 | * move the transport element (robot arm) to a specific element. | ||
84 | */ | ||
85 | struct changer_position { | ||
86 | int cp_type; | ||
87 | int cp_unit; | ||
88 | int cp_flags; | ||
89 | }; | ||
90 | #define CP_INVERT 1 | ||
91 | |||
92 | |||
93 | /* | ||
94 | * CHIOGSTATUS | ||
95 | * get element status for all elements of a specific type | ||
96 | */ | ||
97 | struct changer_element_status { | ||
98 | int ces_type; | ||
99 | unsigned char *ces_data; | ||
100 | }; | ||
101 | #define CESTATUS_FULL 0x01 /* full */ | ||
102 | #define CESTATUS_IMPEXP 0x02 /* media was imported (inserted by sysop) */ | ||
103 | #define CESTATUS_EXCEPT 0x04 /* error condition */ | ||
104 | #define CESTATUS_ACCESS 0x08 /* access allowed */ | ||
105 | #define CESTATUS_EXENAB 0x10 /* element can export media */ | ||
106 | #define CESTATUS_INENAB 0x20 /* element can import media */ | ||
107 | |||
108 | |||
109 | /* | ||
110 | * CHIOGELEM | ||
111 | * get more detailed status informtion for a single element | ||
112 | */ | ||
113 | struct changer_get_element { | ||
114 | int cge_type; /* type/unit */ | ||
115 | int cge_unit; | ||
116 | int cge_status; /* status */ | ||
117 | int cge_errno; /* errno */ | ||
118 | int cge_srctype; /* source element of the last move/exchange */ | ||
119 | int cge_srcunit; | ||
120 | int cge_id; /* scsi id (for data transfer elements) */ | ||
121 | int cge_lun; /* scsi lun (for data transfer elements) */ | ||
122 | char cge_pvoltag[36]; /* primary volume tag */ | ||
123 | char cge_avoltag[36]; /* alternate volume tag */ | ||
124 | int cge_flags; | ||
125 | }; | ||
126 | /* flags */ | ||
127 | #define CGE_ERRNO 0x01 /* errno available */ | ||
128 | #define CGE_INVERT 0x02 /* media inverted */ | ||
129 | #define CGE_SRC 0x04 /* media src available */ | ||
130 | #define CGE_IDLUN 0x08 /* ID+LUN available */ | ||
131 | #define CGE_PVOLTAG 0x10 /* primary volume tag available */ | ||
132 | #define CGE_AVOLTAG 0x20 /* alternate volume tag available */ | ||
133 | |||
134 | |||
135 | /* | ||
136 | * CHIOSVOLTAG | ||
137 | * set volume tag | ||
138 | */ | ||
139 | struct changer_set_voltag { | ||
140 | int csv_type; /* type/unit */ | ||
141 | int csv_unit; | ||
142 | char csv_voltag[36]; /* volume tag */ | ||
143 | int csv_flags; | ||
144 | }; | ||
145 | #define CSV_PVOLTAG 0x01 /* primary volume tag */ | ||
146 | #define CSV_AVOLTAG 0x02 /* alternate volume tag */ | ||
147 | #define CSV_CLEARTAG 0x04 /* clear volume tag */ | ||
148 | |||
149 | /* ioctls */ | ||
150 | #define CHIOMOVE _IOW('c', 1,struct changer_move) | ||
151 | #define CHIOEXCHANGE _IOW('c', 2,struct changer_exchange) | ||
152 | #define CHIOPOSITION _IOW('c', 3,struct changer_position) | ||
153 | #define CHIOGPICKER _IOR('c', 4,int) /* not impl. */ | ||
154 | #define CHIOSPICKER _IOW('c', 5,int) /* not impl. */ | ||
155 | #define CHIOGPARAMS _IOR('c', 6,struct changer_params) | ||
156 | #define CHIOGSTATUS _IOW('c', 8,struct changer_element_status) | ||
157 | #define CHIOGELEM _IOW('c',16,struct changer_get_element) | ||
158 | #define CHIOINITELEM _IO('c',17) | ||
159 | #define CHIOSVOLTAG _IOW('c',18,struct changer_set_voltag) | ||
160 | #define CHIOGVPARAMS _IOR('c',19,struct changer_vendor_params) | ||
161 | |||
162 | /* ---------------------------------------------------------------------- */ | ||
163 | |||
164 | /* | ||
165 | * Local variables: | ||
166 | * c-basic-offset: 8 | ||
167 | * End: | ||
168 | */ | ||
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h new file mode 100644 index 000000000000..0008e2ad0c9f --- /dev/null +++ b/include/linux/dm9000.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* include/linux/dm9000.h | ||
2 | * | ||
3 | * Copyright (c) 2004 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for dm9000 platform data | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __DM9000_PLATFORM_DATA | ||
15 | #define __DM9000_PLATFORM_DATA __FILE__ | ||
16 | |||
17 | /* IO control flags */ | ||
18 | |||
19 | #define DM9000_PLATF_8BITONLY (0x0001) | ||
20 | #define DM9000_PLATF_16BITONLY (0x0002) | ||
21 | #define DM9000_PLATF_32BITONLY (0x0004) | ||
22 | |||
23 | /* platfrom data for platfrom device structure's platfrom_data field */ | ||
24 | |||
25 | struct dm9000_plat_data { | ||
26 | unsigned int flags; | ||
27 | |||
28 | /* allow replacement IO routines */ | ||
29 | |||
30 | void (*inblk)(void __iomem *reg, void *data, int len); | ||
31 | void (*outblk)(void __iomem *reg, void *data, int len); | ||
32 | void (*dumpblk)(void __iomem *reg, int len); | ||
33 | }; | ||
34 | |||
35 | #endif /* __DM9000_PLATFORM_DATA */ | ||
36 | |||
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 806c305332c1..2d80cc761a15 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -14,7 +14,12 @@ enum dma_data_direction { | |||
14 | }; | 14 | }; |
15 | 15 | ||
16 | #define DMA_64BIT_MASK 0xffffffffffffffffULL | 16 | #define DMA_64BIT_MASK 0xffffffffffffffffULL |
17 | #define DMA_40BIT_MASK 0x000000ffffffffffULL | ||
18 | #define DMA_39BIT_MASK 0x0000007fffffffffULL | ||
17 | #define DMA_32BIT_MASK 0x00000000ffffffffULL | 19 | #define DMA_32BIT_MASK 0x00000000ffffffffULL |
20 | #define DMA_31BIT_MASK 0x000000007fffffffULL | ||
21 | #define DMA_30BIT_MASK 0x000000003fffffffULL | ||
22 | #define DMA_29BIT_MASK 0x000000001fffffffULL | ||
18 | 23 | ||
19 | #include <asm/dma-mapping.h> | 24 | #include <asm/dma-mapping.h> |
20 | 25 | ||
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index 503194e62fe1..ed2927ef1ff7 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Generic HDLC support routines for Linux | 2 | * Generic HDLC support routines for Linux |
3 | * | 3 | * |
4 | * Copyright (C) 1999-2003 Krzysztof Halasa <khc@pm.waw.pl> | 4 | * Copyright (C) 1999-2005 Krzysztof Halasa <khc@pm.waw.pl> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of version 2 of the GNU General Public License | 7 | * under the terms of version 2 of the GNU General Public License |
@@ -41,6 +41,7 @@ | |||
41 | #define LMI_NONE 1 /* No LMI, all PVCs are static */ | 41 | #define LMI_NONE 1 /* No LMI, all PVCs are static */ |
42 | #define LMI_ANSI 2 /* ANSI Annex D */ | 42 | #define LMI_ANSI 2 /* ANSI Annex D */ |
43 | #define LMI_CCITT 3 /* ITU-T Annex A */ | 43 | #define LMI_CCITT 3 /* ITU-T Annex A */ |
44 | #define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ | ||
44 | 45 | ||
45 | #define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */ | 46 | #define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */ |
46 | #define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */ | 47 | #define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */ |
@@ -89,6 +90,7 @@ typedef struct pvc_device_struct { | |||
89 | unsigned int deleted: 1; | 90 | unsigned int deleted: 1; |
90 | unsigned int fecn: 1; | 91 | unsigned int fecn: 1; |
91 | unsigned int becn: 1; | 92 | unsigned int becn: 1; |
93 | unsigned int bandwidth; /* Cisco LMI reporting only */ | ||
92 | }state; | 94 | }state; |
93 | }pvc_device; | 95 | }pvc_device; |
94 | 96 | ||
diff --git a/include/linux/if.h b/include/linux/if.h index d73a9d62f208..ce627d9092ef 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -33,7 +33,7 @@ | |||
33 | #define IFF_LOOPBACK 0x8 /* is a loopback net */ | 33 | #define IFF_LOOPBACK 0x8 /* is a loopback net */ |
34 | #define IFF_POINTOPOINT 0x10 /* interface is has p-p link */ | 34 | #define IFF_POINTOPOINT 0x10 /* interface is has p-p link */ |
35 | #define IFF_NOTRAILERS 0x20 /* avoid use of trailers */ | 35 | #define IFF_NOTRAILERS 0x20 /* avoid use of trailers */ |
36 | #define IFF_RUNNING 0x40 /* resources allocated */ | 36 | #define IFF_RUNNING 0x40 /* interface running and carrier ok */ |
37 | #define IFF_NOARP 0x80 /* no ARP protocol */ | 37 | #define IFF_NOARP 0x80 /* no ARP protocol */ |
38 | #define IFF_PROMISC 0x100 /* receive all packets */ | 38 | #define IFF_PROMISC 0x100 /* receive all packets */ |
39 | #define IFF_ALLMULTI 0x200 /* receive all multicast packets*/ | 39 | #define IFF_ALLMULTI 0x200 /* receive all multicast packets*/ |
diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h index 0485b256d043..004e6f09a6e2 100644 --- a/include/linux/if_shaper.h +++ b/include/linux/if_shaper.h | |||
@@ -23,7 +23,7 @@ struct shaper | |||
23 | __u32 shapeclock; | 23 | __u32 shapeclock; |
24 | unsigned long recovery; /* Time we can next clock a packet out on | 24 | unsigned long recovery; /* Time we can next clock a packet out on |
25 | an empty queue */ | 25 | an empty queue */ |
26 | unsigned long locked; | 26 | struct semaphore sem; |
27 | struct net_device_stats stats; | 27 | struct net_device_stats stats; |
28 | struct net_device *dev; | 28 | struct net_device *dev; |
29 | int (*hard_start_xmit) (struct sk_buff *skb, | 29 | int (*hard_start_xmit) (struct sk_buff *skb, |
@@ -38,7 +38,6 @@ struct shaper | |||
38 | int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh); | 38 | int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh); |
39 | void (*header_cache_update)(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr); | 39 | void (*header_cache_update)(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr); |
40 | struct net_device_stats* (*get_stats)(struct net_device *dev); | 40 | struct net_device_stats* (*get_stats)(struct net_device *dev); |
41 | wait_queue_head_t wait_queue; | ||
42 | struct timer_list timer; | 41 | struct timer_list timer; |
43 | }; | 42 | }; |
44 | 43 | ||
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h index 6688b414c529..3fba9e2f5427 100644 --- a/include/linux/if_tr.h +++ b/include/linux/if_tr.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #ifndef _LINUX_IF_TR_H | 19 | #ifndef _LINUX_IF_TR_H |
20 | #define _LINUX_IF_TR_H | 20 | #define _LINUX_IF_TR_H |
21 | 21 | ||
22 | #include <asm/byteorder.h> /* For __be16 */ | ||
23 | |||
22 | /* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble | 24 | /* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble |
23 | and FCS/CRC (frame check sequence). */ | 25 | and FCS/CRC (frame check sequence). */ |
24 | #define TR_ALEN 6 /* Octets in one token-ring addr */ | 26 | #define TR_ALEN 6 /* Octets in one token-ring addr */ |
diff --git a/include/linux/ip.h b/include/linux/ip.h index 8438c68591f9..31e7cedd9f84 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h | |||
@@ -81,6 +81,7 @@ | |||
81 | #ifdef __KERNEL__ | 81 | #ifdef __KERNEL__ |
82 | #include <linux/config.h> | 82 | #include <linux/config.h> |
83 | #include <linux/types.h> | 83 | #include <linux/types.h> |
84 | #include <net/request_sock.h> | ||
84 | #include <net/sock.h> | 85 | #include <net/sock.h> |
85 | #include <linux/igmp.h> | 86 | #include <linux/igmp.h> |
86 | #include <net/flow.h> | 87 | #include <net/flow.h> |
@@ -107,6 +108,26 @@ struct ip_options { | |||
107 | 108 | ||
108 | #define optlength(opt) (sizeof(struct ip_options) + opt->optlen) | 109 | #define optlength(opt) (sizeof(struct ip_options) + opt->optlen) |
109 | 110 | ||
111 | struct inet_request_sock { | ||
112 | struct request_sock req; | ||
113 | u32 loc_addr; | ||
114 | u32 rmt_addr; | ||
115 | u16 rmt_port; | ||
116 | u16 snd_wscale : 4, | ||
117 | rcv_wscale : 4, | ||
118 | tstamp_ok : 1, | ||
119 | sack_ok : 1, | ||
120 | wscale_ok : 1, | ||
121 | ecn_ok : 1, | ||
122 | acked : 1; | ||
123 | struct ip_options *opt; | ||
124 | }; | ||
125 | |||
126 | static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) | ||
127 | { | ||
128 | return (struct inet_request_sock *)sk; | ||
129 | } | ||
130 | |||
110 | struct ipv6_pinfo; | 131 | struct ipv6_pinfo; |
111 | 132 | ||
112 | struct inet_sock { | 133 | struct inet_sock { |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index ab0d0efbf240..6fcd6a0ade24 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -193,6 +193,19 @@ struct inet6_skb_parm { | |||
193 | 193 | ||
194 | #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) | 194 | #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) |
195 | 195 | ||
196 | struct tcp6_request_sock { | ||
197 | struct tcp_request_sock req; | ||
198 | struct in6_addr loc_addr; | ||
199 | struct in6_addr rmt_addr; | ||
200 | struct sk_buff *pktopts; | ||
201 | int iif; | ||
202 | }; | ||
203 | |||
204 | static inline struct tcp6_request_sock *tcp6_rsk(const struct request_sock *sk) | ||
205 | { | ||
206 | return (struct tcp6_request_sock *)sk; | ||
207 | } | ||
208 | |||
196 | /** | 209 | /** |
197 | * struct ipv6_pinfo - ipv6 private area | 210 | * struct ipv6_pinfo - ipv6 private area |
198 | * | 211 | * |
diff --git a/include/linux/libata.h b/include/linux/libata.h index e74f301e9bae..6cd9ba63563b 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -421,6 +421,7 @@ extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | |||
421 | extern unsigned int ata_dev_classify(struct ata_taskfile *tf); | 421 | extern unsigned int ata_dev_classify(struct ata_taskfile *tf); |
422 | extern void ata_dev_id_string(u16 *id, unsigned char *s, | 422 | extern void ata_dev_id_string(u16 *id, unsigned char *s, |
423 | unsigned int ofs, unsigned int len); | 423 | unsigned int ofs, unsigned int len); |
424 | extern void ata_dev_config(struct ata_port *ap, unsigned int i); | ||
424 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 425 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
425 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); | 426 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); |
426 | extern void ata_bmdma_stop(struct ata_port *ap); | 427 | extern void ata_bmdma_stop(struct ata_port *ap); |
@@ -467,12 +468,34 @@ static inline u8 ata_chk_status(struct ata_port *ap) | |||
467 | return ap->ops->check_status(ap); | 468 | return ap->ops->check_status(ap); |
468 | } | 469 | } |
469 | 470 | ||
471 | |||
472 | /** | ||
473 | * ata_pause - Flush writes and pause 400 nanoseconds. | ||
474 | * @ap: Port to wait for. | ||
475 | * | ||
476 | * LOCKING: | ||
477 | * Inherited from caller. | ||
478 | */ | ||
479 | |||
470 | static inline void ata_pause(struct ata_port *ap) | 480 | static inline void ata_pause(struct ata_port *ap) |
471 | { | 481 | { |
472 | ata_altstatus(ap); | 482 | ata_altstatus(ap); |
473 | ndelay(400); | 483 | ndelay(400); |
474 | } | 484 | } |
475 | 485 | ||
486 | |||
487 | /** | ||
488 | * ata_busy_wait - Wait for a port status register | ||
489 | * @ap: Port to wait for. | ||
490 | * | ||
491 | * Waits up to max*10 microseconds for the selected bits in the port's | ||
492 | * status register to be cleared. | ||
493 | * Returns final value of status register. | ||
494 | * | ||
495 | * LOCKING: | ||
496 | * Inherited from caller. | ||
497 | */ | ||
498 | |||
476 | static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, | 499 | static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, |
477 | unsigned int max) | 500 | unsigned int max) |
478 | { | 501 | { |
@@ -487,6 +510,18 @@ static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, | |||
487 | return status; | 510 | return status; |
488 | } | 511 | } |
489 | 512 | ||
513 | |||
514 | /** | ||
515 | * ata_wait_idle - Wait for a port to be idle. | ||
516 | * @ap: Port to wait for. | ||
517 | * | ||
518 | * Waits up to 10ms for port's BUSY and DRQ signals to clear. | ||
519 | * Returns final value of status register. | ||
520 | * | ||
521 | * LOCKING: | ||
522 | * Inherited from caller. | ||
523 | */ | ||
524 | |||
490 | static inline u8 ata_wait_idle(struct ata_port *ap) | 525 | static inline u8 ata_wait_idle(struct ata_port *ap) |
491 | { | 526 | { |
492 | u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); | 527 | u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); |
@@ -525,6 +560,18 @@ static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, uns | |||
525 | tf->device = ATA_DEVICE_OBS | ATA_DEV1; | 560 | tf->device = ATA_DEVICE_OBS | ATA_DEV1; |
526 | } | 561 | } |
527 | 562 | ||
563 | |||
564 | /** | ||
565 | * ata_irq_on - Enable interrupts on a port. | ||
566 | * @ap: Port on which interrupts are enabled. | ||
567 | * | ||
568 | * Enable interrupts on a legacy IDE device using MMIO or PIO, | ||
569 | * wait for idle, clear any pending interrupts. | ||
570 | * | ||
571 | * LOCKING: | ||
572 | * Inherited from caller. | ||
573 | */ | ||
574 | |||
528 | static inline u8 ata_irq_on(struct ata_port *ap) | 575 | static inline u8 ata_irq_on(struct ata_port *ap) |
529 | { | 576 | { |
530 | struct ata_ioports *ioaddr = &ap->ioaddr; | 577 | struct ata_ioports *ioaddr = &ap->ioaddr; |
@@ -544,6 +591,18 @@ static inline u8 ata_irq_on(struct ata_port *ap) | |||
544 | return tmp; | 591 | return tmp; |
545 | } | 592 | } |
546 | 593 | ||
594 | |||
595 | /** | ||
596 | * ata_irq_ack - Acknowledge a device interrupt. | ||
597 | * @ap: Port on which interrupts are enabled. | ||
598 | * | ||
599 | * Wait up to 10 ms for legacy IDE device to become idle (BUSY | ||
600 | * or BUSY+DRQ clear). Obtain dma status and port status from | ||
601 | * device. Clear the interrupt. Return port status. | ||
602 | * | ||
603 | * LOCKING: | ||
604 | */ | ||
605 | |||
547 | static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) | 606 | static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) |
548 | { | 607 | { |
549 | unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; | 608 | unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; |
diff --git a/include/linux/major.h b/include/linux/major.h index 4b62c42b842c..e36a46702d94 100644 --- a/include/linux/major.h +++ b/include/linux/major.h | |||
@@ -100,6 +100,7 @@ | |||
100 | #define I2O_MAJOR 80 /* 80->87 */ | 100 | #define I2O_MAJOR 80 /* 80->87 */ |
101 | 101 | ||
102 | #define SHMIQ_MAJOR 85 /* Linux/mips, SGI /dev/shmiq */ | 102 | #define SHMIQ_MAJOR 85 /* Linux/mips, SGI /dev/shmiq */ |
103 | #define SCSI_CHANGER_MAJOR 86 | ||
103 | 104 | ||
104 | #define IDE6_MAJOR 88 | 105 | #define IDE6_MAJOR 88 |
105 | #define IDE7_MAJOR 89 | 106 | #define IDE7_MAJOR 89 |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 470af8c1a4a0..ba5d1236aa17 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -204,7 +204,7 @@ struct hh_cache | |||
204 | /* cached hardware header; allow for machine alignment needs. */ | 204 | /* cached hardware header; allow for machine alignment needs. */ |
205 | #define HH_DATA_MOD 16 | 205 | #define HH_DATA_MOD 16 |
206 | #define HH_DATA_OFF(__len) \ | 206 | #define HH_DATA_OFF(__len) \ |
207 | (HH_DATA_MOD - ((__len) & (HH_DATA_MOD - 1))) | 207 | (HH_DATA_MOD - (((__len - 1) & (HH_DATA_MOD - 1)) + 1)) |
208 | #define HH_DATA_ALIGN(__len) \ | 208 | #define HH_DATA_ALIGN(__len) \ |
209 | (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) | 209 | (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) |
210 | unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; | 210 | unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index b2738ac8bc99..e38407a23d04 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -156,7 +156,7 @@ struct netlink_notify | |||
156 | }; | 156 | }; |
157 | 157 | ||
158 | static __inline__ struct nlmsghdr * | 158 | static __inline__ struct nlmsghdr * |
159 | __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len) | 159 | __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) |
160 | { | 160 | { |
161 | struct nlmsghdr *nlh; | 161 | struct nlmsghdr *nlh; |
162 | int size = NLMSG_LENGTH(len); | 162 | int size = NLMSG_LENGTH(len); |
@@ -164,15 +164,31 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len) | |||
164 | nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size)); | 164 | nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size)); |
165 | nlh->nlmsg_type = type; | 165 | nlh->nlmsg_type = type; |
166 | nlh->nlmsg_len = size; | 166 | nlh->nlmsg_len = size; |
167 | nlh->nlmsg_flags = 0; | 167 | nlh->nlmsg_flags = flags; |
168 | nlh->nlmsg_pid = pid; | 168 | nlh->nlmsg_pid = pid; |
169 | nlh->nlmsg_seq = seq; | 169 | nlh->nlmsg_seq = seq; |
170 | return nlh; | 170 | return nlh; |
171 | } | 171 | } |
172 | 172 | ||
173 | #define NLMSG_NEW(skb, pid, seq, type, len, flags) \ | ||
174 | ({ if (skb_tailroom(skb) < (int)NLMSG_SPACE(len)) \ | ||
175 | goto nlmsg_failure; \ | ||
176 | __nlmsg_put(skb, pid, seq, type, len, flags); }) | ||
177 | |||
173 | #define NLMSG_PUT(skb, pid, seq, type, len) \ | 178 | #define NLMSG_PUT(skb, pid, seq, type, len) \ |
174 | ({ if (skb_tailroom(skb) < (int)NLMSG_SPACE(len)) goto nlmsg_failure; \ | 179 | NLMSG_NEW(skb, pid, seq, type, len, 0) |
175 | __nlmsg_put(skb, pid, seq, type, len); }) | 180 | |
181 | #define NLMSG_NEW_ANSWER(skb, cb, type, len, flags) \ | ||
182 | NLMSG_NEW(skb, NETLINK_CB((cb)->skb).pid, \ | ||
183 | (cb)->nlh->nlmsg_seq, type, len, flags) | ||
184 | |||
185 | #define NLMSG_END(skb, nlh) \ | ||
186 | ({ (nlh)->nlmsg_len = (skb)->tail - (unsigned char *) (nlh); \ | ||
187 | (skb)->len; }) | ||
188 | |||
189 | #define NLMSG_CANCEL(skb, nlh) \ | ||
190 | ({ skb_trim(skb, (unsigned char *) (nlh) - (skb)->data); \ | ||
191 | -1; }) | ||
176 | 192 | ||
177 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, | 193 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, |
178 | struct nlmsghdr *nlh, | 194 | struct nlmsghdr *nlh, |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index b0d6134e1ee6..b8b4ebf9abf1 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -874,6 +874,7 @@ | |||
874 | #define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026 | 874 | #define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026 |
875 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027 | 875 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027 |
876 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d | 876 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d |
877 | #define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e | ||
877 | #define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 | 878 | #define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 |
878 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 | 879 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 |
879 | #define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033 | 880 | #define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033 |
@@ -2382,6 +2383,8 @@ | |||
2382 | #define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582 | 2383 | #define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582 |
2383 | #define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590 | 2384 | #define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590 |
2384 | #define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 | 2385 | #define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 |
2386 | #define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 | ||
2387 | #define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772 | ||
2385 | #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 | 2388 | #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 |
2386 | #define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 | 2389 | #define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 |
2387 | #define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 | 2390 | #define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 91ac97c20777..e68dbf0bf579 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -89,6 +89,13 @@ enum { | |||
89 | RTM_GETANYCAST = 62, | 89 | RTM_GETANYCAST = 62, |
90 | #define RTM_GETANYCAST RTM_GETANYCAST | 90 | #define RTM_GETANYCAST RTM_GETANYCAST |
91 | 91 | ||
92 | RTM_NEWNEIGHTBL = 64, | ||
93 | #define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL | ||
94 | RTM_GETNEIGHTBL = 66, | ||
95 | #define RTM_GETNEIGHTBL RTM_GETNEIGHTBL | ||
96 | RTM_SETNEIGHTBL, | ||
97 | #define RTM_SETNEIGHTBL RTM_SETNEIGHTBL | ||
98 | |||
92 | __RTM_MAX, | 99 | __RTM_MAX, |
93 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) | 100 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
94 | }; | 101 | }; |
@@ -493,6 +500,106 @@ struct nda_cacheinfo | |||
493 | __u32 ndm_refcnt; | 500 | __u32 ndm_refcnt; |
494 | }; | 501 | }; |
495 | 502 | ||
503 | |||
504 | /***************************************************************** | ||
505 | * Neighbour tables specific messages. | ||
506 | * | ||
507 | * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the | ||
508 | * NLM_F_DUMP flag set. Every neighbour table configuration is | ||
509 | * spread over multiple messages to avoid running into message | ||
510 | * size limits on systems with many interfaces. The first message | ||
511 | * in the sequence transports all not device specific data such as | ||
512 | * statistics, configuration, and the default parameter set. | ||
513 | * This message is followed by 0..n messages carrying device | ||
514 | * specific parameter sets. | ||
515 | * Although the ordering should be sufficient, NDTA_NAME can be | ||
516 | * used to identify sequences. The initial message can be identified | ||
517 | * by checking for NDTA_CONFIG. The device specific messages do | ||
518 | * not contain this TLV but have NDTPA_IFINDEX set to the | ||
519 | * corresponding interface index. | ||
520 | * | ||
521 | * To change neighbour table attributes, send RTM_SETNEIGHTBL | ||
522 | * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3], | ||
523 | * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked | ||
524 | * otherwise. Device specific parameter sets can be changed by | ||
525 | * setting NDTPA_IFINDEX to the interface index of the corresponding | ||
526 | * device. | ||
527 | ****/ | ||
528 | |||
529 | struct ndt_stats | ||
530 | { | ||
531 | __u64 ndts_allocs; | ||
532 | __u64 ndts_destroys; | ||
533 | __u64 ndts_hash_grows; | ||
534 | __u64 ndts_res_failed; | ||
535 | __u64 ndts_lookups; | ||
536 | __u64 ndts_hits; | ||
537 | __u64 ndts_rcv_probes_mcast; | ||
538 | __u64 ndts_rcv_probes_ucast; | ||
539 | __u64 ndts_periodic_gc_runs; | ||
540 | __u64 ndts_forced_gc_runs; | ||
541 | }; | ||
542 | |||
543 | enum { | ||
544 | NDTPA_UNSPEC, | ||
545 | NDTPA_IFINDEX, /* u32, unchangeable */ | ||
546 | NDTPA_REFCNT, /* u32, read-only */ | ||
547 | NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */ | ||
548 | NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */ | ||
549 | NDTPA_RETRANS_TIME, /* u64, msecs */ | ||
550 | NDTPA_GC_STALETIME, /* u64, msecs */ | ||
551 | NDTPA_DELAY_PROBE_TIME, /* u64, msecs */ | ||
552 | NDTPA_QUEUE_LEN, /* u32 */ | ||
553 | NDTPA_APP_PROBES, /* u32 */ | ||
554 | NDTPA_UCAST_PROBES, /* u32 */ | ||
555 | NDTPA_MCAST_PROBES, /* u32 */ | ||
556 | NDTPA_ANYCAST_DELAY, /* u64, msecs */ | ||
557 | NDTPA_PROXY_DELAY, /* u64, msecs */ | ||
558 | NDTPA_PROXY_QLEN, /* u32 */ | ||
559 | NDTPA_LOCKTIME, /* u64, msecs */ | ||
560 | __NDTPA_MAX | ||
561 | }; | ||
562 | #define NDTPA_MAX (__NDTPA_MAX - 1) | ||
563 | |||
564 | struct ndtmsg | ||
565 | { | ||
566 | __u8 ndtm_family; | ||
567 | __u8 ndtm_pad1; | ||
568 | __u16 ndtm_pad2; | ||
569 | }; | ||
570 | |||
571 | struct ndt_config | ||
572 | { | ||
573 | __u16 ndtc_key_len; | ||
574 | __u16 ndtc_entry_size; | ||
575 | __u32 ndtc_entries; | ||
576 | __u32 ndtc_last_flush; /* delta to now in msecs */ | ||
577 | __u32 ndtc_last_rand; /* delta to now in msecs */ | ||
578 | __u32 ndtc_hash_rnd; | ||
579 | __u32 ndtc_hash_mask; | ||
580 | __u32 ndtc_hash_chain_gc; | ||
581 | __u32 ndtc_proxy_qlen; | ||
582 | }; | ||
583 | |||
584 | enum { | ||
585 | NDTA_UNSPEC, | ||
586 | NDTA_NAME, /* char *, unchangeable */ | ||
587 | NDTA_THRESH1, /* u32 */ | ||
588 | NDTA_THRESH2, /* u32 */ | ||
589 | NDTA_THRESH3, /* u32 */ | ||
590 | NDTA_CONFIG, /* struct ndt_config, read-only */ | ||
591 | NDTA_PARMS, /* nested TLV NDTPA_* */ | ||
592 | NDTA_STATS, /* struct ndt_stats, read-only */ | ||
593 | NDTA_GC_INTERVAL, /* u64, msecs */ | ||
594 | __NDTA_MAX | ||
595 | }; | ||
596 | #define NDTA_MAX (__NDTA_MAX - 1) | ||
597 | |||
598 | #define NDTA_RTA(r) ((struct rtattr*)(((char*)(r)) + \ | ||
599 | NLMSG_ALIGN(sizeof(struct ndtmsg)))) | ||
600 | #define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg)) | ||
601 | |||
602 | |||
496 | /**** | 603 | /**** |
497 | * General form of address family dependent message. | 604 | * General form of address family dependent message. |
498 | ****/ | 605 | ****/ |
@@ -789,6 +896,75 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi | |||
789 | ({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \ | 896 | ({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \ |
790 | goto rtattr_failure; \ | 897 | goto rtattr_failure; \ |
791 | memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); }) | 898 | memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); }) |
899 | |||
900 | #define RTA_PUT_U8(skb, attrtype, value) \ | ||
901 | ({ u8 _tmp = (value); \ | ||
902 | RTA_PUT(skb, attrtype, sizeof(u8), &_tmp); }) | ||
903 | |||
904 | #define RTA_PUT_U16(skb, attrtype, value) \ | ||
905 | ({ u16 _tmp = (value); \ | ||
906 | RTA_PUT(skb, attrtype, sizeof(u16), &_tmp); }) | ||
907 | |||
908 | #define RTA_PUT_U32(skb, attrtype, value) \ | ||
909 | ({ u32 _tmp = (value); \ | ||
910 | RTA_PUT(skb, attrtype, sizeof(u32), &_tmp); }) | ||
911 | |||
912 | #define RTA_PUT_U64(skb, attrtype, value) \ | ||
913 | ({ u64 _tmp = (value); \ | ||
914 | RTA_PUT(skb, attrtype, sizeof(u64), &_tmp); }) | ||
915 | |||
916 | #define RTA_PUT_SECS(skb, attrtype, value) \ | ||
917 | RTA_PUT_U64(skb, attrtype, (value) / HZ) | ||
918 | |||
919 | #define RTA_PUT_MSECS(skb, attrtype, value) \ | ||
920 | RTA_PUT_U64(skb, attrtype, jiffies_to_msecs(value)) | ||
921 | |||
922 | #define RTA_PUT_STRING(skb, attrtype, value) \ | ||
923 | RTA_PUT(skb, attrtype, strlen(value) + 1, value) | ||
924 | |||
925 | #define RTA_PUT_FLAG(skb, attrtype) \ | ||
926 | RTA_PUT(skb, attrtype, 0, NULL); | ||
927 | |||
928 | #define RTA_NEST(skb, type) \ | ||
929 | ({ struct rtattr *__start = (struct rtattr *) (skb)->tail; \ | ||
930 | RTA_PUT(skb, type, 0, NULL); \ | ||
931 | __start; }) | ||
932 | |||
933 | #define RTA_NEST_END(skb, start) \ | ||
934 | ({ (start)->rta_len = ((skb)->tail - (unsigned char *) (start)); \ | ||
935 | (skb)->len; }) | ||
936 | |||
937 | #define RTA_NEST_CANCEL(skb, start) \ | ||
938 | ({ if (start) \ | ||
939 | skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ | ||
940 | -1; }) | ||
941 | |||
942 | #define RTA_GET_U8(rta) \ | ||
943 | ({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u8)) \ | ||
944 | goto rtattr_failure; \ | ||
945 | *(u8 *) RTA_DATA(rta); }) | ||
946 | |||
947 | #define RTA_GET_U16(rta) \ | ||
948 | ({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u16)) \ | ||
949 | goto rtattr_failure; \ | ||
950 | *(u16 *) RTA_DATA(rta); }) | ||
951 | |||
952 | #define RTA_GET_U32(rta) \ | ||
953 | ({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u32)) \ | ||
954 | goto rtattr_failure; \ | ||
955 | *(u32 *) RTA_DATA(rta); }) | ||
956 | |||
957 | #define RTA_GET_U64(rta) \ | ||
958 | ({ u64 _tmp; \ | ||
959 | if (!rta || RTA_PAYLOAD(rta) < sizeof(u64)) \ | ||
960 | goto rtattr_failure; \ | ||
961 | memcpy(&_tmp, RTA_DATA(rta), sizeof(_tmp)); \ | ||
962 | _tmp; }) | ||
963 | |||
964 | #define RTA_GET_FLAG(rta) (!!(rta)) | ||
965 | |||
966 | #define RTA_GET_SECS(rta) ((unsigned long) RTA_GET_U64(rta) * HZ) | ||
967 | #define RTA_GET_MSECS(rta) (msecs_to_jiffies((unsigned long) RTA_GET_U64(rta))) | ||
792 | 968 | ||
793 | static inline struct rtattr * | 969 | static inline struct rtattr * |
794 | __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) | 970 | __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) |
diff --git a/include/linux/signal.h b/include/linux/signal.h index 0a98f5ec5cae..7be18b5e2fb4 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -231,10 +231,8 @@ extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); | |||
231 | extern long do_sigpending(void __user *, unsigned long); | 231 | extern long do_sigpending(void __user *, unsigned long); |
232 | extern int sigprocmask(int, sigset_t *, sigset_t *); | 232 | extern int sigprocmask(int, sigset_t *, sigset_t *); |
233 | 233 | ||
234 | #ifndef HAVE_ARCH_GET_SIGNAL_TO_DELIVER | ||
235 | struct pt_regs; | 234 | struct pt_regs; |
236 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); | 235 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); |
237 | #endif | ||
238 | 236 | ||
239 | #endif /* __KERNEL__ */ | 237 | #endif /* __KERNEL__ */ |
240 | 238 | ||
diff --git a/include/linux/slab.h b/include/linux/slab.h index 7d66385ae750..76cf7e60216c 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -64,6 +64,7 @@ extern int kmem_cache_shrink(kmem_cache_t *); | |||
64 | extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); | 64 | extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); |
65 | extern void kmem_cache_free(kmem_cache_t *, void *); | 65 | extern void kmem_cache_free(kmem_cache_t *, void *); |
66 | extern unsigned int kmem_cache_size(kmem_cache_t *); | 66 | extern unsigned int kmem_cache_size(kmem_cache_t *); |
67 | extern const char *kmem_cache_name(kmem_cache_t *); | ||
67 | extern kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags); | 68 | extern kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags); |
68 | 69 | ||
69 | /* Size description struct for general caches. */ | 70 | /* Size description struct for general caches. */ |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 23032d9d6071..a17745c80a91 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -346,6 +346,7 @@ enum | |||
346 | NET_TCP_MODERATE_RCVBUF=106, | 346 | NET_TCP_MODERATE_RCVBUF=106, |
347 | NET_TCP_TSO_WIN_DIVISOR=107, | 347 | NET_TCP_TSO_WIN_DIVISOR=107, |
348 | NET_TCP_BIC_BETA=108, | 348 | NET_TCP_BIC_BETA=108, |
349 | NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109, | ||
349 | }; | 350 | }; |
350 | 351 | ||
351 | enum { | 352 | enum { |
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h index aa6b48bb4dcd..a6b2cc530af5 100644 --- a/include/linux/tc_ematch/tc_em_meta.h +++ b/include/linux/tc_ematch/tc_em_meta.h | |||
@@ -56,6 +56,36 @@ enum | |||
56 | TCF_META_ID_TCCLASSID, | 56 | TCF_META_ID_TCCLASSID, |
57 | TCF_META_ID_RTCLASSID, | 57 | TCF_META_ID_RTCLASSID, |
58 | TCF_META_ID_RTIIF, | 58 | TCF_META_ID_RTIIF, |
59 | TCF_META_ID_SK_FAMILY, | ||
60 | TCF_META_ID_SK_STATE, | ||
61 | TCF_META_ID_SK_REUSE, | ||
62 | TCF_META_ID_SK_BOUND_IF, | ||
63 | TCF_META_ID_SK_REFCNT, | ||
64 | TCF_META_ID_SK_SHUTDOWN, | ||
65 | TCF_META_ID_SK_PROTO, | ||
66 | TCF_META_ID_SK_TYPE, | ||
67 | TCF_META_ID_SK_RCVBUF, | ||
68 | TCF_META_ID_SK_RMEM_ALLOC, | ||
69 | TCF_META_ID_SK_WMEM_ALLOC, | ||
70 | TCF_META_ID_SK_OMEM_ALLOC, | ||
71 | TCF_META_ID_SK_WMEM_QUEUED, | ||
72 | TCF_META_ID_SK_RCV_QLEN, | ||
73 | TCF_META_ID_SK_SND_QLEN, | ||
74 | TCF_META_ID_SK_ERR_QLEN, | ||
75 | TCF_META_ID_SK_FORWARD_ALLOCS, | ||
76 | TCF_META_ID_SK_SNDBUF, | ||
77 | TCF_META_ID_SK_ALLOCS, | ||
78 | TCF_META_ID_SK_ROUTE_CAPS, | ||
79 | TCF_META_ID_SK_HASHENT, | ||
80 | TCF_META_ID_SK_LINGERTIME, | ||
81 | TCF_META_ID_SK_ACK_BACKLOG, | ||
82 | TCF_META_ID_SK_MAX_ACK_BACKLOG, | ||
83 | TCF_META_ID_SK_PRIO, | ||
84 | TCF_META_ID_SK_RCVLOWAT, | ||
85 | TCF_META_ID_SK_RCVTIMEO, | ||
86 | TCF_META_ID_SK_SNDTIMEO, | ||
87 | TCF_META_ID_SK_SENDMSG_OFF, | ||
88 | TCF_META_ID_SK_WRITE_PENDING, | ||
59 | __TCF_META_ID_MAX | 89 | __TCF_META_ID_MAX |
60 | }; | 90 | }; |
61 | #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) | 91 | #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 14a55e3e3a50..97a7c9e03df5 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -230,6 +230,17 @@ struct tcp_options_received { | |||
230 | __u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ | 230 | __u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ |
231 | }; | 231 | }; |
232 | 232 | ||
233 | struct tcp_request_sock { | ||
234 | struct inet_request_sock req; | ||
235 | __u32 rcv_isn; | ||
236 | __u32 snt_isn; | ||
237 | }; | ||
238 | |||
239 | static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) | ||
240 | { | ||
241 | return (struct tcp_request_sock *)req; | ||
242 | } | ||
243 | |||
233 | struct tcp_sock { | 244 | struct tcp_sock { |
234 | /* inet_sock has to be the first member of tcp_sock */ | 245 | /* inet_sock has to be the first member of tcp_sock */ |
235 | struct inet_sock inet; | 246 | struct inet_sock inet; |
@@ -368,22 +379,7 @@ struct tcp_sock { | |||
368 | 379 | ||
369 | __u32 total_retrans; /* Total retransmits for entire connection */ | 380 | __u32 total_retrans; /* Total retransmits for entire connection */ |
370 | 381 | ||
371 | /* The syn_wait_lock is necessary only to avoid proc interface having | 382 | struct request_sock_queue accept_queue; /* FIFO of established children */ |
372 | * to grab the main lock sock while browsing the listening hash | ||
373 | * (otherwise it's deadlock prone). | ||
374 | * This lock is acquired in read mode only from listening_get_next() | ||
375 | * and it's acquired in write mode _only_ from code that is actively | ||
376 | * changing the syn_wait_queue. All readers that are holding | ||
377 | * the master sock lock don't need to grab this lock in read mode | ||
378 | * too as the syn_wait_queue writes are always protected from | ||
379 | * the main sock lock. | ||
380 | */ | ||
381 | rwlock_t syn_wait_lock; | ||
382 | struct tcp_listen_opt *listen_opt; | ||
383 | |||
384 | /* FIFO of established children */ | ||
385 | struct open_request *accept_queue; | ||
386 | struct open_request *accept_queue_tail; | ||
387 | 383 | ||
388 | unsigned int keepalive_time; /* time before keep alive takes place */ | 384 | unsigned int keepalive_time; /* time before keep alive takes place */ |
389 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ | 385 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 41d1a644c9d4..2d1ac5058534 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -796,6 +796,10 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *); | |||
796 | * of the iso_frame_desc array, and the number of errors is reported in | 796 | * of the iso_frame_desc array, and the number of errors is reported in |
797 | * error_count. Completion callbacks for ISO transfers will normally | 797 | * error_count. Completion callbacks for ISO transfers will normally |
798 | * (re)submit URBs to ensure a constant transfer rate. | 798 | * (re)submit URBs to ensure a constant transfer rate. |
799 | * | ||
800 | * Note that even fields marked "public" should not be touched by the driver | ||
801 | * when the urb is owned by the hcd, that is, since the call to | ||
802 | * usb_submit_urb() till the entry into the completion routine. | ||
799 | */ | 803 | */ |
800 | struct urb | 804 | struct urb |
801 | { | 805 | { |
@@ -803,12 +807,12 @@ struct urb | |||
803 | struct kref kref; /* reference count of the URB */ | 807 | struct kref kref; /* reference count of the URB */ |
804 | spinlock_t lock; /* lock for the URB */ | 808 | spinlock_t lock; /* lock for the URB */ |
805 | void *hcpriv; /* private data for host controller */ | 809 | void *hcpriv; /* private data for host controller */ |
806 | struct list_head urb_list; /* list pointer to all active urbs */ | ||
807 | int bandwidth; /* bandwidth for INT/ISO request */ | 810 | int bandwidth; /* bandwidth for INT/ISO request */ |
808 | atomic_t use_count; /* concurrent submissions counter */ | 811 | atomic_t use_count; /* concurrent submissions counter */ |
809 | u8 reject; /* submissions will fail */ | 812 | u8 reject; /* submissions will fail */ |
810 | 813 | ||
811 | /* public, documented fields in the urb that can be used by drivers */ | 814 | /* public, documented fields in the urb that can be used by drivers */ |
815 | struct list_head urb_list; /* list head for use by the urb owner */ | ||
812 | struct usb_device *dev; /* (in) pointer to associated device */ | 816 | struct usb_device *dev; /* (in) pointer to associated device */ |
813 | unsigned int pipe; /* (in) pipe information */ | 817 | unsigned int pipe; /* (in) pipe information */ |
814 | int status; /* (return) non-ISO status */ | 818 | int status; /* (return) non-ISO status */ |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 2f51f2b6562e..ae485f9c916e 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * This file define a set of standard wireless extensions | 2 | * This file define a set of standard wireless extensions |
3 | * | 3 | * |
4 | * Version : 17 21.6.04 | 4 | * Version : 18 12.3.05 |
5 | * | 5 | * |
6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
7 | * Copyright (c) 1997-2004 Jean Tourrilhes, All Rights Reserved. | 7 | * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef _LINUX_WIRELESS_H | 10 | #ifndef _LINUX_WIRELESS_H |
@@ -82,7 +82,7 @@ | |||
82 | * (there is some stuff that will be added in the future...) | 82 | * (there is some stuff that will be added in the future...) |
83 | * I just plan to increment with each new version. | 83 | * I just plan to increment with each new version. |
84 | */ | 84 | */ |
85 | #define WIRELESS_EXT 17 | 85 | #define WIRELESS_EXT 18 |
86 | 86 | ||
87 | /* | 87 | /* |
88 | * Changes : | 88 | * Changes : |
@@ -182,6 +182,21 @@ | |||
182 | * - Document (struct iw_quality *)->updated, add new flags (INVALID) | 182 | * - Document (struct iw_quality *)->updated, add new flags (INVALID) |
183 | * - Wireless Event capability in struct iw_range | 183 | * - Wireless Event capability in struct iw_range |
184 | * - Add support for relative TxPower (yick !) | 184 | * - Add support for relative TxPower (yick !) |
185 | * | ||
186 | * V17 to V18 (From Jouni Malinen <jkmaline@cc.hut.fi>) | ||
187 | * ---------- | ||
188 | * - Add support for WPA/WPA2 | ||
189 | * - Add extended encoding configuration (SIOCSIWENCODEEXT and | ||
190 | * SIOCGIWENCODEEXT) | ||
191 | * - Add SIOCSIWGENIE/SIOCGIWGENIE | ||
192 | * - Add SIOCSIWMLME | ||
193 | * - Add SIOCSIWPMKSA | ||
194 | * - Add struct iw_range bit field for supported encoding capabilities | ||
195 | * - Add optional scan request parameters for SIOCSIWSCAN | ||
196 | * - Add SIOCSIWAUTH/SIOCGIWAUTH for setting authentication and WPA | ||
197 | * related parameters (extensible up to 4096 parameter values) | ||
198 | * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE, | ||
199 | * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND | ||
185 | */ | 200 | */ |
186 | 201 | ||
187 | /**************************** CONSTANTS ****************************/ | 202 | /**************************** CONSTANTS ****************************/ |
@@ -256,6 +271,30 @@ | |||
256 | #define SIOCSIWPOWER 0x8B2C /* set Power Management settings */ | 271 | #define SIOCSIWPOWER 0x8B2C /* set Power Management settings */ |
257 | #define SIOCGIWPOWER 0x8B2D /* get Power Management settings */ | 272 | #define SIOCGIWPOWER 0x8B2D /* get Power Management settings */ |
258 | 273 | ||
274 | /* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM). | ||
275 | * This ioctl uses struct iw_point and data buffer that includes IE id and len | ||
276 | * fields. More than one IE may be included in the request. Setting the generic | ||
277 | * IE to empty buffer (len=0) removes the generic IE from the driver. Drivers | ||
278 | * are allowed to generate their own WPA/RSN IEs, but in these cases, drivers | ||
279 | * are required to report the used IE as a wireless event, e.g., when | ||
280 | * associating with an AP. */ | ||
281 | #define SIOCSIWGENIE 0x8B30 /* set generic IE */ | ||
282 | #define SIOCGIWGENIE 0x8B31 /* get generic IE */ | ||
283 | |||
284 | /* WPA : IEEE 802.11 MLME requests */ | ||
285 | #define SIOCSIWMLME 0x8B16 /* request MLME operation; uses | ||
286 | * struct iw_mlme */ | ||
287 | /* WPA : Authentication mode parameters */ | ||
288 | #define SIOCSIWAUTH 0x8B32 /* set authentication mode params */ | ||
289 | #define SIOCGIWAUTH 0x8B33 /* get authentication mode params */ | ||
290 | |||
291 | /* WPA : Extended version of encoding configuration */ | ||
292 | #define SIOCSIWENCODEEXT 0x8B34 /* set encoding token & mode */ | ||
293 | #define SIOCGIWENCODEEXT 0x8B35 /* get encoding token & mode */ | ||
294 | |||
295 | /* WPA2 : PMKSA cache management */ | ||
296 | #define SIOCSIWPMKSA 0x8B36 /* PMKSA cache operation */ | ||
297 | |||
259 | /* -------------------- DEV PRIVATE IOCTL LIST -------------------- */ | 298 | /* -------------------- DEV PRIVATE IOCTL LIST -------------------- */ |
260 | 299 | ||
261 | /* These 32 ioctl are wireless device private, for 16 commands. | 300 | /* These 32 ioctl are wireless device private, for 16 commands. |
@@ -297,6 +336,34 @@ | |||
297 | #define IWEVCUSTOM 0x8C02 /* Driver specific ascii string */ | 336 | #define IWEVCUSTOM 0x8C02 /* Driver specific ascii string */ |
298 | #define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */ | 337 | #define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */ |
299 | #define IWEVEXPIRED 0x8C04 /* Expired a node (AP mode) */ | 338 | #define IWEVEXPIRED 0x8C04 /* Expired a node (AP mode) */ |
339 | #define IWEVGENIE 0x8C05 /* Generic IE (WPA, RSN, WMM, ..) | ||
340 | * (scan results); This includes id and | ||
341 | * length fields. One IWEVGENIE may | ||
342 | * contain more than one IE. Scan | ||
343 | * results may contain one or more | ||
344 | * IWEVGENIE events. */ | ||
345 | #define IWEVMICHAELMICFAILURE 0x8C06 /* Michael MIC failure | ||
346 | * (struct iw_michaelmicfailure) | ||
347 | */ | ||
348 | #define IWEVASSOCREQIE 0x8C07 /* IEs used in (Re)Association Request. | ||
349 | * The data includes id and length | ||
350 | * fields and may contain more than one | ||
351 | * IE. This event is required in | ||
352 | * Managed mode if the driver | ||
353 | * generates its own WPA/RSN IE. This | ||
354 | * should be sent just before | ||
355 | * IWEVREGISTERED event for the | ||
356 | * association. */ | ||
357 | #define IWEVASSOCRESPIE 0x8C08 /* IEs used in (Re)Association | ||
358 | * Response. The data includes id and | ||
359 | * length fields and may contain more | ||
360 | * than one IE. This may be sent | ||
361 | * between IWEVASSOCREQIE and | ||
362 | * IWEVREGISTERED events for the | ||
363 | * association. */ | ||
364 | #define IWEVPMKIDCAND 0x8C09 /* PMKID candidate for RSN | ||
365 | * pre-authentication | ||
366 | * (struct iw_pmkid_cand) */ | ||
300 | 367 | ||
301 | #define IWEVFIRST 0x8C00 | 368 | #define IWEVFIRST 0x8C00 |
302 | 369 | ||
@@ -432,12 +499,94 @@ | |||
432 | #define IW_SCAN_THIS_MODE 0x0020 /* Scan only this Mode */ | 499 | #define IW_SCAN_THIS_MODE 0x0020 /* Scan only this Mode */ |
433 | #define IW_SCAN_ALL_RATE 0x0040 /* Scan all Bit-Rates */ | 500 | #define IW_SCAN_ALL_RATE 0x0040 /* Scan all Bit-Rates */ |
434 | #define IW_SCAN_THIS_RATE 0x0080 /* Scan only this Bit-Rate */ | 501 | #define IW_SCAN_THIS_RATE 0x0080 /* Scan only this Bit-Rate */ |
502 | /* struct iw_scan_req scan_type */ | ||
503 | #define IW_SCAN_TYPE_ACTIVE 0 | ||
504 | #define IW_SCAN_TYPE_PASSIVE 1 | ||
435 | /* Maximum size of returned data */ | 505 | /* Maximum size of returned data */ |
436 | #define IW_SCAN_MAX_DATA 4096 /* In bytes */ | 506 | #define IW_SCAN_MAX_DATA 4096 /* In bytes */ |
437 | 507 | ||
438 | /* Max number of char in custom event - use multiple of them if needed */ | 508 | /* Max number of char in custom event - use multiple of them if needed */ |
439 | #define IW_CUSTOM_MAX 256 /* In bytes */ | 509 | #define IW_CUSTOM_MAX 256 /* In bytes */ |
440 | 510 | ||
511 | /* Generic information element */ | ||
512 | #define IW_GENERIC_IE_MAX 1024 | ||
513 | |||
514 | /* MLME requests (SIOCSIWMLME / struct iw_mlme) */ | ||
515 | #define IW_MLME_DEAUTH 0 | ||
516 | #define IW_MLME_DISASSOC 1 | ||
517 | |||
518 | /* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */ | ||
519 | #define IW_AUTH_INDEX 0x0FFF | ||
520 | #define IW_AUTH_FLAGS 0xF000 | ||
521 | /* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095) | ||
522 | * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the | ||
523 | * parameter that is being set/get to; value will be read/written to | ||
524 | * struct iw_param value field) */ | ||
525 | #define IW_AUTH_WPA_VERSION 0 | ||
526 | #define IW_AUTH_CIPHER_PAIRWISE 1 | ||
527 | #define IW_AUTH_CIPHER_GROUP 2 | ||
528 | #define IW_AUTH_KEY_MGMT 3 | ||
529 | #define IW_AUTH_TKIP_COUNTERMEASURES 4 | ||
530 | #define IW_AUTH_DROP_UNENCRYPTED 5 | ||
531 | #define IW_AUTH_80211_AUTH_ALG 6 | ||
532 | #define IW_AUTH_WPA_ENABLED 7 | ||
533 | #define IW_AUTH_RX_UNENCRYPTED_EAPOL 8 | ||
534 | #define IW_AUTH_ROAMING_CONTROL 9 | ||
535 | #define IW_AUTH_PRIVACY_INVOKED 10 | ||
536 | |||
537 | /* IW_AUTH_WPA_VERSION values (bit field) */ | ||
538 | #define IW_AUTH_WPA_VERSION_DISABLED 0x00000001 | ||
539 | #define IW_AUTH_WPA_VERSION_WPA 0x00000002 | ||
540 | #define IW_AUTH_WPA_VERSION_WPA2 0x00000004 | ||
541 | |||
542 | /* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */ | ||
543 | #define IW_AUTH_CIPHER_NONE 0x00000001 | ||
544 | #define IW_AUTH_CIPHER_WEP40 0x00000002 | ||
545 | #define IW_AUTH_CIPHER_TKIP 0x00000004 | ||
546 | #define IW_AUTH_CIPHER_CCMP 0x00000008 | ||
547 | #define IW_AUTH_CIPHER_WEP104 0x00000010 | ||
548 | |||
549 | /* IW_AUTH_KEY_MGMT values (bit field) */ | ||
550 | #define IW_AUTH_KEY_MGMT_802_1X 1 | ||
551 | #define IW_AUTH_KEY_MGMT_PSK 2 | ||
552 | |||
553 | /* IW_AUTH_80211_AUTH_ALG values (bit field) */ | ||
554 | #define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001 | ||
555 | #define IW_AUTH_ALG_SHARED_KEY 0x00000002 | ||
556 | #define IW_AUTH_ALG_LEAP 0x00000004 | ||
557 | |||
558 | /* IW_AUTH_ROAMING_CONTROL values */ | ||
559 | #define IW_AUTH_ROAMING_ENABLE 0 /* driver/firmware based roaming */ | ||
560 | #define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming | ||
561 | * control */ | ||
562 | |||
563 | /* SIOCSIWENCODEEXT definitions */ | ||
564 | #define IW_ENCODE_SEQ_MAX_SIZE 8 | ||
565 | /* struct iw_encode_ext ->alg */ | ||
566 | #define IW_ENCODE_ALG_NONE 0 | ||
567 | #define IW_ENCODE_ALG_WEP 1 | ||
568 | #define IW_ENCODE_ALG_TKIP 2 | ||
569 | #define IW_ENCODE_ALG_CCMP 3 | ||
570 | /* struct iw_encode_ext ->ext_flags */ | ||
571 | #define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001 | ||
572 | #define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002 | ||
573 | #define IW_ENCODE_EXT_GROUP_KEY 0x00000004 | ||
574 | #define IW_ENCODE_EXT_SET_TX_KEY 0x00000008 | ||
575 | |||
576 | /* IWEVMICHAELMICFAILURE : struct iw_michaelmicfailure ->flags */ | ||
577 | #define IW_MICFAILURE_KEY_ID 0x00000003 /* Key ID 0..3 */ | ||
578 | #define IW_MICFAILURE_GROUP 0x00000004 | ||
579 | #define IW_MICFAILURE_PAIRWISE 0x00000008 | ||
580 | #define IW_MICFAILURE_STAKEY 0x00000010 | ||
581 | #define IW_MICFAILURE_COUNT 0x00000060 /* 1 or 2 (0 = count not supported) | ||
582 | */ | ||
583 | |||
584 | /* Bit field values for enc_capa in struct iw_range */ | ||
585 | #define IW_ENC_CAPA_WPA 0x00000001 | ||
586 | #define IW_ENC_CAPA_WPA2 0x00000002 | ||
587 | #define IW_ENC_CAPA_CIPHER_TKIP 0x00000004 | ||
588 | #define IW_ENC_CAPA_CIPHER_CCMP 0x00000008 | ||
589 | |||
441 | /* Event capability macros - in (struct iw_range *)->event_capa | 590 | /* Event capability macros - in (struct iw_range *)->event_capa |
442 | * Because we have more than 32 possible events, we use an array of | 591 | * Because we have more than 32 possible events, we use an array of |
443 | * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */ | 592 | * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */ |
@@ -546,6 +695,132 @@ struct iw_thrspy | |||
546 | struct iw_quality high; /* High threshold */ | 695 | struct iw_quality high; /* High threshold */ |
547 | }; | 696 | }; |
548 | 697 | ||
698 | /* | ||
699 | * Optional data for scan request | ||
700 | * | ||
701 | * Note: these optional parameters are controlling parameters for the | ||
702 | * scanning behavior, these do not apply to getting scan results | ||
703 | * (SIOCGIWSCAN). Drivers are expected to keep a local BSS table and | ||
704 | * provide a merged results with all BSSes even if the previous scan | ||
705 | * request limited scanning to a subset, e.g., by specifying an SSID. | ||
706 | * Especially, scan results are required to include an entry for the | ||
707 | * current BSS if the driver is in Managed mode and associated with an AP. | ||
708 | */ | ||
709 | struct iw_scan_req | ||
710 | { | ||
711 | __u8 scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */ | ||
712 | __u8 essid_len; | ||
713 | __u8 num_channels; /* num entries in channel_list; | ||
714 | * 0 = scan all allowed channels */ | ||
715 | __u8 flags; /* reserved as padding; use zero, this may | ||
716 | * be used in the future for adding flags | ||
717 | * to request different scan behavior */ | ||
718 | struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or | ||
719 | * individual address of a specific BSS */ | ||
720 | |||
721 | /* | ||
722 | * Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using | ||
723 | * the current ESSID. This allows scan requests for specific ESSID | ||
724 | * without having to change the current ESSID and potentially breaking | ||
725 | * the current association. | ||
726 | */ | ||
727 | __u8 essid[IW_ESSID_MAX_SIZE]; | ||
728 | |||
729 | /* | ||
730 | * Optional parameters for changing the default scanning behavior. | ||
731 | * These are based on the MLME-SCAN.request from IEEE Std 802.11. | ||
732 | * TU is 1.024 ms. If these are set to 0, driver is expected to use | ||
733 | * reasonable default values. min_channel_time defines the time that | ||
734 | * will be used to wait for the first reply on each channel. If no | ||
735 | * replies are received, next channel will be scanned after this. If | ||
736 | * replies are received, total time waited on the channel is defined by | ||
737 | * max_channel_time. | ||
738 | */ | ||
739 | __u32 min_channel_time; /* in TU */ | ||
740 | __u32 max_channel_time; /* in TU */ | ||
741 | |||
742 | struct iw_freq channel_list[IW_MAX_FREQUENCIES]; | ||
743 | }; | ||
744 | |||
745 | /* ------------------------- WPA SUPPORT ------------------------- */ | ||
746 | |||
747 | /* | ||
748 | * Extended data structure for get/set encoding (this is used with | ||
749 | * SIOCSIWENCODEEXT/SIOCGIWENCODEEXT. struct iw_point and IW_ENCODE_* | ||
750 | * flags are used in the same way as with SIOCSIWENCODE/SIOCGIWENCODE and | ||
751 | * only the data contents changes (key data -> this structure, including | ||
752 | * key data). | ||
753 | * | ||
754 | * If the new key is the first group key, it will be set as the default | ||
755 | * TX key. Otherwise, default TX key index is only changed if | ||
756 | * IW_ENCODE_EXT_SET_TX_KEY flag is set. | ||
757 | * | ||
758 | * Key will be changed with SIOCSIWENCODEEXT in all cases except for | ||
759 | * special "change TX key index" operation which is indicated by setting | ||
760 | * key_len = 0 and ext_flags |= IW_ENCODE_EXT_SET_TX_KEY. | ||
761 | * | ||
762 | * tx_seq/rx_seq are only used when respective | ||
763 | * IW_ENCODE_EXT_{TX,RX}_SEQ_VALID flag is set in ext_flags. Normal | ||
764 | * TKIP/CCMP operation is to set RX seq with SIOCSIWENCODEEXT and start | ||
765 | * TX seq from zero whenever key is changed. SIOCGIWENCODEEXT is normally | ||
766 | * used only by an Authenticator (AP or an IBSS station) to get the | ||
767 | * current TX sequence number. Using TX_SEQ_VALID for SIOCSIWENCODEEXT and | ||
768 | * RX_SEQ_VALID for SIOCGIWENCODEEXT are optional, but can be useful for | ||
769 | * debugging/testing. | ||
770 | */ | ||
771 | struct iw_encode_ext | ||
772 | { | ||
773 | __u32 ext_flags; /* IW_ENCODE_EXT_* */ | ||
774 | __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */ | ||
775 | __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */ | ||
776 | struct sockaddr addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast | ||
777 | * (group) keys or unicast address for | ||
778 | * individual keys */ | ||
779 | __u16 alg; /* IW_ENCODE_ALG_* */ | ||
780 | __u16 key_len; | ||
781 | __u8 key[0]; | ||
782 | }; | ||
783 | |||
784 | /* SIOCSIWMLME data */ | ||
785 | struct iw_mlme | ||
786 | { | ||
787 | __u16 cmd; /* IW_MLME_* */ | ||
788 | __u16 reason_code; | ||
789 | struct sockaddr addr; | ||
790 | }; | ||
791 | |||
792 | /* SIOCSIWPMKSA data */ | ||
793 | #define IW_PMKSA_ADD 1 | ||
794 | #define IW_PMKSA_REMOVE 2 | ||
795 | #define IW_PMKSA_FLUSH 3 | ||
796 | |||
797 | #define IW_PMKID_LEN 16 | ||
798 | |||
799 | struct iw_pmksa | ||
800 | { | ||
801 | __u32 cmd; /* IW_PMKSA_* */ | ||
802 | struct sockaddr bssid; | ||
803 | __u8 pmkid[IW_PMKID_LEN]; | ||
804 | }; | ||
805 | |||
806 | /* IWEVMICHAELMICFAILURE data */ | ||
807 | struct iw_michaelmicfailure | ||
808 | { | ||
809 | __u32 flags; | ||
810 | struct sockaddr src_addr; | ||
811 | __u8 tsc[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */ | ||
812 | }; | ||
813 | |||
814 | /* IWEVPMKIDCAND data */ | ||
815 | #define IW_PMKID_CAND_PREAUTH 0x00000001 /* RNS pre-authentication enabled */ | ||
816 | struct iw_pmkid_cand | ||
817 | { | ||
818 | __u32 flags; /* IW_PMKID_CAND_* */ | ||
819 | __u32 index; /* the smaller the index, the higher the | ||
820 | * priority */ | ||
821 | struct sockaddr bssid; | ||
822 | }; | ||
823 | |||
549 | /* ------------------------ WIRELESS STATS ------------------------ */ | 824 | /* ------------------------ WIRELESS STATS ------------------------ */ |
550 | /* | 825 | /* |
551 | * Wireless statistics (used for /proc/net/wireless) | 826 | * Wireless statistics (used for /proc/net/wireless) |
@@ -725,6 +1000,8 @@ struct iw_range | |||
725 | struct iw_freq freq[IW_MAX_FREQUENCIES]; /* list */ | 1000 | struct iw_freq freq[IW_MAX_FREQUENCIES]; /* list */ |
726 | /* Note : this frequency list doesn't need to fit channel numbers, | 1001 | /* Note : this frequency list doesn't need to fit channel numbers, |
727 | * because each entry contain its channel index */ | 1002 | * because each entry contain its channel index */ |
1003 | |||
1004 | __u32 enc_capa; /* IW_ENC_CAPA_* bit field */ | ||
728 | }; | 1005 | }; |
729 | 1006 | ||
730 | /* | 1007 | /* |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index fd2ef742a9fd..d68391a9b9f3 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -174,6 +174,8 @@ enum xfrm_attr_type_t { | |||
174 | XFRMA_ALG_COMP, /* struct xfrm_algo */ | 174 | XFRMA_ALG_COMP, /* struct xfrm_algo */ |
175 | XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ | 175 | XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ |
176 | XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ | 176 | XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ |
177 | XFRMA_SA, | ||
178 | XFRMA_POLICY, | ||
177 | __XFRMA_MAX | 179 | __XFRMA_MAX |
178 | 180 | ||
179 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 181 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
@@ -257,5 +259,7 @@ struct xfrm_usersa_flush { | |||
257 | 259 | ||
258 | #define XFRMGRP_ACQUIRE 1 | 260 | #define XFRMGRP_ACQUIRE 1 |
259 | #define XFRMGRP_EXPIRE 2 | 261 | #define XFRMGRP_EXPIRE 2 |
262 | #define XFRMGRP_SA 4 | ||
263 | #define XFRMGRP_POLICY 8 | ||
260 | 264 | ||
261 | #endif /* _LINUX_XFRM_H */ | 265 | #endif /* _LINUX_XFRM_H */ |
diff --git a/include/net/ip.h b/include/net/ip.h index 3f63992eb712..32360bbe143f 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -163,6 +163,7 @@ DECLARE_SNMP_STAT(struct linux_mib, net_statistics); | |||
163 | 163 | ||
164 | extern int sysctl_local_port_range[2]; | 164 | extern int sysctl_local_port_range[2]; |
165 | extern int sysctl_ip_default_ttl; | 165 | extern int sysctl_ip_default_ttl; |
166 | extern int sysctl_ip_nonlocal_bind; | ||
166 | 167 | ||
167 | #ifdef CONFIG_INET | 168 | #ifdef CONFIG_INET |
168 | /* The function in 2.2 was invalid, producing wrong result for | 169 | /* The function in 2.2 was invalid, producing wrong result for |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 4f33bbc21e7f..89809891e5ab 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -65,11 +65,10 @@ struct neighbour; | |||
65 | 65 | ||
66 | struct neigh_parms | 66 | struct neigh_parms |
67 | { | 67 | { |
68 | struct net_device *dev; | ||
68 | struct neigh_parms *next; | 69 | struct neigh_parms *next; |
69 | int (*neigh_setup)(struct neighbour *); | 70 | int (*neigh_setup)(struct neighbour *); |
70 | struct neigh_table *tbl; | 71 | struct neigh_table *tbl; |
71 | int entries; | ||
72 | void *priv; | ||
73 | 72 | ||
74 | void *sysctl_table; | 73 | void *sysctl_table; |
75 | 74 | ||
@@ -192,7 +191,6 @@ struct neigh_table | |||
192 | atomic_t entries; | 191 | atomic_t entries; |
193 | rwlock_t lock; | 192 | rwlock_t lock; |
194 | unsigned long last_rand; | 193 | unsigned long last_rand; |
195 | struct neigh_parms *parms_list; | ||
196 | kmem_cache_t *kmem_cachep; | 194 | kmem_cache_t *kmem_cachep; |
197 | struct neigh_statistics *stats; | 195 | struct neigh_statistics *stats; |
198 | struct neighbour **hash_buckets; | 196 | struct neighbour **hash_buckets; |
@@ -252,6 +250,9 @@ extern int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); | |||
252 | extern int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); | 250 | extern int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); |
253 | extern void neigh_app_ns(struct neighbour *n); | 251 | extern void neigh_app_ns(struct neighbour *n); |
254 | 252 | ||
253 | extern int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb); | ||
254 | extern int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); | ||
255 | |||
255 | extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); | 256 | extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); |
256 | extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); | 257 | extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); |
257 | extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_entry *)); | 258 | extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_entry *)); |
diff --git a/include/net/request_sock.h b/include/net/request_sock.h new file mode 100644 index 000000000000..72fd6f5e86b1 --- /dev/null +++ b/include/net/request_sock.h | |||
@@ -0,0 +1,255 @@ | |||
1 | /* | ||
2 | * NET Generic infrastructure for Network protocols. | ||
3 | * | ||
4 | * Definitions for request_sock | ||
5 | * | ||
6 | * Authors: Arnaldo Carvalho de Melo <acme@conectiva.com.br> | ||
7 | * | ||
8 | * From code originally in include/net/tcp.h | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version | ||
13 | * 2 of the License, or (at your option) any later version. | ||
14 | */ | ||
15 | #ifndef _REQUEST_SOCK_H | ||
16 | #define _REQUEST_SOCK_H | ||
17 | |||
18 | #include <linux/slab.h> | ||
19 | #include <linux/spinlock.h> | ||
20 | #include <linux/types.h> | ||
21 | |||
22 | #include <net/sock.h> | ||
23 | |||
24 | struct request_sock; | ||
25 | struct sk_buff; | ||
26 | struct dst_entry; | ||
27 | struct proto; | ||
28 | |||
29 | struct request_sock_ops { | ||
30 | int family; | ||
31 | kmem_cache_t *slab; | ||
32 | int obj_size; | ||
33 | int (*rtx_syn_ack)(struct sock *sk, | ||
34 | struct request_sock *req, | ||
35 | struct dst_entry *dst); | ||
36 | void (*send_ack)(struct sk_buff *skb, | ||
37 | struct request_sock *req); | ||
38 | void (*send_reset)(struct sk_buff *skb); | ||
39 | void (*destructor)(struct request_sock *req); | ||
40 | }; | ||
41 | |||
42 | /* struct request_sock - mini sock to represent a connection request | ||
43 | */ | ||
44 | struct request_sock { | ||
45 | struct request_sock *dl_next; /* Must be first member! */ | ||
46 | u16 mss; | ||
47 | u8 retrans; | ||
48 | u8 __pad; | ||
49 | /* The following two fields can be easily recomputed I think -AK */ | ||
50 | u32 window_clamp; /* window clamp at creation time */ | ||
51 | u32 rcv_wnd; /* rcv_wnd offered first time */ | ||
52 | u32 ts_recent; | ||
53 | unsigned long expires; | ||
54 | struct request_sock_ops *rsk_ops; | ||
55 | struct sock *sk; | ||
56 | }; | ||
57 | |||
58 | static inline struct request_sock *reqsk_alloc(struct request_sock_ops *ops) | ||
59 | { | ||
60 | struct request_sock *req = kmem_cache_alloc(ops->slab, SLAB_ATOMIC); | ||
61 | |||
62 | if (req != NULL) | ||
63 | req->rsk_ops = ops; | ||
64 | |||
65 | return req; | ||
66 | } | ||
67 | |||
68 | static inline void __reqsk_free(struct request_sock *req) | ||
69 | { | ||
70 | kmem_cache_free(req->rsk_ops->slab, req); | ||
71 | } | ||
72 | |||
73 | static inline void reqsk_free(struct request_sock *req) | ||
74 | { | ||
75 | req->rsk_ops->destructor(req); | ||
76 | __reqsk_free(req); | ||
77 | } | ||
78 | |||
79 | extern int sysctl_max_syn_backlog; | ||
80 | |||
81 | /** struct listen_sock - listen state | ||
82 | * | ||
83 | * @max_qlen_log - log_2 of maximal queued SYNs/REQUESTs | ||
84 | */ | ||
85 | struct listen_sock { | ||
86 | u8 max_qlen_log; | ||
87 | /* 3 bytes hole, try to use */ | ||
88 | int qlen; | ||
89 | int qlen_young; | ||
90 | int clock_hand; | ||
91 | u32 hash_rnd; | ||
92 | struct request_sock *syn_table[0]; | ||
93 | }; | ||
94 | |||
95 | /** struct request_sock_queue - queue of request_socks | ||
96 | * | ||
97 | * @rskq_accept_head - FIFO head of established children | ||
98 | * @rskq_accept_tail - FIFO tail of established children | ||
99 | * @syn_wait_lock - serializer | ||
100 | * | ||
101 | * %syn_wait_lock is necessary only to avoid proc interface having to grab the main | ||
102 | * lock sock while browsing the listening hash (otherwise it's deadlock prone). | ||
103 | * | ||
104 | * This lock is acquired in read mode only from listening_get_next() seq_file | ||
105 | * op and it's acquired in write mode _only_ from code that is actively | ||
106 | * changing rskq_accept_head. All readers that are holding the master sock lock | ||
107 | * don't need to grab this lock in read mode too as rskq_accept_head. writes | ||
108 | * are always protected from the main sock lock. | ||
109 | */ | ||
110 | struct request_sock_queue { | ||
111 | struct request_sock *rskq_accept_head; | ||
112 | struct request_sock *rskq_accept_tail; | ||
113 | rwlock_t syn_wait_lock; | ||
114 | struct listen_sock *listen_opt; | ||
115 | }; | ||
116 | |||
117 | extern int reqsk_queue_alloc(struct request_sock_queue *queue, | ||
118 | const int nr_table_entries); | ||
119 | |||
120 | static inline struct listen_sock *reqsk_queue_yank_listen_sk(struct request_sock_queue *queue) | ||
121 | { | ||
122 | struct listen_sock *lopt; | ||
123 | |||
124 | write_lock_bh(&queue->syn_wait_lock); | ||
125 | lopt = queue->listen_opt; | ||
126 | queue->listen_opt = NULL; | ||
127 | write_unlock_bh(&queue->syn_wait_lock); | ||
128 | |||
129 | return lopt; | ||
130 | } | ||
131 | |||
132 | static inline void reqsk_queue_destroy(struct request_sock_queue *queue) | ||
133 | { | ||
134 | kfree(reqsk_queue_yank_listen_sk(queue)); | ||
135 | } | ||
136 | |||
137 | static inline struct request_sock * | ||
138 | reqsk_queue_yank_acceptq(struct request_sock_queue *queue) | ||
139 | { | ||
140 | struct request_sock *req = queue->rskq_accept_head; | ||
141 | |||
142 | queue->rskq_accept_head = queue->rskq_accept_head = NULL; | ||
143 | return req; | ||
144 | } | ||
145 | |||
146 | static inline int reqsk_queue_empty(struct request_sock_queue *queue) | ||
147 | { | ||
148 | return queue->rskq_accept_head == NULL; | ||
149 | } | ||
150 | |||
151 | static inline void reqsk_queue_unlink(struct request_sock_queue *queue, | ||
152 | struct request_sock *req, | ||
153 | struct request_sock **prev_req) | ||
154 | { | ||
155 | write_lock(&queue->syn_wait_lock); | ||
156 | *prev_req = req->dl_next; | ||
157 | write_unlock(&queue->syn_wait_lock); | ||
158 | } | ||
159 | |||
160 | static inline void reqsk_queue_add(struct request_sock_queue *queue, | ||
161 | struct request_sock *req, | ||
162 | struct sock *parent, | ||
163 | struct sock *child) | ||
164 | { | ||
165 | req->sk = child; | ||
166 | sk_acceptq_added(parent); | ||
167 | |||
168 | if (queue->rskq_accept_head == NULL) | ||
169 | queue->rskq_accept_head = req; | ||
170 | else | ||
171 | queue->rskq_accept_tail->dl_next = req; | ||
172 | |||
173 | queue->rskq_accept_tail = req; | ||
174 | req->dl_next = NULL; | ||
175 | } | ||
176 | |||
177 | static inline struct request_sock *reqsk_queue_remove(struct request_sock_queue *queue) | ||
178 | { | ||
179 | struct request_sock *req = queue->rskq_accept_head; | ||
180 | |||
181 | BUG_TRAP(req != NULL); | ||
182 | |||
183 | queue->rskq_accept_head = req->dl_next; | ||
184 | if (queue->rskq_accept_head == NULL) | ||
185 | queue->rskq_accept_tail = NULL; | ||
186 | |||
187 | return req; | ||
188 | } | ||
189 | |||
190 | static inline struct sock *reqsk_queue_get_child(struct request_sock_queue *queue, | ||
191 | struct sock *parent) | ||
192 | { | ||
193 | struct request_sock *req = reqsk_queue_remove(queue); | ||
194 | struct sock *child = req->sk; | ||
195 | |||
196 | BUG_TRAP(child != NULL); | ||
197 | |||
198 | sk_acceptq_removed(parent); | ||
199 | __reqsk_free(req); | ||
200 | return child; | ||
201 | } | ||
202 | |||
203 | static inline int reqsk_queue_removed(struct request_sock_queue *queue, | ||
204 | struct request_sock *req) | ||
205 | { | ||
206 | struct listen_sock *lopt = queue->listen_opt; | ||
207 | |||
208 | if (req->retrans == 0) | ||
209 | --lopt->qlen_young; | ||
210 | |||
211 | return --lopt->qlen; | ||
212 | } | ||
213 | |||
214 | static inline int reqsk_queue_added(struct request_sock_queue *queue) | ||
215 | { | ||
216 | struct listen_sock *lopt = queue->listen_opt; | ||
217 | const int prev_qlen = lopt->qlen; | ||
218 | |||
219 | lopt->qlen_young++; | ||
220 | lopt->qlen++; | ||
221 | return prev_qlen; | ||
222 | } | ||
223 | |||
224 | static inline int reqsk_queue_len(struct request_sock_queue *queue) | ||
225 | { | ||
226 | return queue->listen_opt != NULL ? queue->listen_opt->qlen : 0; | ||
227 | } | ||
228 | |||
229 | static inline int reqsk_queue_len_young(struct request_sock_queue *queue) | ||
230 | { | ||
231 | return queue->listen_opt->qlen_young; | ||
232 | } | ||
233 | |||
234 | static inline int reqsk_queue_is_full(struct request_sock_queue *queue) | ||
235 | { | ||
236 | return queue->listen_opt->qlen >> queue->listen_opt->max_qlen_log; | ||
237 | } | ||
238 | |||
239 | static inline void reqsk_queue_hash_req(struct request_sock_queue *queue, | ||
240 | u32 hash, struct request_sock *req, | ||
241 | unsigned timeout) | ||
242 | { | ||
243 | struct listen_sock *lopt = queue->listen_opt; | ||
244 | |||
245 | req->expires = jiffies + timeout; | ||
246 | req->retrans = 0; | ||
247 | req->sk = NULL; | ||
248 | req->dl_next = lopt->syn_table[hash]; | ||
249 | |||
250 | write_lock(&queue->syn_wait_lock); | ||
251 | lopt->syn_table[hash] = req; | ||
252 | write_unlock(&queue->syn_wait_lock); | ||
253 | } | ||
254 | |||
255 | #endif /* _REQUEST_SOCK_H */ | ||
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index c57504b3b518..7b97405e2dbf 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -172,4 +172,126 @@ tcf_destroy(struct tcf_proto *tp) | |||
172 | kfree(tp); | 172 | kfree(tp); |
173 | } | 173 | } |
174 | 174 | ||
175 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, | ||
176 | struct sk_buff_head *list) | ||
177 | { | ||
178 | __skb_queue_tail(list, skb); | ||
179 | sch->qstats.backlog += skb->len; | ||
180 | sch->bstats.bytes += skb->len; | ||
181 | sch->bstats.packets++; | ||
182 | |||
183 | return NET_XMIT_SUCCESS; | ||
184 | } | ||
185 | |||
186 | static inline int qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch) | ||
187 | { | ||
188 | return __qdisc_enqueue_tail(skb, sch, &sch->q); | ||
189 | } | ||
190 | |||
191 | static inline struct sk_buff *__qdisc_dequeue_head(struct Qdisc *sch, | ||
192 | struct sk_buff_head *list) | ||
193 | { | ||
194 | struct sk_buff *skb = __skb_dequeue(list); | ||
195 | |||
196 | if (likely(skb != NULL)) | ||
197 | sch->qstats.backlog -= skb->len; | ||
198 | |||
199 | return skb; | ||
200 | } | ||
201 | |||
202 | static inline struct sk_buff *qdisc_dequeue_head(struct Qdisc *sch) | ||
203 | { | ||
204 | return __qdisc_dequeue_head(sch, &sch->q); | ||
205 | } | ||
206 | |||
207 | static inline struct sk_buff *__qdisc_dequeue_tail(struct Qdisc *sch, | ||
208 | struct sk_buff_head *list) | ||
209 | { | ||
210 | struct sk_buff *skb = __skb_dequeue_tail(list); | ||
211 | |||
212 | if (likely(skb != NULL)) | ||
213 | sch->qstats.backlog -= skb->len; | ||
214 | |||
215 | return skb; | ||
216 | } | ||
217 | |||
218 | static inline struct sk_buff *qdisc_dequeue_tail(struct Qdisc *sch) | ||
219 | { | ||
220 | return __qdisc_dequeue_tail(sch, &sch->q); | ||
221 | } | ||
222 | |||
223 | static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch, | ||
224 | struct sk_buff_head *list) | ||
225 | { | ||
226 | __skb_queue_head(list, skb); | ||
227 | sch->qstats.backlog += skb->len; | ||
228 | sch->qstats.requeues++; | ||
229 | |||
230 | return NET_XMIT_SUCCESS; | ||
231 | } | ||
232 | |||
233 | static inline int qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch) | ||
234 | { | ||
235 | return __qdisc_requeue(skb, sch, &sch->q); | ||
236 | } | ||
237 | |||
238 | static inline void __qdisc_reset_queue(struct Qdisc *sch, | ||
239 | struct sk_buff_head *list) | ||
240 | { | ||
241 | /* | ||
242 | * We do not know the backlog in bytes of this list, it | ||
243 | * is up to the caller to correct it | ||
244 | */ | ||
245 | skb_queue_purge(list); | ||
246 | } | ||
247 | |||
248 | static inline void qdisc_reset_queue(struct Qdisc *sch) | ||
249 | { | ||
250 | __qdisc_reset_queue(sch, &sch->q); | ||
251 | sch->qstats.backlog = 0; | ||
252 | } | ||
253 | |||
254 | static inline unsigned int __qdisc_queue_drop(struct Qdisc *sch, | ||
255 | struct sk_buff_head *list) | ||
256 | { | ||
257 | struct sk_buff *skb = __qdisc_dequeue_tail(sch, list); | ||
258 | |||
259 | if (likely(skb != NULL)) { | ||
260 | unsigned int len = skb->len; | ||
261 | kfree_skb(skb); | ||
262 | return len; | ||
263 | } | ||
264 | |||
265 | return 0; | ||
266 | } | ||
267 | |||
268 | static inline unsigned int qdisc_queue_drop(struct Qdisc *sch) | ||
269 | { | ||
270 | return __qdisc_queue_drop(sch, &sch->q); | ||
271 | } | ||
272 | |||
273 | static inline int qdisc_drop(struct sk_buff *skb, struct Qdisc *sch) | ||
274 | { | ||
275 | kfree_skb(skb); | ||
276 | sch->qstats.drops++; | ||
277 | |||
278 | return NET_XMIT_DROP; | ||
279 | } | ||
280 | |||
281 | static inline int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch) | ||
282 | { | ||
283 | sch->qstats.drops++; | ||
284 | |||
285 | #ifdef CONFIG_NET_CLS_POLICE | ||
286 | if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch)) | ||
287 | goto drop; | ||
288 | |||
289 | return NET_XMIT_SUCCESS; | ||
290 | |||
291 | drop: | ||
292 | #endif | ||
293 | kfree_skb(skb); | ||
294 | return NET_XMIT_DROP; | ||
295 | } | ||
296 | |||
175 | #endif | 297 | #endif |
diff --git a/include/net/sock.h b/include/net/sock.h index a9ef3a6a13f3..e593af5b1ecc 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -484,6 +484,8 @@ extern void sk_stream_kill_queues(struct sock *sk); | |||
484 | 484 | ||
485 | extern int sk_wait_data(struct sock *sk, long *timeo); | 485 | extern int sk_wait_data(struct sock *sk, long *timeo); |
486 | 486 | ||
487 | struct request_sock_ops; | ||
488 | |||
487 | /* Networking protocol blocks we attach to sockets. | 489 | /* Networking protocol blocks we attach to sockets. |
488 | * socket layer -> transport layer interface | 490 | * socket layer -> transport layer interface |
489 | * transport -> network interface is defined by struct inet_proto | 491 | * transport -> network interface is defined by struct inet_proto |
@@ -547,6 +549,8 @@ struct proto { | |||
547 | kmem_cache_t *slab; | 549 | kmem_cache_t *slab; |
548 | unsigned int obj_size; | 550 | unsigned int obj_size; |
549 | 551 | ||
552 | struct request_sock_ops *rsk_prot; | ||
553 | |||
550 | struct module *owner; | 554 | struct module *owner; |
551 | 555 | ||
552 | char name[32]; | 556 | char name[32]; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index e71f8ba3e101..f730935b824a 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/cache.h> | 31 | #include <linux/cache.h> |
32 | #include <linux/percpu.h> | 32 | #include <linux/percpu.h> |
33 | #include <net/checksum.h> | 33 | #include <net/checksum.h> |
34 | #include <net/request_sock.h> | ||
34 | #include <net/sock.h> | 35 | #include <net/sock.h> |
35 | #include <net/snmp.h> | 36 | #include <net/snmp.h> |
36 | #include <net/ip.h> | 37 | #include <net/ip.h> |
@@ -563,7 +564,6 @@ static __inline__ int tcp_sk_listen_hashfn(struct sock *sk) | |||
563 | #define TCP_NAGLE_PUSH 4 /* Cork is overriden for already queued data */ | 564 | #define TCP_NAGLE_PUSH 4 /* Cork is overriden for already queued data */ |
564 | 565 | ||
565 | /* sysctl variables for tcp */ | 566 | /* sysctl variables for tcp */ |
566 | extern int sysctl_max_syn_backlog; | ||
567 | extern int sysctl_tcp_timestamps; | 567 | extern int sysctl_tcp_timestamps; |
568 | extern int sysctl_tcp_window_scaling; | 568 | extern int sysctl_tcp_window_scaling; |
569 | extern int sysctl_tcp_sack; | 569 | extern int sysctl_tcp_sack; |
@@ -613,74 +613,6 @@ extern atomic_t tcp_memory_allocated; | |||
613 | extern atomic_t tcp_sockets_allocated; | 613 | extern atomic_t tcp_sockets_allocated; |
614 | extern int tcp_memory_pressure; | 614 | extern int tcp_memory_pressure; |
615 | 615 | ||
616 | struct open_request; | ||
617 | |||
618 | struct or_calltable { | ||
619 | int family; | ||
620 | int (*rtx_syn_ack) (struct sock *sk, struct open_request *req, struct dst_entry*); | ||
621 | void (*send_ack) (struct sk_buff *skb, struct open_request *req); | ||
622 | void (*destructor) (struct open_request *req); | ||
623 | void (*send_reset) (struct sk_buff *skb); | ||
624 | }; | ||
625 | |||
626 | struct tcp_v4_open_req { | ||
627 | __u32 loc_addr; | ||
628 | __u32 rmt_addr; | ||
629 | struct ip_options *opt; | ||
630 | }; | ||
631 | |||
632 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | ||
633 | struct tcp_v6_open_req { | ||
634 | struct in6_addr loc_addr; | ||
635 | struct in6_addr rmt_addr; | ||
636 | struct sk_buff *pktopts; | ||
637 | int iif; | ||
638 | }; | ||
639 | #endif | ||
640 | |||
641 | /* this structure is too big */ | ||
642 | struct open_request { | ||
643 | struct open_request *dl_next; /* Must be first member! */ | ||
644 | __u32 rcv_isn; | ||
645 | __u32 snt_isn; | ||
646 | __u16 rmt_port; | ||
647 | __u16 mss; | ||
648 | __u8 retrans; | ||
649 | __u8 __pad; | ||
650 | __u16 snd_wscale : 4, | ||
651 | rcv_wscale : 4, | ||
652 | tstamp_ok : 1, | ||
653 | sack_ok : 1, | ||
654 | wscale_ok : 1, | ||
655 | ecn_ok : 1, | ||
656 | acked : 1; | ||
657 | /* The following two fields can be easily recomputed I think -AK */ | ||
658 | __u32 window_clamp; /* window clamp at creation time */ | ||
659 | __u32 rcv_wnd; /* rcv_wnd offered first time */ | ||
660 | __u32 ts_recent; | ||
661 | unsigned long expires; | ||
662 | struct or_calltable *class; | ||
663 | struct sock *sk; | ||
664 | union { | ||
665 | struct tcp_v4_open_req v4_req; | ||
666 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | ||
667 | struct tcp_v6_open_req v6_req; | ||
668 | #endif | ||
669 | } af; | ||
670 | }; | ||
671 | |||
672 | /* SLAB cache for open requests. */ | ||
673 | extern kmem_cache_t *tcp_openreq_cachep; | ||
674 | |||
675 | #define tcp_openreq_alloc() kmem_cache_alloc(tcp_openreq_cachep, SLAB_ATOMIC) | ||
676 | #define tcp_openreq_fastfree(req) kmem_cache_free(tcp_openreq_cachep, req) | ||
677 | |||
678 | static inline void tcp_openreq_free(struct open_request *req) | ||
679 | { | ||
680 | req->class->destructor(req); | ||
681 | tcp_openreq_fastfree(req); | ||
682 | } | ||
683 | |||
684 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 616 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
685 | #define TCP_INET_FAMILY(fam) ((fam) == AF_INET) | 617 | #define TCP_INET_FAMILY(fam) ((fam) == AF_INET) |
686 | #else | 618 | #else |
@@ -708,7 +640,7 @@ struct tcp_func { | |||
708 | 640 | ||
709 | struct sock * (*syn_recv_sock) (struct sock *sk, | 641 | struct sock * (*syn_recv_sock) (struct sock *sk, |
710 | struct sk_buff *skb, | 642 | struct sk_buff *skb, |
711 | struct open_request *req, | 643 | struct request_sock *req, |
712 | struct dst_entry *dst); | 644 | struct dst_entry *dst); |
713 | 645 | ||
714 | int (*remember_stamp) (struct sock *sk); | 646 | int (*remember_stamp) (struct sock *sk); |
@@ -852,8 +784,8 @@ extern enum tcp_tw_status tcp_timewait_state_process(struct tcp_tw_bucket *tw, | |||
852 | unsigned len); | 784 | unsigned len); |
853 | 785 | ||
854 | extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, | 786 | extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, |
855 | struct open_request *req, | 787 | struct request_sock *req, |
856 | struct open_request **prev); | 788 | struct request_sock **prev); |
857 | extern int tcp_child_process(struct sock *parent, | 789 | extern int tcp_child_process(struct sock *parent, |
858 | struct sock *child, | 790 | struct sock *child, |
859 | struct sk_buff *skb); | 791 | struct sk_buff *skb); |
@@ -903,12 +835,12 @@ extern int tcp_v4_conn_request(struct sock *sk, | |||
903 | struct sk_buff *skb); | 835 | struct sk_buff *skb); |
904 | 836 | ||
905 | extern struct sock * tcp_create_openreq_child(struct sock *sk, | 837 | extern struct sock * tcp_create_openreq_child(struct sock *sk, |
906 | struct open_request *req, | 838 | struct request_sock *req, |
907 | struct sk_buff *skb); | 839 | struct sk_buff *skb); |
908 | 840 | ||
909 | extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, | 841 | extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, |
910 | struct sk_buff *skb, | 842 | struct sk_buff *skb, |
911 | struct open_request *req, | 843 | struct request_sock *req, |
912 | struct dst_entry *dst); | 844 | struct dst_entry *dst); |
913 | 845 | ||
914 | extern int tcp_v4_do_rcv(struct sock *sk, | 846 | extern int tcp_v4_do_rcv(struct sock *sk, |
@@ -922,7 +854,7 @@ extern int tcp_connect(struct sock *sk); | |||
922 | 854 | ||
923 | extern struct sk_buff * tcp_make_synack(struct sock *sk, | 855 | extern struct sk_buff * tcp_make_synack(struct sock *sk, |
924 | struct dst_entry *dst, | 856 | struct dst_entry *dst, |
925 | struct open_request *req); | 857 | struct request_sock *req); |
926 | 858 | ||
927 | extern int tcp_disconnect(struct sock *sk, int flags); | 859 | extern int tcp_disconnect(struct sock *sk, int flags); |
928 | 860 | ||
@@ -1750,99 +1682,71 @@ static inline int tcp_full_space(const struct sock *sk) | |||
1750 | return tcp_win_from_space(sk->sk_rcvbuf); | 1682 | return tcp_win_from_space(sk->sk_rcvbuf); |
1751 | } | 1683 | } |
1752 | 1684 | ||
1753 | static inline void tcp_acceptq_queue(struct sock *sk, struct open_request *req, | 1685 | static inline void tcp_acceptq_queue(struct sock *sk, struct request_sock *req, |
1754 | struct sock *child) | 1686 | struct sock *child) |
1755 | { | 1687 | { |
1756 | struct tcp_sock *tp = tcp_sk(sk); | 1688 | reqsk_queue_add(&tcp_sk(sk)->accept_queue, req, sk, child); |
1757 | |||
1758 | req->sk = child; | ||
1759 | sk_acceptq_added(sk); | ||
1760 | |||
1761 | if (!tp->accept_queue_tail) { | ||
1762 | tp->accept_queue = req; | ||
1763 | } else { | ||
1764 | tp->accept_queue_tail->dl_next = req; | ||
1765 | } | ||
1766 | tp->accept_queue_tail = req; | ||
1767 | req->dl_next = NULL; | ||
1768 | } | 1689 | } |
1769 | 1690 | ||
1770 | struct tcp_listen_opt | ||
1771 | { | ||
1772 | u8 max_qlen_log; /* log_2 of maximal queued SYNs */ | ||
1773 | int qlen; | ||
1774 | int qlen_young; | ||
1775 | int clock_hand; | ||
1776 | u32 hash_rnd; | ||
1777 | struct open_request *syn_table[TCP_SYNQ_HSIZE]; | ||
1778 | }; | ||
1779 | |||
1780 | static inline void | 1691 | static inline void |
1781 | tcp_synq_removed(struct sock *sk, struct open_request *req) | 1692 | tcp_synq_removed(struct sock *sk, struct request_sock *req) |
1782 | { | 1693 | { |
1783 | struct tcp_listen_opt *lopt = tcp_sk(sk)->listen_opt; | 1694 | if (reqsk_queue_removed(&tcp_sk(sk)->accept_queue, req) == 0) |
1784 | |||
1785 | if (--lopt->qlen == 0) | ||
1786 | tcp_delete_keepalive_timer(sk); | 1695 | tcp_delete_keepalive_timer(sk); |
1787 | if (req->retrans == 0) | ||
1788 | lopt->qlen_young--; | ||
1789 | } | 1696 | } |
1790 | 1697 | ||
1791 | static inline void tcp_synq_added(struct sock *sk) | 1698 | static inline void tcp_synq_added(struct sock *sk) |
1792 | { | 1699 | { |
1793 | struct tcp_listen_opt *lopt = tcp_sk(sk)->listen_opt; | 1700 | if (reqsk_queue_added(&tcp_sk(sk)->accept_queue) == 0) |
1794 | |||
1795 | if (lopt->qlen++ == 0) | ||
1796 | tcp_reset_keepalive_timer(sk, TCP_TIMEOUT_INIT); | 1701 | tcp_reset_keepalive_timer(sk, TCP_TIMEOUT_INIT); |
1797 | lopt->qlen_young++; | ||
1798 | } | 1702 | } |
1799 | 1703 | ||
1800 | static inline int tcp_synq_len(struct sock *sk) | 1704 | static inline int tcp_synq_len(struct sock *sk) |
1801 | { | 1705 | { |
1802 | return tcp_sk(sk)->listen_opt->qlen; | 1706 | return reqsk_queue_len(&tcp_sk(sk)->accept_queue); |
1803 | } | 1707 | } |
1804 | 1708 | ||
1805 | static inline int tcp_synq_young(struct sock *sk) | 1709 | static inline int tcp_synq_young(struct sock *sk) |
1806 | { | 1710 | { |
1807 | return tcp_sk(sk)->listen_opt->qlen_young; | 1711 | return reqsk_queue_len_young(&tcp_sk(sk)->accept_queue); |
1808 | } | 1712 | } |
1809 | 1713 | ||
1810 | static inline int tcp_synq_is_full(struct sock *sk) | 1714 | static inline int tcp_synq_is_full(struct sock *sk) |
1811 | { | 1715 | { |
1812 | return tcp_synq_len(sk) >> tcp_sk(sk)->listen_opt->max_qlen_log; | 1716 | return reqsk_queue_is_full(&tcp_sk(sk)->accept_queue); |
1813 | } | 1717 | } |
1814 | 1718 | ||
1815 | static inline void tcp_synq_unlink(struct tcp_sock *tp, struct open_request *req, | 1719 | static inline void tcp_synq_unlink(struct tcp_sock *tp, struct request_sock *req, |
1816 | struct open_request **prev) | 1720 | struct request_sock **prev) |
1817 | { | 1721 | { |
1818 | write_lock(&tp->syn_wait_lock); | 1722 | reqsk_queue_unlink(&tp->accept_queue, req, prev); |
1819 | *prev = req->dl_next; | ||
1820 | write_unlock(&tp->syn_wait_lock); | ||
1821 | } | 1723 | } |
1822 | 1724 | ||
1823 | static inline void tcp_synq_drop(struct sock *sk, struct open_request *req, | 1725 | static inline void tcp_synq_drop(struct sock *sk, struct request_sock *req, |
1824 | struct open_request **prev) | 1726 | struct request_sock **prev) |
1825 | { | 1727 | { |
1826 | tcp_synq_unlink(tcp_sk(sk), req, prev); | 1728 | tcp_synq_unlink(tcp_sk(sk), req, prev); |
1827 | tcp_synq_removed(sk, req); | 1729 | tcp_synq_removed(sk, req); |
1828 | tcp_openreq_free(req); | 1730 | reqsk_free(req); |
1829 | } | 1731 | } |
1830 | 1732 | ||
1831 | static __inline__ void tcp_openreq_init(struct open_request *req, | 1733 | static __inline__ void tcp_openreq_init(struct request_sock *req, |
1832 | struct tcp_options_received *rx_opt, | 1734 | struct tcp_options_received *rx_opt, |
1833 | struct sk_buff *skb) | 1735 | struct sk_buff *skb) |
1834 | { | 1736 | { |
1737 | struct inet_request_sock *ireq = inet_rsk(req); | ||
1738 | |||
1835 | req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */ | 1739 | req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */ |
1836 | req->rcv_isn = TCP_SKB_CB(skb)->seq; | 1740 | tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; |
1837 | req->mss = rx_opt->mss_clamp; | 1741 | req->mss = rx_opt->mss_clamp; |
1838 | req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; | 1742 | req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; |
1839 | req->tstamp_ok = rx_opt->tstamp_ok; | 1743 | ireq->tstamp_ok = rx_opt->tstamp_ok; |
1840 | req->sack_ok = rx_opt->sack_ok; | 1744 | ireq->sack_ok = rx_opt->sack_ok; |
1841 | req->snd_wscale = rx_opt->snd_wscale; | 1745 | ireq->snd_wscale = rx_opt->snd_wscale; |
1842 | req->wscale_ok = rx_opt->wscale_ok; | 1746 | ireq->wscale_ok = rx_opt->wscale_ok; |
1843 | req->acked = 0; | 1747 | ireq->acked = 0; |
1844 | req->ecn_ok = 0; | 1748 | ireq->ecn_ok = 0; |
1845 | req->rmt_port = skb->h.th->source; | 1749 | ireq->rmt_port = skb->h.th->source; |
1846 | } | 1750 | } |
1847 | 1751 | ||
1848 | extern void tcp_enter_memory_pressure(void); | 1752 | extern void tcp_enter_memory_pressure(void); |
diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h index dc1456389a97..64980ee8c92a 100644 --- a/include/net/tcp_ecn.h +++ b/include/net/tcp_ecn.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _NET_TCP_ECN_H_ 1 | 2 | #define _NET_TCP_ECN_H_ 1 |
3 | 3 | ||
4 | #include <net/inet_ecn.h> | 4 | #include <net/inet_ecn.h> |
5 | #include <net/request_sock.h> | ||
5 | 6 | ||
6 | #define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH)) | 7 | #define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH)) |
7 | 8 | ||
@@ -38,9 +39,9 @@ static inline void TCP_ECN_send_syn(struct sock *sk, struct tcp_sock *tp, | |||
38 | } | 39 | } |
39 | 40 | ||
40 | static __inline__ void | 41 | static __inline__ void |
41 | TCP_ECN_make_synack(struct open_request *req, struct tcphdr *th) | 42 | TCP_ECN_make_synack(struct request_sock *req, struct tcphdr *th) |
42 | { | 43 | { |
43 | if (req->ecn_ok) | 44 | if (inet_rsk(req)->ecn_ok) |
44 | th->ece = 1; | 45 | th->ece = 1; |
45 | } | 46 | } |
46 | 47 | ||
@@ -111,16 +112,16 @@ static inline int TCP_ECN_rcv_ecn_echo(struct tcp_sock *tp, struct tcphdr *th) | |||
111 | } | 112 | } |
112 | 113 | ||
113 | static inline void TCP_ECN_openreq_child(struct tcp_sock *tp, | 114 | static inline void TCP_ECN_openreq_child(struct tcp_sock *tp, |
114 | struct open_request *req) | 115 | struct request_sock *req) |
115 | { | 116 | { |
116 | tp->ecn_flags = req->ecn_ok ? TCP_ECN_OK : 0; | 117 | tp->ecn_flags = inet_rsk(req)->ecn_ok ? TCP_ECN_OK : 0; |
117 | } | 118 | } |
118 | 119 | ||
119 | static __inline__ void | 120 | static __inline__ void |
120 | TCP_ECN_create_request(struct open_request *req, struct tcphdr *th) | 121 | TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th) |
121 | { | 122 | { |
122 | if (sysctl_tcp_ecn && th->ece && th->cwr) | 123 | if (sysctl_tcp_ecn && th->ece && th->cwr) |
123 | req->ecn_ok = 1; | 124 | inet_rsk(req)->ecn_ok = 1; |
124 | } | 125 | } |
125 | 126 | ||
126 | #endif | 127 | #endif |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index d675836ba6c3..0e65e02b7a1d 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -158,6 +158,20 @@ enum { | |||
158 | XFRM_STATE_DEAD | 158 | XFRM_STATE_DEAD |
159 | }; | 159 | }; |
160 | 160 | ||
161 | /* callback structure passed from either netlink or pfkey */ | ||
162 | struct km_event | ||
163 | { | ||
164 | union { | ||
165 | u32 hard; | ||
166 | u32 proto; | ||
167 | u32 byid; | ||
168 | } data; | ||
169 | |||
170 | u32 seq; | ||
171 | u32 pid; | ||
172 | u32 event; | ||
173 | }; | ||
174 | |||
161 | struct xfrm_type; | 175 | struct xfrm_type; |
162 | struct xfrm_dst; | 176 | struct xfrm_dst; |
163 | struct xfrm_policy_afinfo { | 177 | struct xfrm_policy_afinfo { |
@@ -179,6 +193,8 @@ struct xfrm_policy_afinfo { | |||
179 | 193 | ||
180 | extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); | 194 | extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); |
181 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); | 195 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); |
196 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); | ||
197 | extern void km_state_notify(struct xfrm_state *x, struct km_event *c); | ||
182 | 198 | ||
183 | #define XFRM_ACQ_EXPIRES 30 | 199 | #define XFRM_ACQ_EXPIRES 30 |
184 | 200 | ||
@@ -290,11 +306,11 @@ struct xfrm_mgr | |||
290 | { | 306 | { |
291 | struct list_head list; | 307 | struct list_head list; |
292 | char *id; | 308 | char *id; |
293 | int (*notify)(struct xfrm_state *x, int event); | 309 | int (*notify)(struct xfrm_state *x, struct km_event *c); |
294 | int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir); | 310 | int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir); |
295 | struct xfrm_policy *(*compile_policy)(u16 family, int opt, u8 *data, int len, int *dir); | 311 | struct xfrm_policy *(*compile_policy)(u16 family, int opt, u8 *data, int len, int *dir); |
296 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); | 312 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); |
297 | int (*notify_policy)(struct xfrm_policy *x, int dir, int event); | 313 | int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); |
298 | }; | 314 | }; |
299 | 315 | ||
300 | extern int xfrm_register_km(struct xfrm_mgr *km); | 316 | extern int xfrm_register_km(struct xfrm_mgr *km); |
@@ -656,7 +672,7 @@ static inline int xfrm_sk_clone_policy(struct sock *sk) | |||
656 | return 0; | 672 | return 0; |
657 | } | 673 | } |
658 | 674 | ||
659 | extern void xfrm_policy_delete(struct xfrm_policy *pol, int dir); | 675 | extern int xfrm_policy_delete(struct xfrm_policy *pol, int dir); |
660 | 676 | ||
661 | static inline void xfrm_sk_free_policy(struct sock *sk) | 677 | static inline void xfrm_sk_free_policy(struct sock *sk) |
662 | { | 678 | { |
@@ -817,7 +833,7 @@ extern int xfrm_state_add(struct xfrm_state *x); | |||
817 | extern int xfrm_state_update(struct xfrm_state *x); | 833 | extern int xfrm_state_update(struct xfrm_state *x); |
818 | extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family); | 834 | extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family); |
819 | extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); | 835 | extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); |
820 | extern void xfrm_state_delete(struct xfrm_state *x); | 836 | extern int xfrm_state_delete(struct xfrm_state *x); |
821 | extern void xfrm_state_flush(u8 proto); | 837 | extern void xfrm_state_flush(u8 proto); |
822 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); | 838 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); |
823 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); | 839 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 659ecf48fb4a..1fb233741513 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -41,6 +41,7 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; | |||
41 | #define FORMAT_UNIT 0x04 | 41 | #define FORMAT_UNIT 0x04 |
42 | #define READ_BLOCK_LIMITS 0x05 | 42 | #define READ_BLOCK_LIMITS 0x05 |
43 | #define REASSIGN_BLOCKS 0x07 | 43 | #define REASSIGN_BLOCKS 0x07 |
44 | #define INITIALIZE_ELEMENT_STATUS 0x07 | ||
44 | #define READ_6 0x08 | 45 | #define READ_6 0x08 |
45 | #define WRITE_6 0x0a | 46 | #define WRITE_6 0x0a |
46 | #define SEEK_6 0x0b | 47 | #define SEEK_6 0x0b |
@@ -65,6 +66,7 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; | |||
65 | #define READ_10 0x28 | 66 | #define READ_10 0x28 |
66 | #define WRITE_10 0x2a | 67 | #define WRITE_10 0x2a |
67 | #define SEEK_10 0x2b | 68 | #define SEEK_10 0x2b |
69 | #define POSITION_TO_ELEMENT 0x2b | ||
68 | #define WRITE_VERIFY 0x2e | 70 | #define WRITE_VERIFY 0x2e |
69 | #define VERIFY 0x2f | 71 | #define VERIFY 0x2f |
70 | #define SEARCH_HIGH 0x30 | 72 | #define SEARCH_HIGH 0x30 |
@@ -97,6 +99,7 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; | |||
97 | #define PERSISTENT_RESERVE_OUT 0x5f | 99 | #define PERSISTENT_RESERVE_OUT 0x5f |
98 | #define REPORT_LUNS 0xa0 | 100 | #define REPORT_LUNS 0xa0 |
99 | #define MOVE_MEDIUM 0xa5 | 101 | #define MOVE_MEDIUM 0xa5 |
102 | #define EXCHANGE_MEDIUM 0xa6 | ||
100 | #define READ_12 0xa8 | 103 | #define READ_12 0xa8 |
101 | #define WRITE_12 0xaa | 104 | #define WRITE_12 0xaa |
102 | #define WRITE_VERIFY_12 0xae | 105 | #define WRITE_VERIFY_12 0xae |
@@ -210,6 +213,7 @@ static inline int scsi_status_is_good(int status) | |||
210 | #define TYPE_COMM 0x09 /* Communications device */ | 213 | #define TYPE_COMM 0x09 /* Communications device */ |
211 | #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ | 214 | #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ |
212 | #define TYPE_RAID 0x0c | 215 | #define TYPE_RAID 0x0c |
216 | #define TYPE_RBC 0x0e | ||
213 | #define TYPE_NO_LUN 0x7f | 217 | #define TYPE_NO_LUN 0x7f |
214 | 218 | ||
215 | /* | 219 | /* |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index c018020d9160..63c91dd85ca1 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -154,7 +154,9 @@ struct scsi_target { | |||
154 | unsigned int id; /* target id ... replace | 154 | unsigned int id; /* target id ... replace |
155 | * scsi_device.id eventually */ | 155 | * scsi_device.id eventually */ |
156 | unsigned long create:1; /* signal that it needs to be added */ | 156 | unsigned long create:1; /* signal that it needs to be added */ |
157 | unsigned long starget_data[0]; | 157 | void *hostdata; /* available to low-level driver */ |
158 | unsigned long starget_data[0]; /* for the transport */ | ||
159 | /* starget_data must be the last element!!!! */ | ||
158 | } __attribute__((aligned(sizeof(unsigned long)))); | 160 | } __attribute__((aligned(sizeof(unsigned long)))); |
159 | 161 | ||
160 | #define to_scsi_target(d) container_of(d, struct scsi_target, dev) | 162 | #define to_scsi_target(d) container_of(d, struct scsi_target, dev) |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 1cee1e100943..db9914adeac9 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -10,6 +10,7 @@ struct block_device; | |||
10 | struct module; | 10 | struct module; |
11 | struct scsi_cmnd; | 11 | struct scsi_cmnd; |
12 | struct scsi_device; | 12 | struct scsi_device; |
13 | struct scsi_target; | ||
13 | struct Scsi_Host; | 14 | struct Scsi_Host; |
14 | struct scsi_host_cmd_pool; | 15 | struct scsi_host_cmd_pool; |
15 | struct scsi_transport_template; | 16 | struct scsi_transport_template; |
@@ -228,6 +229,30 @@ struct scsi_host_template { | |||
228 | void (* slave_destroy)(struct scsi_device *); | 229 | void (* slave_destroy)(struct scsi_device *); |
229 | 230 | ||
230 | /* | 231 | /* |
232 | * Before the mid layer attempts to scan for a new device attached | ||
233 | * to a target where no target currently exists, it will call this | ||
234 | * entry in your driver. Should your driver need to allocate any | ||
235 | * structs or perform any other init items in order to send commands | ||
236 | * to a currently unused target, then this is where you can perform | ||
237 | * those allocations. | ||
238 | * | ||
239 | * Return values: 0 on success, non-0 on failure | ||
240 | * | ||
241 | * Status: OPTIONAL | ||
242 | */ | ||
243 | int (* target_alloc)(struct scsi_target *); | ||
244 | |||
245 | /* | ||
246 | * Immediately prior to deallocating the target structure, and | ||
247 | * after all activity to attached scsi devices has ceased, the | ||
248 | * midlayer calls this point so that the driver may deallocate | ||
249 | * and terminate any references to the target. | ||
250 | * | ||
251 | * Status: OPTIONAL | ||
252 | */ | ||
253 | void (* target_destroy)(struct scsi_target *); | ||
254 | |||
255 | /* | ||
231 | * fill in this function to allow the queue depth of this host | 256 | * fill in this function to allow the queue depth of this host |
232 | * to be changeable (on a per device basis). returns either | 257 | * to be changeable (on a per device basis). returns either |
233 | * the current queue depth setting (may be different from what | 258 | * the current queue depth setting (may be different from what |
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h index 2dcee7a84752..a4f1837a33b1 100644 --- a/include/scsi/scsi_transport.h +++ b/include/scsi/scsi_transport.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define SCSI_TRANSPORT_H | 21 | #define SCSI_TRANSPORT_H |
22 | 22 | ||
23 | #include <linux/transport_class.h> | 23 | #include <linux/transport_class.h> |
24 | #include <scsi/scsi_host.h> | ||
24 | 25 | ||
25 | struct scsi_transport_template { | 26 | struct scsi_transport_template { |
26 | /* the attribute containers */ | 27 | /* the attribute containers */ |
@@ -32,8 +33,11 @@ struct scsi_transport_template { | |||
32 | * space of this size will be left at the end of the | 33 | * space of this size will be left at the end of the |
33 | * scsi_* structure */ | 34 | * scsi_* structure */ |
34 | int device_size; | 35 | int device_size; |
36 | int device_private_offset; | ||
35 | int target_size; | 37 | int target_size; |
38 | int target_private_offset; | ||
36 | int host_size; | 39 | int host_size; |
40 | /* no private offset for the host; there's an alternative mechanism */ | ||
37 | 41 | ||
38 | /* | 42 | /* |
39 | * True if the transport wants to use a host-based work-queue | 43 | * True if the transport wants to use a host-based work-queue |
@@ -45,4 +49,38 @@ struct scsi_transport_template { | |||
45 | dev_to_shost((tc)->dev) | 49 | dev_to_shost((tc)->dev) |
46 | 50 | ||
47 | 51 | ||
52 | /* Private area maintenance. The driver requested allocations come | ||
53 | * directly after the transport class allocations (if any). The idea | ||
54 | * is that you *must* call these only once. The code assumes that the | ||
55 | * initial values are the ones the transport specific code requires */ | ||
56 | static inline void | ||
57 | scsi_transport_reserve_target(struct scsi_transport_template * t, int space) | ||
58 | { | ||
59 | BUG_ON(t->target_private_offset != 0); | ||
60 | t->target_private_offset = ALIGN(t->target_size, sizeof(void *)); | ||
61 | t->target_size = t->target_private_offset + space; | ||
62 | } | ||
63 | static inline void | ||
64 | scsi_transport_reserve_device(struct scsi_transport_template * t, int space) | ||
65 | { | ||
66 | BUG_ON(t->device_private_offset != 0); | ||
67 | t->device_private_offset = ALIGN(t->device_size, sizeof(void *)); | ||
68 | t->device_size = t->device_private_offset + space; | ||
69 | } | ||
70 | static inline void * | ||
71 | scsi_transport_target_data(struct scsi_target *starget) | ||
72 | { | ||
73 | struct Scsi_Host *shost = dev_to_shost(&starget->dev); | ||
74 | return (u8 *)starget->starget_data | ||
75 | + shost->transportt->target_private_offset; | ||
76 | |||
77 | } | ||
78 | static inline void * | ||
79 | scsi_transport_device_data(struct scsi_device *sdev) | ||
80 | { | ||
81 | struct Scsi_Host *shost = sdev->host; | ||
82 | return (u8 *)sdev->sdev_data | ||
83 | + shost->transportt->device_private_offset; | ||
84 | } | ||
85 | |||
48 | #endif /* SCSI_TRANSPORT_H */ | 86 | #endif /* SCSI_TRANSPORT_H */ |