diff options
author | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 05:02:08 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 05:02:08 -0500 |
commit | 5501972e0b5857bc8354770d900ceb9b40c7f6b7 (patch) | |
tree | ff239422827c4cd54d2998f8851304255de31b38 /include | |
parent | 9d2f928ddf64ca0361562e30faf584cd33055c60 (diff) | |
parent | e952f31bce6e9f64db01f607abc46529ba57ac9e (diff) |
Merge with rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'include')
117 files changed, 1810 insertions, 898 deletions
diff --git a/include/asm-arm/irq.h b/include/asm-arm/irq.h index 7772432d3fd7..60b5105c9c93 100644 --- a/include/asm-arm/irq.h +++ b/include/asm-arm/irq.h | |||
@@ -27,7 +27,7 @@ extern void enable_irq(unsigned int); | |||
27 | 27 | ||
28 | /* | 28 | /* |
29 | * These correspond with the SA_TRIGGER_* defines, and therefore the | 29 | * These correspond with the SA_TRIGGER_* defines, and therefore the |
30 | * IRQRESOURCE_IRQ_* defines. | 30 | * IORESOURCE_IRQ_* defines. |
31 | */ | 31 | */ |
32 | #define __IRQT_RISEDGE (1 << 0) | 32 | #define __IRQT_RISEDGE (1 << 0) |
33 | #define __IRQT_FALEDGE (1 << 1) | 33 | #define __IRQT_FALEDGE (1 << 1) |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 35de20cf8fac..9d11550b4818 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -58,6 +58,13 @@ | |||
58 | VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ | 58 | VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ |
59 | } \ | 59 | } \ |
60 | \ | 60 | \ |
61 | /* Kernel symbol table: GPL-future-only symbols */ \ | ||
62 | __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \ | ||
63 | VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \ | ||
64 | *(__ksymtab_gpl_future) \ | ||
65 | VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \ | ||
66 | } \ | ||
67 | \ | ||
61 | /* Kernel symbol table: Normal symbols */ \ | 68 | /* Kernel symbol table: Normal symbols */ \ |
62 | __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \ | 69 | __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \ |
63 | VMLINUX_SYMBOL(__start___kcrctab) = .; \ | 70 | VMLINUX_SYMBOL(__start___kcrctab) = .; \ |
@@ -72,6 +79,13 @@ | |||
72 | VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \ | 79 | VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \ |
73 | } \ | 80 | } \ |
74 | \ | 81 | \ |
82 | /* Kernel symbol table: GPL-future-only symbols */ \ | ||
83 | __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \ | ||
84 | VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \ | ||
85 | *(__kcrctab_gpl_future) \ | ||
86 | VMLINUX_SYMBOL(__stop___kcrctab_gpl_future) = .; \ | ||
87 | } \ | ||
88 | \ | ||
75 | /* Kernel symbol table: strings */ \ | 89 | /* Kernel symbol table: strings */ \ |
76 | __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ | 90 | __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ |
77 | *(__ksymtab_strings) \ | 91 | *(__ksymtab_strings) \ |
diff --git a/include/asm-ia64/intel_intrin.h b/include/asm-ia64/intel_intrin.h index a7122d850177..d069b6acddce 100644 --- a/include/asm-ia64/intel_intrin.h +++ b/include/asm-ia64/intel_intrin.h | |||
@@ -5,113 +5,10 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2002,2003 Jun Nakajima <jun.nakajima@intel.com> | 6 | * Copyright (C) 2002,2003 Jun Nakajima <jun.nakajima@intel.com> |
7 | * Copyright (C) 2002,2003 Suresh Siddha <suresh.b.siddha@intel.com> | 7 | * Copyright (C) 2002,2003 Suresh Siddha <suresh.b.siddha@intel.com> |
8 | * Copyright (C) 2005,2006 Hongjiu Lu <hongjiu.lu@intel.com> | ||
8 | * | 9 | * |
9 | */ | 10 | */ |
10 | #include <asm/types.h> | 11 | #include <ia64intrin.h> |
11 | |||
12 | void __lfetch(int lfhint, void *y); | ||
13 | void __lfetch_excl(int lfhint, void *y); | ||
14 | void __lfetch_fault(int lfhint, void *y); | ||
15 | void __lfetch_fault_excl(int lfhint, void *y); | ||
16 | |||
17 | /* In the following, whichFloatReg should be an integer from 0-127 */ | ||
18 | void __ldfs(const int whichFloatReg, void *src); | ||
19 | void __ldfd(const int whichFloatReg, void *src); | ||
20 | void __ldfe(const int whichFloatReg, void *src); | ||
21 | void __ldf8(const int whichFloatReg, void *src); | ||
22 | void __ldf_fill(const int whichFloatReg, void *src); | ||
23 | void __stfs(void *dst, const int whichFloatReg); | ||
24 | void __stfd(void *dst, const int whichFloatReg); | ||
25 | void __stfe(void *dst, const int whichFloatReg); | ||
26 | void __stf8(void *dst, const int whichFloatReg); | ||
27 | void __stf_spill(void *dst, const int whichFloatReg); | ||
28 | |||
29 | void __st1_rel(void *dst, const __s8 value); | ||
30 | void __st2_rel(void *dst, const __s16 value); | ||
31 | void __st4_rel(void *dst, const __s32 value); | ||
32 | void __st8_rel(void *dst, const __s64 value); | ||
33 | __u8 __ld1_acq(void *src); | ||
34 | __u16 __ld2_acq(void *src); | ||
35 | __u32 __ld4_acq(void *src); | ||
36 | __u64 __ld8_acq(void *src); | ||
37 | |||
38 | __u64 __fetchadd4_acq(__u32 *addend, const int increment); | ||
39 | __u64 __fetchadd4_rel(__u32 *addend, const int increment); | ||
40 | __u64 __fetchadd8_acq(__u64 *addend, const int increment); | ||
41 | __u64 __fetchadd8_rel(__u64 *addend, const int increment); | ||
42 | |||
43 | __u64 __getf_exp(double d); | ||
44 | |||
45 | /* OS Related Itanium(R) Intrinsics */ | ||
46 | |||
47 | /* The names to use for whichReg and whichIndReg below come from | ||
48 | the include file asm/ia64regs.h */ | ||
49 | |||
50 | __u64 __getIndReg(const int whichIndReg, __s64 index); | ||
51 | __u64 __getReg(const int whichReg); | ||
52 | |||
53 | void __setIndReg(const int whichIndReg, __s64 index, __u64 value); | ||
54 | void __setReg(const int whichReg, __u64 value); | ||
55 | |||
56 | void __mf(void); | ||
57 | void __mfa(void); | ||
58 | void __synci(void); | ||
59 | void __itcd(__s64 pa); | ||
60 | void __itci(__s64 pa); | ||
61 | void __itrd(__s64 whichTransReg, __s64 pa); | ||
62 | void __itri(__s64 whichTransReg, __s64 pa); | ||
63 | void __ptce(__s64 va); | ||
64 | void __ptcl(__s64 va, __s64 pagesz); | ||
65 | void __ptcg(__s64 va, __s64 pagesz); | ||
66 | void __ptcga(__s64 va, __s64 pagesz); | ||
67 | void __ptri(__s64 va, __s64 pagesz); | ||
68 | void __ptrd(__s64 va, __s64 pagesz); | ||
69 | void __invala (void); | ||
70 | void __invala_gr(const int whichGeneralReg /* 0-127 */ ); | ||
71 | void __invala_fr(const int whichFloatReg /* 0-127 */ ); | ||
72 | void __nop(const int); | ||
73 | void __fc(__u64 *addr); | ||
74 | void __sum(int mask); | ||
75 | void __rum(int mask); | ||
76 | void __ssm(int mask); | ||
77 | void __rsm(int mask); | ||
78 | __u64 __thash(__s64); | ||
79 | __u64 __ttag(__s64); | ||
80 | __s64 __tpa(__s64); | ||
81 | |||
82 | /* Intrinsics for implementing get/put_user macros */ | ||
83 | void __st_user(const char *tableName, __u64 addr, char size, char relocType, __u64 val); | ||
84 | void __ld_user(const char *tableName, __u64 addr, char size, char relocType); | ||
85 | |||
86 | /* This intrinsic does not generate code, it creates a barrier across which | ||
87 | * the compiler will not schedule data access instructions. | ||
88 | */ | ||
89 | void __memory_barrier(void); | ||
90 | |||
91 | void __isrlz(void); | ||
92 | void __dsrlz(void); | ||
93 | |||
94 | __u64 _m64_mux1(__u64 a, const int n); | ||
95 | __u64 __thash(__u64); | ||
96 | |||
97 | /* Lock and Atomic Operation Related Intrinsics */ | ||
98 | __u64 _InterlockedExchange8(volatile __u8 *trgt, __u8 value); | ||
99 | __u64 _InterlockedExchange16(volatile __u16 *trgt, __u16 value); | ||
100 | __s64 _InterlockedExchange(volatile __u32 *trgt, __u32 value); | ||
101 | __s64 _InterlockedExchange64(volatile __u64 *trgt, __u64 value); | ||
102 | |||
103 | __u64 _InterlockedCompareExchange8_rel(volatile __u8 *dest, __u64 xchg, __u64 comp); | ||
104 | __u64 _InterlockedCompareExchange8_acq(volatile __u8 *dest, __u64 xchg, __u64 comp); | ||
105 | __u64 _InterlockedCompareExchange16_rel(volatile __u16 *dest, __u64 xchg, __u64 comp); | ||
106 | __u64 _InterlockedCompareExchange16_acq(volatile __u16 *dest, __u64 xchg, __u64 comp); | ||
107 | __u64 _InterlockedCompareExchange_rel(volatile __u32 *dest, __u64 xchg, __u64 comp); | ||
108 | __u64 _InterlockedCompareExchange_acq(volatile __u32 *dest, __u64 xchg, __u64 comp); | ||
109 | __u64 _InterlockedCompareExchange64_rel(volatile __u64 *dest, __u64 xchg, __u64 comp); | ||
110 | __u64 _InterlockedCompareExchange64_acq(volatile __u64 *dest, __u64 xchg, __u64 comp); | ||
111 | |||
112 | __s64 _m64_dep_mi(const int v, __s64 s, const int p, const int len); | ||
113 | __s64 _m64_shrp(__s64 a, __s64 b, const int count); | ||
114 | __s64 _m64_popcnt(__s64 a); | ||
115 | 12 | ||
116 | #define ia64_barrier() __memory_barrier() | 13 | #define ia64_barrier() __memory_barrier() |
117 | 14 | ||
@@ -122,15 +19,16 @@ __s64 _m64_popcnt(__s64 a); | |||
122 | #define ia64_getreg __getReg | 19 | #define ia64_getreg __getReg |
123 | #define ia64_setreg __setReg | 20 | #define ia64_setreg __setReg |
124 | 21 | ||
125 | #define ia64_hint(x) | 22 | #define ia64_hint __hint |
23 | #define ia64_hint_pause __hint_pause | ||
126 | 24 | ||
127 | #define ia64_mux1_brcst 0 | 25 | #define ia64_mux1_brcst _m64_mux1_brcst |
128 | #define ia64_mux1_mix 8 | 26 | #define ia64_mux1_mix _m64_mux1_mix |
129 | #define ia64_mux1_shuf 9 | 27 | #define ia64_mux1_shuf _m64_mux1_shuf |
130 | #define ia64_mux1_alt 10 | 28 | #define ia64_mux1_alt _m64_mux1_alt |
131 | #define ia64_mux1_rev 11 | 29 | #define ia64_mux1_rev _m64_mux1_rev |
132 | 30 | ||
133 | #define ia64_mux1 _m64_mux1 | 31 | #define ia64_mux1(x,v) _m_to_int64(_m64_mux1(_m_from_int64(x), (v))) |
134 | #define ia64_popcnt _m64_popcnt | 32 | #define ia64_popcnt _m64_popcnt |
135 | #define ia64_getf_exp __getf_exp | 33 | #define ia64_getf_exp __getf_exp |
136 | #define ia64_shrp _m64_shrp | 34 | #define ia64_shrp _m64_shrp |
@@ -158,7 +56,7 @@ __s64 _m64_popcnt(__s64 a); | |||
158 | #define ia64_stf8 __stf8 | 56 | #define ia64_stf8 __stf8 |
159 | #define ia64_stf_spill __stf_spill | 57 | #define ia64_stf_spill __stf_spill |
160 | 58 | ||
161 | #define ia64_mf __mf | 59 | #define ia64_mf __mf |
162 | #define ia64_mfa __mfa | 60 | #define ia64_mfa __mfa |
163 | 61 | ||
164 | #define ia64_fetchadd4_acq __fetchadd4_acq | 62 | #define ia64_fetchadd4_acq __fetchadd4_acq |
@@ -234,10 +132,10 @@ __s64 _m64_popcnt(__s64 a); | |||
234 | 132 | ||
235 | /* Values for lfhint in __lfetch and __lfetch_fault */ | 133 | /* Values for lfhint in __lfetch and __lfetch_fault */ |
236 | 134 | ||
237 | #define ia64_lfhint_none 0 | 135 | #define ia64_lfhint_none __lfhint_none |
238 | #define ia64_lfhint_nt1 1 | 136 | #define ia64_lfhint_nt1 __lfhint_nt1 |
239 | #define ia64_lfhint_nt2 2 | 137 | #define ia64_lfhint_nt2 __lfhint_nt2 |
240 | #define ia64_lfhint_nta 3 | 138 | #define ia64_lfhint_nta __lfhint_nta |
241 | 139 | ||
242 | #define ia64_lfetch __lfetch | 140 | #define ia64_lfetch __lfetch |
243 | #define ia64_lfetch_excl __lfetch_excl | 141 | #define ia64_lfetch_excl __lfetch_excl |
@@ -254,4 +152,6 @@ do { \ | |||
254 | } \ | 152 | } \ |
255 | } while (0) | 153 | } while (0) |
256 | 154 | ||
155 | #define __builtin_trap() __break(0); | ||
156 | |||
257 | #endif /* _ASM_IA64_INTEL_INTRIN_H */ | 157 | #endif /* _ASM_IA64_INTEL_INTRIN_H */ |
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index ca5ea994d688..c3e4ed8a3e17 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h | |||
@@ -20,6 +20,7 @@ struct scatterlist; | |||
20 | struct page; | 20 | struct page; |
21 | struct mm_struct; | 21 | struct mm_struct; |
22 | struct pci_bus; | 22 | struct pci_bus; |
23 | struct task_struct; | ||
23 | 24 | ||
24 | typedef void ia64_mv_setup_t (char **); | 25 | typedef void ia64_mv_setup_t (char **); |
25 | typedef void ia64_mv_cpu_init_t (void); | 26 | typedef void ia64_mv_cpu_init_t (void); |
@@ -34,6 +35,7 @@ typedef int ia64_mv_pci_legacy_read_t (struct pci_bus *, u16 port, u32 *val, | |||
34 | u8 size); | 35 | u8 size); |
35 | typedef int ia64_mv_pci_legacy_write_t (struct pci_bus *, u16 port, u32 val, | 36 | typedef int ia64_mv_pci_legacy_write_t (struct pci_bus *, u16 port, u32 val, |
36 | u8 size); | 37 | u8 size); |
38 | typedef void ia64_mv_migrate_t(struct task_struct * task); | ||
37 | 39 | ||
38 | /* DMA-mapping interface: */ | 40 | /* DMA-mapping interface: */ |
39 | typedef void ia64_mv_dma_init (void); | 41 | typedef void ia64_mv_dma_init (void); |
@@ -85,6 +87,11 @@ machvec_noop_mm (struct mm_struct *mm) | |||
85 | { | 87 | { |
86 | } | 88 | } |
87 | 89 | ||
90 | static inline void | ||
91 | machvec_noop_task (struct task_struct *task) | ||
92 | { | ||
93 | } | ||
94 | |||
88 | extern void machvec_setup (char **); | 95 | extern void machvec_setup (char **); |
89 | extern void machvec_timer_interrupt (int, void *, struct pt_regs *); | 96 | extern void machvec_timer_interrupt (int, void *, struct pt_regs *); |
90 | extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int); | 97 | extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int); |
@@ -146,6 +153,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *); | |||
146 | # define platform_readw_relaxed ia64_mv.readw_relaxed | 153 | # define platform_readw_relaxed ia64_mv.readw_relaxed |
147 | # define platform_readl_relaxed ia64_mv.readl_relaxed | 154 | # define platform_readl_relaxed ia64_mv.readl_relaxed |
148 | # define platform_readq_relaxed ia64_mv.readq_relaxed | 155 | # define platform_readq_relaxed ia64_mv.readq_relaxed |
156 | # define platform_migrate ia64_mv.migrate | ||
149 | # endif | 157 | # endif |
150 | 158 | ||
151 | /* __attribute__((__aligned__(16))) is required to make size of the | 159 | /* __attribute__((__aligned__(16))) is required to make size of the |
@@ -194,6 +202,7 @@ struct ia64_machine_vector { | |||
194 | ia64_mv_readw_relaxed_t *readw_relaxed; | 202 | ia64_mv_readw_relaxed_t *readw_relaxed; |
195 | ia64_mv_readl_relaxed_t *readl_relaxed; | 203 | ia64_mv_readl_relaxed_t *readl_relaxed; |
196 | ia64_mv_readq_relaxed_t *readq_relaxed; | 204 | ia64_mv_readq_relaxed_t *readq_relaxed; |
205 | ia64_mv_migrate_t *migrate; | ||
197 | } __attribute__((__aligned__(16))); /* align attrib? see above comment */ | 206 | } __attribute__((__aligned__(16))); /* align attrib? see above comment */ |
198 | 207 | ||
199 | #define MACHVEC_INIT(name) \ | 208 | #define MACHVEC_INIT(name) \ |
@@ -238,6 +247,7 @@ struct ia64_machine_vector { | |||
238 | platform_readw_relaxed, \ | 247 | platform_readw_relaxed, \ |
239 | platform_readl_relaxed, \ | 248 | platform_readl_relaxed, \ |
240 | platform_readq_relaxed, \ | 249 | platform_readq_relaxed, \ |
250 | platform_migrate, \ | ||
241 | } | 251 | } |
242 | 252 | ||
243 | extern struct ia64_machine_vector ia64_mv; | 253 | extern struct ia64_machine_vector ia64_mv; |
@@ -386,5 +396,8 @@ extern ia64_mv_dma_supported swiotlb_dma_supported; | |||
386 | #ifndef platform_readq_relaxed | 396 | #ifndef platform_readq_relaxed |
387 | # define platform_readq_relaxed __ia64_readq_relaxed | 397 | # define platform_readq_relaxed __ia64_readq_relaxed |
388 | #endif | 398 | #endif |
399 | #ifndef platform_migrate | ||
400 | # define platform_migrate machvec_noop_task | ||
401 | #endif | ||
389 | 402 | ||
390 | #endif /* _ASM_IA64_MACHVEC_H */ | 403 | #endif /* _ASM_IA64_MACHVEC_H */ |
diff --git a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h index 03d00faf03b5..da1d43755afe 100644 --- a/include/asm-ia64/machvec_sn2.h +++ b/include/asm-ia64/machvec_sn2.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2002-2003, 2006 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2002-2003,2006 Silicon Graphics, Inc. All Rights Reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms of version 2 of the GNU General Public License | 5 | * under the terms of version 2 of the GNU General Public License |
@@ -66,6 +66,7 @@ extern ia64_mv_dma_sync_single_for_device sn_dma_sync_single_for_device; | |||
66 | extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device; | 66 | extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device; |
67 | extern ia64_mv_dma_mapping_error sn_dma_mapping_error; | 67 | extern ia64_mv_dma_mapping_error sn_dma_mapping_error; |
68 | extern ia64_mv_dma_supported sn_dma_supported; | 68 | extern ia64_mv_dma_supported sn_dma_supported; |
69 | extern ia64_mv_migrate_t sn_migrate; | ||
69 | 70 | ||
70 | /* | 71 | /* |
71 | * This stuff has dual use! | 72 | * This stuff has dual use! |
@@ -115,6 +116,7 @@ extern ia64_mv_dma_supported sn_dma_supported; | |||
115 | #define platform_dma_sync_sg_for_device sn_dma_sync_sg_for_device | 116 | #define platform_dma_sync_sg_for_device sn_dma_sync_sg_for_device |
116 | #define platform_dma_mapping_error sn_dma_mapping_error | 117 | #define platform_dma_mapping_error sn_dma_mapping_error |
117 | #define platform_dma_supported sn_dma_supported | 118 | #define platform_dma_supported sn_dma_supported |
119 | #define platform_migrate sn_migrate | ||
118 | 120 | ||
119 | #include <asm/sn/io.h> | 121 | #include <asm/sn/io.h> |
120 | 122 | ||
diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h index c7d9c9ed38ba..bfbbb8da79c7 100644 --- a/include/asm-ia64/mca.h +++ b/include/asm-ia64/mca.h | |||
@@ -131,6 +131,8 @@ struct ia64_mca_cpu { | |||
131 | /* Array of physical addresses of each CPU's MCA area. */ | 131 | /* Array of physical addresses of each CPU's MCA area. */ |
132 | extern unsigned long __per_cpu_mca[NR_CPUS]; | 132 | extern unsigned long __per_cpu_mca[NR_CPUS]; |
133 | 133 | ||
134 | extern int cpe_vector; | ||
135 | extern int ia64_cpe_irq; | ||
134 | extern void ia64_mca_init(void); | 136 | extern void ia64_mca_init(void); |
135 | extern void ia64_mca_cpu_init(void *); | 137 | extern void ia64_mca_cpu_init(void *); |
136 | extern void ia64_os_mca_dispatch(void); | 138 | extern void ia64_os_mca_dispatch(void); |
diff --git a/include/asm-ia64/mutex.h b/include/asm-ia64/mutex.h index 458c1f7fbc18..5a3224f6af38 100644 --- a/include/asm-ia64/mutex.h +++ b/include/asm-ia64/mutex.h | |||
@@ -1,9 +1,92 @@ | |||
1 | /* | 1 | /* |
2 | * Pull in the generic implementation for the mutex fastpath. | 2 | * ia64 implementation of the mutex fastpath. |
3 | * | 3 | * |
4 | * TODO: implement optimized primitives instead, or leave the generic | 4 | * Copyright (C) 2006 Ken Chen <kenneth.w.chen@intel.com> |
5 | * implementation in place, or pick the atomic_xchg() based generic | 5 | * |
6 | * implementation. (see asm-generic/mutex-xchg.h for details) | 6 | */ |
7 | |||
8 | #ifndef _ASM_MUTEX_H | ||
9 | #define _ASM_MUTEX_H | ||
10 | |||
11 | /** | ||
12 | * __mutex_fastpath_lock - try to take the lock by moving the count | ||
13 | * from 1 to a 0 value | ||
14 | * @count: pointer of type atomic_t | ||
15 | * @fail_fn: function to call if the original value was not 1 | ||
16 | * | ||
17 | * Change the count from 1 to a value lower than 1, and call <fail_fn> if | ||
18 | * it wasn't 1 originally. This function MUST leave the value lower than | ||
19 | * 1 even when the "1" assertion wasn't true. | ||
20 | */ | ||
21 | static inline void | ||
22 | __mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *)) | ||
23 | { | ||
24 | if (unlikely(ia64_fetchadd4_acq(count, -1) != 1)) | ||
25 | fail_fn(count); | ||
26 | } | ||
27 | |||
28 | /** | ||
29 | * __mutex_fastpath_lock_retval - try to take the lock by moving the count | ||
30 | * from 1 to a 0 value | ||
31 | * @count: pointer of type atomic_t | ||
32 | * @fail_fn: function to call if the original value was not 1 | ||
33 | * | ||
34 | * Change the count from 1 to a value lower than 1, and call <fail_fn> if | ||
35 | * it wasn't 1 originally. This function returns 0 if the fastpath succeeds, | ||
36 | * or anything the slow path function returns. | ||
37 | */ | ||
38 | static inline int | ||
39 | __mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) | ||
40 | { | ||
41 | if (unlikely(ia64_fetchadd4_acq(count, -1) != 1)) | ||
42 | return fail_fn(count); | ||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * __mutex_fastpath_unlock - try to promote the count from 0 to 1 | ||
48 | * @count: pointer of type atomic_t | ||
49 | * @fail_fn: function to call if the original value was not 0 | ||
50 | * | ||
51 | * Try to promote the count from 0 to 1. If it wasn't 0, call <fail_fn>. | ||
52 | * In the failure case, this function is allowed to either set the value to | ||
53 | * 1, or to set it to a value lower than 1. | ||
54 | * | ||
55 | * If the implementation sets it to a value of lower than 1, then the | ||
56 | * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs | ||
57 | * to return 0 otherwise. | ||
58 | */ | ||
59 | static inline void | ||
60 | __mutex_fastpath_unlock(atomic_t *count, void (*fail_fn)(atomic_t *)) | ||
61 | { | ||
62 | int ret = ia64_fetchadd4_rel(count, 1); | ||
63 | if (unlikely(ret < 0)) | ||
64 | fail_fn(count); | ||
65 | } | ||
66 | |||
67 | #define __mutex_slowpath_needs_to_unlock() 1 | ||
68 | |||
69 | /** | ||
70 | * __mutex_fastpath_trylock - try to acquire the mutex, without waiting | ||
71 | * | ||
72 | * @count: pointer of type atomic_t | ||
73 | * @fail_fn: fallback function | ||
74 | * | ||
75 | * Change the count from 1 to a value lower than 1, and return 0 (failure) | ||
76 | * if it wasn't 1 originally, or return 1 (success) otherwise. This function | ||
77 | * MUST leave the value lower than 1 even when the "1" assertion wasn't true. | ||
78 | * Additionally, if the value was < 0 originally, this function must not leave | ||
79 | * it to 0 on failure. | ||
80 | * | ||
81 | * If the architecture has no effective trylock variant, it should call the | ||
82 | * <fail_fn> spinlock-based trylock variant unconditionally. | ||
7 | */ | 83 | */ |
84 | static inline int | ||
85 | __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *)) | ||
86 | { | ||
87 | if (likely(cmpxchg_acq(count, 1, 0)) == 1) | ||
88 | return 1; | ||
89 | return 0; | ||
90 | } | ||
8 | 91 | ||
9 | #include <asm-generic/mutex-dec.h> | 92 | #endif |
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h index 23c8e1be1911..128fefd8056f 100644 --- a/include/asm-ia64/processor.h +++ b/include/asm-ia64/processor.h | |||
@@ -50,7 +50,8 @@ | |||
50 | #define IA64_THREAD_PM_VALID (__IA64_UL(1) << 2) /* performance registers valid? */ | 50 | #define IA64_THREAD_PM_VALID (__IA64_UL(1) << 2) /* performance registers valid? */ |
51 | #define IA64_THREAD_UAC_NOPRINT (__IA64_UL(1) << 3) /* don't log unaligned accesses */ | 51 | #define IA64_THREAD_UAC_NOPRINT (__IA64_UL(1) << 3) /* don't log unaligned accesses */ |
52 | #define IA64_THREAD_UAC_SIGBUS (__IA64_UL(1) << 4) /* generate SIGBUS on unaligned acc. */ | 52 | #define IA64_THREAD_UAC_SIGBUS (__IA64_UL(1) << 4) /* generate SIGBUS on unaligned acc. */ |
53 | /* bit 5 is currently unused */ | 53 | #define IA64_THREAD_MIGRATION (__IA64_UL(1) << 5) /* require migration |
54 | sync at ctx sw */ | ||
54 | #define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6) /* don't log any fpswa faults */ | 55 | #define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6) /* don't log any fpswa faults */ |
55 | #define IA64_THREAD_FPEMU_SIGFPE (__IA64_UL(1) << 7) /* send a SIGFPE for fpswa faults */ | 56 | #define IA64_THREAD_FPEMU_SIGFPE (__IA64_UL(1) << 7) /* send a SIGFPE for fpswa faults */ |
56 | 57 | ||
diff --git a/include/asm-ia64/signal.h b/include/asm-ia64/signal.h index 608168d713d3..5e328ed5d01d 100644 --- a/include/asm-ia64/signal.h +++ b/include/asm-ia64/signal.h | |||
@@ -158,8 +158,6 @@ struct k_sigaction { | |||
158 | 158 | ||
159 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) | 159 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) |
160 | 160 | ||
161 | void set_sigdelayed(pid_t pid, int signo, int code, void __user *addr); | ||
162 | |||
163 | #endif /* __KERNEL__ */ | 161 | #endif /* __KERNEL__ */ |
164 | 162 | ||
165 | # endif /* !__ASSEMBLY__ */ | 163 | # endif /* !__ASSEMBLY__ */ |
diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h index 2c32e4b77b54..1d9efe541662 100644 --- a/include/asm-ia64/sn/addrs.h +++ b/include/asm-ia64/sn/addrs.h | |||
@@ -283,5 +283,13 @@ | |||
283 | #define REMOTE_HUB_L(n, a) HUB_L(REMOTE_HUB_ADDR((n), (a))) | 283 | #define REMOTE_HUB_L(n, a) HUB_L(REMOTE_HUB_ADDR((n), (a))) |
284 | #define REMOTE_HUB_S(n, a, d) HUB_S(REMOTE_HUB_ADDR((n), (a)), (d)) | 284 | #define REMOTE_HUB_S(n, a, d) HUB_S(REMOTE_HUB_ADDR((n), (a)), (d)) |
285 | 285 | ||
286 | /* | ||
287 | * Coretalk address breakdown | ||
288 | */ | ||
289 | #define CTALK_NASID_SHFT 40 | ||
290 | #define CTALK_NASID_MASK (0x3FFFULL << CTALK_NASID_SHFT) | ||
291 | #define CTALK_CID_SHFT 38 | ||
292 | #define CTALK_CID_MASK (0x3ULL << CTALK_CID_SHFT) | ||
293 | #define CTALK_NODE_OFFSET 0x3FFFFFFFFF | ||
286 | 294 | ||
287 | #endif /* _ASM_IA64_SN_ADDRS_H */ | 295 | #endif /* _ASM_IA64_SN_ADDRS_H */ |
diff --git a/include/asm-ia64/sn/rw_mmr.h b/include/asm-ia64/sn/rw_mmr.h index f40fd1a5510d..2d78f4c5a45e 100644 --- a/include/asm-ia64/sn/rw_mmr.h +++ b/include/asm-ia64/sn/rw_mmr.h | |||
@@ -3,15 +3,14 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 2002-2004 Silicon Graphics, Inc. All Rights Reserved. | 6 | * Copyright (C) 2002-2006 Silicon Graphics, Inc. All Rights Reserved. |
7 | */ | 7 | */ |
8 | #ifndef _ASM_IA64_SN_RW_MMR_H | 8 | #ifndef _ASM_IA64_SN_RW_MMR_H |
9 | #define _ASM_IA64_SN_RW_MMR_H | 9 | #define _ASM_IA64_SN_RW_MMR_H |
10 | 10 | ||
11 | 11 | ||
12 | /* | 12 | /* |
13 | * This file contains macros used to access MMR registers via | 13 | * This file that access MMRs via uncached physical addresses. |
14 | * uncached physical addresses. | ||
15 | * pio_phys_read_mmr - read an MMR | 14 | * pio_phys_read_mmr - read an MMR |
16 | * pio_phys_write_mmr - write an MMR | 15 | * pio_phys_write_mmr - write an MMR |
17 | * pio_atomic_phys_write_mmrs - atomically write 1 or 2 MMRs with psr.ic=0 | 16 | * pio_atomic_phys_write_mmrs - atomically write 1 or 2 MMRs with psr.ic=0 |
@@ -22,53 +21,8 @@ | |||
22 | */ | 21 | */ |
23 | 22 | ||
24 | 23 | ||
25 | extern inline long | 24 | extern long pio_phys_read_mmr(volatile long *mmr); |
26 | pio_phys_read_mmr(volatile long *mmr) | 25 | extern void pio_phys_write_mmr(volatile long *mmr, long val); |
27 | { | 26 | extern void pio_atomic_phys_write_mmrs(volatile long *mmr1, long val1, volatile long *mmr2, long val2); |
28 | long val; | ||
29 | asm volatile | ||
30 | ("mov r2=psr;;" | ||
31 | "rsm psr.i | psr.dt;;" | ||
32 | "srlz.i;;" | ||
33 | "ld8.acq %0=[%1];;" | ||
34 | "mov psr.l=r2;;" | ||
35 | "srlz.i;;" | ||
36 | : "=r"(val) | ||
37 | : "r"(mmr) | ||
38 | : "r2"); | ||
39 | return val; | ||
40 | } | ||
41 | |||
42 | |||
43 | |||
44 | extern inline void | ||
45 | pio_phys_write_mmr(volatile long *mmr, long val) | ||
46 | { | ||
47 | asm volatile | ||
48 | ("mov r2=psr;;" | ||
49 | "rsm psr.i | psr.dt;;" | ||
50 | "srlz.i;;" | ||
51 | "st8.rel [%0]=%1;;" | ||
52 | "mov psr.l=r2;;" | ||
53 | "srlz.i;;" | ||
54 | :: "r"(mmr), "r"(val) | ||
55 | : "r2", "memory"); | ||
56 | } | ||
57 | |||
58 | extern inline void | ||
59 | pio_atomic_phys_write_mmrs(volatile long *mmr1, long val1, volatile long *mmr2, long val2) | ||
60 | { | ||
61 | asm volatile | ||
62 | ("mov r2=psr;;" | ||
63 | "rsm psr.i | psr.dt | psr.ic;;" | ||
64 | "cmp.ne p9,p0=%2,r0;" | ||
65 | "srlz.i;;" | ||
66 | "st8.rel [%0]=%1;" | ||
67 | "(p9) st8.rel [%2]=%3;;" | ||
68 | "mov psr.l=r2;;" | ||
69 | "srlz.i;;" | ||
70 | :: "r"(mmr1), "r"(val1), "r"(mmr2), "r"(val2) | ||
71 | : "p9", "r2", "memory"); | ||
72 | } | ||
73 | 27 | ||
74 | #endif /* _ASM_IA64_SN_RW_MMR_H */ | 28 | #endif /* _ASM_IA64_SN_RW_MMR_H */ |
diff --git a/include/asm-ia64/sn/tioce.h b/include/asm-ia64/sn/tioce.h index d4c990712eac..893468e1b41b 100644 --- a/include/asm-ia64/sn/tioce.h +++ b/include/asm-ia64/sn/tioce.h | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | /* CE ASIC part & mfgr information */ | 12 | /* CE ASIC part & mfgr information */ |
13 | #define TIOCE_PART_NUM 0xCE00 | 13 | #define TIOCE_PART_NUM 0xCE00 |
14 | #define TIOCE_MFGR_NUM 0x36 | 14 | #define TIOCE_SRC_ID 0x01 |
15 | #define TIOCE_REV_A 0x1 | 15 | #define TIOCE_REV_A 0x1 |
16 | 16 | ||
17 | /* CE Virtual PPB Vendor/Device IDs */ | 17 | /* CE Virtual PPB Vendor/Device IDs */ |
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | /* CE Host Bridge Vendor/Device IDs */ | 21 | /* CE Host Bridge Vendor/Device IDs */ |
22 | #define CE_HOST_BRIDGE_VENDOR_ID 0x10a9 | 22 | #define CE_HOST_BRIDGE_VENDOR_ID 0x10a9 |
23 | #define CE_HOST_BRIDGE_DEVICE_ID 0x4003 | 23 | #define CE_HOST_BRIDGE_DEVICE_ID 0x4001 |
24 | 24 | ||
25 | 25 | ||
26 | #define TIOCE_NUM_M40_ATES 4096 | 26 | #define TIOCE_NUM_M40_ATES 4096 |
@@ -463,6 +463,25 @@ typedef volatile struct tioce { | |||
463 | u64 ce_end_of_struct; /* 0x044400 */ | 463 | u64 ce_end_of_struct; /* 0x044400 */ |
464 | } tioce_t; | 464 | } tioce_t; |
465 | 465 | ||
466 | /* ce_lsiX_gb_cfg1 register bit masks & shifts */ | ||
467 | #define CE_LSI_GB_CFG1_RXL0S_THS_SHFT 0 | ||
468 | #define CE_LSI_GB_CFG1_RXL0S_THS_MASK (0xffULL << 0) | ||
469 | #define CE_LSI_GB_CFG1_RXL0S_SMP_SHFT 8 | ||
470 | #define CE_LSI_GB_CFG1_RXL0S_SMP_MASK (0xfULL << 8); | ||
471 | #define CE_LSI_GB_CFG1_RXL0S_ADJ_SHFT 12 | ||
472 | #define CE_LSI_GB_CFG1_RXL0S_ADJ_MASK (0x7ULL << 12) | ||
473 | #define CE_LSI_GB_CFG1_RXL0S_FLT_SHFT 15 | ||
474 | #define CE_LSI_GB_CFG1_RXL0S_FLT_MASK (0x1ULL << 15) | ||
475 | #define CE_LSI_GB_CFG1_LPBK_SEL_SHFT 16 | ||
476 | #define CE_LSI_GB_CFG1_LPBK_SEL_MASK (0x3ULL << 16) | ||
477 | #define CE_LSI_GB_CFG1_LPBK_EN_SHFT 18 | ||
478 | #define CE_LSI_GB_CFG1_LPBK_EN_MASK (0x1ULL << 18) | ||
479 | #define CE_LSI_GB_CFG1_RVRS_LB_SHFT 19 | ||
480 | #define CE_LSI_GB_CFG1_RVRS_LB_MASK (0x1ULL << 19) | ||
481 | #define CE_LSI_GB_CFG1_RVRS_CLK_SHFT 20 | ||
482 | #define CE_LSI_GB_CFG1_RVRS_CLK_MASK (0x3ULL << 20) | ||
483 | #define CE_LSI_GB_CFG1_SLF_TS_SHFT 24 | ||
484 | #define CE_LSI_GB_CFG1_SLF_TS_MASK (0xfULL << 24) | ||
466 | 485 | ||
467 | /* ce_adm_int_mask/ce_adm_int_status register bit defines */ | 486 | /* ce_adm_int_mask/ce_adm_int_status register bit defines */ |
468 | #define CE_ADM_INT_CE_ERROR_SHFT 0 | 487 | #define CE_ADM_INT_CE_ERROR_SHFT 0 |
@@ -592,6 +611,11 @@ typedef volatile struct tioce { | |||
592 | #define CE_URE_RD_MRG_ENABLE (0x1ULL << 0) | 611 | #define CE_URE_RD_MRG_ENABLE (0x1ULL << 0) |
593 | #define CE_URE_WRT_MRG_ENABLE1 (0x1ULL << 4) | 612 | #define CE_URE_WRT_MRG_ENABLE1 (0x1ULL << 4) |
594 | #define CE_URE_WRT_MRG_ENABLE2 (0x1ULL << 5) | 613 | #define CE_URE_WRT_MRG_ENABLE2 (0x1ULL << 5) |
614 | #define CE_URE_WRT_MRG_TIMER_SHFT 12 | ||
615 | #define CE_URE_WRT_MRG_TIMER_MASK (0x7FFULL << CE_URE_WRT_MRG_TIMER_SHFT) | ||
616 | #define CE_URE_WRT_MRG_TIMER(x) (((u64)(x) << \ | ||
617 | CE_URE_WRT_MRG_TIMER_SHFT) & \ | ||
618 | CE_URE_WRT_MRG_TIMER_MASK) | ||
595 | #define CE_URE_RSPQ_BYPASS_DISABLE (0x1ULL << 24) | 619 | #define CE_URE_RSPQ_BYPASS_DISABLE (0x1ULL << 24) |
596 | #define CE_URE_UPS_DAT1_PAR_DISABLE (0x1ULL << 32) | 620 | #define CE_URE_UPS_DAT1_PAR_DISABLE (0x1ULL << 32) |
597 | #define CE_URE_UPS_HDR1_PAR_DISABLE (0x1ULL << 33) | 621 | #define CE_URE_UPS_HDR1_PAR_DISABLE (0x1ULL << 33) |
@@ -653,8 +677,12 @@ typedef volatile struct tioce { | |||
653 | #define CE_URE_SI (0x1ULL << 0) | 677 | #define CE_URE_SI (0x1ULL << 0) |
654 | #define CE_URE_ELAL_SHFT 4 | 678 | #define CE_URE_ELAL_SHFT 4 |
655 | #define CE_URE_ELAL_MASK (0x7ULL << CE_URE_ELAL_SHFT) | 679 | #define CE_URE_ELAL_MASK (0x7ULL << CE_URE_ELAL_SHFT) |
680 | #define CE_URE_ELAL_SET(n) (((u64)(n) << CE_URE_ELAL_SHFT) & \ | ||
681 | CE_URE_ELAL_MASK) | ||
656 | #define CE_URE_ELAL1_SHFT 8 | 682 | #define CE_URE_ELAL1_SHFT 8 |
657 | #define CE_URE_ELAL1_MASK (0x7ULL << CE_URE_ELAL1_SHFT) | 683 | #define CE_URE_ELAL1_MASK (0x7ULL << CE_URE_ELAL1_SHFT) |
684 | #define CE_URE_ELAL1_SET(n) (((u64)(n) << CE_URE_ELAL1_SHFT) & \ | ||
685 | CE_URE_ELAL1_MASK) | ||
658 | #define CE_URE_SCC (0x1ULL << 12) | 686 | #define CE_URE_SCC (0x1ULL << 12) |
659 | #define CE_URE_PN1_SHFT 16 | 687 | #define CE_URE_PN1_SHFT 16 |
660 | #define CE_URE_PN1_MASK (0xFFULL << CE_URE_PN1_SHFT) | 688 | #define CE_URE_PN1_MASK (0xFFULL << CE_URE_PN1_SHFT) |
@@ -675,8 +703,12 @@ typedef volatile struct tioce { | |||
675 | #define CE_URE_HPC (0x1ULL << 6) | 703 | #define CE_URE_HPC (0x1ULL << 6) |
676 | #define CE_URE_SPLV_SHFT 7 | 704 | #define CE_URE_SPLV_SHFT 7 |
677 | #define CE_URE_SPLV_MASK (0xFFULL << CE_URE_SPLV_SHFT) | 705 | #define CE_URE_SPLV_MASK (0xFFULL << CE_URE_SPLV_SHFT) |
706 | #define CE_URE_SPLV_SET(n) (((u64)(n) << CE_URE_SPLV_SHFT) & \ | ||
707 | CE_URE_SPLV_MASK) | ||
678 | #define CE_URE_SPLS_SHFT 15 | 708 | #define CE_URE_SPLS_SHFT 15 |
679 | #define CE_URE_SPLS_MASK (0x3ULL << CE_URE_SPLS_SHFT) | 709 | #define CE_URE_SPLS_MASK (0x3ULL << CE_URE_SPLS_SHFT) |
710 | #define CE_URE_SPLS_SET(n) (((u64)(n) << CE_URE_SPLS_SHFT) & \ | ||
711 | CE_URE_SPLS_MASK) | ||
680 | #define CE_URE_PSN1_SHFT 19 | 712 | #define CE_URE_PSN1_SHFT 19 |
681 | #define CE_URE_PSN1_MASK (0x1FFFULL << CE_URE_PSN1_SHFT) | 713 | #define CE_URE_PSN1_MASK (0x1FFFULL << CE_URE_PSN1_SHFT) |
682 | #define CE_URE_PSN2_SHFT 32 | 714 | #define CE_URE_PSN2_SHFT 32 |
diff --git a/include/asm-ia64/sn/xpc.h b/include/asm-ia64/sn/xpc.h index df7f5f4f3cde..aa3b8ace9030 100644 --- a/include/asm-ia64/sn/xpc.h +++ b/include/asm-ia64/sn/xpc.h | |||
@@ -1227,28 +1227,6 @@ xpc_map_bte_errors(bte_result_t error) | |||
1227 | 1227 | ||
1228 | 1228 | ||
1229 | 1229 | ||
1230 | static inline void * | ||
1231 | xpc_kmalloc_cacheline_aligned(size_t size, gfp_t flags, void **base) | ||
1232 | { | ||
1233 | /* see if kmalloc will give us cachline aligned memory by default */ | ||
1234 | *base = kmalloc(size, flags); | ||
1235 | if (*base == NULL) { | ||
1236 | return NULL; | ||
1237 | } | ||
1238 | if ((u64) *base == L1_CACHE_ALIGN((u64) *base)) { | ||
1239 | return *base; | ||
1240 | } | ||
1241 | kfree(*base); | ||
1242 | |||
1243 | /* nope, we'll have to do it ourselves */ | ||
1244 | *base = kmalloc(size + L1_CACHE_BYTES, flags); | ||
1245 | if (*base == NULL) { | ||
1246 | return NULL; | ||
1247 | } | ||
1248 | return (void *) L1_CACHE_ALIGN((u64) *base); | ||
1249 | } | ||
1250 | |||
1251 | |||
1252 | /* | 1230 | /* |
1253 | * Check to see if there is any channel activity to/from the specified | 1231 | * Check to see if there is any channel activity to/from the specified |
1254 | * partition. | 1232 | * partition. |
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index 062538715623..cd4233d66f15 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h | |||
@@ -244,6 +244,13 @@ extern void ia64_load_extra (struct task_struct *task); | |||
244 | __ia64_save_fpu((prev)->thread.fph); \ | 244 | __ia64_save_fpu((prev)->thread.fph); \ |
245 | } \ | 245 | } \ |
246 | __switch_to(prev, next, last); \ | 246 | __switch_to(prev, next, last); \ |
247 | /* "next" in old context is "current" in new context */ \ | ||
248 | if (unlikely((current->thread.flags & IA64_THREAD_MIGRATION) && \ | ||
249 | (task_cpu(current) != \ | ||
250 | task_thread_info(current)->last_cpu))) { \ | ||
251 | platform_migrate(current); \ | ||
252 | task_thread_info(current)->last_cpu = task_cpu(current); \ | ||
253 | } \ | ||
247 | } while (0) | 254 | } while (0) |
248 | #else | 255 | #else |
249 | # define switch_to(prev,next,last) __switch_to(prev, next, last) | 256 | # define switch_to(prev,next,last) __switch_to(prev, next, last) |
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h index 1d6518fe1f02..56394a2c7055 100644 --- a/include/asm-ia64/thread_info.h +++ b/include/asm-ia64/thread_info.h | |||
@@ -26,16 +26,10 @@ struct thread_info { | |||
26 | struct exec_domain *exec_domain;/* execution domain */ | 26 | struct exec_domain *exec_domain;/* execution domain */ |
27 | __u32 flags; /* thread_info flags (see TIF_*) */ | 27 | __u32 flags; /* thread_info flags (see TIF_*) */ |
28 | __u32 cpu; /* current CPU */ | 28 | __u32 cpu; /* current CPU */ |
29 | __u32 last_cpu; /* Last CPU thread ran on */ | ||
29 | mm_segment_t addr_limit; /* user-level address space limit */ | 30 | mm_segment_t addr_limit; /* user-level address space limit */ |
30 | int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ | 31 | int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ |
31 | struct restart_block restart_block; | 32 | struct restart_block restart_block; |
32 | struct { | ||
33 | int signo; | ||
34 | int code; | ||
35 | void __user *addr; | ||
36 | unsigned long start_time; | ||
37 | pid_t pid; | ||
38 | } sigdelayed; /* Saved information for TIF_SIGDELAYED */ | ||
39 | }; | 33 | }; |
40 | 34 | ||
41 | #define THREAD_SIZE KERNEL_STACK_SIZE | 35 | #define THREAD_SIZE KERNEL_STACK_SIZE |
@@ -89,7 +83,6 @@ struct thread_info { | |||
89 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ | 83 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ |
90 | #define TIF_SYSCALL_TRACE 3 /* syscall trace active */ | 84 | #define TIF_SYSCALL_TRACE 3 /* syscall trace active */ |
91 | #define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ | 85 | #define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ |
92 | #define TIF_SIGDELAYED 5 /* signal delayed from MCA/INIT/NMI/PMI context */ | ||
93 | #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 86 | #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
94 | #define TIF_MEMDIE 17 | 87 | #define TIF_MEMDIE 17 |
95 | #define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */ | 88 | #define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */ |
@@ -101,13 +94,12 @@ struct thread_info { | |||
101 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | 94 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
102 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | 95 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
103 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | 96 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
104 | #define _TIF_SIGDELAYED (1 << TIF_SIGDELAYED) | ||
105 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) | 97 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) |
106 | #define _TIF_MCA_INIT (1 << TIF_MCA_INIT) | 98 | #define _TIF_MCA_INIT (1 << TIF_MCA_INIT) |
107 | #define _TIF_DB_DISABLED (1 << TIF_DB_DISABLED) | 99 | #define _TIF_DB_DISABLED (1 << TIF_DB_DISABLED) |
108 | 100 | ||
109 | /* "work to do on user-return" bits */ | 101 | /* "work to do on user-return" bits */ |
110 | #define TIF_ALLWORK_MASK (_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SIGDELAYED) | 102 | #define TIF_ALLWORK_MASK (_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) |
111 | /* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */ | 103 | /* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */ |
112 | #define TIF_WORK_MASK (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)) | 104 | #define TIF_WORK_MASK (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)) |
113 | 105 | ||
diff --git a/include/asm-mips/byteorder.h b/include/asm-mips/byteorder.h index 584f8128fffd..aefc02f16fd8 100644 --- a/include/asm-mips/byteorder.h +++ b/include/asm-mips/byteorder.h | |||
@@ -39,6 +39,24 @@ static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x) | |||
39 | } | 39 | } |
40 | #define __arch__swab32(x) ___arch__swab32(x) | 40 | #define __arch__swab32(x) ___arch__swab32(x) |
41 | 41 | ||
42 | #ifdef CONFIG_CPU_MIPS64_R2 | ||
43 | |||
44 | static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x) | ||
45 | { | ||
46 | __asm__( | ||
47 | " dsbh %0, %1 \n" | ||
48 | " dshd %0, %0 \n" | ||
49 | " drotr %0, %0, 32 \n" | ||
50 | : "=r" (x) | ||
51 | : "r" (x)); | ||
52 | |||
53 | return x; | ||
54 | } | ||
55 | |||
56 | #define __arch__swab64(x) ___arch__swab64(x) | ||
57 | |||
58 | #endif /* CONFIG_CPU_MIPS64_R2 */ | ||
59 | |||
42 | #endif /* CONFIG_CPU_MIPSR2 */ | 60 | #endif /* CONFIG_CPU_MIPSR2 */ |
43 | 61 | ||
44 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) | 62 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) |
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h index 35d2604fe69c..0012bd804d2d 100644 --- a/include/asm-mips/compat.h +++ b/include/asm-mips/compat.h | |||
@@ -128,17 +128,17 @@ typedef u32 compat_sigset_word; | |||
128 | */ | 128 | */ |
129 | typedef u32 compat_uptr_t; | 129 | typedef u32 compat_uptr_t; |
130 | 130 | ||
131 | static inline void *compat_ptr(compat_uptr_t uptr) | 131 | static inline void __user *compat_ptr(compat_uptr_t uptr) |
132 | { | 132 | { |
133 | return (void *)(long)uptr; | 133 | return (void __user *)(long)uptr; |
134 | } | 134 | } |
135 | 135 | ||
136 | static inline void *compat_alloc_user_space(long len) | 136 | static inline void __user *compat_alloc_user_space(long len) |
137 | { | 137 | { |
138 | struct pt_regs *regs = (struct pt_regs *) | 138 | struct pt_regs *regs = (struct pt_regs *) |
139 | ((unsigned long) current_thread_info() + THREAD_SIZE - 32) - 1; | 139 | ((unsigned long) current_thread_info() + THREAD_SIZE - 32) - 1; |
140 | 140 | ||
141 | return (void *) (regs->regs[29] - len); | 141 | return (void __user *) (regs->regs[29] - len); |
142 | } | 142 | } |
143 | #if defined (__MIPSEL__) | 143 | #if defined (__MIPSEL__) |
144 | #define __COMPAT_ENDIAN_SWAP__ 1 | 144 | #define __COMPAT_ENDIAN_SWAP__ 1 |
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index ba1d7bbc15d2..546a17e56a9b 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h | |||
@@ -40,56 +40,13 @@ | |||
40 | * hardware. An example use would be for flash memory that's used for | 40 | * hardware. An example use would be for flash memory that's used for |
41 | * execute in place. | 41 | * execute in place. |
42 | */ | 42 | */ |
43 | # define __raw_ioswabb(x) (x) | 43 | # define __raw_ioswabb(a,x) (x) |
44 | # define __raw_ioswabw(x) (x) | 44 | # define __raw_ioswabw(a,x) (x) |
45 | # define __raw_ioswabl(x) (x) | 45 | # define __raw_ioswabl(a,x) (x) |
46 | # define __raw_ioswabq(x) (x) | 46 | # define __raw_ioswabq(a,x) (x) |
47 | # define ____raw_ioswabq(x) (x) | 47 | # define ____raw_ioswabq(a,x) (x) |
48 | 48 | ||
49 | /* | 49 | /* ioswab[bwlq], __mem_ioswab[bwlq] are defined in mangle-port.h */ |
50 | * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware; | ||
51 | * less sane hardware forces software to fiddle with this... | ||
52 | * | ||
53 | * Regardless, if the host bus endianness mismatches that of PCI/ISA, then | ||
54 | * you can't have the numerical value of data and byte addresses within | ||
55 | * multibyte quantities both preserved at the same time. Hence two | ||
56 | * variations of functions: non-prefixed ones that preserve the value | ||
57 | * and prefixed ones that preserve byte addresses. The latters are | ||
58 | * typically used for moving raw data between a peripheral and memory (cf. | ||
59 | * string I/O functions), hence the "__mem_" prefix. | ||
60 | */ | ||
61 | #if defined(CONFIG_SWAP_IO_SPACE) | ||
62 | |||
63 | # define ioswabb(x) (x) | ||
64 | # define __mem_ioswabb(x) (x) | ||
65 | # ifdef CONFIG_SGI_IP22 | ||
66 | /* | ||
67 | * IP22 seems braindead enough to swap 16bits values in hardware, but | ||
68 | * not 32bits. Go figure... Can't tell without documentation. | ||
69 | */ | ||
70 | # define ioswabw(x) (x) | ||
71 | # define __mem_ioswabw(x) le16_to_cpu(x) | ||
72 | # else | ||
73 | # define ioswabw(x) le16_to_cpu(x) | ||
74 | # define __mem_ioswabw(x) (x) | ||
75 | # endif | ||
76 | # define ioswabl(x) le32_to_cpu(x) | ||
77 | # define __mem_ioswabl(x) (x) | ||
78 | # define ioswabq(x) le64_to_cpu(x) | ||
79 | # define __mem_ioswabq(x) (x) | ||
80 | |||
81 | #else | ||
82 | |||
83 | # define ioswabb(x) (x) | ||
84 | # define __mem_ioswabb(x) (x) | ||
85 | # define ioswabw(x) (x) | ||
86 | # define __mem_ioswabw(x) cpu_to_le16(x) | ||
87 | # define ioswabl(x) (x) | ||
88 | # define __mem_ioswabl(x) cpu_to_le32(x) | ||
89 | # define ioswabq(x) (x) | ||
90 | # define __mem_ioswabq(x) cpu_to_le32(x) | ||
91 | |||
92 | #endif | ||
93 | 50 | ||
94 | #define IO_SPACE_LIMIT 0xffff | 51 | #define IO_SPACE_LIMIT 0xffff |
95 | 52 | ||
@@ -346,7 +303,7 @@ static inline void pfx##write##bwlq(type val, \ | |||
346 | \ | 303 | \ |
347 | __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \ | 304 | __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \ |
348 | \ | 305 | \ |
349 | __val = pfx##ioswab##bwlq(val); \ | 306 | __val = pfx##ioswab##bwlq(__mem, val); \ |
350 | \ | 307 | \ |
351 | if (sizeof(type) != sizeof(u64) || sizeof(u64) == sizeof(long)) \ | 308 | if (sizeof(type) != sizeof(u64) || sizeof(u64) == sizeof(long)) \ |
352 | *__mem = __val; \ | 309 | *__mem = __val; \ |
@@ -401,7 +358,7 @@ static inline type pfx##read##bwlq(const volatile void __iomem *mem) \ | |||
401 | BUG(); \ | 358 | BUG(); \ |
402 | } \ | 359 | } \ |
403 | \ | 360 | \ |
404 | return pfx##ioswab##bwlq(__val); \ | 361 | return pfx##ioswab##bwlq(__mem, __val); \ |
405 | } | 362 | } |
406 | 363 | ||
407 | #define __BUILD_IOPORT_SINGLE(pfx, bwlq, type, p, slow) \ | 364 | #define __BUILD_IOPORT_SINGLE(pfx, bwlq, type, p, slow) \ |
@@ -411,10 +368,9 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \ | |||
411 | volatile type *__addr; \ | 368 | volatile type *__addr; \ |
412 | type __val; \ | 369 | type __val; \ |
413 | \ | 370 | \ |
414 | port = __swizzle_addr_##bwlq(port); \ | 371 | __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \ |
415 | __addr = (void *)(mips_io_port_base + port); \ | ||
416 | \ | 372 | \ |
417 | __val = pfx##ioswab##bwlq(val); \ | 373 | __val = pfx##ioswab##bwlq(__addr, val); \ |
418 | \ | 374 | \ |
419 | /* Really, we want this to be atomic */ \ | 375 | /* Really, we want this to be atomic */ \ |
420 | BUILD_BUG_ON(sizeof(type) > sizeof(unsigned long)); \ | 376 | BUILD_BUG_ON(sizeof(type) > sizeof(unsigned long)); \ |
@@ -428,15 +384,14 @@ static inline type pfx##in##bwlq##p(unsigned long port) \ | |||
428 | volatile type *__addr; \ | 384 | volatile type *__addr; \ |
429 | type __val; \ | 385 | type __val; \ |
430 | \ | 386 | \ |
431 | port = __swizzle_addr_##bwlq(port); \ | 387 | __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \ |
432 | __addr = (void *)(mips_io_port_base + port); \ | ||
433 | \ | 388 | \ |
434 | BUILD_BUG_ON(sizeof(type) > sizeof(unsigned long)); \ | 389 | BUILD_BUG_ON(sizeof(type) > sizeof(unsigned long)); \ |
435 | \ | 390 | \ |
436 | __val = *__addr; \ | 391 | __val = *__addr; \ |
437 | slow; \ | 392 | slow; \ |
438 | \ | 393 | \ |
439 | return pfx##ioswab##bwlq(__val); \ | 394 | return pfx##ioswab##bwlq(__addr, __val); \ |
440 | } | 395 | } |
441 | 396 | ||
442 | #define __BUILD_MEMORY_PFX(bus, bwlq, type) \ | 397 | #define __BUILD_MEMORY_PFX(bus, bwlq, type) \ |
diff --git a/include/asm-mips/mach-cobalt/cobalt.h b/include/asm-mips/mach-cobalt/cobalt.h index 78e1df2095fb..b3c5ecbec03c 100644 --- a/include/asm-mips/mach-cobalt/cobalt.h +++ b/include/asm-mips/mach-cobalt/cobalt.h | |||
@@ -113,4 +113,6 @@ do { \ | |||
113 | # define COBALT_KEY_SELECT (1 << 7) | 113 | # define COBALT_KEY_SELECT (1 << 7) |
114 | # define COBALT_KEY_MASK 0xfe | 114 | # define COBALT_KEY_MASK 0xfe |
115 | 115 | ||
116 | #define COBALT_UART ((volatile unsigned char *) CKSEG1ADDR(0x1c800000)) | ||
117 | |||
116 | #endif /* __ASM_COBALT_H */ | 118 | #endif /* __ASM_COBALT_H */ |
diff --git a/include/asm-mips/mach-generic/mangle-port.h b/include/asm-mips/mach-generic/mangle-port.h index 4a98d83b8ec7..6e1b0c075de7 100644 --- a/include/asm-mips/mach-generic/mangle-port.h +++ b/include/asm-mips/mach-generic/mangle-port.h | |||
@@ -13,4 +13,40 @@ | |||
13 | #define __swizzle_addr_l(port) (port) | 13 | #define __swizzle_addr_l(port) (port) |
14 | #define __swizzle_addr_q(port) (port) | 14 | #define __swizzle_addr_q(port) (port) |
15 | 15 | ||
16 | /* | ||
17 | * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware; | ||
18 | * less sane hardware forces software to fiddle with this... | ||
19 | * | ||
20 | * Regardless, if the host bus endianness mismatches that of PCI/ISA, then | ||
21 | * you can't have the numerical value of data and byte addresses within | ||
22 | * multibyte quantities both preserved at the same time. Hence two | ||
23 | * variations of functions: non-prefixed ones that preserve the value | ||
24 | * and prefixed ones that preserve byte addresses. The latters are | ||
25 | * typically used for moving raw data between a peripheral and memory (cf. | ||
26 | * string I/O functions), hence the "__mem_" prefix. | ||
27 | */ | ||
28 | #if defined(CONFIG_SWAP_IO_SPACE) | ||
29 | |||
30 | # define ioswabb(a,x) (x) | ||
31 | # define __mem_ioswabb(a,x) (x) | ||
32 | # define ioswabw(a,x) le16_to_cpu(x) | ||
33 | # define __mem_ioswabw(a,x) (x) | ||
34 | # define ioswabl(a,x) le32_to_cpu(x) | ||
35 | # define __mem_ioswabl(a,x) (x) | ||
36 | # define ioswabq(a,x) le64_to_cpu(x) | ||
37 | # define __mem_ioswabq(a,x) (x) | ||
38 | |||
39 | #else | ||
40 | |||
41 | # define ioswabb(a,x) (x) | ||
42 | # define __mem_ioswabb(a,x) (x) | ||
43 | # define ioswabw(a,x) (x) | ||
44 | # define __mem_ioswabw(a,x) cpu_to_le16(x) | ||
45 | # define ioswabl(a,x) (x) | ||
46 | # define __mem_ioswabl(a,x) cpu_to_le32(x) | ||
47 | # define ioswabq(a,x) (x) | ||
48 | # define __mem_ioswabq(a,x) cpu_to_le32(x) | ||
49 | |||
50 | #endif | ||
51 | |||
16 | #endif /* __ASM_MACH_GENERIC_MANGLE_PORT_H */ | 52 | #endif /* __ASM_MACH_GENERIC_MANGLE_PORT_H */ |
diff --git a/include/asm-mips/mach-ip27/mangle-port.h b/include/asm-mips/mach-ip27/mangle-port.h index f76c44880451..d615312a451a 100644 --- a/include/asm-mips/mach-ip27/mangle-port.h +++ b/include/asm-mips/mach-ip27/mangle-port.h | |||
@@ -13,4 +13,13 @@ | |||
13 | #define __swizzle_addr_l(port) (port) | 13 | #define __swizzle_addr_l(port) (port) |
14 | #define __swizzle_addr_q(port) (port) | 14 | #define __swizzle_addr_q(port) (port) |
15 | 15 | ||
16 | # define ioswabb(a,x) (x) | ||
17 | # define __mem_ioswabb(a,x) (x) | ||
18 | # define ioswabw(a,x) (x) | ||
19 | # define __mem_ioswabw(a,x) cpu_to_le16(x) | ||
20 | # define ioswabl(a,x) (x) | ||
21 | # define __mem_ioswabl(a,x) cpu_to_le32(x) | ||
22 | # define ioswabq(a,x) (x) | ||
23 | # define __mem_ioswabq(a,x) cpu_to_le32(x) | ||
24 | |||
16 | #endif /* __ASM_MACH_IP27_MANGLE_PORT_H */ | 25 | #endif /* __ASM_MACH_IP27_MANGLE_PORT_H */ |
diff --git a/include/asm-mips/mach-ip32/mangle-port.h b/include/asm-mips/mach-ip32/mangle-port.h index 6e25b52ed8f2..81320eb55324 100644 --- a/include/asm-mips/mach-ip32/mangle-port.h +++ b/include/asm-mips/mach-ip32/mangle-port.h | |||
@@ -14,4 +14,13 @@ | |||
14 | #define __swizzle_addr_l(port) (port) | 14 | #define __swizzle_addr_l(port) (port) |
15 | #define __swizzle_addr_q(port) (port) | 15 | #define __swizzle_addr_q(port) (port) |
16 | 16 | ||
17 | # define ioswabb(a,x) (x) | ||
18 | # define __mem_ioswabb(a,x) (x) | ||
19 | # define ioswabw(a,x) (x) | ||
20 | # define __mem_ioswabw(a,x) cpu_to_le16(x) | ||
21 | # define ioswabl(a,x) (x) | ||
22 | # define __mem_ioswabl(a,x) cpu_to_le32(x) | ||
23 | # define ioswabq(a,x) (x) | ||
24 | # define __mem_ioswabq(a,x) cpu_to_le32(x) | ||
25 | |||
17 | #endif /* __ASM_MACH_IP32_MANGLE_PORT_H */ | 26 | #endif /* __ASM_MACH_IP32_MANGLE_PORT_H */ |
diff --git a/include/asm-mips/mach-mips/cpu-feature-overrides.h b/include/asm-mips/mach-mips/cpu-feature-overrides.h index 9f92aed17754..e06af6c86f86 100644 --- a/include/asm-mips/mach-mips/cpu-feature-overrides.h +++ b/include/asm-mips/mach-mips/cpu-feature-overrides.h | |||
@@ -29,7 +29,11 @@ | |||
29 | /* #define cpu_has_prefetch ? */ | 29 | /* #define cpu_has_prefetch ? */ |
30 | #define cpu_has_mcheck 1 | 30 | #define cpu_has_mcheck 1 |
31 | /* #define cpu_has_ejtag ? */ | 31 | /* #define cpu_has_ejtag ? */ |
32 | #ifdef CONFIG_CPU_HAS_LLSC | ||
32 | #define cpu_has_llsc 1 | 33 | #define cpu_has_llsc 1 |
34 | #else | ||
35 | #define cpu_has_llsc 0 | ||
36 | #endif | ||
33 | /* #define cpu_has_vtag_icache ? */ | 37 | /* #define cpu_has_vtag_icache ? */ |
34 | /* #define cpu_has_dc_aliases ? */ | 38 | /* #define cpu_has_dc_aliases ? */ |
35 | /* #define cpu_has_ic_fills_f_dc ? */ | 39 | /* #define cpu_has_ic_fills_f_dc ? */ |
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h index 19cdf7642e66..61cf22588137 100644 --- a/include/asm-mips/mmu_context.h +++ b/include/asm-mips/mmu_context.h | |||
@@ -33,12 +33,7 @@ extern unsigned long pgd_current[]; | |||
33 | write_c0_context((unsigned long) smp_processor_id() << 25); \ | 33 | write_c0_context((unsigned long) smp_processor_id() << 25); \ |
34 | TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) | 34 | TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) |
35 | #endif | 35 | #endif |
36 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) | 36 | #ifdef CONFIG_64BIT |
37 | #define TLBMISS_HANDLER_SETUP() \ | ||
38 | write_c0_context((unsigned long) &pgd_current[smp_processor_id()] << 23); \ | ||
39 | TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) | ||
40 | #endif | ||
41 | #if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) | ||
42 | #define TLBMISS_HANDLER_SETUP() \ | 37 | #define TLBMISS_HANDLER_SETUP() \ |
43 | write_c0_context((unsigned long) smp_processor_id() << 26); \ | 38 | write_c0_context((unsigned long) smp_processor_id() << 26); \ |
44 | TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) | 39 | TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) |
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h index 0cff64ce0fb8..4d6bc45df594 100644 --- a/include/asm-mips/pgtable-32.h +++ b/include/asm-mips/pgtable-32.h | |||
@@ -206,7 +206,7 @@ pfn_pte(unsigned long pfn, pgprot_t prot) | |||
206 | /* fixme */ | 206 | /* fixme */ |
207 | #define pte_to_pgoff(_pte) (((_pte).pte_high >> 6) + ((_pte).pte_high & 0x3f)) | 207 | #define pte_to_pgoff(_pte) (((_pte).pte_high >> 6) + ((_pte).pte_high & 0x3f)) |
208 | #define pgoff_to_pte(off) \ | 208 | #define pgoff_to_pte(off) \ |
209 | ((pte_t){(((off) & 0x3f) + ((off) << 6) + _PAGE_FILE)}) | 209 | ((pte_t){(((off) & 0x3f) + ((off) << 6) + _PAGE_FILE)}) |
210 | 210 | ||
211 | #else | 211 | #else |
212 | #define pte_to_pgoff(_pte) \ | 212 | #define pte_to_pgoff(_pte) \ |
diff --git a/include/asm-mips/r4kcache.h b/include/asm-mips/r4kcache.h index 0bcb79a58ee9..90c374700977 100644 --- a/include/asm-mips/r4kcache.h +++ b/include/asm-mips/r4kcache.h | |||
@@ -303,5 +303,6 @@ __BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, ) | |||
303 | __BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, ) | 303 | __BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, ) |
304 | /* blast_inv_dcache_range */ | 304 | /* blast_inv_dcache_range */ |
305 | __BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, ) | 305 | __BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, ) |
306 | __BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, ) | ||
306 | 307 | ||
307 | #endif /* _ASM_R4KCACHE_H */ | 308 | #endif /* _ASM_R4KCACHE_H */ |
diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h index 6fe903e09c62..d8349e4b55ee 100644 --- a/include/asm-mips/signal.h +++ b/include/asm-mips/signal.h | |||
@@ -147,16 +147,34 @@ struct k_sigaction { | |||
147 | 147 | ||
148 | /* IRIX compatible stack_t */ | 148 | /* IRIX compatible stack_t */ |
149 | typedef struct sigaltstack { | 149 | typedef struct sigaltstack { |
150 | void *ss_sp; | 150 | void __user *ss_sp; |
151 | size_t ss_size; | 151 | size_t ss_size; |
152 | int ss_flags; | 152 | int ss_flags; |
153 | } stack_t; | 153 | } stack_t; |
154 | 154 | ||
155 | #ifdef __KERNEL__ | 155 | #ifdef __KERNEL__ |
156 | #include <asm/sigcontext.h> | 156 | #include <asm/sigcontext.h> |
157 | #include <asm/siginfo.h> | ||
157 | 158 | ||
158 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) | 159 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) |
159 | 160 | ||
161 | struct pt_regs; | ||
162 | extern void do_signal(struct pt_regs *regs); | ||
163 | extern void do_signal32(struct pt_regs *regs); | ||
164 | |||
165 | extern int setup_frame(struct k_sigaction * ka, struct pt_regs *regs, | ||
166 | int signr, sigset_t *set); | ||
167 | extern int setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs, | ||
168 | int signr, sigset_t *set, siginfo_t *info); | ||
169 | |||
170 | extern int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs, | ||
171 | int signr, sigset_t *set); | ||
172 | extern int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs, | ||
173 | int signr, sigset_t *set, siginfo_t *info); | ||
174 | |||
175 | extern int setup_rt_frame_n32(struct k_sigaction * ka, struct pt_regs *regs, | ||
176 | int signr, sigset_t *set, siginfo_t *info); | ||
177 | |||
160 | #endif /* __KERNEL__ */ | 178 | #endif /* __KERNEL__ */ |
161 | 179 | ||
162 | #endif /* _ASM_SIGNAL_H */ | 180 | #endif /* _ASM_SIGNAL_H */ |
diff --git a/include/asm-mips/sn/klconfig.h b/include/asm-mips/sn/klconfig.h index d028e28d6239..9709ff701d9b 100644 --- a/include/asm-mips/sn/klconfig.h +++ b/include/asm-mips/sn/klconfig.h | |||
@@ -99,7 +99,7 @@ typedef s32 klconf_off_t; | |||
99 | #define ENABLE_BOARD 0x01 | 99 | #define ENABLE_BOARD 0x01 |
100 | #define FAILED_BOARD 0x02 | 100 | #define FAILED_BOARD 0x02 |
101 | #define DUPLICATE_BOARD 0x04 /* Boards like midplanes/routers which | 101 | #define DUPLICATE_BOARD 0x04 /* Boards like midplanes/routers which |
102 | are discovered twice. Use one of them */ | 102 | are discovered twice. Use one of them */ |
103 | #define VISITED_BOARD 0x08 /* Used for compact hub numbering. */ | 103 | #define VISITED_BOARD 0x08 /* Used for compact hub numbering. */ |
104 | #define LOCAL_MASTER_IO6 0x10 /* master io6 for that node */ | 104 | #define LOCAL_MASTER_IO6 0x10 /* master io6 for that node */ |
105 | #define GLOBAL_MASTER_IO6 0x20 | 105 | #define GLOBAL_MASTER_IO6 0x20 |
diff --git a/include/asm-mips/sn/mapped_kernel.h b/include/asm-mips/sn/mapped_kernel.h index 3a17846df849..59edb20f8ec5 100644 --- a/include/asm-mips/sn/mapped_kernel.h +++ b/include/asm-mips/sn/mapped_kernel.h | |||
@@ -23,11 +23,7 @@ | |||
23 | #include <linux/config.h> | 23 | #include <linux/config.h> |
24 | #include <asm/addrspace.h> | 24 | #include <asm/addrspace.h> |
25 | 25 | ||
26 | #ifdef CONFIG_BUILD_ELF64 | ||
27 | #define REP_BASE CAC_BASE | 26 | #define REP_BASE CAC_BASE |
28 | #else | ||
29 | #define REP_BASE CKSEG0 | ||
30 | #endif | ||
31 | 27 | ||
32 | #ifdef CONFIG_MAPPED_KERNEL | 28 | #ifdef CONFIG_MAPPED_KERNEL |
33 | 29 | ||
diff --git a/include/asm-mips/sn/sn0/hubio.h b/include/asm-mips/sn/sn0/hubio.h index 80cf6a52ed3b..f314da21b970 100644 --- a/include/asm-mips/sn/sn0/hubio.h +++ b/include/asm-mips/sn/sn0/hubio.h | |||
@@ -229,7 +229,7 @@ typedef union hubii_ilcsr_u { | |||
229 | icsr_llp_en: 1, /* LLP enable bit */ | 229 | icsr_llp_en: 1, /* LLP enable bit */ |
230 | icsr_rsvd2: 1, /* reserver */ | 230 | icsr_rsvd2: 1, /* reserver */ |
231 | icsr_wrm_reset: 1, /* Warm reset bit */ | 231 | icsr_wrm_reset: 1, /* Warm reset bit */ |
232 | icsr_rsvd1: 2, /* Data ready offset */ | 232 | icsr_rsvd1: 2, /* Data ready offset */ |
233 | icsr_null_to: 6; /* Null timeout */ | 233 | icsr_null_to: 6; /* Null timeout */ |
234 | 234 | ||
235 | } icsr_fields_s; | 235 | } icsr_fields_s; |
@@ -274,9 +274,9 @@ typedef union io_perf_sel { | |||
274 | u64 perf_sel_reg; | 274 | u64 perf_sel_reg; |
275 | struct { | 275 | struct { |
276 | u64 perf_rsvd : 48, | 276 | u64 perf_rsvd : 48, |
277 | perf_icct : 8, | 277 | perf_icct : 8, |
278 | perf_ippr1 : 4, | 278 | perf_ippr1 : 4, |
279 | perf_ippr0 : 4; | 279 | perf_ippr0 : 4; |
280 | } perf_sel_bits; | 280 | } perf_sel_bits; |
281 | } io_perf_sel_t; | 281 | } io_perf_sel_t; |
282 | 282 | ||
@@ -287,8 +287,8 @@ typedef union io_perf_cnt { | |||
287 | u64 perf_cnt; | 287 | u64 perf_cnt; |
288 | struct { | 288 | struct { |
289 | u64 perf_rsvd1 : 32, | 289 | u64 perf_rsvd1 : 32, |
290 | perf_rsvd2 : 12, | 290 | perf_rsvd2 : 12, |
291 | perf_cnt : 20; | 291 | perf_cnt : 20; |
292 | } perf_cnt_bits; | 292 | } perf_cnt_bits; |
293 | } io_perf_cnt_t; | 293 | } io_perf_cnt_t; |
294 | 294 | ||
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h index a8919dcc93c8..2acf3e844f00 100644 --- a/include/asm-mips/stackframe.h +++ b/include/asm-mips/stackframe.h | |||
@@ -63,17 +63,7 @@ | |||
63 | addu k1, k0 | 63 | addu k1, k0 |
64 | LONG_L k1, %lo(kernelsp)(k1) | 64 | LONG_L k1, %lo(kernelsp)(k1) |
65 | #endif | 65 | #endif |
66 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) | 66 | #ifdef CONFIG_64BIT |
67 | MFC0 k1, CP0_CONTEXT | ||
68 | dsra k1, 23 | ||
69 | lui k0, %hi(pgd_current) | ||
70 | addiu k0, %lo(pgd_current) | ||
71 | dsubu k1, k0 | ||
72 | lui k0, %hi(kernelsp) | ||
73 | daddu k1, k0 | ||
74 | LONG_L k1, %lo(kernelsp)(k1) | ||
75 | #endif | ||
76 | #if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) | ||
77 | MFC0 k1, CP0_CONTEXT | 67 | MFC0 k1, CP0_CONTEXT |
78 | lui k0, %highest(kernelsp) | 68 | lui k0, %highest(kernelsp) |
79 | dsrl k1, 23 | 69 | dsrl k1, 23 |
@@ -91,11 +81,7 @@ | |||
91 | mfc0 \temp, CP0_CONTEXT | 81 | mfc0 \temp, CP0_CONTEXT |
92 | srl \temp, 23 | 82 | srl \temp, 23 |
93 | #endif | 83 | #endif |
94 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) | 84 | #ifdef CONFIG_64BIT |
95 | lw \temp, TI_CPU(gp) | ||
96 | dsll \temp, 3 | ||
97 | #endif | ||
98 | #if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) | ||
99 | MFC0 \temp, CP0_CONTEXT | 85 | MFC0 \temp, CP0_CONTEXT |
100 | dsrl \temp, 23 | 86 | dsrl \temp, 23 |
101 | #endif | 87 | #endif |
@@ -103,7 +89,7 @@ | |||
103 | .endm | 89 | .endm |
104 | #else | 90 | #else |
105 | .macro get_saved_sp /* Uniprocessor variation */ | 91 | .macro get_saved_sp /* Uniprocessor variation */ |
106 | #if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) | 92 | #ifdef CONFIG_64BIT |
107 | lui k1, %highest(kernelsp) | 93 | lui k1, %highest(kernelsp) |
108 | daddiu k1, %higher(kernelsp) | 94 | daddiu k1, %higher(kernelsp) |
109 | dsll k1, k1, 16 | 95 | dsll k1, k1, 16 |
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index ddae9bae31af..4097fac5ac3c 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -286,10 +286,10 @@ extern void __xchg_called_with_bad_pointer(void); | |||
286 | static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) | 286 | static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) |
287 | { | 287 | { |
288 | switch (size) { | 288 | switch (size) { |
289 | case 4: | 289 | case 4: |
290 | return __xchg_u32(ptr, x); | 290 | return __xchg_u32(ptr, x); |
291 | case 8: | 291 | case 8: |
292 | return __xchg_u64(ptr, x); | 292 | return __xchg_u64(ptr, x); |
293 | } | 293 | } |
294 | __xchg_called_with_bad_pointer(); | 294 | __xchg_called_with_bad_pointer(); |
295 | return x; | 295 | return x; |
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h index fa193f861e71..f8d97dafd2f4 100644 --- a/include/asm-mips/thread_info.h +++ b/include/asm-mips/thread_info.h | |||
@@ -31,7 +31,7 @@ struct thread_info { | |||
31 | int preempt_count; /* 0 => preemptable, <0 => BUG */ | 31 | int preempt_count; /* 0 => preemptable, <0 => BUG */ |
32 | 32 | ||
33 | mm_segment_t addr_limit; /* thread address space: | 33 | mm_segment_t addr_limit; /* thread address space: |
34 | 0-0xBFFFFFFF for user-thead | 34 | 0-0xBFFFFFFF for user-thead |
35 | 0-0xFFFFFFFF for kernel-thread | 35 | 0-0xFFFFFFFF for kernel-thread |
36 | */ | 36 | */ |
37 | struct restart_block restart_block; | 37 | struct restart_block restart_block; |
diff --git a/include/asm-sparc/socket.h b/include/asm-sparc/socket.h index 09575b608adb..4e0ce3a35ea9 100644 --- a/include/asm-sparc/socket.h +++ b/include/asm-sparc/socket.h | |||
@@ -47,7 +47,7 @@ | |||
47 | #define SO_TIMESTAMP 0x001d | 47 | #define SO_TIMESTAMP 0x001d |
48 | #define SCM_TIMESTAMP SO_TIMESTAMP | 48 | #define SCM_TIMESTAMP SO_TIMESTAMP |
49 | 49 | ||
50 | #define SO_PEERSEC 0x100e | 50 | #define SO_PEERSEC 0x001e |
51 | 51 | ||
52 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | 52 | /* Security levels - as per NRL IPv6 - don't actually do anything */ |
53 | #define SO_SECURITY_AUTHENTICATION 0x5001 | 53 | #define SO_SECURITY_AUTHENTICATION 0x5001 |
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h index 6b8d73dc1ab0..9cf64b1b688b 100644 --- a/include/linux/amba/clcd.h +++ b/include/linux/amba/clcd.h | |||
@@ -54,6 +54,7 @@ | |||
54 | #define CNTL_LCDBPP4 (2 << 1) | 54 | #define CNTL_LCDBPP4 (2 << 1) |
55 | #define CNTL_LCDBPP8 (3 << 1) | 55 | #define CNTL_LCDBPP8 (3 << 1) |
56 | #define CNTL_LCDBPP16 (4 << 1) | 56 | #define CNTL_LCDBPP16 (4 << 1) |
57 | #define CNTL_LCDBPP16_565 (6 << 1) | ||
57 | #define CNTL_LCDBPP24 (5 << 1) | 58 | #define CNTL_LCDBPP24 (5 << 1) |
58 | #define CNTL_LCDBW (1 << 4) | 59 | #define CNTL_LCDBW (1 << 4) |
59 | #define CNTL_LCDTFT (1 << 5) | 60 | #define CNTL_LCDTFT (1 << 5) |
@@ -209,7 +210,16 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) | |||
209 | val |= CNTL_LCDBPP8; | 210 | val |= CNTL_LCDBPP8; |
210 | break; | 211 | break; |
211 | case 16: | 212 | case 16: |
212 | val |= CNTL_LCDBPP16; | 213 | /* |
214 | * PL110 cannot choose between 5551 and 565 modes in | ||
215 | * its control register | ||
216 | */ | ||
217 | if ((fb->dev->periphid & 0x000fffff) == 0x00041110) | ||
218 | val |= CNTL_LCDBPP16; | ||
219 | else if (fb->fb.var.green.length == 5) | ||
220 | val |= CNTL_LCDBPP16; | ||
221 | else | ||
222 | val |= CNTL_LCDBPP16_565; | ||
213 | break; | 223 | break; |
214 | case 32: | 224 | case 32: |
215 | val |= CNTL_LCDBPP24; | 225 | val |= CNTL_LCDBPP24; |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 94f77cce27fa..b02a16c435e7 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -267,6 +267,16 @@ struct ata_taskfile { | |||
267 | ((u64) (id)[(n) + 1] << 16) | \ | 267 | ((u64) (id)[(n) + 1] << 16) | \ |
268 | ((u64) (id)[(n) + 0]) ) | 268 | ((u64) (id)[(n) + 0]) ) |
269 | 269 | ||
270 | static inline unsigned int ata_id_major_version(const u16 *id) | ||
271 | { | ||
272 | unsigned int mver; | ||
273 | |||
274 | for (mver = 14; mver >= 1; mver--) | ||
275 | if (id[ATA_ID_MAJOR_VER] & (1 << mver)) | ||
276 | break; | ||
277 | return mver; | ||
278 | } | ||
279 | |||
270 | static inline int ata_id_current_chs_valid(const u16 *id) | 280 | static inline int ata_id_current_chs_valid(const u16 *id) |
271 | { | 281 | { |
272 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 282 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
@@ -302,4 +312,16 @@ static inline int ata_ok(u8 status) | |||
302 | == ATA_DRDY); | 312 | == ATA_DRDY); |
303 | } | 313 | } |
304 | 314 | ||
315 | static inline int lba_28_ok(u64 block, u32 n_block) | ||
316 | { | ||
317 | /* check the ending block number */ | ||
318 | return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256); | ||
319 | } | ||
320 | |||
321 | static inline int lba_48_ok(u64 block, u32 n_block) | ||
322 | { | ||
323 | /* check the ending block number */ | ||
324 | return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536); | ||
325 | } | ||
326 | |||
305 | #endif /* __LINUX_ATA_H__ */ | 327 | #endif /* __LINUX_ATA_H__ */ |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 0ed1d4853c69..d612b89dce33 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -32,7 +32,7 @@ struct cpu { | |||
32 | }; | 32 | }; |
33 | 33 | ||
34 | extern int register_cpu(struct cpu *, int, struct node *); | 34 | extern int register_cpu(struct cpu *, int, struct node *); |
35 | extern struct sys_device *get_cpu_sysdev(int cpu); | 35 | extern struct sys_device *get_cpu_sysdev(unsigned cpu); |
36 | #ifdef CONFIG_HOTPLUG_CPU | 36 | #ifdef CONFIG_HOTPLUG_CPU |
37 | extern void unregister_cpu(struct cpu *, struct node *); | 37 | extern void unregister_cpu(struct cpu *, struct node *); |
38 | #endif | 38 | #endif |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index d88bf8aa8b47..0ab1bc1152ca 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -229,6 +229,8 @@ struct crypto_tfm { | |||
229 | } crt_u; | 229 | } crt_u; |
230 | 230 | ||
231 | struct crypto_alg *__crt_alg; | 231 | struct crypto_alg *__crt_alg; |
232 | |||
233 | char __crt_ctx[] __attribute__ ((__aligned__)); | ||
232 | }; | 234 | }; |
233 | 235 | ||
234 | /* | 236 | /* |
@@ -301,7 +303,13 @@ static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm) | |||
301 | 303 | ||
302 | static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) | 304 | static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) |
303 | { | 305 | { |
304 | return (void *)&tfm[1]; | 306 | return tfm->__crt_ctx; |
307 | } | ||
308 | |||
309 | static inline unsigned int crypto_tfm_ctx_alignment(void) | ||
310 | { | ||
311 | struct crypto_tfm *tfm; | ||
312 | return __alignof__(tfm->__crt_ctx); | ||
305 | } | 313 | } |
306 | 314 | ||
307 | /* | 315 | /* |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 088529f54965..676333b9fad0 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -18,7 +18,7 @@ | |||
18 | * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x | 18 | * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x |
19 | */ | 19 | */ |
20 | struct dccp_hdr { | 20 | struct dccp_hdr { |
21 | __u16 dccph_sport, | 21 | __be16 dccph_sport, |
22 | dccph_dport; | 22 | dccph_dport; |
23 | __u8 dccph_doff; | 23 | __u8 dccph_doff; |
24 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 24 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
@@ -32,18 +32,18 @@ struct dccp_hdr { | |||
32 | #endif | 32 | #endif |
33 | __u16 dccph_checksum; | 33 | __u16 dccph_checksum; |
34 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 34 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
35 | __u32 dccph_x:1, | 35 | __u8 dccph_x:1, |
36 | dccph_type:4, | 36 | dccph_type:4, |
37 | dccph_reserved:3, | 37 | dccph_reserved:3; |
38 | dccph_seq:24; | ||
39 | #elif defined(__BIG_ENDIAN_BITFIELD) | 38 | #elif defined(__BIG_ENDIAN_BITFIELD) |
40 | __u32 dccph_reserved:3, | 39 | __u8 dccph_reserved:3, |
41 | dccph_type:4, | 40 | dccph_type:4, |
42 | dccph_x:1, | 41 | dccph_x:1; |
43 | dccph_seq:24; | ||
44 | #else | 42 | #else |
45 | #error "Adjust your <asm/byteorder.h> defines" | 43 | #error "Adjust your <asm/byteorder.h> defines" |
46 | #endif | 44 | #endif |
45 | __u8 dccph_seq2; | ||
46 | __be16 dccph_seq; | ||
47 | }; | 47 | }; |
48 | 48 | ||
49 | /** | 49 | /** |
@@ -52,7 +52,7 @@ struct dccp_hdr { | |||
52 | * @dccph_seq_low - low 24 bits of a 48 bit seq packet | 52 | * @dccph_seq_low - low 24 bits of a 48 bit seq packet |
53 | */ | 53 | */ |
54 | struct dccp_hdr_ext { | 54 | struct dccp_hdr_ext { |
55 | __u32 dccph_seq_low; | 55 | __be32 dccph_seq_low; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | /** | 58 | /** |
@@ -62,7 +62,7 @@ struct dccp_hdr_ext { | |||
62 | * @dccph_req_options - list of options (must be a multiple of 32 bits | 62 | * @dccph_req_options - list of options (must be a multiple of 32 bits |
63 | */ | 63 | */ |
64 | struct dccp_hdr_request { | 64 | struct dccp_hdr_request { |
65 | __u32 dccph_req_service; | 65 | __be32 dccph_req_service; |
66 | }; | 66 | }; |
67 | /** | 67 | /** |
68 | * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets | 68 | * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets |
@@ -71,9 +71,9 @@ struct dccp_hdr_request { | |||
71 | * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR | 71 | * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR |
72 | */ | 72 | */ |
73 | struct dccp_hdr_ack_bits { | 73 | struct dccp_hdr_ack_bits { |
74 | __u32 dccph_reserved1:8, | 74 | __be16 dccph_reserved1; |
75 | dccph_ack_nr_high:24; | 75 | __be16 dccph_ack_nr_high; |
76 | __u32 dccph_ack_nr_low; | 76 | __be32 dccph_ack_nr_low; |
77 | }; | 77 | }; |
78 | /** | 78 | /** |
79 | * struct dccp_hdr_response - Conection initiation response header | 79 | * struct dccp_hdr_response - Conection initiation response header |
@@ -85,7 +85,7 @@ struct dccp_hdr_ack_bits { | |||
85 | */ | 85 | */ |
86 | struct dccp_hdr_response { | 86 | struct dccp_hdr_response { |
87 | struct dccp_hdr_ack_bits dccph_resp_ack; | 87 | struct dccp_hdr_ack_bits dccph_resp_ack; |
88 | __u32 dccph_resp_service; | 88 | __be32 dccph_resp_service; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | /** | 91 | /** |
@@ -154,6 +154,10 @@ enum { | |||
154 | DCCPO_MANDATORY = 1, | 154 | DCCPO_MANDATORY = 1, |
155 | DCCPO_MIN_RESERVED = 3, | 155 | DCCPO_MIN_RESERVED = 3, |
156 | DCCPO_MAX_RESERVED = 31, | 156 | DCCPO_MAX_RESERVED = 31, |
157 | DCCPO_CHANGE_L = 32, | ||
158 | DCCPO_CONFIRM_L = 33, | ||
159 | DCCPO_CHANGE_R = 34, | ||
160 | DCCPO_CONFIRM_R = 35, | ||
157 | DCCPO_NDP_COUNT = 37, | 161 | DCCPO_NDP_COUNT = 37, |
158 | DCCPO_ACK_VECTOR_0 = 38, | 162 | DCCPO_ACK_VECTOR_0 = 38, |
159 | DCCPO_ACK_VECTOR_1 = 39, | 163 | DCCPO_ACK_VECTOR_1 = 39, |
@@ -168,7 +172,9 @@ enum { | |||
168 | /* DCCP features */ | 172 | /* DCCP features */ |
169 | enum { | 173 | enum { |
170 | DCCPF_RESERVED = 0, | 174 | DCCPF_RESERVED = 0, |
175 | DCCPF_CCID = 1, | ||
171 | DCCPF_SEQUENCE_WINDOW = 3, | 176 | DCCPF_SEQUENCE_WINDOW = 3, |
177 | DCCPF_ACK_RATIO = 5, | ||
172 | DCCPF_SEND_ACK_VECTOR = 6, | 178 | DCCPF_SEND_ACK_VECTOR = 6, |
173 | DCCPF_SEND_NDP_COUNT = 7, | 179 | DCCPF_SEND_NDP_COUNT = 7, |
174 | /* 10-127 reserved */ | 180 | /* 10-127 reserved */ |
@@ -176,9 +182,18 @@ enum { | |||
176 | DCCPF_MAX_CCID_SPECIFIC = 255, | 182 | DCCPF_MAX_CCID_SPECIFIC = 255, |
177 | }; | 183 | }; |
178 | 184 | ||
185 | /* this structure is argument to DCCP_SOCKOPT_CHANGE_X */ | ||
186 | struct dccp_so_feat { | ||
187 | __u8 dccpsf_feat; | ||
188 | __u8 *dccpsf_val; | ||
189 | __u8 dccpsf_len; | ||
190 | }; | ||
191 | |||
179 | /* DCCP socket options */ | 192 | /* DCCP socket options */ |
180 | #define DCCP_SOCKOPT_PACKET_SIZE 1 | 193 | #define DCCP_SOCKOPT_PACKET_SIZE 1 |
181 | #define DCCP_SOCKOPT_SERVICE 2 | 194 | #define DCCP_SOCKOPT_SERVICE 2 |
195 | #define DCCP_SOCKOPT_CHANGE_L 3 | ||
196 | #define DCCP_SOCKOPT_CHANGE_R 4 | ||
182 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 | 197 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 |
183 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 | 198 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 |
184 | 199 | ||
@@ -254,16 +269,12 @@ static inline unsigned int dccp_basic_hdr_len(const struct sk_buff *skb) | |||
254 | static inline __u64 dccp_hdr_seq(const struct sk_buff *skb) | 269 | static inline __u64 dccp_hdr_seq(const struct sk_buff *skb) |
255 | { | 270 | { |
256 | const struct dccp_hdr *dh = dccp_hdr(skb); | 271 | const struct dccp_hdr *dh = dccp_hdr(skb); |
257 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 272 | __u64 seq_nr = ntohs(dh->dccph_seq); |
258 | __u64 seq_nr = ntohl(dh->dccph_seq << 8); | ||
259 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
260 | __u64 seq_nr = ntohl(dh->dccph_seq); | ||
261 | #else | ||
262 | #error "Adjust your <asm/byteorder.h> defines" | ||
263 | #endif | ||
264 | 273 | ||
265 | if (dh->dccph_x != 0) | 274 | if (dh->dccph_x != 0) |
266 | seq_nr = (seq_nr << 32) + ntohl(dccp_hdrx(skb)->dccph_seq_low); | 275 | seq_nr = (seq_nr << 32) + ntohl(dccp_hdrx(skb)->dccph_seq_low); |
276 | else | ||
277 | seq_nr += (u32)dh->dccph_seq2 << 16; | ||
267 | 278 | ||
268 | return seq_nr; | 279 | return seq_nr; |
269 | } | 280 | } |
@@ -281,13 +292,7 @@ static inline struct dccp_hdr_ack_bits *dccp_hdr_ack_bits(const struct sk_buff * | |||
281 | static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) | 292 | static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) |
282 | { | 293 | { |
283 | const struct dccp_hdr_ack_bits *dhack = dccp_hdr_ack_bits(skb); | 294 | const struct dccp_hdr_ack_bits *dhack = dccp_hdr_ack_bits(skb); |
284 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 295 | return ((u64)ntohs(dhack->dccph_ack_nr_high) << 32) + ntohl(dhack->dccph_ack_nr_low); |
285 | return (((u64)ntohl(dhack->dccph_ack_nr_high << 8)) << 32) + ntohl(dhack->dccph_ack_nr_low); | ||
286 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
287 | return (((u64)ntohl(dhack->dccph_ack_nr_high)) << 32) + ntohl(dhack->dccph_ack_nr_low); | ||
288 | #else | ||
289 | #error "Adjust your <asm/byteorder.h> defines" | ||
290 | #endif | ||
291 | } | 296 | } |
292 | 297 | ||
293 | static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb) | 298 | static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb) |
@@ -314,38 +319,60 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb) | |||
314 | 319 | ||
315 | /* initial values for each feature */ | 320 | /* initial values for each feature */ |
316 | #define DCCPF_INITIAL_SEQUENCE_WINDOW 100 | 321 | #define DCCPF_INITIAL_SEQUENCE_WINDOW 100 |
317 | /* FIXME: for now we're using CCID 3 (TFRC) */ | 322 | #define DCCPF_INITIAL_ACK_RATIO 2 |
318 | #define DCCPF_INITIAL_CCID 3 | 323 | #define DCCPF_INITIAL_CCID 2 |
319 | #define DCCPF_INITIAL_SEND_ACK_VECTOR 0 | 324 | #define DCCPF_INITIAL_SEND_ACK_VECTOR 1 |
320 | /* FIXME: for now we're default to 1 but it should really be 0 */ | 325 | /* FIXME: for now we're default to 1 but it should really be 0 */ |
321 | #define DCCPF_INITIAL_SEND_NDP_COUNT 1 | 326 | #define DCCPF_INITIAL_SEND_NDP_COUNT 1 |
322 | 327 | ||
323 | #define DCCP_NDP_LIMIT 0xFFFFFF | 328 | #define DCCP_NDP_LIMIT 0xFFFFFF |
324 | 329 | ||
325 | /** | 330 | /** |
326 | * struct dccp_options - option values for a DCCP connection | 331 | * struct dccp_minisock - Minimal DCCP connection representation |
327 | * @dccpo_sequence_window - Sequence Window Feature (section 7.5.2) | 332 | * |
328 | * @dccpo_ccid - Congestion Control Id (CCID) (section 10) | 333 | * Will be used to pass the state from dccp_request_sock to dccp_sock. |
329 | * @dccpo_send_ack_vector - Send Ack Vector Feature (section 11.5) | 334 | * |
330 | * @dccpo_send_ndp_count - Send NDP Count Feature (7.7.2) | 335 | * @dccpms_sequence_window - Sequence Window Feature (section 7.5.2) |
336 | * @dccpms_ccid - Congestion Control Id (CCID) (section 10) | ||
337 | * @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5) | ||
338 | * @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2) | ||
331 | */ | 339 | */ |
332 | struct dccp_options { | 340 | struct dccp_minisock { |
333 | __u64 dccpo_sequence_window; | 341 | __u64 dccpms_sequence_window; |
334 | __u8 dccpo_rx_ccid; | 342 | __u8 dccpms_rx_ccid; |
335 | __u8 dccpo_tx_ccid; | 343 | __u8 dccpms_tx_ccid; |
336 | __u8 dccpo_send_ack_vector; | 344 | __u8 dccpms_send_ack_vector; |
337 | __u8 dccpo_send_ndp_count; | 345 | __u8 dccpms_send_ndp_count; |
346 | __u8 dccpms_ack_ratio; | ||
347 | struct list_head dccpms_pending; | ||
348 | struct list_head dccpms_conf; | ||
349 | }; | ||
350 | |||
351 | struct dccp_opt_conf { | ||
352 | __u8 *dccpoc_val; | ||
353 | __u8 dccpoc_len; | ||
354 | }; | ||
355 | |||
356 | struct dccp_opt_pend { | ||
357 | struct list_head dccpop_node; | ||
358 | __u8 dccpop_type; | ||
359 | __u8 dccpop_feat; | ||
360 | __u8 *dccpop_val; | ||
361 | __u8 dccpop_len; | ||
362 | int dccpop_conf; | ||
363 | struct dccp_opt_conf *dccpop_sc; | ||
338 | }; | 364 | }; |
339 | 365 | ||
340 | extern void __dccp_options_init(struct dccp_options *dccpo); | 366 | extern void __dccp_minisock_init(struct dccp_minisock *dmsk); |
341 | extern void dccp_options_init(struct dccp_options *dccpo); | 367 | extern void dccp_minisock_init(struct dccp_minisock *dmsk); |
368 | |||
342 | extern int dccp_parse_options(struct sock *sk, struct sk_buff *skb); | 369 | extern int dccp_parse_options(struct sock *sk, struct sk_buff *skb); |
343 | 370 | ||
344 | struct dccp_request_sock { | 371 | struct dccp_request_sock { |
345 | struct inet_request_sock dreq_inet_rsk; | 372 | struct inet_request_sock dreq_inet_rsk; |
346 | __u64 dreq_iss; | 373 | __u64 dreq_iss; |
347 | __u64 dreq_isr; | 374 | __u64 dreq_isr; |
348 | __u32 dreq_service; | 375 | __be32 dreq_service; |
349 | }; | 376 | }; |
350 | 377 | ||
351 | static inline struct dccp_request_sock *dccp_rsk(const struct request_sock *req) | 378 | static inline struct dccp_request_sock *dccp_rsk(const struct request_sock *req) |
@@ -373,13 +400,13 @@ enum dccp_role { | |||
373 | 400 | ||
374 | struct dccp_service_list { | 401 | struct dccp_service_list { |
375 | __u32 dccpsl_nr; | 402 | __u32 dccpsl_nr; |
376 | __u32 dccpsl_list[0]; | 403 | __be32 dccpsl_list[0]; |
377 | }; | 404 | }; |
378 | 405 | ||
379 | #define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) | 406 | #define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) |
380 | 407 | ||
381 | static inline int dccp_list_has_service(const struct dccp_service_list *sl, | 408 | static inline int dccp_list_has_service(const struct dccp_service_list *sl, |
382 | const u32 service) | 409 | const __be32 service) |
383 | { | 410 | { |
384 | if (likely(sl != NULL)) { | 411 | if (likely(sl != NULL)) { |
385 | u32 i = sl->dccpsl_nr; | 412 | u32 i = sl->dccpsl_nr; |
@@ -425,17 +452,17 @@ struct dccp_sock { | |||
425 | __u64 dccps_gss; | 452 | __u64 dccps_gss; |
426 | __u64 dccps_gsr; | 453 | __u64 dccps_gsr; |
427 | __u64 dccps_gar; | 454 | __u64 dccps_gar; |
428 | __u32 dccps_service; | 455 | __be32 dccps_service; |
429 | struct dccp_service_list *dccps_service_list; | 456 | struct dccp_service_list *dccps_service_list; |
430 | struct timeval dccps_timestamp_time; | 457 | struct timeval dccps_timestamp_time; |
431 | __u32 dccps_timestamp_echo; | 458 | __u32 dccps_timestamp_echo; |
432 | __u32 dccps_packet_size; | 459 | __u32 dccps_packet_size; |
460 | __u16 dccps_l_ack_ratio; | ||
461 | __u16 dccps_r_ack_ratio; | ||
433 | unsigned long dccps_ndp_count; | 462 | unsigned long dccps_ndp_count; |
434 | __u32 dccps_mss_cache; | 463 | __u32 dccps_mss_cache; |
435 | struct dccp_options dccps_options; | 464 | struct dccp_minisock dccps_minisock; |
436 | struct dccp_ackvec *dccps_hc_rx_ackvec; | 465 | struct dccp_ackvec *dccps_hc_rx_ackvec; |
437 | void *dccps_hc_rx_ccid_private; | ||
438 | void *dccps_hc_tx_ccid_private; | ||
439 | struct ccid *dccps_hc_rx_ccid; | 466 | struct ccid *dccps_hc_rx_ccid; |
440 | struct ccid *dccps_hc_tx_ccid; | 467 | struct ccid *dccps_hc_tx_ccid; |
441 | struct dccp_options_received dccps_options_received; | 468 | struct dccp_options_received dccps_options_received; |
@@ -450,6 +477,11 @@ static inline struct dccp_sock *dccp_sk(const struct sock *sk) | |||
450 | return (struct dccp_sock *)sk; | 477 | return (struct dccp_sock *)sk; |
451 | } | 478 | } |
452 | 479 | ||
480 | static inline struct dccp_minisock *dccp_msk(const struct sock *sk) | ||
481 | { | ||
482 | return (struct dccp_minisock *)&dccp_sk(sk)->dccps_minisock; | ||
483 | } | ||
484 | |||
453 | static inline int dccp_service_not_initialized(const struct sock *sk) | 485 | static inline int dccp_service_not_initialized(const struct sock *sk) |
454 | { | 486 | { |
455 | return dccp_sk(sk)->dccps_service == DCCP_SERVICE_INVALID_VALUE; | 487 | return dccp_sk(sk)->dccps_service == DCCP_SERVICE_INVALID_VALUE; |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index a5fa6a6eede8..4b0428e335be 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -21,6 +21,11 @@ | |||
21 | 21 | ||
22 | struct file_operations; | 22 | struct file_operations; |
23 | 23 | ||
24 | struct debugfs_blob_wrapper { | ||
25 | void *data; | ||
26 | unsigned long size; | ||
27 | }; | ||
28 | |||
24 | #if defined(CONFIG_DEBUG_FS) | 29 | #if defined(CONFIG_DEBUG_FS) |
25 | struct dentry *debugfs_create_file(const char *name, mode_t mode, | 30 | struct dentry *debugfs_create_file(const char *name, mode_t mode, |
26 | struct dentry *parent, void *data, | 31 | struct dentry *parent, void *data, |
@@ -39,6 +44,9 @@ struct dentry *debugfs_create_u32(const char *name, mode_t mode, | |||
39 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, | 44 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, |
40 | struct dentry *parent, u32 *value); | 45 | struct dentry *parent, u32 *value); |
41 | 46 | ||
47 | struct dentry *debugfs_create_blob(const char *name, mode_t mode, | ||
48 | struct dentry *parent, | ||
49 | struct debugfs_blob_wrapper *blob); | ||
42 | #else | 50 | #else |
43 | 51 | ||
44 | #include <linux/err.h> | 52 | #include <linux/err.h> |
@@ -94,6 +102,13 @@ static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, | |||
94 | return ERR_PTR(-ENODEV); | 102 | return ERR_PTR(-ENODEV); |
95 | } | 103 | } |
96 | 104 | ||
105 | static inline struct dentry *debugfs_create_blob(const char *name, mode_t mode, | ||
106 | struct dentry *parent, | ||
107 | struct debugfs_blob_wrapper *blob) | ||
108 | { | ||
109 | return ERR_PTR(-ENODEV); | ||
110 | } | ||
111 | |||
97 | #endif | 112 | #endif |
98 | 113 | ||
99 | #endif | 114 | #endif |
diff --git a/include/linux/device.h b/include/linux/device.h index 58df18d9cd3e..5b595fdfb672 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -424,6 +424,8 @@ extern void firmware_unregister(struct subsystem *); | |||
424 | dev_printk(KERN_INFO , dev , format , ## arg) | 424 | dev_printk(KERN_INFO , dev , format , ## arg) |
425 | #define dev_warn(dev, format, arg...) \ | 425 | #define dev_warn(dev, format, arg...) \ |
426 | dev_printk(KERN_WARNING , dev , format , ## arg) | 426 | dev_printk(KERN_WARNING , dev , format , ## arg) |
427 | #define dev_notice(dev, format, arg...) \ | ||
428 | dev_printk(KERN_NOTICE , dev , format , ## arg) | ||
427 | 429 | ||
428 | /* Create alias, so I can be autoloaded. */ | 430 | /* Create alias, so I can be autoloaded. */ |
429 | #define MODULE_ALIAS_CHARDEV(major,minor) \ | 431 | #define MODULE_ALIAS_CHARDEV(major,minor) \ |
diff --git a/include/linux/dn.h b/include/linux/dn.h index 782cae49e64c..10b6a6fd5837 100644 --- a/include/linux/dn.h +++ b/include/linux/dn.h | |||
@@ -71,17 +71,17 @@ | |||
71 | 71 | ||
72 | struct dn_naddr | 72 | struct dn_naddr |
73 | { | 73 | { |
74 | unsigned short a_len; | 74 | __le16 a_len; |
75 | unsigned char a_addr[DN_MAXADDL]; | 75 | __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */ |
76 | }; | 76 | }; |
77 | 77 | ||
78 | struct sockaddr_dn | 78 | struct sockaddr_dn |
79 | { | 79 | { |
80 | unsigned short sdn_family; | 80 | __u16 sdn_family; |
81 | unsigned char sdn_flags; | 81 | __u8 sdn_flags; |
82 | unsigned char sdn_objnum; | 82 | __u8 sdn_objnum; |
83 | unsigned short sdn_objnamel; | 83 | __le16 sdn_objnamel; |
84 | unsigned char sdn_objname[DN_MAXOBJL]; | 84 | __u8 sdn_objname[DN_MAXOBJL]; |
85 | struct dn_naddr sdn_add; | 85 | struct dn_naddr sdn_add; |
86 | }; | 86 | }; |
87 | #define sdn_nodeaddrl sdn_add.a_len /* Node address length */ | 87 | #define sdn_nodeaddrl sdn_add.a_len /* Node address length */ |
@@ -93,38 +93,38 @@ struct sockaddr_dn | |||
93 | * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure | 93 | * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure |
94 | */ | 94 | */ |
95 | struct optdata_dn { | 95 | struct optdata_dn { |
96 | unsigned short opt_status; /* Extended status return */ | 96 | __le16 opt_status; /* Extended status return */ |
97 | #define opt_sts opt_status | 97 | #define opt_sts opt_status |
98 | unsigned short opt_optl; /* Length of user data */ | 98 | __le16 opt_optl; /* Length of user data */ |
99 | unsigned char opt_data[16]; /* User data */ | 99 | __u8 opt_data[16]; /* User data */ |
100 | }; | 100 | }; |
101 | 101 | ||
102 | struct accessdata_dn | 102 | struct accessdata_dn |
103 | { | 103 | { |
104 | unsigned char acc_accl; | 104 | __u8 acc_accl; |
105 | unsigned char acc_acc[DN_MAXACCL]; | 105 | __u8 acc_acc[DN_MAXACCL]; |
106 | unsigned char acc_passl; | 106 | __u8 acc_passl; |
107 | unsigned char acc_pass[DN_MAXACCL]; | 107 | __u8 acc_pass[DN_MAXACCL]; |
108 | unsigned char acc_userl; | 108 | __u8 acc_userl; |
109 | unsigned char acc_user[DN_MAXACCL]; | 109 | __u8 acc_user[DN_MAXACCL]; |
110 | }; | 110 | }; |
111 | 111 | ||
112 | /* | 112 | /* |
113 | * DECnet logical link information structure | 113 | * DECnet logical link information structure |
114 | */ | 114 | */ |
115 | struct linkinfo_dn { | 115 | struct linkinfo_dn { |
116 | unsigned short idn_segsize; /* Segment size for link */ | 116 | __le16 idn_segsize; /* Segment size for link */ |
117 | unsigned char idn_linkstate; /* Logical link state */ | 117 | __u8 idn_linkstate; /* Logical link state */ |
118 | }; | 118 | }; |
119 | 119 | ||
120 | /* | 120 | /* |
121 | * Ethernet address format (for DECnet) | 121 | * Ethernet address format (for DECnet) |
122 | */ | 122 | */ |
123 | union etheraddress { | 123 | union etheraddress { |
124 | unsigned char dne_addr[6]; /* Full ethernet address */ | 124 | __u8 dne_addr[6]; /* Full ethernet address */ |
125 | struct { | 125 | struct { |
126 | unsigned char dne_hiord[4]; /* DECnet HIORD prefix */ | 126 | __u8 dne_hiord[4]; /* DECnet HIORD prefix */ |
127 | unsigned char dne_nodeaddr[2]; /* DECnet node address */ | 127 | __u8 dne_nodeaddr[2]; /* DECnet node address */ |
128 | } dne_remote; | 128 | } dne_remote; |
129 | }; | 129 | }; |
130 | 130 | ||
@@ -133,7 +133,7 @@ union etheraddress { | |||
133 | * DECnet physical socket address format | 133 | * DECnet physical socket address format |
134 | */ | 134 | */ |
135 | struct dn_addr { | 135 | struct dn_addr { |
136 | unsigned short dna_family; /* AF_DECnet */ | 136 | __le16 dna_family; /* AF_DECnet */ |
137 | union etheraddress dna_netaddr; /* DECnet ethernet address */ | 137 | union etheraddress dna_netaddr; /* DECnet ethernet address */ |
138 | }; | 138 | }; |
139 | 139 | ||
diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h index 2b8797084685..0874a67c6b92 100644 --- a/include/linux/dvb/audio.h +++ b/include/linux/dvb/audio.h | |||
@@ -121,4 +121,17 @@ typedef uint16_t audio_attributes_t; | |||
121 | #define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audio_attributes_t) | 121 | #define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audio_attributes_t) |
122 | #define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t) | 122 | #define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t) |
123 | 123 | ||
124 | /** | ||
125 | * AUDIO_GET_PTS | ||
126 | * | ||
127 | * Read the 33 bit presentation time stamp as defined | ||
128 | * in ITU T-REC-H.222.0 / ISO/IEC 13818-1. | ||
129 | * | ||
130 | * The PTS should belong to the currently played | ||
131 | * frame if possible, but may also be a value close to it | ||
132 | * like the PTS of the last decoded frame or the last PTS | ||
133 | * extracted by the PES parser. | ||
134 | */ | ||
135 | #define AUDIO_GET_PTS _IOR('o', 19, __u64) | ||
136 | |||
124 | #endif /* _DVBAUDIO_H_ */ | 137 | #endif /* _DVBAUDIO_H_ */ |
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h index b81e58b2ebf8..faebfda397ff 100644 --- a/include/linux/dvb/video.h +++ b/include/linux/dvb/video.h | |||
@@ -200,4 +200,17 @@ typedef uint16_t video_attributes_t; | |||
200 | #define VIDEO_GET_SIZE _IOR('o', 55, video_size_t) | 200 | #define VIDEO_GET_SIZE _IOR('o', 55, video_size_t) |
201 | #define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int) | 201 | #define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int) |
202 | 202 | ||
203 | /** | ||
204 | * VIDEO_GET_PTS | ||
205 | * | ||
206 | * Read the 33 bit presentation time stamp as defined | ||
207 | * in ITU T-REC-H.222.0 / ISO/IEC 13818-1. | ||
208 | * | ||
209 | * The PTS should belong to the currently played | ||
210 | * frame if possible, but may also be a value close to it | ||
211 | * like the PTS of the last decoded frame or the last PTS | ||
212 | * extracted by the PES parser. | ||
213 | */ | ||
214 | #define VIDEO_GET_PTS _IOR('o', 57, __u64) | ||
215 | |||
203 | #endif /*_DVBVIDEO_H_*/ | 216 | #endif /*_DVBVIDEO_H_*/ |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index a9f1cfd096ff..a3a0e078f79d 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -83,5 +83,32 @@ struct fsl_i2c_platform_data { | |||
83 | #define FSL_I2C_DEV_SEPARATE_DFSRR 0x00000001 | 83 | #define FSL_I2C_DEV_SEPARATE_DFSRR 0x00000001 |
84 | #define FSL_I2C_DEV_CLOCK_5200 0x00000002 | 84 | #define FSL_I2C_DEV_CLOCK_5200 0x00000002 |
85 | 85 | ||
86 | |||
87 | enum fsl_usb2_operating_modes { | ||
88 | FSL_USB2_MPH_HOST, | ||
89 | FSL_USB2_DR_HOST, | ||
90 | FSL_USB2_DR_DEVICE, | ||
91 | FSL_USB2_DR_OTG, | ||
92 | }; | ||
93 | |||
94 | enum fsl_usb2_phy_modes { | ||
95 | FSL_USB2_PHY_NONE, | ||
96 | FSL_USB2_PHY_ULPI, | ||
97 | FSL_USB2_PHY_UTMI, | ||
98 | FSL_USB2_PHY_UTMI_WIDE, | ||
99 | FSL_USB2_PHY_SERIAL, | ||
100 | }; | ||
101 | |||
102 | struct fsl_usb2_platform_data { | ||
103 | /* board specific information */ | ||
104 | enum fsl_usb2_operating_modes operating_mode; | ||
105 | enum fsl_usb2_phy_modes phy_mode; | ||
106 | unsigned int port_enables; | ||
107 | }; | ||
108 | |||
109 | /* Flags in fsl_usb2_mph_platform_data */ | ||
110 | #define FSL_USB2_PORT0_ENABLED 0x00000001 | ||
111 | #define FSL_USB2_PORT1_ENABLED 0x00000002 | ||
112 | |||
86 | #endif /* _FSL_DEVICE_H_ */ | 113 | #endif /* _FSL_DEVICE_H_ */ |
87 | #endif /* __KERNEL__ */ | 114 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 0cf6c8b12caf..c771a7db9871 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -40,14 +40,16 @@ struct icmp6hdr { | |||
40 | struct icmpv6_nd_ra { | 40 | struct icmpv6_nd_ra { |
41 | __u8 hop_limit; | 41 | __u8 hop_limit; |
42 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 42 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
43 | __u8 reserved:6, | 43 | __u8 reserved:4, |
44 | router_pref:2, | ||
44 | other:1, | 45 | other:1, |
45 | managed:1; | 46 | managed:1; |
46 | 47 | ||
47 | #elif defined(__BIG_ENDIAN_BITFIELD) | 48 | #elif defined(__BIG_ENDIAN_BITFIELD) |
48 | __u8 managed:1, | 49 | __u8 managed:1, |
49 | other:1, | 50 | other:1, |
50 | reserved:6; | 51 | router_pref:2, |
52 | reserved:4; | ||
51 | #else | 53 | #else |
52 | #error "Please fix <asm/byteorder.h>" | 54 | #error "Please fix <asm/byteorder.h>" |
53 | #endif | 55 | #endif |
@@ -70,8 +72,13 @@ struct icmp6hdr { | |||
70 | #define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed | 72 | #define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed |
71 | #define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other | 73 | #define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other |
72 | #define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime | 74 | #define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime |
75 | #define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref | ||
73 | }; | 76 | }; |
74 | 77 | ||
78 | #define ICMPV6_ROUTER_PREF_LOW 0x3 | ||
79 | #define ICMPV6_ROUTER_PREF_MEDIUM 0x0 | ||
80 | #define ICMPV6_ROUTER_PREF_HIGH 0x1 | ||
81 | #define ICMPV6_ROUTER_PREF_INVALID 0x2 | ||
75 | 82 | ||
76 | #define ICMPV6_DEST_UNREACH 1 | 83 | #define ICMPV6_DEST_UNREACH 1 |
77 | #define ICMPV6_PKT_TOOBIG 2 | 84 | #define ICMPV6_PKT_TOOBIG 2 |
diff --git a/include/linux/if.h b/include/linux/if.h index 12c6f6d157c3..374e20ad8b0d 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 /* interface running and carrier ok */ | 36 | #define IFF_RUNNING 0x40 /* interface RFC2863 OPER_UP */ |
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*/ |
@@ -43,12 +43,16 @@ | |||
43 | 43 | ||
44 | #define IFF_MULTICAST 0x1000 /* Supports multicast */ | 44 | #define IFF_MULTICAST 0x1000 /* Supports multicast */ |
45 | 45 | ||
46 | #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_MASTER|IFF_SLAVE|IFF_RUNNING) | ||
47 | |||
48 | #define IFF_PORTSEL 0x2000 /* can set media type */ | 46 | #define IFF_PORTSEL 0x2000 /* can set media type */ |
49 | #define IFF_AUTOMEDIA 0x4000 /* auto media select active */ | 47 | #define IFF_AUTOMEDIA 0x4000 /* auto media select active */ |
50 | #define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/ | 48 | #define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/ |
51 | 49 | ||
50 | #define IFF_LOWER_UP 0x10000 /* driver signals L1 up */ | ||
51 | #define IFF_DORMANT 0x20000 /* driver signals dormant */ | ||
52 | |||
53 | #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|\ | ||
54 | IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT) | ||
55 | |||
52 | /* Private (from user) interface flags (netdevice->priv_flags). */ | 56 | /* Private (from user) interface flags (netdevice->priv_flags). */ |
53 | #define IFF_802_1Q_VLAN 0x1 /* 802.1Q VLAN device. */ | 57 | #define IFF_802_1Q_VLAN 0x1 /* 802.1Q VLAN device. */ |
54 | #define IFF_EBRIDGE 0x2 /* Ethernet bridging device. */ | 58 | #define IFF_EBRIDGE 0x2 /* Ethernet bridging device. */ |
@@ -83,6 +87,22 @@ | |||
83 | #define IF_PROTO_FR_ETH_PVC 0x200B | 87 | #define IF_PROTO_FR_ETH_PVC 0x200B |
84 | #define IF_PROTO_RAW 0x200C /* RAW Socket */ | 88 | #define IF_PROTO_RAW 0x200C /* RAW Socket */ |
85 | 89 | ||
90 | /* RFC 2863 operational status */ | ||
91 | enum { | ||
92 | IF_OPER_UNKNOWN, | ||
93 | IF_OPER_NOTPRESENT, | ||
94 | IF_OPER_DOWN, | ||
95 | IF_OPER_LOWERLAYERDOWN, | ||
96 | IF_OPER_TESTING, | ||
97 | IF_OPER_DORMANT, | ||
98 | IF_OPER_UP, | ||
99 | }; | ||
100 | |||
101 | /* link modes */ | ||
102 | enum { | ||
103 | IF_LINK_MODE_DEFAULT, | ||
104 | IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */ | ||
105 | }; | ||
86 | 106 | ||
87 | /* | 107 | /* |
88 | * Device mapping structure. I'd just gone off and designed a | 108 | * Device mapping structure. I'd just gone off and designed a |
diff --git a/include/linux/in.h b/include/linux/in.h index ba355384016a..94f557fa4636 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -72,6 +72,7 @@ struct in_addr { | |||
72 | #define IP_FREEBIND 15 | 72 | #define IP_FREEBIND 15 |
73 | #define IP_IPSEC_POLICY 16 | 73 | #define IP_IPSEC_POLICY 16 |
74 | #define IP_XFRM_POLICY 17 | 74 | #define IP_XFRM_POLICY 17 |
75 | #define IP_PASSSEC 18 | ||
75 | 76 | ||
76 | /* BSD compatibility */ | 77 | /* BSD compatibility */ |
77 | #define IP_RECVRETOPTS IP_RETOPTS | 78 | #define IP_RECVRETOPTS IP_RETOPTS |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index fd7af86151b1..92297ff24e85 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -25,6 +25,7 @@ struct ipv4_devconf | |||
25 | int arp_filter; | 25 | int arp_filter; |
26 | int arp_announce; | 26 | int arp_announce; |
27 | int arp_ignore; | 27 | int arp_ignore; |
28 | int arp_accept; | ||
28 | int medium_id; | 29 | int medium_id; |
29 | int no_xfrm; | 30 | int no_xfrm; |
30 | int no_policy; | 31 | int no_policy; |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 9c8f4c9ed429..1263d8cb3c18 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -145,6 +145,15 @@ struct ipv6_devconf { | |||
145 | __s32 max_desync_factor; | 145 | __s32 max_desync_factor; |
146 | #endif | 146 | #endif |
147 | __s32 max_addresses; | 147 | __s32 max_addresses; |
148 | __s32 accept_ra_defrtr; | ||
149 | __s32 accept_ra_pinfo; | ||
150 | #ifdef CONFIG_IPV6_ROUTER_PREF | ||
151 | __s32 accept_ra_rtr_pref; | ||
152 | __s32 rtr_probe_interval; | ||
153 | #ifdef CONFIG_IPV6_ROUTE_INFO | ||
154 | __s32 accept_ra_rt_info_max_plen; | ||
155 | #endif | ||
156 | #endif | ||
148 | void *sysctl; | 157 | void *sysctl; |
149 | }; | 158 | }; |
150 | 159 | ||
@@ -167,6 +176,11 @@ enum { | |||
167 | DEVCONF_MAX_DESYNC_FACTOR, | 176 | DEVCONF_MAX_DESYNC_FACTOR, |
168 | DEVCONF_MAX_ADDRESSES, | 177 | DEVCONF_MAX_ADDRESSES, |
169 | DEVCONF_FORCE_MLD_VERSION, | 178 | DEVCONF_FORCE_MLD_VERSION, |
179 | DEVCONF_ACCEPT_RA_DEFRTR, | ||
180 | DEVCONF_ACCEPT_RA_PINFO, | ||
181 | DEVCONF_ACCEPT_RA_RTR_PREF, | ||
182 | DEVCONF_RTR_PROBE_INTERVAL, | ||
183 | DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN, | ||
170 | DEVCONF_MAX | 184 | DEVCONF_MAX |
171 | }; | 185 | }; |
172 | 186 | ||
diff --git a/include/linux/ipv6_route.h b/include/linux/ipv6_route.h index d7c41d1d706a..b323ff577967 100644 --- a/include/linux/ipv6_route.h +++ b/include/linux/ipv6_route.h | |||
@@ -23,12 +23,22 @@ | |||
23 | #define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */ | 23 | #define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */ |
24 | #define RTF_EXPIRES 0x00400000 | 24 | #define RTF_EXPIRES 0x00400000 |
25 | 25 | ||
26 | #define RTF_ROUTEINFO 0x00800000 /* route information - RA */ | ||
27 | |||
26 | #define RTF_CACHE 0x01000000 /* cache entry */ | 28 | #define RTF_CACHE 0x01000000 /* cache entry */ |
27 | #define RTF_FLOW 0x02000000 /* flow significant route */ | 29 | #define RTF_FLOW 0x02000000 /* flow significant route */ |
28 | #define RTF_POLICY 0x04000000 /* policy route */ | 30 | #define RTF_POLICY 0x04000000 /* policy route */ |
29 | 31 | ||
32 | #define RTF_PREF(pref) ((pref) << 27) | ||
33 | #define RTF_PREF_MASK 0x18000000 | ||
34 | |||
30 | #define RTF_LOCAL 0x80000000 | 35 | #define RTF_LOCAL 0x80000000 |
31 | 36 | ||
37 | #ifdef __KERNEL__ | ||
38 | #define IPV6_EXTRACT_PREF(flag) (((flag) & RTF_PREF_MASK) >> 27) | ||
39 | #define IPV6_DECODE_PREF(pref) ((pref) ^ 2) /* 1:low,2:med,3:high */ | ||
40 | #endif | ||
41 | |||
32 | struct in6_rtmsg { | 42 | struct in6_rtmsg { |
33 | struct in6_addr rtmsg_dst; | 43 | struct in6_addr rtmsg_dst; |
34 | struct in6_addr rtmsg_src; | 44 | struct in6_addr rtmsg_src; |
diff --git a/include/linux/irda.h b/include/linux/irda.h index 95dee174cdc5..09d8f105a5a8 100644 --- a/include/linux/irda.h +++ b/include/linux/irda.h | |||
@@ -76,6 +76,7 @@ typedef enum { | |||
76 | IRDA_MCP2120_DONGLE = 9, | 76 | IRDA_MCP2120_DONGLE = 9, |
77 | IRDA_ACT200L_DONGLE = 10, | 77 | IRDA_ACT200L_DONGLE = 10, |
78 | IRDA_MA600_DONGLE = 11, | 78 | IRDA_MA600_DONGLE = 11, |
79 | IRDA_TOIM3232_DONGLE = 12, | ||
79 | } IRDA_DONGLE; | 80 | } IRDA_DONGLE; |
80 | 81 | ||
81 | /* Protocol types to be used for SOCK_DGRAM */ | 82 | /* Protocol types to be used for SOCK_DGRAM */ |
diff --git a/include/linux/kobj_map.h b/include/linux/kobj_map.h index cbe7d8008042..bafe178a381f 100644 --- a/include/linux/kobj_map.h +++ b/include/linux/kobj_map.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #ifdef __KERNEL__ | 1 | #ifdef __KERNEL__ |
2 | 2 | ||
3 | #include <asm/semaphore.h> | 3 | #include <linux/mutex.h> |
4 | 4 | ||
5 | typedef struct kobject *kobj_probe_t(dev_t, int *, void *); | 5 | typedef struct kobject *kobj_probe_t(dev_t, int *, void *); |
6 | struct kobj_map; | 6 | struct kobj_map; |
@@ -9,6 +9,6 @@ int kobj_map(struct kobj_map *, dev_t, unsigned long, struct module *, | |||
9 | kobj_probe_t *, int (*)(dev_t, void *), void *); | 9 | kobj_probe_t *, int (*)(dev_t, void *), void *); |
10 | void kobj_unmap(struct kobj_map *, dev_t, unsigned long); | 10 | void kobj_unmap(struct kobj_map *, dev_t, unsigned long); |
11 | struct kobject *kobj_lookup(struct kobj_map *, dev_t, int *); | 11 | struct kobject *kobj_lookup(struct kobj_map *, dev_t, int *); |
12 | struct kobj_map *kobj_map_init(kobj_probe_t *, struct semaphore *); | 12 | struct kobj_map *kobj_map_init(kobj_probe_t *, struct mutex *); |
13 | 13 | ||
14 | #endif | 14 | #endif |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index c374b5fa8d3b..4cb1214ec290 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -80,6 +80,8 @@ extern void kobject_unregister(struct kobject *); | |||
80 | extern struct kobject * kobject_get(struct kobject *); | 80 | extern struct kobject * kobject_get(struct kobject *); |
81 | extern void kobject_put(struct kobject *); | 81 | extern void kobject_put(struct kobject *); |
82 | 82 | ||
83 | extern struct kobject *kobject_add_dir(struct kobject *, const char *); | ||
84 | |||
83 | extern char * kobject_get_path(struct kobject *, gfp_t); | 85 | extern char * kobject_get_path(struct kobject *, gfp_t); |
84 | 86 | ||
85 | struct kobj_type { | 87 | struct kobj_type { |
@@ -255,7 +257,7 @@ struct subsys_attribute { | |||
255 | extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); | 257 | extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); |
256 | extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *); | 258 | extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *); |
257 | 259 | ||
258 | #if defined(CONFIG_HOTPLUG) & defined(CONFIG_NET) | 260 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) |
259 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); | 261 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); |
260 | 262 | ||
261 | int add_uevent_var(char **envp, int num_envp, int *cur_index, | 263 | int add_uevent_var(char **envp, int num_envp, int *cur_index, |
diff --git a/include/linux/libata.h b/include/linux/libata.h index c91be5e64ede..239408ecfddf 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -35,7 +35,8 @@ | |||
35 | #include <linux/workqueue.h> | 35 | #include <linux/workqueue.h> |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * compile-time options | 38 | * compile-time options: to be removed as soon as all the drivers are |
39 | * converted to the new debugging mechanism | ||
39 | */ | 40 | */ |
40 | #undef ATA_DEBUG /* debugging output */ | 41 | #undef ATA_DEBUG /* debugging output */ |
41 | #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ | 42 | #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ |
@@ -61,15 +62,37 @@ | |||
61 | 62 | ||
62 | #define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) | 63 | #define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) |
63 | 64 | ||
64 | #ifdef ATA_NDEBUG | 65 | /* NEW: debug levels */ |
65 | #define assert(expr) | 66 | #define HAVE_LIBATA_MSG 1 |
66 | #else | 67 | |
67 | #define assert(expr) \ | 68 | enum { |
68 | if(unlikely(!(expr))) { \ | 69 | ATA_MSG_DRV = 0x0001, |
69 | printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n", \ | 70 | ATA_MSG_INFO = 0x0002, |
70 | #expr,__FILE__,__FUNCTION__,__LINE__); \ | 71 | ATA_MSG_PROBE = 0x0004, |
71 | } | 72 | ATA_MSG_WARN = 0x0008, |
72 | #endif | 73 | ATA_MSG_MALLOC = 0x0010, |
74 | ATA_MSG_CTL = 0x0020, | ||
75 | ATA_MSG_INTR = 0x0040, | ||
76 | ATA_MSG_ERR = 0x0080, | ||
77 | }; | ||
78 | |||
79 | #define ata_msg_drv(p) ((p)->msg_enable & ATA_MSG_DRV) | ||
80 | #define ata_msg_info(p) ((p)->msg_enable & ATA_MSG_INFO) | ||
81 | #define ata_msg_probe(p) ((p)->msg_enable & ATA_MSG_PROBE) | ||
82 | #define ata_msg_warn(p) ((p)->msg_enable & ATA_MSG_WARN) | ||
83 | #define ata_msg_malloc(p) ((p)->msg_enable & ATA_MSG_MALLOC) | ||
84 | #define ata_msg_ctl(p) ((p)->msg_enable & ATA_MSG_CTL) | ||
85 | #define ata_msg_intr(p) ((p)->msg_enable & ATA_MSG_INTR) | ||
86 | #define ata_msg_err(p) ((p)->msg_enable & ATA_MSG_ERR) | ||
87 | |||
88 | static inline u32 ata_msg_init(int dval, int default_msg_enable_bits) | ||
89 | { | ||
90 | if (dval < 0 || dval >= (sizeof(u32) * 8)) | ||
91 | return default_msg_enable_bits; /* should be 0x1 - only driver info msgs */ | ||
92 | if (!dval) | ||
93 | return 0; | ||
94 | return (1 << dval) - 1; | ||
95 | } | ||
73 | 96 | ||
74 | /* defines only for the constants which don't work well as enums */ | 97 | /* defines only for the constants which don't work well as enums */ |
75 | #define ATA_TAG_POISON 0xfafbfcfdU | 98 | #define ATA_TAG_POISON 0xfafbfcfdU |
@@ -99,8 +122,7 @@ enum { | |||
99 | /* struct ata_device stuff */ | 122 | /* struct ata_device stuff */ |
100 | ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ | 123 | ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ |
101 | ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ | 124 | ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ |
102 | ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ | 125 | ATA_DFLAG_LBA = (1 << 2), /* device supports LBA */ |
103 | ATA_DFLAG_LBA = (1 << 3), /* device supports LBA */ | ||
104 | 126 | ||
105 | ATA_DEV_UNKNOWN = 0, /* unknown device */ | 127 | ATA_DEV_UNKNOWN = 0, /* unknown device */ |
106 | ATA_DEV_ATA = 1, /* ATA device */ | 128 | ATA_DEV_ATA = 1, /* ATA device */ |
@@ -115,9 +137,9 @@ enum { | |||
115 | ATA_FLAG_PORT_DISABLED = (1 << 2), /* port is disabled, ignore it */ | 137 | ATA_FLAG_PORT_DISABLED = (1 << 2), /* port is disabled, ignore it */ |
116 | ATA_FLAG_SATA = (1 << 3), | 138 | ATA_FLAG_SATA = (1 << 3), |
117 | ATA_FLAG_NO_LEGACY = (1 << 4), /* no legacy mode check */ | 139 | ATA_FLAG_NO_LEGACY = (1 << 4), /* no legacy mode check */ |
118 | ATA_FLAG_SRST = (1 << 5), /* use ATA SRST, not E.D.D. */ | 140 | ATA_FLAG_SRST = (1 << 5), /* (obsolete) use ATA SRST, not E.D.D. */ |
119 | ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */ | 141 | ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */ |
120 | ATA_FLAG_SATA_RESET = (1 << 7), /* use COMRESET */ | 142 | ATA_FLAG_SATA_RESET = (1 << 7), /* (obsolete) use COMRESET */ |
121 | ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ | 143 | ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ |
122 | ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once | 144 | ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once |
123 | * proper HSM is in place. */ | 145 | * proper HSM is in place. */ |
@@ -129,10 +151,14 @@ enum { | |||
129 | ATA_FLAG_PIO_LBA48 = (1 << 13), /* Host DMA engine is LBA28 only */ | 151 | ATA_FLAG_PIO_LBA48 = (1 << 13), /* Host DMA engine is LBA28 only */ |
130 | ATA_FLAG_IRQ_MASK = (1 << 14), /* Mask IRQ in PIO xfers */ | 152 | ATA_FLAG_IRQ_MASK = (1 << 14), /* Mask IRQ in PIO xfers */ |
131 | 153 | ||
154 | ATA_FLAG_FLUSH_PORT_TASK = (1 << 15), /* Flush port task */ | ||
155 | ATA_FLAG_IN_EH = (1 << 16), /* EH in progress */ | ||
156 | |||
132 | ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ | 157 | ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ |
133 | ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ | 158 | ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ |
134 | ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */ | 159 | ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */ |
135 | ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, | 160 | ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, |
161 | ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ | ||
136 | 162 | ||
137 | /* various lengths of time */ | 163 | /* various lengths of time */ |
138 | ATA_TMOUT_EDD = 5 * HZ, /* heuristic */ | 164 | ATA_TMOUT_EDD = 5 * HZ, /* heuristic */ |
@@ -162,11 +188,19 @@ enum { | |||
162 | PORT_DISABLED = 2, | 188 | PORT_DISABLED = 2, |
163 | 189 | ||
164 | /* encoding various smaller bitmaps into a single | 190 | /* encoding various smaller bitmaps into a single |
165 | * unsigned long bitmap | 191 | * unsigned int bitmap |
166 | */ | 192 | */ |
167 | ATA_SHIFT_UDMA = 0, | 193 | ATA_BITS_PIO = 5, |
168 | ATA_SHIFT_MWDMA = 8, | 194 | ATA_BITS_MWDMA = 3, |
169 | ATA_SHIFT_PIO = 11, | 195 | ATA_BITS_UDMA = 8, |
196 | |||
197 | ATA_SHIFT_PIO = 0, | ||
198 | ATA_SHIFT_MWDMA = ATA_SHIFT_PIO + ATA_BITS_PIO, | ||
199 | ATA_SHIFT_UDMA = ATA_SHIFT_MWDMA + ATA_BITS_MWDMA, | ||
200 | |||
201 | ATA_MASK_PIO = ((1 << ATA_BITS_PIO) - 1) << ATA_SHIFT_PIO, | ||
202 | ATA_MASK_MWDMA = ((1 << ATA_BITS_MWDMA) - 1) << ATA_SHIFT_MWDMA, | ||
203 | ATA_MASK_UDMA = ((1 << ATA_BITS_UDMA) - 1) << ATA_SHIFT_UDMA, | ||
170 | 204 | ||
171 | /* size of buffer to pad xfers ending on unaligned boundaries */ | 205 | /* size of buffer to pad xfers ending on unaligned boundaries */ |
172 | ATA_DMA_PAD_SZ = 4, | 206 | ATA_DMA_PAD_SZ = 4, |
@@ -189,10 +223,15 @@ enum hsm_task_states { | |||
189 | }; | 223 | }; |
190 | 224 | ||
191 | enum ata_completion_errors { | 225 | enum ata_completion_errors { |
192 | AC_ERR_OTHER = (1 << 0), | 226 | AC_ERR_DEV = (1 << 0), /* device reported error */ |
193 | AC_ERR_DEV = (1 << 1), | 227 | AC_ERR_HSM = (1 << 1), /* host state machine violation */ |
194 | AC_ERR_ATA_BUS = (1 << 2), | 228 | AC_ERR_TIMEOUT = (1 << 2), /* timeout */ |
195 | AC_ERR_HOST_BUS = (1 << 3), | 229 | AC_ERR_MEDIA = (1 << 3), /* media error */ |
230 | AC_ERR_ATA_BUS = (1 << 4), /* ATA bus error */ | ||
231 | AC_ERR_HOST_BUS = (1 << 5), /* host bus error */ | ||
232 | AC_ERR_SYSTEM = (1 << 6), /* system error */ | ||
233 | AC_ERR_INVALID = (1 << 7), /* invalid argument */ | ||
234 | AC_ERR_OTHER = (1 << 8), /* unknown */ | ||
196 | }; | 235 | }; |
197 | 236 | ||
198 | /* forward declarations */ | 237 | /* forward declarations */ |
@@ -202,7 +241,10 @@ struct ata_port; | |||
202 | struct ata_queued_cmd; | 241 | struct ata_queued_cmd; |
203 | 242 | ||
204 | /* typedefs */ | 243 | /* typedefs */ |
205 | typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc); | 244 | typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc); |
245 | typedef void (*ata_probeinit_fn_t)(struct ata_port *); | ||
246 | typedef int (*ata_reset_fn_t)(struct ata_port *, int, unsigned int *); | ||
247 | typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *); | ||
206 | 248 | ||
207 | struct ata_ioports { | 249 | struct ata_ioports { |
208 | unsigned long cmd_addr; | 250 | unsigned long cmd_addr; |
@@ -305,7 +347,7 @@ struct ata_device { | |||
305 | unsigned long flags; /* ATA_DFLAG_xxx */ | 347 | unsigned long flags; /* ATA_DFLAG_xxx */ |
306 | unsigned int class; /* ATA_DEV_xxx */ | 348 | unsigned int class; /* ATA_DEV_xxx */ |
307 | unsigned int devno; /* 0 or 1 */ | 349 | unsigned int devno; /* 0 or 1 */ |
308 | u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ | 350 | u16 *id; /* IDENTIFY xxx DEVICE data */ |
309 | u8 pio_mode; | 351 | u8 pio_mode; |
310 | u8 dma_mode; | 352 | u8 dma_mode; |
311 | u8 xfer_mode; | 353 | u8 xfer_mode; |
@@ -313,6 +355,8 @@ struct ata_device { | |||
313 | 355 | ||
314 | unsigned int multi_count; /* sectors count for | 356 | unsigned int multi_count; /* sectors count for |
315 | READ/WRITE MULTIPLE */ | 357 | READ/WRITE MULTIPLE */ |
358 | unsigned int max_sectors; /* per-device max sectors */ | ||
359 | unsigned int cdb_len; | ||
316 | 360 | ||
317 | /* for CHS addressing */ | 361 | /* for CHS addressing */ |
318 | u16 cylinders; /* Number of cylinders */ | 362 | u16 cylinders; /* Number of cylinders */ |
@@ -342,7 +386,6 @@ struct ata_port { | |||
342 | unsigned int mwdma_mask; | 386 | unsigned int mwdma_mask; |
343 | unsigned int udma_mask; | 387 | unsigned int udma_mask; |
344 | unsigned int cbl; /* cable type; ATA_CBL_xxx */ | 388 | unsigned int cbl; /* cable type; ATA_CBL_xxx */ |
345 | unsigned int cdb_len; | ||
346 | 389 | ||
347 | struct ata_device device[ATA_MAX_DEVICES]; | 390 | struct ata_device device[ATA_MAX_DEVICES]; |
348 | 391 | ||
@@ -353,12 +396,14 @@ struct ata_port { | |||
353 | struct ata_host_stats stats; | 396 | struct ata_host_stats stats; |
354 | struct ata_host_set *host_set; | 397 | struct ata_host_set *host_set; |
355 | 398 | ||
356 | struct work_struct packet_task; | 399 | struct work_struct port_task; |
357 | 400 | ||
358 | struct work_struct pio_task; | ||
359 | unsigned int hsm_task_state; | 401 | unsigned int hsm_task_state; |
360 | unsigned long pio_task_timeout; | 402 | unsigned long pio_task_timeout; |
361 | 403 | ||
404 | u32 msg_enable; | ||
405 | struct list_head eh_done_q; | ||
406 | |||
362 | void *private_data; | 407 | void *private_data; |
363 | }; | 408 | }; |
364 | 409 | ||
@@ -378,7 +423,9 @@ struct ata_port_operations { | |||
378 | u8 (*check_altstatus)(struct ata_port *ap); | 423 | u8 (*check_altstatus)(struct ata_port *ap); |
379 | void (*dev_select)(struct ata_port *ap, unsigned int device); | 424 | void (*dev_select)(struct ata_port *ap, unsigned int device); |
380 | 425 | ||
381 | void (*phy_reset) (struct ata_port *ap); | 426 | void (*phy_reset) (struct ata_port *ap); /* obsolete */ |
427 | int (*probe_reset) (struct ata_port *ap, unsigned int *classes); | ||
428 | |||
382 | void (*post_set_mode) (struct ata_port *ap); | 429 | void (*post_set_mode) (struct ata_port *ap); |
383 | 430 | ||
384 | int (*check_atapi_dma) (struct ata_queued_cmd *qc); | 431 | int (*check_atapi_dma) (struct ata_queued_cmd *qc); |
@@ -387,7 +434,7 @@ struct ata_port_operations { | |||
387 | void (*bmdma_start) (struct ata_queued_cmd *qc); | 434 | void (*bmdma_start) (struct ata_queued_cmd *qc); |
388 | 435 | ||
389 | void (*qc_prep) (struct ata_queued_cmd *qc); | 436 | void (*qc_prep) (struct ata_queued_cmd *qc); |
390 | int (*qc_issue) (struct ata_queued_cmd *qc); | 437 | unsigned int (*qc_issue) (struct ata_queued_cmd *qc); |
391 | 438 | ||
392 | void (*eng_timeout) (struct ata_port *ap); | 439 | void (*eng_timeout) (struct ata_port *ap); |
393 | 440 | ||
@@ -435,6 +482,18 @@ extern void ata_port_probe(struct ata_port *); | |||
435 | extern void __sata_phy_reset(struct ata_port *ap); | 482 | extern void __sata_phy_reset(struct ata_port *ap); |
436 | extern void sata_phy_reset(struct ata_port *ap); | 483 | extern void sata_phy_reset(struct ata_port *ap); |
437 | extern void ata_bus_reset(struct ata_port *ap); | 484 | extern void ata_bus_reset(struct ata_port *ap); |
485 | extern int ata_drive_probe_reset(struct ata_port *ap, | ||
486 | ata_probeinit_fn_t probeinit, | ||
487 | ata_reset_fn_t softreset, ata_reset_fn_t hardreset, | ||
488 | ata_postreset_fn_t postreset, unsigned int *classes); | ||
489 | extern void ata_std_probeinit(struct ata_port *ap); | ||
490 | extern int ata_std_softreset(struct ata_port *ap, int verbose, | ||
491 | unsigned int *classes); | ||
492 | extern int sata_std_hardreset(struct ata_port *ap, int verbose, | ||
493 | unsigned int *class); | ||
494 | extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); | ||
495 | extern int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev, | ||
496 | int post_reset); | ||
438 | extern void ata_port_disable(struct ata_port *); | 497 | extern void ata_port_disable(struct ata_port *); |
439 | extern void ata_std_ports(struct ata_ioports *ioaddr); | 498 | extern void ata_std_ports(struct ata_ioports *ioaddr); |
440 | #ifdef CONFIG_PCI | 499 | #ifdef CONFIG_PCI |
@@ -449,7 +508,10 @@ extern void ata_host_set_remove(struct ata_host_set *host_set); | |||
449 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 508 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
450 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 509 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
451 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 510 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
511 | extern enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd); | ||
452 | extern int ata_scsi_error(struct Scsi_Host *host); | 512 | extern int ata_scsi_error(struct Scsi_Host *host); |
513 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); | ||
514 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); | ||
453 | extern int ata_scsi_release(struct Scsi_Host *host); | 515 | extern int ata_scsi_release(struct Scsi_Host *host); |
454 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); | 516 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); |
455 | extern int ata_scsi_device_resume(struct scsi_device *); | 517 | extern int ata_scsi_device_resume(struct scsi_device *); |
@@ -457,6 +519,11 @@ extern int ata_scsi_device_suspend(struct scsi_device *); | |||
457 | extern int ata_device_resume(struct ata_port *, struct ata_device *); | 519 | extern int ata_device_resume(struct ata_port *, struct ata_device *); |
458 | extern int ata_device_suspend(struct ata_port *, struct ata_device *); | 520 | extern int ata_device_suspend(struct ata_port *, struct ata_device *); |
459 | extern int ata_ratelimit(void); | 521 | extern int ata_ratelimit(void); |
522 | extern unsigned int ata_busy_sleep(struct ata_port *ap, | ||
523 | unsigned long timeout_pat, | ||
524 | unsigned long timeout); | ||
525 | extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), | ||
526 | void *data, unsigned long delay); | ||
460 | 527 | ||
461 | /* | 528 | /* |
462 | * Default driver ops implementations | 529 | * Default driver ops implementations |
@@ -470,26 +537,28 @@ extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); | |||
470 | extern u8 ata_check_status(struct ata_port *ap); | 537 | extern u8 ata_check_status(struct ata_port *ap); |
471 | extern u8 ata_altstatus(struct ata_port *ap); | 538 | extern u8 ata_altstatus(struct ata_port *ap); |
472 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); | 539 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); |
540 | extern int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes); | ||
473 | extern int ata_port_start (struct ata_port *ap); | 541 | extern int ata_port_start (struct ata_port *ap); |
474 | extern void ata_port_stop (struct ata_port *ap); | 542 | extern void ata_port_stop (struct ata_port *ap); |
475 | extern void ata_host_stop (struct ata_host_set *host_set); | 543 | extern void ata_host_stop (struct ata_host_set *host_set); |
476 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); | 544 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); |
477 | extern void ata_qc_prep(struct ata_queued_cmd *qc); | 545 | extern void ata_qc_prep(struct ata_queued_cmd *qc); |
478 | extern int ata_qc_issue_prot(struct ata_queued_cmd *qc); | 546 | extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); |
479 | extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, | 547 | extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, |
480 | unsigned int buflen); | 548 | unsigned int buflen); |
481 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | 549 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, |
482 | unsigned int n_elem); | 550 | unsigned int n_elem); |
483 | extern unsigned int ata_dev_classify(const struct ata_taskfile *tf); | 551 | extern unsigned int ata_dev_classify(const struct ata_taskfile *tf); |
484 | extern void ata_dev_id_string(const u16 *id, unsigned char *s, | 552 | extern void ata_id_string(const u16 *id, unsigned char *s, |
485 | unsigned int ofs, unsigned int len); | 553 | unsigned int ofs, unsigned int len); |
486 | extern void ata_dev_config(struct ata_port *ap, unsigned int i); | 554 | extern void ata_id_c_string(const u16 *id, unsigned char *s, |
555 | unsigned int ofs, unsigned int len); | ||
487 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 556 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
488 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); | 557 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); |
489 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | 558 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); |
490 | extern u8 ata_bmdma_status(struct ata_port *ap); | 559 | extern u8 ata_bmdma_status(struct ata_port *ap); |
491 | extern void ata_bmdma_irq_clear(struct ata_port *ap); | 560 | extern void ata_bmdma_irq_clear(struct ata_port *ap); |
492 | extern void ata_qc_complete(struct ata_queued_cmd *qc); | 561 | extern void __ata_qc_complete(struct ata_queued_cmd *qc); |
493 | extern void ata_eng_timeout(struct ata_port *ap); | 562 | extern void ata_eng_timeout(struct ata_port *ap); |
494 | extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev, | 563 | extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev, |
495 | struct scsi_cmnd *cmd, | 564 | struct scsi_cmnd *cmd, |
@@ -586,10 +655,14 @@ static inline unsigned int ata_tag_valid(unsigned int tag) | |||
586 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; | 655 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; |
587 | } | 656 | } |
588 | 657 | ||
658 | static inline unsigned int ata_class_present(unsigned int class) | ||
659 | { | ||
660 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; | ||
661 | } | ||
662 | |||
589 | static inline unsigned int ata_dev_present(const struct ata_device *dev) | 663 | static inline unsigned int ata_dev_present(const struct ata_device *dev) |
590 | { | 664 | { |
591 | return ((dev->class == ATA_DEV_ATA) || | 665 | return ata_class_present(dev->class); |
592 | (dev->class == ATA_DEV_ATAPI)); | ||
593 | } | 666 | } |
594 | 667 | ||
595 | static inline u8 ata_chk_status(struct ata_port *ap) | 668 | static inline u8 ata_chk_status(struct ata_port *ap) |
@@ -657,9 +730,9 @@ static inline u8 ata_wait_idle(struct ata_port *ap) | |||
657 | 730 | ||
658 | if (status & (ATA_BUSY | ATA_DRQ)) { | 731 | if (status & (ATA_BUSY | ATA_DRQ)) { |
659 | unsigned long l = ap->ioaddr.status_addr; | 732 | unsigned long l = ap->ioaddr.status_addr; |
660 | printk(KERN_WARNING | 733 | if (ata_msg_warn(ap)) |
661 | "ATA: abnormal status 0x%X on port 0x%lX\n", | 734 | printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%lX\n", |
662 | status, l); | 735 | status, l); |
663 | } | 736 | } |
664 | 737 | ||
665 | return status; | 738 | return status; |
@@ -701,6 +774,24 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc) | |||
701 | ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); | 774 | ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); |
702 | } | 775 | } |
703 | 776 | ||
777 | /** | ||
778 | * ata_qc_complete - Complete an active ATA command | ||
779 | * @qc: Command to complete | ||
780 | * @err_mask: ATA Status register contents | ||
781 | * | ||
782 | * Indicate to the mid and upper layers that an ATA | ||
783 | * command has completed, with either an ok or not-ok status. | ||
784 | * | ||
785 | * LOCKING: | ||
786 | * spin_lock_irqsave(host_set lock) | ||
787 | */ | ||
788 | static inline void ata_qc_complete(struct ata_queued_cmd *qc) | ||
789 | { | ||
790 | if (unlikely(qc->flags & ATA_QCFLAG_EH_SCHEDULED)) | ||
791 | return; | ||
792 | |||
793 | __ata_qc_complete(qc); | ||
794 | } | ||
704 | 795 | ||
705 | /** | 796 | /** |
706 | * ata_irq_on - Enable interrupts on a port. | 797 | * ata_irq_on - Enable interrupts on a port. |
@@ -751,7 +842,8 @@ static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) | |||
751 | 842 | ||
752 | status = ata_busy_wait(ap, bits, 1000); | 843 | status = ata_busy_wait(ap, bits, 1000); |
753 | if (status & bits) | 844 | if (status & bits) |
754 | DPRINTK("abnormal status 0x%X\n", status); | 845 | if (ata_msg_err(ap)) |
846 | printk(KERN_ERR "abnormal status 0x%X\n", status); | ||
755 | 847 | ||
756 | /* get controller status; clear intr, err bits */ | 848 | /* get controller status; clear intr, err bits */ |
757 | if (ap->flags & ATA_FLAG_MMIO) { | 849 | if (ap->flags & ATA_FLAG_MMIO) { |
@@ -769,8 +861,10 @@ static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) | |||
769 | post_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); | 861 | post_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); |
770 | } | 862 | } |
771 | 863 | ||
772 | VPRINTK("irq ack: host_stat 0x%X, new host_stat 0x%X, drv_stat 0x%X\n", | 864 | if (ata_msg_intr(ap)) |
773 | host_stat, post_stat, status); | 865 | printk(KERN_INFO "%s: irq ack: host_stat 0x%X, new host_stat 0x%X, drv_stat 0x%X\n", |
866 | __FUNCTION__, | ||
867 | host_stat, post_stat, status); | ||
774 | 868 | ||
775 | return status; | 869 | return status; |
776 | } | 870 | } |
@@ -807,7 +901,7 @@ static inline int ata_try_flush_cache(const struct ata_device *dev) | |||
807 | static inline unsigned int ac_err_mask(u8 status) | 901 | static inline unsigned int ac_err_mask(u8 status) |
808 | { | 902 | { |
809 | if (status & ATA_BUSY) | 903 | if (status & ATA_BUSY) |
810 | return AC_ERR_ATA_BUS; | 904 | return AC_ERR_HSM; |
811 | if (status & (ATA_ERR | ATA_DF)) | 905 | if (status & (ATA_ERR | ATA_DF)) |
812 | return AC_ERR_DEV; | 906 | return AC_ERR_DEV; |
813 | return 0; | 907 | return 0; |
diff --git a/include/linux/list.h b/include/linux/list.h index 47208bd99f9e..67258b47e9ca 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -411,6 +411,17 @@ static inline void list_splice_init(struct list_head *list, | |||
411 | pos = list_entry(pos->member.next, typeof(*pos), member)) | 411 | pos = list_entry(pos->member.next, typeof(*pos), member)) |
412 | 412 | ||
413 | /** | 413 | /** |
414 | * list_for_each_entry_from - iterate over list of given type | ||
415 | * continuing from existing point | ||
416 | * @pos: the type * to use as a loop counter. | ||
417 | * @head: the head for your list. | ||
418 | * @member: the name of the list_struct within the struct. | ||
419 | */ | ||
420 | #define list_for_each_entry_from(pos, head, member) \ | ||
421 | for (; prefetch(pos->member.next), &pos->member != (head); \ | ||
422 | pos = list_entry(pos->member.next, typeof(*pos), member)) | ||
423 | |||
424 | /** | ||
414 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry | 425 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry |
415 | * @pos: the type * to use as a loop counter. | 426 | * @pos: the type * to use as a loop counter. |
416 | * @n: another type * to use as temporary storage | 427 | * @n: another type * to use as temporary storage |
@@ -438,6 +449,19 @@ static inline void list_splice_init(struct list_head *list, | |||
438 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 449 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
439 | 450 | ||
440 | /** | 451 | /** |
452 | * list_for_each_entry_safe_from - iterate over list of given type | ||
453 | * from existing point safe against removal of list entry | ||
454 | * @pos: the type * to use as a loop counter. | ||
455 | * @n: another type * to use as temporary storage | ||
456 | * @head: the head for your list. | ||
457 | * @member: the name of the list_struct within the struct. | ||
458 | */ | ||
459 | #define list_for_each_entry_safe_from(pos, n, head, member) \ | ||
460 | for (n = list_entry(pos->member.next, typeof(*pos), member); \ | ||
461 | &pos->member != (head); \ | ||
462 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | ||
463 | |||
464 | /** | ||
441 | * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against | 465 | * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against |
442 | * removal of list entry | 466 | * removal of list entry |
443 | * @pos: the type * to use as a loop counter. | 467 | * @pos: the type * to use as a loop counter. |
diff --git a/include/linux/module.h b/include/linux/module.h index 84d75f3a8aca..70bd843c71cb 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -198,6 +198,9 @@ void *__symbol_get_gpl(const char *symbol); | |||
198 | #define EXPORT_SYMBOL_GPL(sym) \ | 198 | #define EXPORT_SYMBOL_GPL(sym) \ |
199 | __EXPORT_SYMBOL(sym, "_gpl") | 199 | __EXPORT_SYMBOL(sym, "_gpl") |
200 | 200 | ||
201 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) \ | ||
202 | __EXPORT_SYMBOL(sym, "_gpl_future") | ||
203 | |||
201 | #endif | 204 | #endif |
202 | 205 | ||
203 | struct module_ref | 206 | struct module_ref |
@@ -242,6 +245,7 @@ struct module | |||
242 | /* Sysfs stuff. */ | 245 | /* Sysfs stuff. */ |
243 | struct module_kobject mkobj; | 246 | struct module_kobject mkobj; |
244 | struct module_param_attrs *param_attrs; | 247 | struct module_param_attrs *param_attrs; |
248 | struct module_attribute *modinfo_attrs; | ||
245 | const char *version; | 249 | const char *version; |
246 | const char *srcversion; | 250 | const char *srcversion; |
247 | 251 | ||
@@ -255,6 +259,11 @@ struct module | |||
255 | unsigned int num_gpl_syms; | 259 | unsigned int num_gpl_syms; |
256 | const unsigned long *gpl_crcs; | 260 | const unsigned long *gpl_crcs; |
257 | 261 | ||
262 | /* symbols that will be GPL-only in the near future. */ | ||
263 | const struct kernel_symbol *gpl_future_syms; | ||
264 | unsigned int num_gpl_future_syms; | ||
265 | const unsigned long *gpl_future_crcs; | ||
266 | |||
258 | /* Exception table */ | 267 | /* Exception table */ |
259 | unsigned int num_exentries; | 268 | unsigned int num_exentries; |
260 | const struct exception_table_entry *extable; | 269 | const struct exception_table_entry *extable; |
@@ -441,6 +450,7 @@ void module_remove_driver(struct device_driver *); | |||
441 | #else /* !CONFIG_MODULES... */ | 450 | #else /* !CONFIG_MODULES... */ |
442 | #define EXPORT_SYMBOL(sym) | 451 | #define EXPORT_SYMBOL(sym) |
443 | #define EXPORT_SYMBOL_GPL(sym) | 452 | #define EXPORT_SYMBOL_GPL(sym) |
453 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) | ||
444 | 454 | ||
445 | /* Given an address, look for it in the exception tables. */ | 455 | /* Given an address, look for it in the exception tables. */ |
446 | static inline const struct exception_table_entry * | 456 | static inline const struct exception_table_entry * |
diff --git a/include/linux/net.h b/include/linux/net.h index 28195a2d8ff0..152fa6551fd8 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -149,6 +149,10 @@ struct proto_ops { | |||
149 | int optname, char __user *optval, int optlen); | 149 | int optname, char __user *optval, int optlen); |
150 | int (*getsockopt)(struct socket *sock, int level, | 150 | int (*getsockopt)(struct socket *sock, int level, |
151 | int optname, char __user *optval, int __user *optlen); | 151 | int optname, char __user *optval, int __user *optlen); |
152 | int (*compat_setsockopt)(struct socket *sock, int level, | ||
153 | int optname, char __user *optval, int optlen); | ||
154 | int (*compat_getsockopt)(struct socket *sock, int level, | ||
155 | int optname, char __user *optval, int __user *optlen); | ||
152 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, | 156 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, |
153 | struct msghdr *m, size_t total_len); | 157 | struct msghdr *m, size_t total_len); |
154 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, | 158 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7fda03d338d1..950dc55e5192 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -230,7 +230,8 @@ enum netdev_state_t | |||
230 | __LINK_STATE_SCHED, | 230 | __LINK_STATE_SCHED, |
231 | __LINK_STATE_NOCARRIER, | 231 | __LINK_STATE_NOCARRIER, |
232 | __LINK_STATE_RX_SCHED, | 232 | __LINK_STATE_RX_SCHED, |
233 | __LINK_STATE_LINKWATCH_PENDING | 233 | __LINK_STATE_LINKWATCH_PENDING, |
234 | __LINK_STATE_DORMANT, | ||
234 | }; | 235 | }; |
235 | 236 | ||
236 | 237 | ||
@@ -335,11 +336,14 @@ struct net_device | |||
335 | */ | 336 | */ |
336 | 337 | ||
337 | 338 | ||
338 | unsigned short flags; /* interface flags (a la BSD) */ | 339 | unsigned int flags; /* interface flags (a la BSD) */ |
339 | unsigned short gflags; | 340 | unsigned short gflags; |
340 | unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ | 341 | unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ |
341 | unsigned short padded; /* How much padding added by alloc_netdev() */ | 342 | unsigned short padded; /* How much padding added by alloc_netdev() */ |
342 | 343 | ||
344 | unsigned char operstate; /* RFC2863 operstate */ | ||
345 | unsigned char link_mode; /* mapping policy to operstate */ | ||
346 | |||
343 | unsigned mtu; /* interface MTU value */ | 347 | unsigned mtu; /* interface MTU value */ |
344 | unsigned short type; /* interface hardware type */ | 348 | unsigned short type; /* interface hardware type */ |
345 | unsigned short hard_header_len; /* hardware hdr length */ | 349 | unsigned short hard_header_len; /* hardware hdr length */ |
@@ -708,12 +712,18 @@ static inline void dev_put(struct net_device *dev) | |||
708 | atomic_dec(&dev->refcnt); | 712 | atomic_dec(&dev->refcnt); |
709 | } | 713 | } |
710 | 714 | ||
711 | #define __dev_put(dev) atomic_dec(&(dev)->refcnt) | 715 | static inline void dev_hold(struct net_device *dev) |
712 | #define dev_hold(dev) atomic_inc(&(dev)->refcnt) | 716 | { |
717 | atomic_inc(&dev->refcnt); | ||
718 | } | ||
713 | 719 | ||
714 | /* Carrier loss detection, dial on demand. The functions netif_carrier_on | 720 | /* Carrier loss detection, dial on demand. The functions netif_carrier_on |
715 | * and _off may be called from IRQ context, but it is caller | 721 | * and _off may be called from IRQ context, but it is caller |
716 | * who is responsible for serialization of these calls. | 722 | * who is responsible for serialization of these calls. |
723 | * | ||
724 | * The name carrier is inappropriate, these functions should really be | ||
725 | * called netif_lowerlayer_*() because they represent the state of any | ||
726 | * kind of lower layer not just hardware media. | ||
717 | */ | 727 | */ |
718 | 728 | ||
719 | extern void linkwatch_fire_event(struct net_device *dev); | 729 | extern void linkwatch_fire_event(struct net_device *dev); |
@@ -729,6 +739,29 @@ extern void netif_carrier_on(struct net_device *dev); | |||
729 | 739 | ||
730 | extern void netif_carrier_off(struct net_device *dev); | 740 | extern void netif_carrier_off(struct net_device *dev); |
731 | 741 | ||
742 | static inline void netif_dormant_on(struct net_device *dev) | ||
743 | { | ||
744 | if (!test_and_set_bit(__LINK_STATE_DORMANT, &dev->state)) | ||
745 | linkwatch_fire_event(dev); | ||
746 | } | ||
747 | |||
748 | static inline void netif_dormant_off(struct net_device *dev) | ||
749 | { | ||
750 | if (test_and_clear_bit(__LINK_STATE_DORMANT, &dev->state)) | ||
751 | linkwatch_fire_event(dev); | ||
752 | } | ||
753 | |||
754 | static inline int netif_dormant(const struct net_device *dev) | ||
755 | { | ||
756 | return test_bit(__LINK_STATE_DORMANT, &dev->state); | ||
757 | } | ||
758 | |||
759 | |||
760 | static inline int netif_oper_up(const struct net_device *dev) { | ||
761 | return (dev->operstate == IF_OPER_UP || | ||
762 | dev->operstate == IF_OPER_UNKNOWN /* backward compat */); | ||
763 | } | ||
764 | |||
732 | /* Hot-plugging. */ | 765 | /* Hot-plugging. */ |
733 | static inline int netif_device_present(struct net_device *dev) | 766 | static inline int netif_device_present(struct net_device *dev) |
734 | { | 767 | { |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 468896939843..412e52ca9720 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -80,10 +80,14 @@ struct nf_sockopt_ops | |||
80 | int set_optmin; | 80 | int set_optmin; |
81 | int set_optmax; | 81 | int set_optmax; |
82 | int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); | 82 | int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); |
83 | int (*compat_set)(struct sock *sk, int optval, | ||
84 | void __user *user, unsigned int len); | ||
83 | 85 | ||
84 | int get_optmin; | 86 | int get_optmin; |
85 | int get_optmax; | 87 | int get_optmax; |
86 | int (*get)(struct sock *sk, int optval, void __user *user, int *len); | 88 | int (*get)(struct sock *sk, int optval, void __user *user, int *len); |
89 | int (*compat_get)(struct sock *sk, int optval, | ||
90 | void __user *user, int *len); | ||
87 | 91 | ||
88 | /* Number of users inside set() or get(). */ | 92 | /* Number of users inside set() or get(). */ |
89 | unsigned int use; | 93 | unsigned int use; |
@@ -246,6 +250,11 @@ int nf_setsockopt(struct sock *sk, int pf, int optval, char __user *opt, | |||
246 | int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt, | 250 | int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt, |
247 | int *len); | 251 | int *len); |
248 | 252 | ||
253 | int compat_nf_setsockopt(struct sock *sk, int pf, int optval, | ||
254 | char __user *opt, int len); | ||
255 | int compat_nf_getsockopt(struct sock *sk, int pf, int optval, | ||
256 | char __user *opt, int *len); | ||
257 | |||
249 | /* Packet queuing */ | 258 | /* Packet queuing */ |
250 | struct nf_queue_handler { | 259 | struct nf_queue_handler { |
251 | int (*outfn)(struct sk_buff *skb, struct nf_info *info, | 260 | int (*outfn)(struct sk_buff *skb, struct nf_info *info, |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 934a2479f160..9f5b12cf489b 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -164,6 +164,7 @@ extern void nfattr_parse(struct nfattr *tb[], int maxattr, | |||
164 | __res; \ | 164 | __res; \ |
165 | }) | 165 | }) |
166 | 166 | ||
167 | extern int nfnetlink_has_listeners(unsigned int group); | ||
167 | extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, | 168 | extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, |
168 | int echo); | 169 | int echo); |
169 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); | 170 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); |
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h index b04b03880595..a7497c7436df 100644 --- a/include/linux/netfilter/nfnetlink_log.h +++ b/include/linux/netfilter/nfnetlink_log.h | |||
@@ -47,6 +47,8 @@ enum nfulnl_attr_type { | |||
47 | NFULA_PAYLOAD, /* opaque data payload */ | 47 | NFULA_PAYLOAD, /* opaque data payload */ |
48 | NFULA_PREFIX, /* string prefix */ | 48 | NFULA_PREFIX, /* string prefix */ |
49 | NFULA_UID, /* user id of socket */ | 49 | NFULA_UID, /* user id of socket */ |
50 | NFULA_SEQ, /* instance-local sequence number */ | ||
51 | NFULA_SEQ_GLOBAL, /* global sequence number */ | ||
50 | 52 | ||
51 | __NFULA_MAX | 53 | __NFULA_MAX |
52 | }; | 54 | }; |
@@ -77,6 +79,7 @@ enum nfulnl_attr_config { | |||
77 | NFULA_CFG_NLBUFSIZ, /* u_int32_t buffer size */ | 79 | NFULA_CFG_NLBUFSIZ, /* u_int32_t buffer size */ |
78 | NFULA_CFG_TIMEOUT, /* u_int32_t in 1/100 s */ | 80 | NFULA_CFG_TIMEOUT, /* u_int32_t in 1/100 s */ |
79 | NFULA_CFG_QTHRESH, /* u_int32_t */ | 81 | NFULA_CFG_QTHRESH, /* u_int32_t */ |
82 | NFULA_CFG_FLAGS, /* u_int16_t */ | ||
80 | __NFULA_CFG_MAX | 83 | __NFULA_CFG_MAX |
81 | }; | 84 | }; |
82 | #define NFULA_CFG_MAX (__NFULA_CFG_MAX -1) | 85 | #define NFULA_CFG_MAX (__NFULA_CFG_MAX -1) |
@@ -85,4 +88,7 @@ enum nfulnl_attr_config { | |||
85 | #define NFULNL_COPY_META 0x01 | 88 | #define NFULNL_COPY_META 0x01 |
86 | #define NFULNL_COPY_PACKET 0x02 | 89 | #define NFULNL_COPY_PACKET 0x02 |
87 | 90 | ||
91 | #define NFULNL_CFG_F_SEQ 0x0001 | ||
92 | #define NFULNL_CFG_F_SEQ_GLOBAL 0x0002 | ||
93 | |||
88 | #endif /* _NFNETLINK_LOG_H */ | 94 | #endif /* _NFNETLINK_LOG_H */ |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 6500d4e59d46..46a0f974f87c 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -92,8 +92,6 @@ struct xt_match | |||
92 | 92 | ||
93 | const char name[XT_FUNCTION_MAXNAMELEN-1]; | 93 | const char name[XT_FUNCTION_MAXNAMELEN-1]; |
94 | 94 | ||
95 | u_int8_t revision; | ||
96 | |||
97 | /* Return true or false: return FALSE and set *hotdrop = 1 to | 95 | /* Return true or false: return FALSE and set *hotdrop = 1 to |
98 | force immediate packet drop. */ | 96 | force immediate packet drop. */ |
99 | /* Arguments changed since 2.6.9, as this must now handle | 97 | /* Arguments changed since 2.6.9, as this must now handle |
@@ -102,6 +100,7 @@ struct xt_match | |||
102 | int (*match)(const struct sk_buff *skb, | 100 | int (*match)(const struct sk_buff *skb, |
103 | const struct net_device *in, | 101 | const struct net_device *in, |
104 | const struct net_device *out, | 102 | const struct net_device *out, |
103 | const struct xt_match *match, | ||
105 | const void *matchinfo, | 104 | const void *matchinfo, |
106 | int offset, | 105 | int offset, |
107 | unsigned int protoff, | 106 | unsigned int protoff, |
@@ -111,15 +110,25 @@ struct xt_match | |||
111 | /* Should return true or false. */ | 110 | /* Should return true or false. */ |
112 | int (*checkentry)(const char *tablename, | 111 | int (*checkentry)(const char *tablename, |
113 | const void *ip, | 112 | const void *ip, |
113 | const struct xt_match *match, | ||
114 | void *matchinfo, | 114 | void *matchinfo, |
115 | unsigned int matchinfosize, | 115 | unsigned int matchinfosize, |
116 | unsigned int hook_mask); | 116 | unsigned int hook_mask); |
117 | 117 | ||
118 | /* Called when entry of this type deleted. */ | 118 | /* Called when entry of this type deleted. */ |
119 | void (*destroy)(void *matchinfo, unsigned int matchinfosize); | 119 | void (*destroy)(const struct xt_match *match, void *matchinfo, |
120 | unsigned int matchinfosize); | ||
120 | 121 | ||
121 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 122 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
122 | struct module *me; | 123 | struct module *me; |
124 | |||
125 | char *table; | ||
126 | unsigned int matchsize; | ||
127 | unsigned int hooks; | ||
128 | unsigned short proto; | ||
129 | |||
130 | unsigned short family; | ||
131 | u_int8_t revision; | ||
123 | }; | 132 | }; |
124 | 133 | ||
125 | /* Registration hooks for targets. */ | 134 | /* Registration hooks for targets. */ |
@@ -129,8 +138,6 @@ struct xt_target | |||
129 | 138 | ||
130 | const char name[XT_FUNCTION_MAXNAMELEN-1]; | 139 | const char name[XT_FUNCTION_MAXNAMELEN-1]; |
131 | 140 | ||
132 | u_int8_t revision; | ||
133 | |||
134 | /* Returns verdict. Argument order changed since 2.6.9, as this | 141 | /* Returns verdict. Argument order changed since 2.6.9, as this |
135 | must now handle non-linear skbs, using skb_copy_bits and | 142 | must now handle non-linear skbs, using skb_copy_bits and |
136 | skb_ip_make_writable. */ | 143 | skb_ip_make_writable. */ |
@@ -138,6 +145,7 @@ struct xt_target | |||
138 | const struct net_device *in, | 145 | const struct net_device *in, |
139 | const struct net_device *out, | 146 | const struct net_device *out, |
140 | unsigned int hooknum, | 147 | unsigned int hooknum, |
148 | const struct xt_target *target, | ||
141 | const void *targinfo, | 149 | const void *targinfo, |
142 | void *userdata); | 150 | void *userdata); |
143 | 151 | ||
@@ -147,15 +155,25 @@ struct xt_target | |||
147 | /* Should return true or false. */ | 155 | /* Should return true or false. */ |
148 | int (*checkentry)(const char *tablename, | 156 | int (*checkentry)(const char *tablename, |
149 | const void *entry, | 157 | const void *entry, |
158 | const struct xt_target *target, | ||
150 | void *targinfo, | 159 | void *targinfo, |
151 | unsigned int targinfosize, | 160 | unsigned int targinfosize, |
152 | unsigned int hook_mask); | 161 | unsigned int hook_mask); |
153 | 162 | ||
154 | /* Called when entry of this type deleted. */ | 163 | /* Called when entry of this type deleted. */ |
155 | void (*destroy)(void *targinfo, unsigned int targinfosize); | 164 | void (*destroy)(const struct xt_target *target, void *targinfo, |
165 | unsigned int targinfosize); | ||
156 | 166 | ||
157 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 167 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
158 | struct module *me; | 168 | struct module *me; |
169 | |||
170 | char *table; | ||
171 | unsigned int targetsize; | ||
172 | unsigned int hooks; | ||
173 | unsigned short proto; | ||
174 | |||
175 | unsigned short family; | ||
176 | u_int8_t revision; | ||
159 | }; | 177 | }; |
160 | 178 | ||
161 | /* Furniture shopping... */ | 179 | /* Furniture shopping... */ |
@@ -207,6 +225,13 @@ extern void xt_unregister_target(int af, struct xt_target *target); | |||
207 | extern int xt_register_match(int af, struct xt_match *target); | 225 | extern int xt_register_match(int af, struct xt_match *target); |
208 | extern void xt_unregister_match(int af, struct xt_match *target); | 226 | extern void xt_unregister_match(int af, struct xt_match *target); |
209 | 227 | ||
228 | extern int xt_check_match(const struct xt_match *match, unsigned short family, | ||
229 | unsigned int size, const char *table, unsigned int hook, | ||
230 | unsigned short proto, int inv_proto); | ||
231 | extern int xt_check_target(const struct xt_target *target, unsigned short family, | ||
232 | unsigned int size, const char *table, unsigned int hook, | ||
233 | unsigned short proto, int inv_proto); | ||
234 | |||
210 | extern int xt_register_table(struct xt_table *table, | 235 | extern int xt_register_table(struct xt_table *table, |
211 | struct xt_table_info *bootstrap, | 236 | struct xt_table_info *bootstrap, |
212 | struct xt_table_info *newinfo); | 237 | struct xt_table_info *newinfo); |
diff --git a/include/linux/netfilter/xt_policy.h b/include/linux/netfilter/xt_policy.h new file mode 100644 index 000000000000..a8132ec076fb --- /dev/null +++ b/include/linux/netfilter/xt_policy.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #ifndef _XT_POLICY_H | ||
2 | #define _XT_POLICY_H | ||
3 | |||
4 | #define XT_POLICY_MAX_ELEM 4 | ||
5 | |||
6 | enum xt_policy_flags | ||
7 | { | ||
8 | XT_POLICY_MATCH_IN = 0x1, | ||
9 | XT_POLICY_MATCH_OUT = 0x2, | ||
10 | XT_POLICY_MATCH_NONE = 0x4, | ||
11 | XT_POLICY_MATCH_STRICT = 0x8, | ||
12 | }; | ||
13 | |||
14 | enum xt_policy_modes | ||
15 | { | ||
16 | XT_POLICY_MODE_TRANSPORT, | ||
17 | XT_POLICY_MODE_TUNNEL | ||
18 | }; | ||
19 | |||
20 | struct xt_policy_spec | ||
21 | { | ||
22 | u_int8_t saddr:1, | ||
23 | daddr:1, | ||
24 | proto:1, | ||
25 | mode:1, | ||
26 | spi:1, | ||
27 | reqid:1; | ||
28 | }; | ||
29 | |||
30 | union xt_policy_addr | ||
31 | { | ||
32 | struct in_addr a4; | ||
33 | struct in6_addr a6; | ||
34 | }; | ||
35 | |||
36 | struct xt_policy_elem | ||
37 | { | ||
38 | union xt_policy_addr saddr; | ||
39 | union xt_policy_addr smask; | ||
40 | union xt_policy_addr daddr; | ||
41 | union xt_policy_addr dmask; | ||
42 | u_int32_t spi; | ||
43 | u_int32_t reqid; | ||
44 | u_int8_t proto; | ||
45 | u_int8_t mode; | ||
46 | |||
47 | struct xt_policy_spec match; | ||
48 | struct xt_policy_spec invert; | ||
49 | }; | ||
50 | |||
51 | struct xt_policy_info | ||
52 | { | ||
53 | struct xt_policy_elem pol[XT_POLICY_MAX_ELEM]; | ||
54 | u_int16_t flags; | ||
55 | u_int16_t len; | ||
56 | }; | ||
57 | |||
58 | #endif /* _XT_POLICY_H */ | ||
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index de4d397865ce..a75b84bb9a88 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h | |||
@@ -47,22 +47,6 @@ enum nf_br_hook_priorities { | |||
47 | #define BRNF_BRIDGED 0x08 | 47 | #define BRNF_BRIDGED 0x08 |
48 | #define BRNF_NF_BRIDGE_PREROUTING 0x10 | 48 | #define BRNF_NF_BRIDGE_PREROUTING 0x10 |
49 | 49 | ||
50 | static inline | ||
51 | struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb) | ||
52 | { | ||
53 | struct nf_bridge_info **nf_bridge = &(skb->nf_bridge); | ||
54 | |||
55 | if ((*nf_bridge = kmalloc(sizeof(**nf_bridge), GFP_ATOMIC)) != NULL) { | ||
56 | atomic_set(&(*nf_bridge)->use, 1); | ||
57 | (*nf_bridge)->mask = 0; | ||
58 | (*nf_bridge)->physindev = (*nf_bridge)->physoutdev = NULL; | ||
59 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | ||
60 | (*nf_bridge)->netoutdev = NULL; | ||
61 | #endif | ||
62 | } | ||
63 | |||
64 | return *nf_bridge; | ||
65 | } | ||
66 | 50 | ||
67 | /* Only used in br_forward.c */ | 51 | /* Only used in br_forward.c */ |
68 | static inline | 52 | static inline |
@@ -77,17 +61,6 @@ void nf_bridge_maybe_copy_header(struct sk_buff *skb) | |||
77 | } | 61 | } |
78 | } | 62 | } |
79 | 63 | ||
80 | static inline | ||
81 | void nf_bridge_save_header(struct sk_buff *skb) | ||
82 | { | ||
83 | int header_size = 16; | ||
84 | |||
85 | if (skb->protocol == __constant_htons(ETH_P_8021Q)) | ||
86 | header_size = 18; | ||
87 | |||
88 | memcpy(skb->nf_bridge->data, skb->data - header_size, header_size); | ||
89 | } | ||
90 | |||
91 | /* This is called by the IP fragmenting code and it ensures there is | 64 | /* This is called by the IP fragmenting code and it ensures there is |
92 | * enough room for the encapsulating header (if there is one). */ | 65 | * enough room for the encapsulating header (if there is one). */ |
93 | static inline | 66 | static inline |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 215765f043e6..f32d75c4f4cf 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
@@ -29,6 +29,7 @@ union ip_conntrack_expect_proto { | |||
29 | }; | 29 | }; |
30 | 30 | ||
31 | /* Add protocol helper include file here */ | 31 | /* Add protocol helper include file here */ |
32 | #include <linux/netfilter_ipv4/ip_conntrack_h323.h> | ||
32 | #include <linux/netfilter_ipv4/ip_conntrack_pptp.h> | 33 | #include <linux/netfilter_ipv4/ip_conntrack_pptp.h> |
33 | #include <linux/netfilter_ipv4/ip_conntrack_amanda.h> | 34 | #include <linux/netfilter_ipv4/ip_conntrack_amanda.h> |
34 | #include <linux/netfilter_ipv4/ip_conntrack_ftp.h> | 35 | #include <linux/netfilter_ipv4/ip_conntrack_ftp.h> |
@@ -37,6 +38,7 @@ union ip_conntrack_expect_proto { | |||
37 | /* per conntrack: application helper private data */ | 38 | /* per conntrack: application helper private data */ |
38 | union ip_conntrack_help { | 39 | union ip_conntrack_help { |
39 | /* insert conntrack helper private data (master) here */ | 40 | /* insert conntrack helper private data (master) here */ |
41 | struct ip_ct_h323_master ct_h323_info; | ||
40 | struct ip_ct_pptp_master ct_pptp_info; | 42 | struct ip_ct_pptp_master ct_pptp_info; |
41 | struct ip_ct_ftp_master ct_ftp_info; | 43 | struct ip_ct_ftp_master ct_ftp_info; |
42 | struct ip_ct_irc_master ct_irc_info; | 44 | struct ip_ct_irc_master ct_irc_info; |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h new file mode 100644 index 000000000000..0987cea53840 --- /dev/null +++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef _IP_CONNTRACK_H323_H | ||
2 | #define _IP_CONNTRACK_H323_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #define RAS_PORT 1719 | ||
7 | #define Q931_PORT 1720 | ||
8 | #define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */ | ||
9 | |||
10 | /* This structure exists only once per master */ | ||
11 | struct ip_ct_h323_master { | ||
12 | |||
13 | /* Original and NATed Q.931 or H.245 signal ports */ | ||
14 | u_int16_t sig_port[IP_CT_DIR_MAX]; | ||
15 | |||
16 | /* Original and NATed RTP ports */ | ||
17 | u_int16_t rtp_port[H323_RTP_CHANNEL_MAX][IP_CT_DIR_MAX]; | ||
18 | |||
19 | union { | ||
20 | /* RAS connection timeout */ | ||
21 | u_int32_t timeout; | ||
22 | |||
23 | /* Next TPKT length (for separate TPKT header and data) */ | ||
24 | u_int16_t tpkt_len[IP_CT_DIR_MAX]; | ||
25 | }; | ||
26 | }; | ||
27 | |||
28 | #endif | ||
29 | |||
30 | #endif | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index 41a107de17cf..e9f5ed1d9f68 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h | |||
@@ -23,7 +23,7 @@ struct ip_nat_seq { | |||
23 | * modification (if any) */ | 23 | * modification (if any) */ |
24 | u_int32_t correction_pos; | 24 | u_int32_t correction_pos; |
25 | /* sequence number offset before and after last modification */ | 25 | /* sequence number offset before and after last modification */ |
26 | int32_t offset_before, offset_after; | 26 | int16_t offset_before, offset_after; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | /* Single range specification. */ | 29 | /* Single range specification. */ |
diff --git a/include/linux/netfilter_ipv4/ipt_policy.h b/include/linux/netfilter_ipv4/ipt_policy.h index a3f6eff39d33..b9478a255301 100644 --- a/include/linux/netfilter_ipv4/ipt_policy.h +++ b/include/linux/netfilter_ipv4/ipt_policy.h | |||
@@ -1,58 +1,21 @@ | |||
1 | #ifndef _IPT_POLICY_H | 1 | #ifndef _IPT_POLICY_H |
2 | #define _IPT_POLICY_H | 2 | #define _IPT_POLICY_H |
3 | 3 | ||
4 | #define IPT_POLICY_MAX_ELEM 4 | 4 | #define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM |
5 | 5 | ||
6 | enum ipt_policy_flags | 6 | /* ipt_policy_flags */ |
7 | { | 7 | #define IPT_POLICY_MATCH_IN XT_POLICY_MATCH_IN |
8 | IPT_POLICY_MATCH_IN = 0x1, | 8 | #define IPT_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT |
9 | IPT_POLICY_MATCH_OUT = 0x2, | 9 | #define IPT_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE |
10 | IPT_POLICY_MATCH_NONE = 0x4, | 10 | #define IPT_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT |
11 | IPT_POLICY_MATCH_STRICT = 0x8, | 11 | |
12 | }; | 12 | /* ipt_policy_modes */ |
13 | 13 | #define IPT_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT | |
14 | enum ipt_policy_modes | 14 | #define IPT_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL |
15 | { | 15 | |
16 | IPT_POLICY_MODE_TRANSPORT, | 16 | #define ipt_policy_spec xt_policy_spec |
17 | IPT_POLICY_MODE_TUNNEL | 17 | #define ipt_policy_addr xt_policy_addr |
18 | }; | 18 | #define ipt_policy_elem xt_policy_elem |
19 | 19 | #define ipt_policy_info xt_policy_info | |
20 | struct ipt_policy_spec | ||
21 | { | ||
22 | u_int8_t saddr:1, | ||
23 | daddr:1, | ||
24 | proto:1, | ||
25 | mode:1, | ||
26 | spi:1, | ||
27 | reqid:1; | ||
28 | }; | ||
29 | |||
30 | union ipt_policy_addr | ||
31 | { | ||
32 | struct in_addr a4; | ||
33 | struct in6_addr a6; | ||
34 | }; | ||
35 | |||
36 | struct ipt_policy_elem | ||
37 | { | ||
38 | union ipt_policy_addr saddr; | ||
39 | union ipt_policy_addr smask; | ||
40 | union ipt_policy_addr daddr; | ||
41 | union ipt_policy_addr dmask; | ||
42 | u_int32_t spi; | ||
43 | u_int32_t reqid; | ||
44 | u_int8_t proto; | ||
45 | u_int8_t mode; | ||
46 | |||
47 | struct ipt_policy_spec match; | ||
48 | struct ipt_policy_spec invert; | ||
49 | }; | ||
50 | |||
51 | struct ipt_policy_info | ||
52 | { | ||
53 | struct ipt_policy_elem pol[IPT_POLICY_MAX_ELEM]; | ||
54 | u_int16_t flags; | ||
55 | u_int16_t len; | ||
56 | }; | ||
57 | 20 | ||
58 | #endif /* _IPT_POLICY_H */ | 21 | #endif /* _IPT_POLICY_H */ |
diff --git a/include/linux/netfilter_ipv6/ip6t_policy.h b/include/linux/netfilter_ipv6/ip6t_policy.h index 671bd818300f..6bab3163d2fb 100644 --- a/include/linux/netfilter_ipv6/ip6t_policy.h +++ b/include/linux/netfilter_ipv6/ip6t_policy.h | |||
@@ -1,58 +1,21 @@ | |||
1 | #ifndef _IP6T_POLICY_H | 1 | #ifndef _IP6T_POLICY_H |
2 | #define _IP6T_POLICY_H | 2 | #define _IP6T_POLICY_H |
3 | 3 | ||
4 | #define IP6T_POLICY_MAX_ELEM 4 | 4 | #define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM |
5 | 5 | ||
6 | enum ip6t_policy_flags | 6 | /* ip6t_policy_flags */ |
7 | { | 7 | #define IP6T_POLICY_MATCH_IN XT_POLICY_MATCH_IN |
8 | IP6T_POLICY_MATCH_IN = 0x1, | 8 | #define IP6T_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT |
9 | IP6T_POLICY_MATCH_OUT = 0x2, | 9 | #define IP6T_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE |
10 | IP6T_POLICY_MATCH_NONE = 0x4, | 10 | #define IP6T_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT |
11 | IP6T_POLICY_MATCH_STRICT = 0x8, | 11 | |
12 | }; | 12 | /* ip6t_policy_modes */ |
13 | 13 | #define IP6T_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT | |
14 | enum ip6t_policy_modes | 14 | #define IP6T_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL |
15 | { | 15 | |
16 | IP6T_POLICY_MODE_TRANSPORT, | 16 | #define ip6t_policy_spec xt_policy_spec |
17 | IP6T_POLICY_MODE_TUNNEL | 17 | #define ip6t_policy_addr xt_policy_addr |
18 | }; | 18 | #define ip6t_policy_elem xt_policy_elem |
19 | 19 | #define ip6t_policy_info xt_policy_info | |
20 | struct ip6t_policy_spec | ||
21 | { | ||
22 | u_int8_t saddr:1, | ||
23 | daddr:1, | ||
24 | proto:1, | ||
25 | mode:1, | ||
26 | spi:1, | ||
27 | reqid:1; | ||
28 | }; | ||
29 | |||
30 | union ip6t_policy_addr | ||
31 | { | ||
32 | struct in_addr a4; | ||
33 | struct in6_addr a6; | ||
34 | }; | ||
35 | |||
36 | struct ip6t_policy_elem | ||
37 | { | ||
38 | union ip6t_policy_addr saddr; | ||
39 | union ip6t_policy_addr smask; | ||
40 | union ip6t_policy_addr daddr; | ||
41 | union ip6t_policy_addr dmask; | ||
42 | u_int32_t spi; | ||
43 | u_int32_t reqid; | ||
44 | u_int8_t proto; | ||
45 | u_int8_t mode; | ||
46 | |||
47 | struct ip6t_policy_spec match; | ||
48 | struct ip6t_policy_spec invert; | ||
49 | }; | ||
50 | |||
51 | struct ip6t_policy_info | ||
52 | { | ||
53 | struct ip6t_policy_elem pol[IP6T_POLICY_MAX_ELEM]; | ||
54 | u_int16_t flags; | ||
55 | u_int16_t len; | ||
56 | }; | ||
57 | 20 | ||
58 | #endif /* _IP6T_POLICY_H */ | 21 | #endif /* _IP6T_POLICY_H */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index c256ebe2a7b4..f8f3d1c927f8 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -151,6 +151,7 @@ struct netlink_skb_parms | |||
151 | 151 | ||
152 | extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module); | 152 | extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module); |
153 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 153 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
154 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); | ||
154 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | 155 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); |
155 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, | 156 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, |
156 | __u32 group, gfp_t allocation); | 157 | __u32 group, gfp_t allocation); |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 751eea58bde8..b9810ddf435a 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1857,16 +1857,22 @@ | |||
1857 | #define PCI_DEVICE_ID_TIGON3_5705M 0x165d | 1857 | #define PCI_DEVICE_ID_TIGON3_5705M 0x165d |
1858 | #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e | 1858 | #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e |
1859 | #define PCI_DEVICE_ID_TIGON3_5714 0x1668 | 1859 | #define PCI_DEVICE_ID_TIGON3_5714 0x1668 |
1860 | #define PCI_DEVICE_ID_TIGON3_5714S 0x1669 | ||
1860 | #define PCI_DEVICE_ID_TIGON3_5780 0x166a | 1861 | #define PCI_DEVICE_ID_TIGON3_5780 0x166a |
1861 | #define PCI_DEVICE_ID_TIGON3_5780S 0x166b | 1862 | #define PCI_DEVICE_ID_TIGON3_5780S 0x166b |
1862 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e | 1863 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e |
1864 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 | ||
1863 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 | 1865 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 |
1864 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 | 1866 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 |
1865 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 | 1867 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 |
1868 | #define PCI_DEVICE_ID_TIGON3_5715S 0x1679 | ||
1869 | #define PCI_DEVICE_ID_TIGON3_5754 0x167a | ||
1866 | #define PCI_DEVICE_ID_TIGON3_5750M 0x167c | 1870 | #define PCI_DEVICE_ID_TIGON3_5750M 0x167c |
1867 | #define PCI_DEVICE_ID_TIGON3_5751M 0x167d | 1871 | #define PCI_DEVICE_ID_TIGON3_5751M 0x167d |
1868 | #define PCI_DEVICE_ID_TIGON3_5751F 0x167e | 1872 | #define PCI_DEVICE_ID_TIGON3_5751F 0x167e |
1873 | #define PCI_DEVICE_ID_TIGON3_5787M 0x1693 | ||
1869 | #define PCI_DEVICE_ID_TIGON3_5782 0x1696 | 1874 | #define PCI_DEVICE_ID_TIGON3_5782 0x1696 |
1875 | #define PCI_DEVICE_ID_TIGON3_5787 0x169b | ||
1870 | #define PCI_DEVICE_ID_TIGON3_5788 0x169c | 1876 | #define PCI_DEVICE_ID_TIGON3_5788 0x169c |
1871 | #define PCI_DEVICE_ID_TIGON3_5789 0x169d | 1877 | #define PCI_DEVICE_ID_TIGON3_5789 0x169d |
1872 | #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 | 1878 | #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index d50482ba27fe..d572d5376319 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -199,6 +199,7 @@ enum | |||
199 | #define RTPROT_BIRD 12 /* BIRD */ | 199 | #define RTPROT_BIRD 12 /* BIRD */ |
200 | #define RTPROT_DNROUTED 13 /* DECnet routing daemon */ | 200 | #define RTPROT_DNROUTED 13 /* DECnet routing daemon */ |
201 | #define RTPROT_XORP 14 /* XORP */ | 201 | #define RTPROT_XORP 14 /* XORP */ |
202 | #define RTPROT_NTK 15 /* Netsukuku */ | ||
202 | 203 | ||
203 | /* rtm_scope | 204 | /* rtm_scope |
204 | 205 | ||
@@ -733,6 +734,8 @@ enum | |||
733 | #define IFLA_MAP IFLA_MAP | 734 | #define IFLA_MAP IFLA_MAP |
734 | IFLA_WEIGHT, | 735 | IFLA_WEIGHT, |
735 | #define IFLA_WEIGHT IFLA_WEIGHT | 736 | #define IFLA_WEIGHT IFLA_WEIGHT |
737 | IFLA_OPERSTATE, | ||
738 | IFLA_LINKMODE, | ||
736 | __IFLA_MAX | 739 | __IFLA_MAX |
737 | }; | 740 | }; |
738 | 741 | ||
@@ -905,6 +908,7 @@ struct tcamsg | |||
905 | #ifdef __KERNEL__ | 908 | #ifdef __KERNEL__ |
906 | 909 | ||
907 | #include <linux/config.h> | 910 | #include <linux/config.h> |
911 | #include <linux/mutex.h> | ||
908 | 912 | ||
909 | extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); | 913 | extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); |
910 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) | 914 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) |
@@ -1036,24 +1040,17 @@ __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) | |||
1036 | 1040 | ||
1037 | extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); | 1041 | extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); |
1038 | 1042 | ||
1039 | extern struct semaphore rtnl_sem; | 1043 | /* RTNL is used as a global lock for all changes to network configuration */ |
1040 | |||
1041 | #define rtnl_shlock() down(&rtnl_sem) | ||
1042 | #define rtnl_shlock_nowait() down_trylock(&rtnl_sem) | ||
1043 | |||
1044 | #define rtnl_shunlock() do { up(&rtnl_sem); \ | ||
1045 | if (rtnl && rtnl->sk_receive_queue.qlen) \ | ||
1046 | rtnl->sk_data_ready(rtnl, 0); \ | ||
1047 | } while(0) | ||
1048 | |||
1049 | extern void rtnl_lock(void); | 1044 | extern void rtnl_lock(void); |
1050 | extern int rtnl_lock_interruptible(void); | ||
1051 | extern void rtnl_unlock(void); | 1045 | extern void rtnl_unlock(void); |
1046 | extern int rtnl_trylock(void); | ||
1047 | |||
1052 | extern void rtnetlink_init(void); | 1048 | extern void rtnetlink_init(void); |
1049 | extern void __rtnl_unlock(void); | ||
1053 | 1050 | ||
1054 | #define ASSERT_RTNL() do { \ | 1051 | #define ASSERT_RTNL() do { \ |
1055 | if (unlikely(down_trylock(&rtnl_sem) == 0)) { \ | 1052 | if (unlikely(rtnl_trylock())) { \ |
1056 | up(&rtnl_sem); \ | 1053 | rtnl_unlock(); \ |
1057 | printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \ | 1054 | printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \ |
1058 | __FILE__, __LINE__); \ | 1055 | __FILE__, __LINE__); \ |
1059 | dump_stack(); \ | 1056 | dump_stack(); \ |
diff --git a/include/linux/security.h b/include/linux/security.h index 7cbef482e13a..b18eb8cfa639 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1286,7 +1286,8 @@ struct security_operations { | |||
1286 | int (*socket_setsockopt) (struct socket * sock, int level, int optname); | 1286 | int (*socket_setsockopt) (struct socket * sock, int level, int optname); |
1287 | int (*socket_shutdown) (struct socket * sock, int how); | 1287 | int (*socket_shutdown) (struct socket * sock, int how); |
1288 | int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); | 1288 | int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); |
1289 | int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); | 1289 | int (*socket_getpeersec_stream) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); |
1290 | int (*socket_getpeersec_dgram) (struct sk_buff *skb, char **secdata, u32 *seclen); | ||
1290 | int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); | 1291 | int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); |
1291 | void (*sk_free_security) (struct sock *sk); | 1292 | void (*sk_free_security) (struct sock *sk); |
1292 | unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir); | 1293 | unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir); |
@@ -2741,10 +2742,16 @@ static inline int security_sock_rcv_skb (struct sock * sk, | |||
2741 | return security_ops->socket_sock_rcv_skb (sk, skb); | 2742 | return security_ops->socket_sock_rcv_skb (sk, skb); |
2742 | } | 2743 | } |
2743 | 2744 | ||
2744 | static inline int security_socket_getpeersec(struct socket *sock, char __user *optval, | 2745 | static inline int security_socket_getpeersec_stream(struct socket *sock, char __user *optval, |
2745 | int __user *optlen, unsigned len) | 2746 | int __user *optlen, unsigned len) |
2746 | { | 2747 | { |
2747 | return security_ops->socket_getpeersec(sock, optval, optlen, len); | 2748 | return security_ops->socket_getpeersec_stream(sock, optval, optlen, len); |
2749 | } | ||
2750 | |||
2751 | static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata, | ||
2752 | u32 *seclen) | ||
2753 | { | ||
2754 | return security_ops->socket_getpeersec_dgram(skb, secdata, seclen); | ||
2748 | } | 2755 | } |
2749 | 2756 | ||
2750 | static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) | 2757 | static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) |
@@ -2863,8 +2870,14 @@ static inline int security_sock_rcv_skb (struct sock * sk, | |||
2863 | return 0; | 2870 | return 0; |
2864 | } | 2871 | } |
2865 | 2872 | ||
2866 | static inline int security_socket_getpeersec(struct socket *sock, char __user *optval, | 2873 | static inline int security_socket_getpeersec_stream(struct socket *sock, char __user *optval, |
2867 | int __user *optlen, unsigned len) | 2874 | int __user *optlen, unsigned len) |
2875 | { | ||
2876 | return -ENOPROTOOPT; | ||
2877 | } | ||
2878 | |||
2879 | static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata, | ||
2880 | u32 *seclen) | ||
2868 | { | 2881 | { |
2869 | return -ENOPROTOOPT; | 2882 | return -ENOPROTOOPT; |
2870 | } | 2883 | } |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index ad7cc22bd424..613b9513f8b9 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -270,7 +270,6 @@ struct sk_buff { | |||
270 | 270 | ||
271 | void (*destructor)(struct sk_buff *skb); | 271 | void (*destructor)(struct sk_buff *skb); |
272 | #ifdef CONFIG_NETFILTER | 272 | #ifdef CONFIG_NETFILTER |
273 | __u32 nfmark; | ||
274 | struct nf_conntrack *nfct; | 273 | struct nf_conntrack *nfct; |
275 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 274 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
276 | struct sk_buff *nfct_reasm; | 275 | struct sk_buff *nfct_reasm; |
@@ -278,6 +277,7 @@ struct sk_buff { | |||
278 | #ifdef CONFIG_BRIDGE_NETFILTER | 277 | #ifdef CONFIG_BRIDGE_NETFILTER |
279 | struct nf_bridge_info *nf_bridge; | 278 | struct nf_bridge_info *nf_bridge; |
280 | #endif | 279 | #endif |
280 | __u32 nfmark; | ||
281 | #endif /* CONFIG_NETFILTER */ | 281 | #endif /* CONFIG_NETFILTER */ |
282 | #ifdef CONFIG_NET_SCHED | 282 | #ifdef CONFIG_NET_SCHED |
283 | __u16 tc_index; /* traffic control index */ | 283 | __u16 tc_index; /* traffic control index */ |
@@ -304,6 +304,7 @@ struct sk_buff { | |||
304 | 304 | ||
305 | #include <asm/system.h> | 305 | #include <asm/system.h> |
306 | 306 | ||
307 | extern void kfree_skb(struct sk_buff *skb); | ||
307 | extern void __kfree_skb(struct sk_buff *skb); | 308 | extern void __kfree_skb(struct sk_buff *skb); |
308 | extern struct sk_buff *__alloc_skb(unsigned int size, | 309 | extern struct sk_buff *__alloc_skb(unsigned int size, |
309 | gfp_t priority, int fclone); | 310 | gfp_t priority, int fclone); |
@@ -404,22 +405,6 @@ static inline struct sk_buff *skb_get(struct sk_buff *skb) | |||
404 | */ | 405 | */ |
405 | 406 | ||
406 | /** | 407 | /** |
407 | * kfree_skb - free an sk_buff | ||
408 | * @skb: buffer to free | ||
409 | * | ||
410 | * Drop a reference to the buffer and free it if the usage count has | ||
411 | * hit zero. | ||
412 | */ | ||
413 | static inline void kfree_skb(struct sk_buff *skb) | ||
414 | { | ||
415 | if (likely(atomic_read(&skb->users) == 1)) | ||
416 | smp_rmb(); | ||
417 | else if (likely(!atomic_dec_and_test(&skb->users))) | ||
418 | return; | ||
419 | __kfree_skb(skb); | ||
420 | } | ||
421 | |||
422 | /** | ||
423 | * skb_cloned - is the buffer a clone | 408 | * skb_cloned - is the buffer a clone |
424 | * @skb: buffer to check | 409 | * @skb: buffer to check |
425 | * | 410 | * |
@@ -1174,12 +1159,14 @@ static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp) | |||
1174 | */ | 1159 | */ |
1175 | 1160 | ||
1176 | static inline void skb_postpull_rcsum(struct sk_buff *skb, | 1161 | static inline void skb_postpull_rcsum(struct sk_buff *skb, |
1177 | const void *start, int len) | 1162 | const void *start, unsigned int len) |
1178 | { | 1163 | { |
1179 | if (skb->ip_summed == CHECKSUM_HW) | 1164 | if (skb->ip_summed == CHECKSUM_HW) |
1180 | skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); | 1165 | skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); |
1181 | } | 1166 | } |
1182 | 1167 | ||
1168 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); | ||
1169 | |||
1183 | /** | 1170 | /** |
1184 | * pskb_trim_rcsum - trim received skb and update checksum | 1171 | * pskb_trim_rcsum - trim received skb and update checksum |
1185 | * @skb: buffer to trim | 1172 | * @skb: buffer to trim |
@@ -1351,16 +1338,6 @@ static inline void nf_conntrack_put_reasm(struct sk_buff *skb) | |||
1351 | kfree_skb(skb); | 1338 | kfree_skb(skb); |
1352 | } | 1339 | } |
1353 | #endif | 1340 | #endif |
1354 | static inline void nf_reset(struct sk_buff *skb) | ||
1355 | { | ||
1356 | nf_conntrack_put(skb->nfct); | ||
1357 | skb->nfct = NULL; | ||
1358 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
1359 | nf_conntrack_put_reasm(skb->nfct_reasm); | ||
1360 | skb->nfct_reasm = NULL; | ||
1361 | #endif | ||
1362 | } | ||
1363 | |||
1364 | #ifdef CONFIG_BRIDGE_NETFILTER | 1341 | #ifdef CONFIG_BRIDGE_NETFILTER |
1365 | static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge) | 1342 | static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge) |
1366 | { | 1343 | { |
@@ -1373,6 +1350,20 @@ static inline void nf_bridge_get(struct nf_bridge_info *nf_bridge) | |||
1373 | atomic_inc(&nf_bridge->use); | 1350 | atomic_inc(&nf_bridge->use); |
1374 | } | 1351 | } |
1375 | #endif /* CONFIG_BRIDGE_NETFILTER */ | 1352 | #endif /* CONFIG_BRIDGE_NETFILTER */ |
1353 | static inline void nf_reset(struct sk_buff *skb) | ||
1354 | { | ||
1355 | nf_conntrack_put(skb->nfct); | ||
1356 | skb->nfct = NULL; | ||
1357 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
1358 | nf_conntrack_put_reasm(skb->nfct_reasm); | ||
1359 | skb->nfct_reasm = NULL; | ||
1360 | #endif | ||
1361 | #ifdef CONFIG_BRIDGE_NETFILTER | ||
1362 | nf_bridge_put(skb->nf_bridge); | ||
1363 | skb->nf_bridge = NULL; | ||
1364 | #endif | ||
1365 | } | ||
1366 | |||
1376 | #else /* CONFIG_NETFILTER */ | 1367 | #else /* CONFIG_NETFILTER */ |
1377 | static inline void nf_reset(struct sk_buff *skb) {} | 1368 | static inline void nf_reset(struct sk_buff *skb) {} |
1378 | #endif /* CONFIG_NETFILTER */ | 1369 | #endif /* CONFIG_NETFILTER */ |
diff --git a/include/linux/socket.h b/include/linux/socket.h index b02dda4ee83d..9ab2ddd80221 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -150,6 +150,7 @@ __KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__ | |||
150 | 150 | ||
151 | #define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */ | 151 | #define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */ |
152 | #define SCM_CREDENTIALS 0x02 /* rw: struct ucred */ | 152 | #define SCM_CREDENTIALS 0x02 /* rw: struct ucred */ |
153 | #define SCM_SECURITY 0x03 /* rw: security label */ | ||
153 | 154 | ||
154 | struct ucred { | 155 | struct ucred { |
155 | __u32 pid; | 156 | __u32 pid; |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index d33c6face032..b4acb3d37c3f 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -36,7 +36,7 @@ struct svc_sock { | |||
36 | 36 | ||
37 | struct list_head sk_deferred; /* deferred requests that need to | 37 | struct list_head sk_deferred; /* deferred requests that need to |
38 | * be revisted */ | 38 | * be revisted */ |
39 | struct semaphore sk_sem; /* to serialize sending data */ | 39 | struct mutex sk_mutex; /* to serialize sending data */ |
40 | 40 | ||
41 | int (*sk_recvfrom)(struct svc_rqst *rqstp); | 41 | int (*sk_recvfrom)(struct svc_rqst *rqstp); |
42 | int (*sk_sendto)(struct svc_rqst *rqstp); | 42 | int (*sk_sendto)(struct svc_rqst *rqstp); |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index bac61db26456..76eaeff76f82 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -211,6 +211,7 @@ enum | |||
211 | NET_SCTP=17, | 211 | NET_SCTP=17, |
212 | NET_LLC=18, | 212 | NET_LLC=18, |
213 | NET_NETFILTER=19, | 213 | NET_NETFILTER=19, |
214 | NET_DCCP=20, | ||
214 | }; | 215 | }; |
215 | 216 | ||
216 | /* /proc/sys/kernel/random */ | 217 | /* /proc/sys/kernel/random */ |
@@ -261,6 +262,8 @@ enum | |||
261 | NET_CORE_DEV_WEIGHT=17, | 262 | NET_CORE_DEV_WEIGHT=17, |
262 | NET_CORE_SOMAXCONN=18, | 263 | NET_CORE_SOMAXCONN=18, |
263 | NET_CORE_BUDGET=19, | 264 | NET_CORE_BUDGET=19, |
265 | NET_CORE_AEVENT_ETIME=20, | ||
266 | NET_CORE_AEVENT_RSEQTH=21, | ||
264 | }; | 267 | }; |
265 | 268 | ||
266 | /* /proc/sys/net/ethernet */ | 269 | /* /proc/sys/net/ethernet */ |
@@ -397,6 +400,9 @@ enum | |||
397 | NET_TCP_CONG_CONTROL=110, | 400 | NET_TCP_CONG_CONTROL=110, |
398 | NET_TCP_ABC=111, | 401 | NET_TCP_ABC=111, |
399 | NET_IPV4_IPFRAG_MAX_DIST=112, | 402 | NET_IPV4_IPFRAG_MAX_DIST=112, |
403 | NET_TCP_MTU_PROBING=113, | ||
404 | NET_TCP_BASE_MSS=114, | ||
405 | NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115, | ||
400 | }; | 406 | }; |
401 | 407 | ||
402 | enum { | 408 | enum { |
@@ -451,6 +457,7 @@ enum | |||
451 | NET_IPV4_CONF_ARP_ANNOUNCE=18, | 457 | NET_IPV4_CONF_ARP_ANNOUNCE=18, |
452 | NET_IPV4_CONF_ARP_IGNORE=19, | 458 | NET_IPV4_CONF_ARP_IGNORE=19, |
453 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, | 459 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, |
460 | NET_IPV4_CONF_ARP_ACCEPT=21, | ||
454 | __NET_IPV4_CONF_MAX | 461 | __NET_IPV4_CONF_MAX |
455 | }; | 462 | }; |
456 | 463 | ||
@@ -531,6 +538,11 @@ enum { | |||
531 | NET_IPV6_MAX_DESYNC_FACTOR=15, | 538 | NET_IPV6_MAX_DESYNC_FACTOR=15, |
532 | NET_IPV6_MAX_ADDRESSES=16, | 539 | NET_IPV6_MAX_ADDRESSES=16, |
533 | NET_IPV6_FORCE_MLD_VERSION=17, | 540 | NET_IPV6_FORCE_MLD_VERSION=17, |
541 | NET_IPV6_ACCEPT_RA_DEFRTR=18, | ||
542 | NET_IPV6_ACCEPT_RA_PINFO=19, | ||
543 | NET_IPV6_ACCEPT_RA_RTR_PREF=20, | ||
544 | NET_IPV6_RTR_PROBE_INTERVAL=21, | ||
545 | NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, | ||
534 | __NET_IPV6_MAX | 546 | __NET_IPV6_MAX |
535 | }; | 547 | }; |
536 | 548 | ||
@@ -562,6 +574,21 @@ enum { | |||
562 | __NET_NEIGH_MAX | 574 | __NET_NEIGH_MAX |
563 | }; | 575 | }; |
564 | 576 | ||
577 | /* /proc/sys/net/dccp */ | ||
578 | enum { | ||
579 | NET_DCCP_DEFAULT=1, | ||
580 | }; | ||
581 | |||
582 | /* /proc/sys/net/dccp/default */ | ||
583 | enum { | ||
584 | NET_DCCP_DEFAULT_SEQ_WINDOW = 1, | ||
585 | NET_DCCP_DEFAULT_RX_CCID = 2, | ||
586 | NET_DCCP_DEFAULT_TX_CCID = 3, | ||
587 | NET_DCCP_DEFAULT_ACK_RATIO = 4, | ||
588 | NET_DCCP_DEFAULT_SEND_ACKVEC = 5, | ||
589 | NET_DCCP_DEFAULT_SEND_NDP = 6, | ||
590 | }; | ||
591 | |||
565 | /* /proc/sys/net/ipx */ | 592 | /* /proc/sys/net/ipx */ |
566 | enum { | 593 | enum { |
567 | NET_IPX_PPROP_BROADCASTING=1, | 594 | NET_IPX_PPROP_BROADCASTING=1, |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index f2bb2396853f..542d39596bd8 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -343,6 +343,12 @@ struct tcp_sock { | |||
343 | __u32 seq; | 343 | __u32 seq; |
344 | __u32 time; | 344 | __u32 time; |
345 | } rcvq_space; | 345 | } rcvq_space; |
346 | |||
347 | /* TCP-specific MTU probe information. */ | ||
348 | struct { | ||
349 | __u32 probe_seq_start; | ||
350 | __u32 probe_seq_end; | ||
351 | } mtu_probe; | ||
346 | }; | 352 | }; |
347 | 353 | ||
348 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) | 354 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 827cc6de5f5c..130d125fda12 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -1018,8 +1018,6 @@ extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype, | |||
1018 | unsigned char descindex, void *buf, int size); | 1018 | unsigned char descindex, void *buf, int size); |
1019 | extern int usb_get_status(struct usb_device *dev, | 1019 | extern int usb_get_status(struct usb_device *dev, |
1020 | int type, int target, void *data); | 1020 | int type, int target, void *data); |
1021 | extern int usb_get_string(struct usb_device *dev, | ||
1022 | unsigned short langid, unsigned char index, void *buf, int size); | ||
1023 | extern int usb_string(struct usb_device *dev, int index, | 1021 | extern int usb_string(struct usb_device *dev, int index, |
1024 | char *buf, size_t size); | 1022 | char *buf, size_t size); |
1025 | 1023 | ||
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h index ff81117eb733..1d78870ed8af 100644 --- a/include/linux/usb_gadget.h +++ b/include/linux/usb_gadget.h | |||
@@ -801,7 +801,9 @@ struct usb_gadget_driver { | |||
801 | * Call this in your gadget driver's module initialization function, | 801 | * Call this in your gadget driver's module initialization function, |
802 | * to tell the underlying usb controller driver about your driver. | 802 | * to tell the underlying usb controller driver about your driver. |
803 | * The driver's bind() function will be called to bind it to a | 803 | * The driver's bind() function will be called to bind it to a |
804 | * gadget. This function must be called in a context that can sleep. | 804 | * gadget before this registration call returns. It's expected that |
805 | * the bind() functions will be in init sections. | ||
806 | * This function must be called in a context that can sleep. | ||
805 | */ | 807 | */ |
806 | int usb_gadget_register_driver (struct usb_gadget_driver *driver); | 808 | int usb_gadget_register_driver (struct usb_gadget_driver *driver); |
807 | 809 | ||
@@ -814,7 +816,8 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver); | |||
814 | * going away. If the controller is connected to a USB host, | 816 | * going away. If the controller is connected to a USB host, |
815 | * it will first disconnect(). The driver is also requested | 817 | * it will first disconnect(). The driver is also requested |
816 | * to unbind() and clean up any device state, before this procedure | 818 | * to unbind() and clean up any device state, before this procedure |
817 | * finally returns. | 819 | * finally returns. It's expected that the unbind() functions |
820 | * will in in exit sections, so may not be linked in some kernels. | ||
818 | * This function must be called in a context that can sleep. | 821 | * This function must be called in a context that can sleep. |
819 | */ | 822 | */ |
820 | int usb_gadget_unregister_driver (struct usb_gadget_driver *driver); | 823 | int usb_gadget_unregister_driver (struct usb_gadget_driver *driver); |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 5208b12d5550..724cfbf54b8a 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -17,11 +17,12 @@ | |||
17 | #include <linux/time.h> /* need struct timeval */ | 17 | #include <linux/time.h> /* need struct timeval */ |
18 | #include <linux/poll.h> | 18 | #include <linux/poll.h> |
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/mutex.h> | ||
20 | #endif | 21 | #endif |
21 | #include <linux/compiler.h> /* need __user */ | 22 | #include <linux/compiler.h> /* need __user */ |
22 | 23 | ||
23 | 24 | ||
24 | #define OBSOLETE_OWNER 1 /* It will be removed for 2.6.15 */ | 25 | #define OBSOLETE_OWNER 1 /* It will be removed for 2.6.17 */ |
25 | #define HAVE_V4L2 1 | 26 | #define HAVE_V4L2 1 |
26 | 27 | ||
27 | /* | 28 | /* |
@@ -48,6 +49,16 @@ | |||
48 | 49 | ||
49 | #ifdef __KERNEL__ | 50 | #ifdef __KERNEL__ |
50 | 51 | ||
52 | /* Minor device allocation */ | ||
53 | #define MINOR_VFL_TYPE_GRABBER_MIN 0 | ||
54 | #define MINOR_VFL_TYPE_GRABBER_MAX 63 | ||
55 | #define MINOR_VFL_TYPE_RADIO_MIN 64 | ||
56 | #define MINOR_VFL_TYPE_RADIO_MAX 127 | ||
57 | #define MINOR_VFL_TYPE_VTX_MIN 192 | ||
58 | #define MINOR_VFL_TYPE_VTX_MAX 223 | ||
59 | #define MINOR_VFL_TYPE_VBI_MIN 224 | ||
60 | #define MINOR_VFL_TYPE_VBI_MAX 255 | ||
61 | |||
51 | #define VFL_TYPE_GRABBER 0 | 62 | #define VFL_TYPE_GRABBER 0 |
52 | #define VFL_TYPE_VBI 1 | 63 | #define VFL_TYPE_VBI 1 |
53 | #define VFL_TYPE_RADIO 2 | 64 | #define VFL_TYPE_RADIO 2 |
@@ -80,7 +91,7 @@ struct video_device | |||
80 | 91 | ||
81 | /* for videodev.c intenal usage -- please don't touch */ | 92 | /* for videodev.c intenal usage -- please don't touch */ |
82 | int users; /* video_exclusive_{open|close} ... */ | 93 | int users; /* video_exclusive_{open|close} ... */ |
83 | struct semaphore lock; /* ... helper function uses these */ | 94 | struct mutex lock; /* ... helper function uses these */ |
84 | char devfs_name[64]; /* devfs */ | 95 | char devfs_name[64]; /* devfs */ |
85 | struct class_device class_dev; /* sysfs */ | 96 | struct class_device class_dev; /* sysfs */ |
86 | }; | 97 | }; |
@@ -952,13 +963,68 @@ struct v4l2_sliced_vbi_format | |||
952 | __u32 reserved[2]; /* must be zero */ | 963 | __u32 reserved[2]; /* must be zero */ |
953 | }; | 964 | }; |
954 | 965 | ||
955 | #define V4L2_SLICED_TELETEXT_B (0x0001) | 966 | /* Teletext World System Teletext |
956 | #define V4L2_SLICED_VPS (0x0400) | 967 | (WST), defined on ITU-R BT.653-2 */ |
957 | #define V4L2_SLICED_CAPTION_525 (0x1000) | 968 | #define V4L2_SLICED_TELETEXT_PAL_B (0x000001) |
958 | #define V4L2_SLICED_WSS_625 (0x4000) | 969 | #define V4L2_SLICED_TELETEXT_PAL_C (0x000002) |
959 | 970 | #define V4L2_SLICED_TELETEXT_NTSC_B (0x000010) | |
960 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) | 971 | #define V4L2_SLICED_TELETEXT_SECAM (0x000020) |
961 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) | 972 | |
973 | /* Teletext North American Broadcast Teletext Specification | ||
974 | (NABTS), defined on ITU-R BT.653-2 */ | ||
975 | #define V4L2_SLICED_TELETEXT_NTSC_C (0x000040) | ||
976 | #define V4L2_SLICED_TELETEXT_NTSC_D (0x000080) | ||
977 | |||
978 | /* Video Program System, defined on ETS 300 231*/ | ||
979 | #define V4L2_SLICED_VPS (0x000400) | ||
980 | |||
981 | /* Closed Caption, defined on EIA-608 */ | ||
982 | #define V4L2_SLICED_CAPTION_525 (0x001000) | ||
983 | #define V4L2_SLICED_CAPTION_625 (0x002000) | ||
984 | |||
985 | /* Wide Screen System, defined on ITU-R BT1119.1 */ | ||
986 | #define V4L2_SLICED_WSS_625 (0x004000) | ||
987 | |||
988 | /* Wide Screen System, defined on IEC 61880 */ | ||
989 | #define V4L2_SLICED_WSS_525 (0x008000) | ||
990 | |||
991 | /* Vertical Interval Timecode (VITC), defined on SMPTE 12M */ | ||
992 | #define V4l2_SLICED_VITC_625 (0x010000) | ||
993 | #define V4l2_SLICED_VITC_525 (0x020000) | ||
994 | |||
995 | #define V4L2_SLICED_TELETEXT_B (V4L2_SLICED_TELETEXT_PAL_B |\ | ||
996 | V4L2_SLICED_TELETEXT_NTSC_B) | ||
997 | |||
998 | #define V4L2_SLICED_TELETEXT (V4L2_SLICED_TELETEXT_PAL_B |\ | ||
999 | V4L2_SLICED_TELETEXT_PAL_C |\ | ||
1000 | V4L2_SLICED_TELETEXT_SECAM |\ | ||
1001 | V4L2_SLICED_TELETEXT_NTSC_B |\ | ||
1002 | V4L2_SLICED_TELETEXT_NTSC_C |\ | ||
1003 | V4L2_SLICED_TELETEXT_NTSC_D) | ||
1004 | |||
1005 | #define V4L2_SLICED_CAPTION (V4L2_SLICED_CAPTION_525 |\ | ||
1006 | V4L2_SLICED_CAPTION_625) | ||
1007 | |||
1008 | #define V4L2_SLICED_WSS (V4L2_SLICED_WSS_525 |\ | ||
1009 | V4L2_SLICED_WSS_625) | ||
1010 | |||
1011 | #define V4L2_SLICED_VITC (V4L2_SLICED_VITC_525 |\ | ||
1012 | V4L2_SLICED_VITC_625) | ||
1013 | |||
1014 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_TELETEXT_NTSC_B |\ | ||
1015 | V4L2_SLICED_TELETEXT_NTSC_C |\ | ||
1016 | V4L2_SLICED_TELETEXT_NTSC_D |\ | ||
1017 | V4L2_SLICED_CAPTION_525 |\ | ||
1018 | V4L2_SLICED_WSS_525 |\ | ||
1019 | V4l2_SLICED_VITC_525) | ||
1020 | |||
1021 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_PAL_B |\ | ||
1022 | V4L2_SLICED_TELETEXT_PAL_C |\ | ||
1023 | V4L2_SLICED_TELETEXT_SECAM |\ | ||
1024 | V4L2_SLICED_VPS |\ | ||
1025 | V4L2_SLICED_CAPTION_625 |\ | ||
1026 | V4L2_SLICED_WSS_625 |\ | ||
1027 | V4l2_SLICED_VITC_625) | ||
962 | 1028 | ||
963 | struct v4l2_sliced_vbi_cap | 1029 | struct v4l2_sliced_vbi_cap |
964 | { | 1030 | { |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 82fbb758e28f..6b42cc474c01 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -156,6 +156,10 @@ enum { | |||
156 | XFRM_MSG_FLUSHPOLICY, | 156 | XFRM_MSG_FLUSHPOLICY, |
157 | #define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY | 157 | #define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY |
158 | 158 | ||
159 | XFRM_MSG_NEWAE, | ||
160 | #define XFRM_MSG_NEWAE XFRM_MSG_NEWAE | ||
161 | XFRM_MSG_GETAE, | ||
162 | #define XFRM_MSG_GETAE XFRM_MSG_GETAE | ||
159 | __XFRM_MSG_MAX | 163 | __XFRM_MSG_MAX |
160 | }; | 164 | }; |
161 | #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) | 165 | #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) |
@@ -194,6 +198,21 @@ struct xfrm_encap_tmpl { | |||
194 | xfrm_address_t encap_oa; | 198 | xfrm_address_t encap_oa; |
195 | }; | 199 | }; |
196 | 200 | ||
201 | /* AEVENT flags */ | ||
202 | enum xfrm_ae_ftype_t { | ||
203 | XFRM_AE_UNSPEC, | ||
204 | XFRM_AE_RTHR=1, /* replay threshold*/ | ||
205 | XFRM_AE_RVAL=2, /* replay value */ | ||
206 | XFRM_AE_LVAL=4, /* lifetime value */ | ||
207 | XFRM_AE_ETHR=8, /* expiry timer threshold */ | ||
208 | XFRM_AE_CR=16, /* Event cause is replay update */ | ||
209 | XFRM_AE_CE=32, /* Event cause is timer expiry */ | ||
210 | XFRM_AE_CU=64, /* Event cause is policy update */ | ||
211 | __XFRM_AE_MAX | ||
212 | |||
213 | #define XFRM_AE_MAX (__XFRM_AE_MAX - 1) | ||
214 | }; | ||
215 | |||
197 | /* Netlink message attributes. */ | 216 | /* Netlink message attributes. */ |
198 | enum xfrm_attr_type_t { | 217 | enum xfrm_attr_type_t { |
199 | XFRMA_UNSPEC, | 218 | XFRMA_UNSPEC, |
@@ -205,6 +224,10 @@ enum xfrm_attr_type_t { | |||
205 | XFRMA_SA, | 224 | XFRMA_SA, |
206 | XFRMA_POLICY, | 225 | XFRMA_POLICY, |
207 | XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */ | 226 | XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */ |
227 | XFRMA_LTIME_VAL, | ||
228 | XFRMA_REPLAY_VAL, | ||
229 | XFRMA_REPLAY_THRESH, | ||
230 | XFRMA_ETIMER_THRESH, | ||
208 | __XFRMA_MAX | 231 | __XFRMA_MAX |
209 | 232 | ||
210 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 233 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
@@ -235,6 +258,11 @@ struct xfrm_usersa_id { | |||
235 | __u8 proto; | 258 | __u8 proto; |
236 | }; | 259 | }; |
237 | 260 | ||
261 | struct xfrm_aevent_id { | ||
262 | struct xfrm_usersa_id sa_id; | ||
263 | __u32 flags; | ||
264 | }; | ||
265 | |||
238 | struct xfrm_userspi_info { | 266 | struct xfrm_userspi_info { |
239 | struct xfrm_usersa_info info; | 267 | struct xfrm_usersa_info info; |
240 | __u32 min; | 268 | __u32 min; |
@@ -306,6 +334,8 @@ enum xfrm_nlgroups { | |||
306 | #define XFRMNLGRP_SA XFRMNLGRP_SA | 334 | #define XFRMNLGRP_SA XFRMNLGRP_SA |
307 | XFRMNLGRP_POLICY, | 335 | XFRMNLGRP_POLICY, |
308 | #define XFRMNLGRP_POLICY XFRMNLGRP_POLICY | 336 | #define XFRMNLGRP_POLICY XFRMNLGRP_POLICY |
337 | XFRMNLGRP_AEVENTS, | ||
338 | #define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS | ||
309 | __XFRMNLGRP_MAX | 339 | __XFRMNLGRP_MAX |
310 | }; | 340 | }; |
311 | #define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) | 341 | #define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index ad3e9bb670c3..302d5b3946e7 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -47,13 +47,6 @@ struct ir_input_state { | |||
47 | int keypressed; /* current state */ | 47 | int keypressed; /* current state */ |
48 | }; | 48 | }; |
49 | 49 | ||
50 | extern IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE]; | ||
51 | extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE]; | ||
52 | extern IR_KEYTAB_TYPE ir_codes_pinnacle[IR_KEYTAB_SIZE]; | ||
53 | extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE]; | ||
54 | extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; | ||
55 | extern IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE]; | ||
56 | |||
57 | void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | 50 | void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, |
58 | int ir_type, IR_KEYTAB_TYPE *ir_codes); | 51 | int ir_type, IR_KEYTAB_TYPE *ir_codes); |
59 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); | 52 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); |
@@ -64,6 +57,39 @@ int ir_dump_samples(u32 *samples, int count); | |||
64 | int ir_decode_biphase(u32 *samples, int count, int low, int high); | 57 | int ir_decode_biphase(u32 *samples, int count, int low, int high); |
65 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); | 58 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); |
66 | 59 | ||
60 | /* Keymaps to be used by other modules */ | ||
61 | |||
62 | extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE]; | ||
63 | extern IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE]; | ||
64 | extern IR_KEYTAB_TYPE ir_codes_avermedia_dvbt[IR_KEYTAB_SIZE]; | ||
65 | extern IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE]; | ||
66 | extern IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE]; | ||
67 | extern IR_KEYTAB_TYPE ir_codes_nebula[IR_KEYTAB_SIZE]; | ||
68 | extern IR_KEYTAB_TYPE ir_codes_dntv_live_dvb_t[IR_KEYTAB_SIZE]; | ||
69 | extern IR_KEYTAB_TYPE ir_codes_iodata_bctv7e[IR_KEYTAB_SIZE]; | ||
70 | extern IR_KEYTAB_TYPE ir_codes_adstech_dvb_t_pci[IR_KEYTAB_SIZE]; | ||
71 | extern IR_KEYTAB_TYPE ir_codes_msi_tvanywhere[IR_KEYTAB_SIZE]; | ||
72 | extern IR_KEYTAB_TYPE ir_codes_cinergy_1400[IR_KEYTAB_SIZE]; | ||
73 | extern IR_KEYTAB_TYPE ir_codes_avertv_303[IR_KEYTAB_SIZE]; | ||
74 | extern IR_KEYTAB_TYPE ir_codes_dntv_live_dvbt_pro[IR_KEYTAB_SIZE]; | ||
75 | extern IR_KEYTAB_TYPE ir_codes_em_terratec[IR_KEYTAB_SIZE]; | ||
76 | extern IR_KEYTAB_TYPE ir_codes_em_pinnacle_usb[IR_KEYTAB_SIZE]; | ||
77 | extern IR_KEYTAB_TYPE ir_codes_flyvideo[IR_KEYTAB_SIZE]; | ||
78 | extern IR_KEYTAB_TYPE ir_codes_flydvb[IR_KEYTAB_SIZE]; | ||
79 | extern IR_KEYTAB_TYPE ir_codes_cinergy[IR_KEYTAB_SIZE]; | ||
80 | extern IR_KEYTAB_TYPE ir_codes_eztv[IR_KEYTAB_SIZE]; | ||
81 | extern IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE]; | ||
82 | extern IR_KEYTAB_TYPE ir_codes_videomate_tv_pvr[IR_KEYTAB_SIZE]; | ||
83 | extern IR_KEYTAB_TYPE ir_codes_manli[IR_KEYTAB_SIZE]; | ||
84 | extern IR_KEYTAB_TYPE ir_codes_gotview7135[IR_KEYTAB_SIZE]; | ||
85 | extern IR_KEYTAB_TYPE ir_codes_purpletv[IR_KEYTAB_SIZE]; | ||
86 | extern IR_KEYTAB_TYPE ir_codes_pctv_sedna[IR_KEYTAB_SIZE]; | ||
87 | extern IR_KEYTAB_TYPE ir_codes_pv951[IR_KEYTAB_SIZE]; | ||
88 | extern IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE]; | ||
89 | extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE]; | ||
90 | extern IR_KEYTAB_TYPE ir_codes_pinnacle[IR_KEYTAB_SIZE]; | ||
91 | extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; | ||
92 | |||
67 | #endif | 93 | #endif |
68 | 94 | ||
69 | /* | 95 | /* |
diff --git a/include/media/saa7146.h b/include/media/saa7146.h index 2bc634fcb7bb..fee579f10b32 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #include <linux/i2c.h> /* for i2c subsystem */ | 11 | #include <linux/i2c.h> /* for i2c subsystem */ |
12 | #include <asm/io.h> /* for accessing devices */ | 12 | #include <asm/io.h> /* for accessing devices */ |
13 | #include <linux/stringify.h> | 13 | #include <linux/stringify.h> |
14 | #include <linux/mutex.h> | ||
15 | |||
14 | #include <linux/vmalloc.h> /* for vmalloc() */ | 16 | #include <linux/vmalloc.h> /* for vmalloc() */ |
15 | #include <linux/mm.h> /* for vmalloc_to_page() */ | 17 | #include <linux/mm.h> /* for vmalloc_to_page() */ |
16 | 18 | ||
@@ -112,7 +114,7 @@ struct saa7146_dev | |||
112 | 114 | ||
113 | /* different device locks */ | 115 | /* different device locks */ |
114 | spinlock_t slock; | 116 | spinlock_t slock; |
115 | struct semaphore lock; | 117 | struct mutex lock; |
116 | 118 | ||
117 | unsigned char __iomem *mem; /* pointer to mapped IO memory */ | 119 | unsigned char __iomem *mem; /* pointer to mapped IO memory */ |
118 | int revision; /* chip revision; needed for bug-workarounds*/ | 120 | int revision; /* chip revision; needed for bug-workarounds*/ |
@@ -133,15 +135,16 @@ struct saa7146_dev | |||
133 | void (*vv_callback)(struct saa7146_dev *dev, unsigned long status); | 135 | void (*vv_callback)(struct saa7146_dev *dev, unsigned long status); |
134 | 136 | ||
135 | /* i2c-stuff */ | 137 | /* i2c-stuff */ |
136 | struct semaphore i2c_lock; | 138 | struct mutex i2c_lock; |
137 | u32 i2c_bitrate; | 139 | |
138 | struct saa7146_dma d_i2c; /* pointer to i2c memory */ | 140 | u32 i2c_bitrate; |
139 | wait_queue_head_t i2c_wq; | 141 | struct saa7146_dma d_i2c; /* pointer to i2c memory */ |
140 | int i2c_op; | 142 | wait_queue_head_t i2c_wq; |
143 | int i2c_op; | ||
141 | 144 | ||
142 | /* memories */ | 145 | /* memories */ |
143 | struct saa7146_dma d_rps0; | 146 | struct saa7146_dma d_rps0; |
144 | struct saa7146_dma d_rps1; | 147 | struct saa7146_dma d_rps1; |
145 | }; | 148 | }; |
146 | 149 | ||
147 | /* from saa7146_i2c.c */ | 150 | /* from saa7146_i2c.c */ |
@@ -150,7 +153,7 @@ int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct i2c_msg *msgs, in | |||
150 | 153 | ||
151 | /* from saa7146_core.c */ | 154 | /* from saa7146_core.c */ |
152 | extern struct list_head saa7146_devices; | 155 | extern struct list_head saa7146_devices; |
153 | extern struct semaphore saa7146_devices_lock; | 156 | extern struct mutex saa7146_devices_lock; |
154 | int saa7146_register_extension(struct saa7146_extension*); | 157 | int saa7146_register_extension(struct saa7146_extension*); |
155 | int saa7146_unregister_extension(struct saa7146_extension*); | 158 | int saa7146_unregister_extension(struct saa7146_extension*); |
156 | struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc); | 159 | struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc); |
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h index 15821ab14a9e..ad9c171bfa07 100644 --- a/include/media/tuner-types.h +++ b/include/media/tuner-types.h | |||
@@ -14,6 +14,7 @@ enum param_type { | |||
14 | 14 | ||
15 | struct tuner_range { | 15 | struct tuner_range { |
16 | unsigned short limit; | 16 | unsigned short limit; |
17 | unsigned char config; | ||
17 | unsigned char cb; | 18 | unsigned char cb; |
18 | }; | 19 | }; |
19 | 20 | ||
@@ -38,7 +39,6 @@ struct tuner_params { | |||
38 | * static unless the control byte was sent first. | 39 | * static unless the control byte was sent first. |
39 | */ | 40 | */ |
40 | unsigned int cb_first_if_lower_freq:1; | 41 | unsigned int cb_first_if_lower_freq:1; |
41 | unsigned char config; /* to be moved into struct tuner_range for dvb-pll merge */ | ||
42 | 42 | ||
43 | unsigned int count; | 43 | unsigned int count; |
44 | struct tuner_range *ranges; | 44 | struct tuner_range *ranges; |
@@ -46,6 +46,7 @@ struct tuner_params { | |||
46 | 46 | ||
47 | struct tunertype { | 47 | struct tunertype { |
48 | char *name; | 48 | char *name; |
49 | unsigned int count; | ||
49 | struct tuner_params *params; | 50 | struct tuner_params *params; |
50 | }; | 51 | }; |
51 | 52 | ||
diff --git a/include/media/tuner.h b/include/media/tuner.h index a5beeac495c7..017fed7d5e4d 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
@@ -110,12 +110,15 @@ | |||
110 | 110 | ||
111 | #define TUNER_LG_TDVS_H062F 64 /* DViCO FusionHDTV 5 */ | 111 | #define TUNER_LG_TDVS_H062F 64 /* DViCO FusionHDTV 5 */ |
112 | #define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */ | 112 | #define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */ |
113 | #define TUNER_LG_NTSC_TALN_MINI 66 | 113 | #define TUNER_LG_TALN 66 |
114 | #define TUNER_PHILIPS_TD1316 67 | 114 | #define TUNER_PHILIPS_TD1316 67 |
115 | 115 | ||
116 | #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ | 116 | #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ |
117 | #define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ | 117 | #define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ |
118 | #define TUNER_SAMSUNG_TCPN_2121P30A 70 /* Hauppauge PVR-500MCE NTSC */ | 118 | #define TUNER_SAMSUNG_TCPN_2121P30A 70 /* Hauppauge PVR-500MCE NTSC */ |
119 | #define TUNER_XCEIVE_XC3028 71 | ||
120 | |||
121 | #define TUNER_THOMSON_FE6600 72 /* DViCO FusionHDTV DVB-T Hybrid */ | ||
119 | 122 | ||
120 | /* tv card specific */ | 123 | /* tv card specific */ |
121 | #define TDA9887_PRESENT (1<<0) | 124 | #define TDA9887_PRESENT (1<<0) |
@@ -209,6 +212,7 @@ struct tuner { | |||
209 | extern unsigned const int tuner_count; | 212 | extern unsigned const int tuner_count; |
210 | 213 | ||
211 | extern int microtune_init(struct i2c_client *c); | 214 | extern int microtune_init(struct i2c_client *c); |
215 | extern int xc3028_init(struct i2c_client *c); | ||
212 | extern int tda8290_init(struct i2c_client *c); | 216 | extern int tda8290_init(struct i2c_client *c); |
213 | extern int tda8290_probe(struct i2c_client *c); | 217 | extern int tda8290_probe(struct i2c_client *c); |
214 | extern int tea5767_tuner_init(struct i2c_client *c); | 218 | extern int tea5767_tuner_init(struct i2c_client *c); |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index d4030a7e16e0..2360453e7496 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -58,6 +58,9 @@ | |||
58 | /* Prints the ioctl in a human-readable format */ | 58 | /* Prints the ioctl in a human-readable format */ |
59 | extern void v4l_printk_ioctl(unsigned int cmd); | 59 | extern void v4l_printk_ioctl(unsigned int cmd); |
60 | 60 | ||
61 | /* Prints the ioctl and arg in a human-readable format */ | ||
62 | extern void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg); | ||
63 | |||
61 | /* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */ | 64 | /* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */ |
62 | #define v4l_print_ioctl(name, cmd) \ | 65 | #define v4l_print_ioctl(name, cmd) \ |
63 | do { \ | 66 | do { \ |
@@ -100,6 +103,7 @@ enum v4l2_chip_ident { | |||
100 | V4L2_IDENT_UNKNOWN = 0, | 103 | V4L2_IDENT_UNKNOWN = 0, |
101 | 104 | ||
102 | /* module saa7115: reserved range 100-149 */ | 105 | /* module saa7115: reserved range 100-149 */ |
106 | V4L2_IDENT_SAA7113 = 103, | ||
103 | V4L2_IDENT_SAA7114 = 104, | 107 | V4L2_IDENT_SAA7114 = 104, |
104 | V4L2_IDENT_SAA7115 = 105, | 108 | V4L2_IDENT_SAA7115 = 105, |
105 | 109 | ||
@@ -115,12 +119,15 @@ enum v4l2_chip_ident { | |||
115 | }; | 119 | }; |
116 | 120 | ||
117 | /* audio ioctls */ | 121 | /* audio ioctls */ |
118 | /* v4l device was opened in Radio mode */ | 122 | |
123 | /* v4l device was opened in Radio mode, to be replaced by VIDIOC_INT_S_TUNER_MODE */ | ||
119 | #define AUDC_SET_RADIO _IO('d',88) | 124 | #define AUDC_SET_RADIO _IO('d',88) |
120 | /* select from TV,radio,extern,MUTE */ | 125 | |
126 | /* select from TV,radio,extern,MUTE, to be replaced with VIDIOC_INT_S_AUDIO_ROUTING */ | ||
121 | #define AUDC_SET_INPUT _IOW('d',89,int) | 127 | #define AUDC_SET_INPUT _IOW('d',89,int) |
122 | 128 | ||
123 | /* msp3400 ioctl: will be removed in the near future */ | 129 | /* msp3400 ioctl: will be removed in the near future, to be replaced by |
130 | VIDIOC_INT_S_AUDIO_ROUTING. */ | ||
124 | struct msp_matrix { | 131 | struct msp_matrix { |
125 | int input; | 132 | int input; |
126 | int output; | 133 | int output; |
@@ -128,12 +135,25 @@ struct msp_matrix { | |||
128 | #define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix) | 135 | #define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix) |
129 | 136 | ||
130 | /* tuner ioctls */ | 137 | /* tuner ioctls */ |
138 | |||
131 | /* Sets tuner type and its I2C addr */ | 139 | /* Sets tuner type and its I2C addr */ |
132 | #define TUNER_SET_TYPE_ADDR _IOW('d',90,int) | 140 | #define TUNER_SET_TYPE_ADDR _IOW('d', 90, int) |
133 | /* Puts tuner on powersaving state, disabling it, except for i2c */ | 141 | |
134 | #define TUNER_SET_STANDBY _IOW('d',91,int) | 142 | /* Puts tuner on powersaving state, disabling it, except for i2c. To be replaced |
143 | by VIDIOC_INT_S_STANDBY. */ | ||
144 | #define TUNER_SET_STANDBY _IOW('d', 91, int) | ||
145 | |||
135 | /* Sets tda9887 specific stuff, like port1, port2 and qss */ | 146 | /* Sets tda9887 specific stuff, like port1, port2 and qss */ |
136 | #define TDA9887_SET_CONFIG _IOW('d',92,int) | 147 | #define TDA9887_SET_CONFIG _IOW('d', 92, int) |
148 | |||
149 | /* Switch the tuner to a specific tuner mode. Replacement of AUDC_SET_RADIO */ | ||
150 | #define VIDIOC_INT_S_TUNER_MODE _IOW('d', 93, enum v4l2_tuner_type) | ||
151 | |||
152 | /* Generic standby command. Passing -1 (all bits set to 1) will put the whole | ||
153 | chip into standby mode, value 0 will make the chip fully active. Specific | ||
154 | bits can be used by certain chips to enable/disable specific subsystems. | ||
155 | Replacement of TUNER_SET_STANDBY. */ | ||
156 | #define VIDIOC_INT_S_STANDBY _IOW('d', 94, u32) | ||
137 | 157 | ||
138 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | 158 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ |
139 | #define VIDIOC_INT_S_REGISTER _IOR ('d', 100, struct v4l2_register) | 159 | #define VIDIOC_INT_S_REGISTER _IOR ('d', 100, struct v4l2_register) |
@@ -160,7 +180,8 @@ struct msp_matrix { | |||
160 | 180 | ||
161 | /* Used to generate VBI signals on a video signal. v4l2_sliced_vbi_data is | 181 | /* Used to generate VBI signals on a video signal. v4l2_sliced_vbi_data is |
162 | filled with the data packets that should be output. Note that if you set | 182 | filled with the data packets that should be output. Note that if you set |
163 | the line field to 0, then that VBI signal is disabled. */ | 183 | the line field to 0, then that VBI signal is disabled. If no |
184 | valid VBI data was found, then the type field is set to 0 on return. */ | ||
164 | #define VIDIOC_INT_S_VBI_DATA _IOW ('d', 105, struct v4l2_sliced_vbi_data) | 185 | #define VIDIOC_INT_S_VBI_DATA _IOW ('d', 105, struct v4l2_sliced_vbi_data) |
165 | 186 | ||
166 | /* Used to obtain the sliced VBI packet from a readback register. Not all | 187 | /* Used to obtain the sliced VBI packet from a readback register. Not all |
@@ -168,11 +189,11 @@ struct msp_matrix { | |||
168 | register contains invalid or erroneous data -EIO is returned. Note that | 189 | register contains invalid or erroneous data -EIO is returned. Note that |
169 | you must fill in the 'id' member and the 'field' member (to determine | 190 | you must fill in the 'id' member and the 'field' member (to determine |
170 | whether CC data from the first or second field should be obtained). */ | 191 | whether CC data from the first or second field should be obtained). */ |
171 | #define VIDIOC_INT_G_VBI_DATA _IOWR('d', 106, struct v4l2_sliced_vbi_data *) | 192 | #define VIDIOC_INT_G_VBI_DATA _IOWR('d', 106, struct v4l2_sliced_vbi_data) |
172 | 193 | ||
173 | /* Returns the chip identifier or V4L2_IDENT_UNKNOWN if no identification can | 194 | /* Returns the chip identifier or V4L2_IDENT_UNKNOWN if no identification can |
174 | be made. */ | 195 | be made. */ |
175 | #define VIDIOC_INT_G_CHIP_IDENT _IOR ('d', 107, enum v4l2_chip_ident *) | 196 | #define VIDIOC_INT_G_CHIP_IDENT _IOR ('d', 107, enum v4l2_chip_ident) |
176 | 197 | ||
177 | /* Sets I2S speed in bps. This is used to provide a standard way to select I2S | 198 | /* Sets I2S speed in bps. This is used to provide a standard way to select I2S |
178 | clock used by driving digital audio streams at some board designs. | 199 | clock used by driving digital audio streams at some board designs. |
@@ -180,4 +201,25 @@ struct msp_matrix { | |||
180 | If the frequency is not supported, then -EINVAL is returned. */ | 201 | If the frequency is not supported, then -EINVAL is returned. */ |
181 | #define VIDIOC_INT_I2S_CLOCK_FREQ _IOW ('d', 108, u32) | 202 | #define VIDIOC_INT_I2S_CLOCK_FREQ _IOW ('d', 108, u32) |
182 | 203 | ||
204 | /* Routing definition, device dependent. It specifies which inputs (if any) | ||
205 | should be routed to which outputs (if any). */ | ||
206 | struct v4l2_routing { | ||
207 | u32 input; | ||
208 | u32 output; | ||
209 | }; | ||
210 | |||
211 | /* These internal commands should be used to define the inputs and outputs | ||
212 | of an audio/video chip. They will replace AUDC_SET_INPUT. | ||
213 | The v4l2 API commands VIDIOC_S/G_INPUT, VIDIOC_S/G_OUTPUT, | ||
214 | VIDIOC_S/G_AUDIO and VIDIOC_S/G_AUDOUT are meant to be used by the | ||
215 | user. Internally these commands should be used to switch inputs/outputs | ||
216 | because only the driver knows how to map a 'Television' input to the precise | ||
217 | input/output routing of an A/D converter, or a DSP, or a video digitizer. | ||
218 | These four commands should only be sent directly to an i2c device, they | ||
219 | should not be broadcast as the routing is very device specific. */ | ||
220 | #define VIDIOC_INT_S_AUDIO_ROUTING _IOW ('d', 109, struct v4l2_routing) | ||
221 | #define VIDIOC_INT_G_AUDIO_ROUTING _IOR ('d', 110, struct v4l2_routing) | ||
222 | #define VIDIOC_INT_S_VIDEO_ROUTING _IOW ('d', 111, struct v4l2_routing) | ||
223 | #define VIDIOC_INT_G_VIDEO_ROUTING _IOR ('d', 112, struct v4l2_routing) | ||
224 | |||
183 | #endif /* V4L2_COMMON_H_ */ | 225 | #endif /* V4L2_COMMON_H_ */ |
diff --git a/include/media/video-buf-dvb.h b/include/media/video-buf-dvb.h index ad0a07a3a895..b78d90fe629f 100644 --- a/include/media/video-buf-dvb.h +++ b/include/media/video-buf-dvb.h | |||
@@ -11,7 +11,7 @@ struct videobuf_dvb { | |||
11 | struct videobuf_queue dvbq; | 11 | struct videobuf_queue dvbq; |
12 | 12 | ||
13 | /* video-buf-dvb state info */ | 13 | /* video-buf-dvb state info */ |
14 | struct semaphore lock; | 14 | struct mutex lock; |
15 | struct task_struct *thread; | 15 | struct task_struct *thread; |
16 | int nfeeds; | 16 | int nfeeds; |
17 | 17 | ||
diff --git a/include/media/video-buf.h b/include/media/video-buf.h index 8ecfd78e0027..d90dec5484ee 100644 --- a/include/media/video-buf.h +++ b/include/media/video-buf.h | |||
@@ -177,7 +177,7 @@ struct videobuf_queue_ops { | |||
177 | }; | 177 | }; |
178 | 178 | ||
179 | struct videobuf_queue { | 179 | struct videobuf_queue { |
180 | struct semaphore lock; | 180 | struct mutex lock; |
181 | spinlock_t *irqlock; | 181 | spinlock_t *irqlock; |
182 | struct pci_dev *pci; | 182 | struct pci_dev *pci; |
183 | 183 | ||
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index bfc1779fc753..427dac94bc7e 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | #include <linux/socket.h> | 5 | #include <linux/socket.h> |
6 | #include <linux/un.h> | 6 | #include <linux/un.h> |
7 | #include <linux/mutex.h> | ||
7 | #include <net/sock.h> | 8 | #include <net/sock.h> |
8 | 9 | ||
9 | extern void unix_inflight(struct file *fp); | 10 | extern void unix_inflight(struct file *fp); |
@@ -71,7 +72,7 @@ struct unix_sock { | |||
71 | struct unix_address *addr; | 72 | struct unix_address *addr; |
72 | struct dentry *dentry; | 73 | struct dentry *dentry; |
73 | struct vfsmount *mnt; | 74 | struct vfsmount *mnt; |
74 | struct semaphore readsem; | 75 | struct mutex readlock; |
75 | struct sock *peer; | 76 | struct sock *peer; |
76 | struct sock *other; | 77 | struct sock *other; |
77 | struct sock *gc_tree; | 78 | struct sock *gc_tree; |
diff --git a/include/net/dn.h b/include/net/dn.h index a4b6168e1e25..465b78302782 100644 --- a/include/net/dn.h +++ b/include/net/dn.h | |||
@@ -6,10 +6,8 @@ | |||
6 | #include <net/tcp.h> | 6 | #include <net/tcp.h> |
7 | #include <asm/byteorder.h> | 7 | #include <asm/byteorder.h> |
8 | 8 | ||
9 | typedef unsigned short dn_address; | 9 | #define dn_ntohs(x) le16_to_cpu(x) |
10 | 10 | #define dn_htons(x) cpu_to_le16(x) | |
11 | #define dn_ntohs(x) le16_to_cpu((unsigned short)(x)) | ||
12 | #define dn_htons(x) cpu_to_le16((unsigned short)(x)) | ||
13 | 11 | ||
14 | struct dn_scp /* Session Control Port */ | 12 | struct dn_scp /* Session Control Port */ |
15 | { | 13 | { |
@@ -31,36 +29,36 @@ struct dn_scp /* Session Control Port */ | |||
31 | #define DN_CL 15 /* Closed */ | 29 | #define DN_CL 15 /* Closed */ |
32 | #define DN_CN 16 /* Closed Notification */ | 30 | #define DN_CN 16 /* Closed Notification */ |
33 | 31 | ||
34 | unsigned short addrloc; | 32 | __le16 addrloc; |
35 | unsigned short addrrem; | 33 | __le16 addrrem; |
36 | unsigned short numdat; | 34 | __u16 numdat; |
37 | unsigned short numoth; | 35 | __u16 numoth; |
38 | unsigned short numoth_rcv; | 36 | __u16 numoth_rcv; |
39 | unsigned short numdat_rcv; | 37 | __u16 numdat_rcv; |
40 | unsigned short ackxmt_dat; | 38 | __u16 ackxmt_dat; |
41 | unsigned short ackxmt_oth; | 39 | __u16 ackxmt_oth; |
42 | unsigned short ackrcv_dat; | 40 | __u16 ackrcv_dat; |
43 | unsigned short ackrcv_oth; | 41 | __u16 ackrcv_oth; |
44 | unsigned char flowrem_sw; | 42 | __u8 flowrem_sw; |
45 | unsigned char flowloc_sw; | 43 | __u8 flowloc_sw; |
46 | #define DN_SEND 2 | 44 | #define DN_SEND 2 |
47 | #define DN_DONTSEND 1 | 45 | #define DN_DONTSEND 1 |
48 | #define DN_NOCHANGE 0 | 46 | #define DN_NOCHANGE 0 |
49 | unsigned short flowrem_dat; | 47 | __u16 flowrem_dat; |
50 | unsigned short flowrem_oth; | 48 | __u16 flowrem_oth; |
51 | unsigned short flowloc_dat; | 49 | __u16 flowloc_dat; |
52 | unsigned short flowloc_oth; | 50 | __u16 flowloc_oth; |
53 | unsigned char services_rem; | 51 | __u8 services_rem; |
54 | unsigned char services_loc; | 52 | __u8 services_loc; |
55 | unsigned char info_rem; | 53 | __u8 info_rem; |
56 | unsigned char info_loc; | 54 | __u8 info_loc; |
57 | 55 | ||
58 | unsigned short segsize_rem; | 56 | __u16 segsize_rem; |
59 | unsigned short segsize_loc; | 57 | __u16 segsize_loc; |
60 | 58 | ||
61 | unsigned char nonagle; | 59 | __u8 nonagle; |
62 | unsigned char multi_ireq; | 60 | __u8 multi_ireq; |
63 | unsigned char accept_mode; | 61 | __u8 accept_mode; |
64 | unsigned long seg_total; /* Running total of current segment */ | 62 | unsigned long seg_total; /* Running total of current segment */ |
65 | 63 | ||
66 | struct optdata_dn conndata_in; | 64 | struct optdata_dn conndata_in; |
@@ -160,40 +158,41 @@ static inline struct dn_scp *DN_SK(struct sock *sk) | |||
160 | */ | 158 | */ |
161 | #define DN_SKB_CB(skb) ((struct dn_skb_cb *)(skb)->cb) | 159 | #define DN_SKB_CB(skb) ((struct dn_skb_cb *)(skb)->cb) |
162 | struct dn_skb_cb { | 160 | struct dn_skb_cb { |
163 | unsigned short dst; | 161 | __le16 dst; |
164 | unsigned short src; | 162 | __le16 src; |
165 | unsigned short hops; | 163 | __u16 hops; |
166 | unsigned short dst_port; | 164 | __le16 dst_port; |
167 | unsigned short src_port; | 165 | __le16 src_port; |
168 | unsigned char services; | 166 | __u8 services; |
169 | unsigned char info; | 167 | __u8 info; |
170 | unsigned char rt_flags; | 168 | __u8 rt_flags; |
171 | unsigned char nsp_flags; | 169 | __u8 nsp_flags; |
172 | unsigned short segsize; | 170 | __u16 segsize; |
173 | unsigned short segnum; | 171 | __u16 segnum; |
174 | unsigned short xmit_count; | 172 | __u16 xmit_count; |
175 | unsigned long stamp; | 173 | unsigned long stamp; |
176 | int iif; | 174 | int iif; |
177 | }; | 175 | }; |
178 | 176 | ||
179 | static inline dn_address dn_eth2dn(unsigned char *ethaddr) | 177 | static inline __le16 dn_eth2dn(unsigned char *ethaddr) |
180 | { | 178 | { |
181 | return ethaddr[4] | (ethaddr[5] << 8); | 179 | return dn_htons(ethaddr[4] | (ethaddr[5] << 8)); |
182 | } | 180 | } |
183 | 181 | ||
184 | static inline dn_address dn_saddr2dn(struct sockaddr_dn *saddr) | 182 | static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr) |
185 | { | 183 | { |
186 | return *(dn_address *)saddr->sdn_nodeaddr; | 184 | return *(__le16 *)saddr->sdn_nodeaddr; |
187 | } | 185 | } |
188 | 186 | ||
189 | static inline void dn_dn2eth(unsigned char *ethaddr, dn_address addr) | 187 | static inline void dn_dn2eth(unsigned char *ethaddr, __le16 addr) |
190 | { | 188 | { |
189 | __u16 a = dn_ntohs(addr); | ||
191 | ethaddr[0] = 0xAA; | 190 | ethaddr[0] = 0xAA; |
192 | ethaddr[1] = 0x00; | 191 | ethaddr[1] = 0x00; |
193 | ethaddr[2] = 0x04; | 192 | ethaddr[2] = 0x04; |
194 | ethaddr[3] = 0x00; | 193 | ethaddr[3] = 0x00; |
195 | ethaddr[4] = (unsigned char)(addr & 0xff); | 194 | ethaddr[4] = (__u8)(a & 0xff); |
196 | ethaddr[5] = (unsigned char)(addr >> 8); | 195 | ethaddr[5] = (__u8)(a >> 8); |
197 | } | 196 | } |
198 | 197 | ||
199 | static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp) | 198 | static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp) |
@@ -202,7 +201,7 @@ static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp) | |||
202 | fl->uli_u.dnports.dport = scp->addrrem; | 201 | fl->uli_u.dnports.dport = scp->addrrem; |
203 | fl->uli_u.dnports.objnum = scp->addr.sdn_objnum; | 202 | fl->uli_u.dnports.objnum = scp->addr.sdn_objnum; |
204 | if (fl->uli_u.dnports.objnum == 0) { | 203 | if (fl->uli_u.dnports.objnum == 0) { |
205 | fl->uli_u.dnports.objnamel = scp->addr.sdn_objnamel; | 204 | fl->uli_u.dnports.objnamel = (__u8)dn_ntohs(scp->addr.sdn_objnamel); |
206 | memcpy(fl->uli_u.dnports.objname, scp->addr.sdn_objname, 16); | 205 | memcpy(fl->uli_u.dnports.objname, scp->addr.sdn_objname, 16); |
207 | } | 206 | } |
208 | } | 207 | } |
@@ -217,7 +216,7 @@ extern unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu); | |||
217 | extern struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr); | 216 | extern struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr); |
218 | extern struct sock *dn_find_by_skb(struct sk_buff *skb); | 217 | extern struct sock *dn_find_by_skb(struct sk_buff *skb); |
219 | #define DN_ASCBUF_LEN 9 | 218 | #define DN_ASCBUF_LEN 9 |
220 | extern char *dn_addr2asc(dn_address, char *); | 219 | extern char *dn_addr2asc(__u16, char *); |
221 | extern int dn_destroy_timer(struct sock *sk); | 220 | extern int dn_destroy_timer(struct sock *sk); |
222 | 221 | ||
223 | extern int dn_sockaddr2username(struct sockaddr_dn *addr, unsigned char *buf, unsigned char type); | 222 | extern int dn_sockaddr2username(struct sockaddr_dn *addr, unsigned char *buf, unsigned char type); |
@@ -226,7 +225,7 @@ extern int dn_username2sockaddr(unsigned char *data, int len, struct sockaddr_dn | |||
226 | extern void dn_start_slow_timer(struct sock *sk); | 225 | extern void dn_start_slow_timer(struct sock *sk); |
227 | extern void dn_stop_slow_timer(struct sock *sk); | 226 | extern void dn_stop_slow_timer(struct sock *sk); |
228 | 227 | ||
229 | extern dn_address decnet_address; | 228 | extern __le16 decnet_address; |
230 | extern int decnet_debug_level; | 229 | extern int decnet_debug_level; |
231 | extern int decnet_time_wait; | 230 | extern int decnet_time_wait; |
232 | extern int decnet_dn_count; | 231 | extern int decnet_dn_count; |
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h index 5a86e78081bf..cee46821dc53 100644 --- a/include/net/dn_dev.h +++ b/include/net/dn_dev.h | |||
@@ -7,11 +7,11 @@ struct dn_dev; | |||
7 | struct dn_ifaddr { | 7 | struct dn_ifaddr { |
8 | struct dn_ifaddr *ifa_next; | 8 | struct dn_ifaddr *ifa_next; |
9 | struct dn_dev *ifa_dev; | 9 | struct dn_dev *ifa_dev; |
10 | dn_address ifa_local; | 10 | __le16 ifa_local; |
11 | dn_address ifa_address; | 11 | __le16 ifa_address; |
12 | unsigned char ifa_flags; | 12 | __u8 ifa_flags; |
13 | unsigned char ifa_scope; | 13 | __u8 ifa_scope; |
14 | char ifa_label[IFNAMSIZ]; | 14 | char ifa_label[IFNAMSIZ]; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | #define DN_DEV_S_RU 0 /* Run - working normally */ | 17 | #define DN_DEV_S_RU 0 /* Run - working normally */ |
@@ -91,7 +91,7 @@ struct dn_dev { | |||
91 | struct timer_list timer; | 91 | struct timer_list timer; |
92 | unsigned long t3; | 92 | unsigned long t3; |
93 | struct neigh_parms *neigh_parms; | 93 | struct neigh_parms *neigh_parms; |
94 | unsigned char addr[ETH_ALEN]; | 94 | __u8 addr[ETH_ALEN]; |
95 | struct neighbour *router; /* Default router on circuit */ | 95 | struct neighbour *router; /* Default router on circuit */ |
96 | struct neighbour *peer; /* Peer on pointopoint links */ | 96 | struct neighbour *peer; /* Peer on pointopoint links */ |
97 | unsigned long uptime; /* Time device went up in jiffies */ | 97 | unsigned long uptime; /* Time device went up in jiffies */ |
@@ -99,56 +99,56 @@ struct dn_dev { | |||
99 | 99 | ||
100 | struct dn_short_packet | 100 | struct dn_short_packet |
101 | { | 101 | { |
102 | unsigned char msgflg; | 102 | __u8 msgflg; |
103 | unsigned short dstnode; | 103 | __le16 dstnode; |
104 | unsigned short srcnode; | 104 | __le16 srcnode; |
105 | unsigned char forward; | 105 | __u8 forward; |
106 | } __attribute__((packed)); | 106 | } __attribute__((packed)); |
107 | 107 | ||
108 | struct dn_long_packet | 108 | struct dn_long_packet |
109 | { | 109 | { |
110 | unsigned char msgflg; | 110 | __u8 msgflg; |
111 | unsigned char d_area; | 111 | __u8 d_area; |
112 | unsigned char d_subarea; | 112 | __u8 d_subarea; |
113 | unsigned char d_id[6]; | 113 | __u8 d_id[6]; |
114 | unsigned char s_area; | 114 | __u8 s_area; |
115 | unsigned char s_subarea; | 115 | __u8 s_subarea; |
116 | unsigned char s_id[6]; | 116 | __u8 s_id[6]; |
117 | unsigned char nl2; | 117 | __u8 nl2; |
118 | unsigned char visit_ct; | 118 | __u8 visit_ct; |
119 | unsigned char s_class; | 119 | __u8 s_class; |
120 | unsigned char pt; | 120 | __u8 pt; |
121 | } __attribute__((packed)); | 121 | } __attribute__((packed)); |
122 | 122 | ||
123 | /*------------------------- DRP - Routing messages ---------------------*/ | 123 | /*------------------------- DRP - Routing messages ---------------------*/ |
124 | 124 | ||
125 | struct endnode_hello_message | 125 | struct endnode_hello_message |
126 | { | 126 | { |
127 | unsigned char msgflg; | 127 | __u8 msgflg; |
128 | unsigned char tiver[3]; | 128 | __u8 tiver[3]; |
129 | unsigned char id[6]; | 129 | __u8 id[6]; |
130 | unsigned char iinfo; | 130 | __u8 iinfo; |
131 | unsigned short blksize; | 131 | __le16 blksize; |
132 | unsigned char area; | 132 | __u8 area; |
133 | unsigned char seed[8]; | 133 | __u8 seed[8]; |
134 | unsigned char neighbor[6]; | 134 | __u8 neighbor[6]; |
135 | unsigned short timer; | 135 | __le16 timer; |
136 | unsigned char mpd; | 136 | __u8 mpd; |
137 | unsigned char datalen; | 137 | __u8 datalen; |
138 | unsigned char data[2]; | 138 | __u8 data[2]; |
139 | } __attribute__((packed)); | 139 | } __attribute__((packed)); |
140 | 140 | ||
141 | struct rtnode_hello_message | 141 | struct rtnode_hello_message |
142 | { | 142 | { |
143 | unsigned char msgflg; | 143 | __u8 msgflg; |
144 | unsigned char tiver[3]; | 144 | __u8 tiver[3]; |
145 | unsigned char id[6]; | 145 | __u8 id[6]; |
146 | unsigned char iinfo; | 146 | __u8 iinfo; |
147 | unsigned short blksize; | 147 | __le16 blksize; |
148 | unsigned char priority; | 148 | __u8 priority; |
149 | unsigned char area; | 149 | __u8 area; |
150 | unsigned short timer; | 150 | __le16 timer; |
151 | unsigned char mpd; | 151 | __u8 mpd; |
152 | } __attribute__((packed)); | 152 | } __attribute__((packed)); |
153 | 153 | ||
154 | 154 | ||
@@ -169,12 +169,12 @@ extern void dn_dev_down(struct net_device *); | |||
169 | 169 | ||
170 | extern int dn_dev_set_default(struct net_device *dev, int force); | 170 | extern int dn_dev_set_default(struct net_device *dev, int force); |
171 | extern struct net_device *dn_dev_get_default(void); | 171 | extern struct net_device *dn_dev_get_default(void); |
172 | extern int dn_dev_bind_default(dn_address *addr); | 172 | extern int dn_dev_bind_default(__le16 *addr); |
173 | 173 | ||
174 | extern int register_dnaddr_notifier(struct notifier_block *nb); | 174 | extern int register_dnaddr_notifier(struct notifier_block *nb); |
175 | extern int unregister_dnaddr_notifier(struct notifier_block *nb); | 175 | extern int unregister_dnaddr_notifier(struct notifier_block *nb); |
176 | 176 | ||
177 | static inline int dn_dev_islocal(struct net_device *dev, dn_address addr) | 177 | static inline int dn_dev_islocal(struct net_device *dev, __le16 addr) |
178 | { | 178 | { |
179 | struct dn_dev *dn_db = dev->dn_ptr; | 179 | struct dn_dev *dn_db = dev->dn_ptr; |
180 | struct dn_ifaddr *ifa; | 180 | struct dn_ifaddr *ifa; |
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h index cd3c96d9601b..a15dcf0d5c1e 100644 --- a/include/net/dn_fib.h +++ b/include/net/dn_fib.h | |||
@@ -37,7 +37,7 @@ struct dn_fib_nh { | |||
37 | int nh_weight; | 37 | int nh_weight; |
38 | int nh_power; | 38 | int nh_power; |
39 | int nh_oif; | 39 | int nh_oif; |
40 | u32 nh_gw; | 40 | __le16 nh_gw; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | struct dn_fib_info { | 43 | struct dn_fib_info { |
@@ -48,7 +48,7 @@ struct dn_fib_info { | |||
48 | int fib_dead; | 48 | int fib_dead; |
49 | unsigned fib_flags; | 49 | unsigned fib_flags; |
50 | int fib_protocol; | 50 | int fib_protocol; |
51 | dn_address fib_prefsrc; | 51 | __le16 fib_prefsrc; |
52 | __u32 fib_priority; | 52 | __u32 fib_priority; |
53 | __u32 fib_metrics[RTAX_MAX]; | 53 | __u32 fib_metrics[RTAX_MAX]; |
54 | #define dn_fib_mtu fib_metrics[RTAX_MTU-1] | 54 | #define dn_fib_mtu fib_metrics[RTAX_MTU-1] |
@@ -71,15 +71,15 @@ struct dn_fib_info { | |||
71 | #define DN_FIB_RES_OIF(res) (DN_FIB_RES_NH(res).nh_oif) | 71 | #define DN_FIB_RES_OIF(res) (DN_FIB_RES_NH(res).nh_oif) |
72 | 72 | ||
73 | typedef struct { | 73 | typedef struct { |
74 | u16 datum; | 74 | __le16 datum; |
75 | } dn_fib_key_t; | 75 | } dn_fib_key_t; |
76 | 76 | ||
77 | typedef struct { | 77 | typedef struct { |
78 | u16 datum; | 78 | __le16 datum; |
79 | } dn_fib_hash_t; | 79 | } dn_fib_hash_t; |
80 | 80 | ||
81 | typedef struct { | 81 | typedef struct { |
82 | u16 datum; | 82 | __u16 datum; |
83 | } dn_fib_idx_t; | 83 | } dn_fib_idx_t; |
84 | 84 | ||
85 | struct dn_fib_node { | 85 | struct dn_fib_node { |
@@ -126,11 +126,11 @@ extern int dn_fib_semantic_match(int type, struct dn_fib_info *fi, | |||
126 | const struct flowi *fl, | 126 | const struct flowi *fl, |
127 | struct dn_fib_res *res); | 127 | struct dn_fib_res *res); |
128 | extern void dn_fib_release_info(struct dn_fib_info *fi); | 128 | extern void dn_fib_release_info(struct dn_fib_info *fi); |
129 | extern u16 dn_fib_get_attr16(struct rtattr *attr, int attrlen, int type); | 129 | extern __le16 dn_fib_get_attr16(struct rtattr *attr, int attrlen, int type); |
130 | extern void dn_fib_flush(void); | 130 | extern void dn_fib_flush(void); |
131 | extern void dn_fib_select_multipath(const struct flowi *fl, | 131 | extern void dn_fib_select_multipath(const struct flowi *fl, |
132 | struct dn_fib_res *res); | 132 | struct dn_fib_res *res); |
133 | extern int dn_fib_sync_down(dn_address local, struct net_device *dev, | 133 | extern int dn_fib_sync_down(__le16 local, struct net_device *dev, |
134 | int force); | 134 | int force); |
135 | extern int dn_fib_sync_up(struct net_device *dev); | 135 | extern int dn_fib_sync_up(struct net_device *dev); |
136 | 136 | ||
@@ -148,8 +148,8 @@ extern void dn_fib_table_cleanup(void); | |||
148 | extern void dn_fib_rules_init(void); | 148 | extern void dn_fib_rules_init(void); |
149 | extern void dn_fib_rules_cleanup(void); | 149 | extern void dn_fib_rules_cleanup(void); |
150 | extern void dn_fib_rule_put(struct dn_fib_rule *); | 150 | extern void dn_fib_rule_put(struct dn_fib_rule *); |
151 | extern __u16 dn_fib_rules_policy(__u16 saddr, struct dn_fib_res *res, unsigned *flags); | 151 | extern __le16 dn_fib_rules_policy(__le16 saddr, struct dn_fib_res *res, unsigned *flags); |
152 | extern unsigned dnet_addr_type(__u16 addr); | 152 | extern unsigned dnet_addr_type(__le16 addr); |
153 | extern int dn_fib_lookup(const struct flowi *fl, struct dn_fib_res *res); | 153 | extern int dn_fib_lookup(const struct flowi *fl, struct dn_fib_res *res); |
154 | 154 | ||
155 | /* | 155 | /* |
@@ -194,10 +194,10 @@ extern struct dn_fib_table *dn_fib_tables[]; | |||
194 | 194 | ||
195 | #endif /* CONFIG_DECNET_ROUTER */ | 195 | #endif /* CONFIG_DECNET_ROUTER */ |
196 | 196 | ||
197 | static inline u16 dnet_make_mask(int n) | 197 | static inline __le16 dnet_make_mask(int n) |
198 | { | 198 | { |
199 | if (n) | 199 | if (n) |
200 | return htons(~((1<<(16-n))-1)); | 200 | return dn_htons(~((1<<(16-n))-1)); |
201 | return 0; | 201 | return 0; |
202 | } | 202 | } |
203 | 203 | ||
diff --git a/include/net/dn_neigh.h b/include/net/dn_neigh.h index 4b1eb038d637..4cb4ae7fb81f 100644 --- a/include/net/dn_neigh.h +++ b/include/net/dn_neigh.h | |||
@@ -7,13 +7,13 @@ | |||
7 | */ | 7 | */ |
8 | struct dn_neigh { | 8 | struct dn_neigh { |
9 | struct neighbour n; | 9 | struct neighbour n; |
10 | dn_address addr; | 10 | __le16 addr; |
11 | unsigned long flags; | 11 | unsigned long flags; |
12 | #define DN_NDFLAG_R1 0x0001 /* Router L1 */ | 12 | #define DN_NDFLAG_R1 0x0001 /* Router L1 */ |
13 | #define DN_NDFLAG_R2 0x0002 /* Router L2 */ | 13 | #define DN_NDFLAG_R2 0x0002 /* Router L2 */ |
14 | #define DN_NDFLAG_P3 0x0004 /* Phase III Node */ | 14 | #define DN_NDFLAG_P3 0x0004 /* Phase III Node */ |
15 | unsigned long blksize; | 15 | unsigned long blksize; |
16 | unsigned char priority; | 16 | __u8 priority; |
17 | }; | 17 | }; |
18 | 18 | ||
19 | extern void dn_neigh_init(void); | 19 | extern void dn_neigh_init(void); |
diff --git a/include/net/dn_nsp.h b/include/net/dn_nsp.h index e6182b86262b..96e816b6974d 100644 --- a/include/net/dn_nsp.h +++ b/include/net/dn_nsp.h | |||
@@ -72,77 +72,77 @@ extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int nobl | |||
72 | 72 | ||
73 | struct nsp_data_seg_msg | 73 | struct nsp_data_seg_msg |
74 | { | 74 | { |
75 | unsigned char msgflg; | 75 | __u8 msgflg; |
76 | unsigned short dstaddr; | 76 | __le16 dstaddr; |
77 | unsigned short srcaddr; | 77 | __le16 srcaddr; |
78 | } __attribute__((packed)); | 78 | } __attribute__((packed)); |
79 | 79 | ||
80 | struct nsp_data_opt_msg | 80 | struct nsp_data_opt_msg |
81 | { | 81 | { |
82 | unsigned short acknum; | 82 | __le16 acknum; |
83 | unsigned short segnum; | 83 | __le16 segnum; |
84 | unsigned short lsflgs; | 84 | __le16 lsflgs; |
85 | } __attribute__((packed)); | 85 | } __attribute__((packed)); |
86 | 86 | ||
87 | struct nsp_data_opt_msg1 | 87 | struct nsp_data_opt_msg1 |
88 | { | 88 | { |
89 | unsigned short acknum; | 89 | __le16 acknum; |
90 | unsigned short segnum; | 90 | __le16 segnum; |
91 | } __attribute__((packed)); | 91 | } __attribute__((packed)); |
92 | 92 | ||
93 | 93 | ||
94 | /* Acknowledgment Message (data/other data) */ | 94 | /* Acknowledgment Message (data/other data) */ |
95 | struct nsp_data_ack_msg | 95 | struct nsp_data_ack_msg |
96 | { | 96 | { |
97 | unsigned char msgflg; | 97 | __u8 msgflg; |
98 | unsigned short dstaddr; | 98 | __le16 dstaddr; |
99 | unsigned short srcaddr; | 99 | __le16 srcaddr; |
100 | unsigned short acknum; | 100 | __le16 acknum; |
101 | } __attribute__((packed)); | 101 | } __attribute__((packed)); |
102 | 102 | ||
103 | /* Connect Acknowledgment Message */ | 103 | /* Connect Acknowledgment Message */ |
104 | struct nsp_conn_ack_msg | 104 | struct nsp_conn_ack_msg |
105 | { | 105 | { |
106 | unsigned char msgflg; | 106 | __u8 msgflg; |
107 | unsigned short dstaddr; | 107 | __le16 dstaddr; |
108 | } __attribute__((packed)); | 108 | } __attribute__((packed)); |
109 | 109 | ||
110 | 110 | ||
111 | /* Connect Initiate/Retransmit Initiate/Connect Confirm */ | 111 | /* Connect Initiate/Retransmit Initiate/Connect Confirm */ |
112 | struct nsp_conn_init_msg | 112 | struct nsp_conn_init_msg |
113 | { | 113 | { |
114 | unsigned char msgflg; | 114 | __u8 msgflg; |
115 | #define NSP_CI 0x18 /* Connect Initiate */ | 115 | #define NSP_CI 0x18 /* Connect Initiate */ |
116 | #define NSP_RCI 0x68 /* Retrans. Conn Init */ | 116 | #define NSP_RCI 0x68 /* Retrans. Conn Init */ |
117 | unsigned short dstaddr; | 117 | __le16 dstaddr; |
118 | unsigned short srcaddr; | 118 | __le16 srcaddr; |
119 | unsigned char services; | 119 | __u8 services; |
120 | #define NSP_FC_NONE 0x00 /* Flow Control None */ | 120 | #define NSP_FC_NONE 0x00 /* Flow Control None */ |
121 | #define NSP_FC_SRC 0x04 /* Seg Req. Count */ | 121 | #define NSP_FC_SRC 0x04 /* Seg Req. Count */ |
122 | #define NSP_FC_SCMC 0x08 /* Sess. Control Mess */ | 122 | #define NSP_FC_SCMC 0x08 /* Sess. Control Mess */ |
123 | #define NSP_FC_MASK 0x0c /* FC type mask */ | 123 | #define NSP_FC_MASK 0x0c /* FC type mask */ |
124 | unsigned char info; | 124 | __u8 info; |
125 | unsigned short segsize; | 125 | __le16 segsize; |
126 | } __attribute__((packed)); | 126 | } __attribute__((packed)); |
127 | 127 | ||
128 | /* Disconnect Initiate/Disconnect Confirm */ | 128 | /* Disconnect Initiate/Disconnect Confirm */ |
129 | struct nsp_disconn_init_msg | 129 | struct nsp_disconn_init_msg |
130 | { | 130 | { |
131 | unsigned char msgflg; | 131 | __u8 msgflg; |
132 | unsigned short dstaddr; | 132 | __le16 dstaddr; |
133 | unsigned short srcaddr; | 133 | __le16 srcaddr; |
134 | unsigned short reason; | 134 | __le16 reason; |
135 | } __attribute__((packed)); | 135 | } __attribute__((packed)); |
136 | 136 | ||
137 | 137 | ||
138 | 138 | ||
139 | struct srcobj_fmt | 139 | struct srcobj_fmt |
140 | { | 140 | { |
141 | char format; | 141 | __u8 format; |
142 | unsigned char task; | 142 | __u8 task; |
143 | unsigned short grpcode; | 143 | __le16 grpcode; |
144 | unsigned short usrcode; | 144 | __le16 usrcode; |
145 | char dlen; | 145 | __u8 dlen; |
146 | } __attribute__((packed)); | 146 | } __attribute__((packed)); |
147 | 147 | ||
148 | /* | 148 | /* |
@@ -150,7 +150,7 @@ struct srcobj_fmt | |||
150 | * numbers used in NSP. Similar in operation to the functions | 150 | * numbers used in NSP. Similar in operation to the functions |
151 | * of the same name in TCP. | 151 | * of the same name in TCP. |
152 | */ | 152 | */ |
153 | static __inline__ int dn_before(unsigned short seq1, unsigned short seq2) | 153 | static __inline__ int dn_before(__u16 seq1, __u16 seq2) |
154 | { | 154 | { |
155 | seq1 &= 0x0fff; | 155 | seq1 &= 0x0fff; |
156 | seq2 &= 0x0fff; | 156 | seq2 &= 0x0fff; |
@@ -159,7 +159,7 @@ static __inline__ int dn_before(unsigned short seq1, unsigned short seq2) | |||
159 | } | 159 | } |
160 | 160 | ||
161 | 161 | ||
162 | static __inline__ int dn_after(unsigned short seq1, unsigned short seq2) | 162 | static __inline__ int dn_after(__u16 seq1, __u16 seq2) |
163 | { | 163 | { |
164 | seq1 &= 0x0fff; | 164 | seq1 &= 0x0fff; |
165 | seq2 &= 0x0fff; | 165 | seq2 &= 0x0fff; |
@@ -167,23 +167,23 @@ static __inline__ int dn_after(unsigned short seq1, unsigned short seq2) | |||
167 | return (int)((seq2 - seq1) & 0x0fff) > 2048; | 167 | return (int)((seq2 - seq1) & 0x0fff) > 2048; |
168 | } | 168 | } |
169 | 169 | ||
170 | static __inline__ int dn_equal(unsigned short seq1, unsigned short seq2) | 170 | static __inline__ int dn_equal(__u16 seq1, __u16 seq2) |
171 | { | 171 | { |
172 | return ((seq1 ^ seq2) & 0x0fff) == 0; | 172 | return ((seq1 ^ seq2) & 0x0fff) == 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | static __inline__ int dn_before_or_equal(unsigned short seq1, unsigned short seq2) | 175 | static __inline__ int dn_before_or_equal(__u16 seq1, __u16 seq2) |
176 | { | 176 | { |
177 | return (dn_before(seq1, seq2) || dn_equal(seq1, seq2)); | 177 | return (dn_before(seq1, seq2) || dn_equal(seq1, seq2)); |
178 | } | 178 | } |
179 | 179 | ||
180 | static __inline__ void seq_add(unsigned short *seq, unsigned short off) | 180 | static __inline__ void seq_add(__u16 *seq, __u16 off) |
181 | { | 181 | { |
182 | (*seq) += off; | 182 | (*seq) += off; |
183 | (*seq) &= 0x0fff; | 183 | (*seq) &= 0x0fff; |
184 | } | 184 | } |
185 | 185 | ||
186 | static __inline__ int seq_next(unsigned short seq1, unsigned short seq2) | 186 | static __inline__ int seq_next(__u16 seq1, __u16 seq2) |
187 | { | 187 | { |
188 | return dn_equal(seq1 + 1, seq2); | 188 | return dn_equal(seq1 + 1, seq2); |
189 | } | 189 | } |
@@ -191,7 +191,7 @@ static __inline__ int seq_next(unsigned short seq1, unsigned short seq2) | |||
191 | /* | 191 | /* |
192 | * Can we delay the ack ? | 192 | * Can we delay the ack ? |
193 | */ | 193 | */ |
194 | static __inline__ int sendack(unsigned short seq) | 194 | static __inline__ int sendack(__u16 seq) |
195 | { | 195 | { |
196 | return (int)((seq & 0x1000) ? 0 : 1); | 196 | return (int)((seq & 0x1000) ? 0 : 1); |
197 | } | 197 | } |
diff --git a/include/net/dn_route.h b/include/net/dn_route.h index 5122da3f2eb3..76f957e258b0 100644 --- a/include/net/dn_route.h +++ b/include/net/dn_route.h | |||
@@ -71,12 +71,12 @@ struct dn_route { | |||
71 | struct dn_route *rt_next; | 71 | struct dn_route *rt_next; |
72 | } u; | 72 | } u; |
73 | 73 | ||
74 | __u16 rt_saddr; | 74 | __le16 rt_saddr; |
75 | __u16 rt_daddr; | 75 | __le16 rt_daddr; |
76 | __u16 rt_gateway; | 76 | __le16 rt_gateway; |
77 | __u16 rt_local_src; /* Source used for forwarding packets */ | 77 | __le16 rt_local_src; /* Source used for forwarding packets */ |
78 | __u16 rt_src_map; | 78 | __le16 rt_src_map; |
79 | __u16 rt_dst_map; | 79 | __le16 rt_dst_map; |
80 | 80 | ||
81 | unsigned rt_flags; | 81 | unsigned rt_flags; |
82 | unsigned rt_type; | 82 | unsigned rt_type; |
diff --git a/include/net/flow.h b/include/net/flow.h index ec7eb86eb203..04d89f763451 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
@@ -30,8 +30,8 @@ struct flowi { | |||
30 | } ip6_u; | 30 | } ip6_u; |
31 | 31 | ||
32 | struct { | 32 | struct { |
33 | __u16 daddr; | 33 | __le16 daddr; |
34 | __u16 saddr; | 34 | __le16 saddr; |
35 | __u32 fwmark; | 35 | __u32 fwmark; |
36 | __u8 scope; | 36 | __u8 scope; |
37 | } dn_u; | 37 | } dn_u; |
@@ -64,8 +64,8 @@ struct flowi { | |||
64 | } icmpt; | 64 | } icmpt; |
65 | 65 | ||
66 | struct { | 66 | struct { |
67 | __u16 sport; | 67 | __le16 sport; |
68 | __u16 dport; | 68 | __le16 dport; |
69 | __u8 objnum; | 69 | __u8 objnum; |
70 | __u8 objnamel; /* Not 16 bits since max val is 16 */ | 70 | __u8 objnamel; /* Not 16 bits since max val is 16 */ |
71 | __u8 objname[16]; /* Not zero terminated */ | 71 | __u8 objname[16]; /* Not zero terminated */ |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index eb8afe3499a9..e459e1a0ae4a 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -180,11 +180,8 @@ struct inet6_dev | |||
180 | 180 | ||
181 | #ifdef CONFIG_IPV6_PRIVACY | 181 | #ifdef CONFIG_IPV6_PRIVACY |
182 | u8 rndid[8]; | 182 | u8 rndid[8]; |
183 | u8 entropy[8]; | ||
184 | struct timer_list regen_timer; | 183 | struct timer_list regen_timer; |
185 | struct inet6_ifaddr *tempaddr_list; | 184 | struct inet6_ifaddr *tempaddr_list; |
186 | __u8 work_eui64[8]; | ||
187 | __u8 work_digest[16]; | ||
188 | #endif | 185 | #endif |
189 | 186 | ||
190 | struct neigh_parms *nd_parms; | 187 | struct neigh_parms *nd_parms; |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index fa587c94e9d0..9bf73fe50948 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -50,6 +50,12 @@ struct inet_connection_sock_af_ops { | |||
50 | char __user *optval, int optlen); | 50 | char __user *optval, int optlen); |
51 | int (*getsockopt)(struct sock *sk, int level, int optname, | 51 | int (*getsockopt)(struct sock *sk, int level, int optname, |
52 | char __user *optval, int __user *optlen); | 52 | char __user *optval, int __user *optlen); |
53 | int (*compat_setsockopt)(struct sock *sk, | ||
54 | int level, int optname, | ||
55 | char __user *optval, int optlen); | ||
56 | int (*compat_getsockopt)(struct sock *sk, | ||
57 | int level, int optname, | ||
58 | char __user *optval, int __user *optlen); | ||
53 | void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); | 59 | void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); |
54 | int sockaddr_len; | 60 | int sockaddr_len; |
55 | }; | 61 | }; |
@@ -72,6 +78,7 @@ struct inet_connection_sock_af_ops { | |||
72 | * @icsk_probes_out: unanswered 0 window probes | 78 | * @icsk_probes_out: unanswered 0 window probes |
73 | * @icsk_ext_hdr_len: Network protocol overhead (IP/IPv6 options) | 79 | * @icsk_ext_hdr_len: Network protocol overhead (IP/IPv6 options) |
74 | * @icsk_ack: Delayed ACK control data | 80 | * @icsk_ack: Delayed ACK control data |
81 | * @icsk_mtup; MTU probing control data | ||
75 | */ | 82 | */ |
76 | struct inet_connection_sock { | 83 | struct inet_connection_sock { |
77 | /* inet_sock has to be the first member! */ | 84 | /* inet_sock has to be the first member! */ |
@@ -104,6 +111,16 @@ struct inet_connection_sock { | |||
104 | __u16 last_seg_size; /* Size of last incoming segment */ | 111 | __u16 last_seg_size; /* Size of last incoming segment */ |
105 | __u16 rcv_mss; /* MSS used for delayed ACK decisions */ | 112 | __u16 rcv_mss; /* MSS used for delayed ACK decisions */ |
106 | } icsk_ack; | 113 | } icsk_ack; |
114 | struct { | ||
115 | int enabled; | ||
116 | |||
117 | /* Range of MTUs to search */ | ||
118 | int search_high; | ||
119 | int search_low; | ||
120 | |||
121 | /* Information on the current probe. */ | ||
122 | int probe_size; | ||
123 | } icsk_mtup; | ||
107 | u32 icsk_ca_priv[16]; | 124 | u32 icsk_ca_priv[16]; |
108 | #define ICSK_CA_PRIV_SIZE (16 * sizeof(u32)) | 125 | #define ICSK_CA_PRIV_SIZE (16 * sizeof(u32)) |
109 | }; | 126 | }; |
@@ -310,4 +327,13 @@ extern void inet_csk_listen_stop(struct sock *sk); | |||
310 | 327 | ||
311 | extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); | 328 | extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); |
312 | 329 | ||
330 | extern int inet_csk_ctl_sock_create(struct socket **sock, | ||
331 | unsigned short family, | ||
332 | unsigned short type, | ||
333 | unsigned char protocol); | ||
334 | |||
335 | extern int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname, | ||
336 | char __user *optval, int __user *optlen); | ||
337 | extern int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname, | ||
338 | char __user *optval, int optlen); | ||
313 | #endif /* _INET_CONNECTION_SOCK_H */ | 339 | #endif /* _INET_CONNECTION_SOCK_H */ |
diff --git a/include/net/ip.h b/include/net/ip.h index fab3d5b3ab1c..8fe6156ca9b0 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -356,6 +356,10 @@ extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); | |||
356 | extern int ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc); | 356 | extern int ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc); |
357 | extern int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen); | 357 | extern int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen); |
358 | extern int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); | 358 | extern int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); |
359 | extern int compat_ip_setsockopt(struct sock *sk, int level, | ||
360 | int optname, char __user *optval, int optlen); | ||
361 | extern int compat_ip_getsockopt(struct sock *sk, int level, | ||
362 | int optname, char __user *optval, int __user *optlen); | ||
359 | extern int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct sock *)); | 363 | extern int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct sock *)); |
360 | 364 | ||
361 | extern int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); | 365 | extern int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 1f2e428ca364..a398ae5e30f9 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -7,6 +7,23 @@ | |||
7 | #define IP6_RT_PRIO_KERN 512 | 7 | #define IP6_RT_PRIO_KERN 512 |
8 | #define IP6_RT_FLOW_MASK 0x00ff | 8 | #define IP6_RT_FLOW_MASK 0x00ff |
9 | 9 | ||
10 | struct route_info { | ||
11 | __u8 type; | ||
12 | __u8 length; | ||
13 | __u8 prefix_len; | ||
14 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
15 | __u8 reserved_h:3, | ||
16 | route_pref:2, | ||
17 | reserved_l:3; | ||
18 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
19 | __u8 reserved_l:3, | ||
20 | route_pref:2, | ||
21 | reserved_h:3; | ||
22 | #endif | ||
23 | __u32 lifetime; | ||
24 | __u8 prefix[0]; /* 0,8 or 16 */ | ||
25 | }; | ||
26 | |||
10 | #ifdef __KERNEL__ | 27 | #ifdef __KERNEL__ |
11 | 28 | ||
12 | #include <net/flow.h> | 29 | #include <net/flow.h> |
@@ -87,11 +104,14 @@ extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, | |||
87 | extern struct rt6_info * rt6_get_dflt_router(struct in6_addr *addr, | 104 | extern struct rt6_info * rt6_get_dflt_router(struct in6_addr *addr, |
88 | struct net_device *dev); | 105 | struct net_device *dev); |
89 | extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr, | 106 | extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr, |
90 | struct net_device *dev); | 107 | struct net_device *dev, |
108 | unsigned int pref); | ||
91 | 109 | ||
92 | extern void rt6_purge_dflt_routers(void); | 110 | extern void rt6_purge_dflt_routers(void); |
93 | 111 | ||
94 | extern void rt6_reset_dflt_pointer(struct rt6_info *rt); | 112 | extern int rt6_route_rcv(struct net_device *dev, |
113 | u8 *opt, int len, | ||
114 | struct in6_addr *gwaddr); | ||
95 | 115 | ||
96 | extern void rt6_redirect(struct in6_addr *dest, | 116 | extern void rt6_redirect(struct in6_addr *dest, |
97 | struct in6_addr *saddr, | 117 | struct in6_addr *saddr, |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 3b1d963d396c..6d6f0634ae41 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -282,6 +282,18 @@ static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr | |||
282 | return memcmp((const void *) a1, (const void *) a2, sizeof(struct in6_addr)); | 282 | return memcmp((const void *) a1, (const void *) a2, sizeof(struct in6_addr)); |
283 | } | 283 | } |
284 | 284 | ||
285 | static inline int | ||
286 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, | ||
287 | const struct in6_addr *a2) | ||
288 | { | ||
289 | unsigned int i; | ||
290 | |||
291 | for (i = 0; i < 4; i++) | ||
292 | if ((a1->s6_addr32[i] ^ a2->s6_addr32[i]) & m->s6_addr32[i]) | ||
293 | return 1; | ||
294 | return 0; | ||
295 | } | ||
296 | |||
285 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) | 297 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) |
286 | { | 298 | { |
287 | memcpy((void *) a1, (const void *) a2, sizeof(struct in6_addr)); | 299 | memcpy((void *) a1, (const void *) a2, sizeof(struct in6_addr)); |
@@ -508,6 +520,16 @@ extern int ipv6_getsockopt(struct sock *sk, int level, | |||
508 | int optname, | 520 | int optname, |
509 | char __user *optval, | 521 | char __user *optval, |
510 | int __user *optlen); | 522 | int __user *optlen); |
523 | extern int compat_ipv6_setsockopt(struct sock *sk, | ||
524 | int level, | ||
525 | int optname, | ||
526 | char __user *optval, | ||
527 | int optlen); | ||
528 | extern int compat_ipv6_getsockopt(struct sock *sk, | ||
529 | int level, | ||
530 | int optname, | ||
531 | char __user *optval, | ||
532 | int __user *optlen); | ||
511 | 533 | ||
512 | extern void ipv6_packet_init(void); | 534 | extern void ipv6_packet_init(void); |
513 | 535 | ||
diff --git a/include/net/llc.h b/include/net/llc.h index 1adb2ef3f6f7..f5024583fc8b 100644 --- a/include/net/llc.h +++ b/include/net/llc.h | |||
@@ -71,7 +71,7 @@ extern int llc_rcv(struct sk_buff *skb, struct net_device *dev, | |||
71 | struct packet_type *pt, struct net_device *orig_dev); | 71 | struct packet_type *pt, struct net_device *orig_dev); |
72 | 72 | ||
73 | extern int llc_mac_hdr_init(struct sk_buff *skb, | 73 | extern int llc_mac_hdr_init(struct sk_buff *skb, |
74 | unsigned char *sa, unsigned char *da); | 74 | const unsigned char *sa, const unsigned char *da); |
75 | 75 | ||
76 | extern void llc_add_pack(int type, void (*handler)(struct llc_sap *sap, | 76 | extern void llc_add_pack(int type, void (*handler)(struct llc_sap *sap, |
77 | struct sk_buff *skb)); | 77 | struct sk_buff *skb)); |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index bbac87eeb422..91fa271a0064 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -22,6 +22,8 @@ enum { | |||
22 | ND_OPT_PREFIX_INFO = 3, /* RFC2461 */ | 22 | ND_OPT_PREFIX_INFO = 3, /* RFC2461 */ |
23 | ND_OPT_REDIRECT_HDR = 4, /* RFC2461 */ | 23 | ND_OPT_REDIRECT_HDR = 4, /* RFC2461 */ |
24 | ND_OPT_MTU = 5, /* RFC2461 */ | 24 | ND_OPT_MTU = 5, /* RFC2461 */ |
25 | __ND_OPT_ARRAY_MAX, | ||
26 | ND_OPT_ROUTE_INFO = 24, /* RFC4191 */ | ||
25 | __ND_OPT_MAX | 27 | __ND_OPT_MAX |
26 | }; | 28 | }; |
27 | 29 | ||
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 6fa9ae190741..b0666d66293f 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -68,6 +68,7 @@ struct neigh_parms | |||
68 | struct net_device *dev; | 68 | struct net_device *dev; |
69 | struct neigh_parms *next; | 69 | struct neigh_parms *next; |
70 | int (*neigh_setup)(struct neighbour *); | 70 | int (*neigh_setup)(struct neighbour *); |
71 | void (*neigh_destructor)(struct neighbour *); | ||
71 | struct neigh_table *tbl; | 72 | struct neigh_table *tbl; |
72 | 73 | ||
73 | void *sysctl_table; | 74 | void *sysctl_table; |
@@ -145,7 +146,6 @@ struct neighbour | |||
145 | struct neigh_ops | 146 | struct neigh_ops |
146 | { | 147 | { |
147 | int family; | 148 | int family; |
148 | void (*destructor)(struct neighbour *); | ||
149 | void (*solicit)(struct neighbour *, struct sk_buff*); | 149 | void (*solicit)(struct neighbour *, struct sk_buff*); |
150 | void (*error_report)(struct neighbour *, struct sk_buff*); | 150 | void (*error_report)(struct neighbour *, struct sk_buff*); |
151 | int (*output)(struct sk_buff*); | 151 | int (*output)(struct sk_buff*); |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 6d075ca16e6e..2743c156caa0 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -67,6 +67,18 @@ do { \ | |||
67 | 67 | ||
68 | struct nf_conntrack_helper; | 68 | struct nf_conntrack_helper; |
69 | 69 | ||
70 | /* nf_conn feature for connections that have a helper */ | ||
71 | struct nf_conn_help { | ||
72 | /* Helper. if any */ | ||
73 | struct nf_conntrack_helper *helper; | ||
74 | |||
75 | union nf_conntrack_help help; | ||
76 | |||
77 | /* Current number of expected connections */ | ||
78 | unsigned int expecting; | ||
79 | }; | ||
80 | |||
81 | |||
70 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> | 82 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> |
71 | struct nf_conn | 83 | struct nf_conn |
72 | { | 84 | { |
@@ -81,6 +93,9 @@ struct nf_conn | |||
81 | /* Have we seen traffic both ways yet? (bitset) */ | 93 | /* Have we seen traffic both ways yet? (bitset) */ |
82 | unsigned long status; | 94 | unsigned long status; |
83 | 95 | ||
96 | /* If we were expected by an expectation, this will be it */ | ||
97 | struct nf_conn *master; | ||
98 | |||
84 | /* Timer function; drops refcnt when it goes off. */ | 99 | /* Timer function; drops refcnt when it goes off. */ |
85 | struct timer_list timeout; | 100 | struct timer_list timeout; |
86 | 101 | ||
@@ -88,38 +103,22 @@ struct nf_conn | |||
88 | /* Accounting Information (same cache line as other written members) */ | 103 | /* Accounting Information (same cache line as other written members) */ |
89 | struct ip_conntrack_counter counters[IP_CT_DIR_MAX]; | 104 | struct ip_conntrack_counter counters[IP_CT_DIR_MAX]; |
90 | #endif | 105 | #endif |
91 | /* If we were expected by an expectation, this will be it */ | ||
92 | struct nf_conn *master; | ||
93 | |||
94 | /* Current number of expected connections */ | ||
95 | unsigned int expecting; | ||
96 | 106 | ||
97 | /* Unique ID that identifies this conntrack*/ | 107 | /* Unique ID that identifies this conntrack*/ |
98 | unsigned int id; | 108 | unsigned int id; |
99 | 109 | ||
100 | /* Helper. if any */ | ||
101 | struct nf_conntrack_helper *helper; | ||
102 | |||
103 | /* features - nat, helper, ... used by allocating system */ | 110 | /* features - nat, helper, ... used by allocating system */ |
104 | u_int32_t features; | 111 | u_int32_t features; |
105 | 112 | ||
106 | /* Storage reserved for other modules: */ | ||
107 | |||
108 | union nf_conntrack_proto proto; | ||
109 | |||
110 | #if defined(CONFIG_NF_CONNTRACK_MARK) | 113 | #if defined(CONFIG_NF_CONNTRACK_MARK) |
111 | u_int32_t mark; | 114 | u_int32_t mark; |
112 | #endif | 115 | #endif |
113 | 116 | ||
114 | /* These members are dynamically allocated. */ | 117 | /* Storage reserved for other modules: */ |
115 | 118 | union nf_conntrack_proto proto; | |
116 | union nf_conntrack_help *help; | ||
117 | 119 | ||
118 | /* Layer 3 dependent members. (ex: NAT) */ | 120 | /* features dynamically at the end: helper, nat (both optional) */ |
119 | union { | 121 | char data[0]; |
120 | struct nf_conntrack_ipv4 *ipv4; | ||
121 | } l3proto; | ||
122 | void *data[0]; | ||
123 | }; | 122 | }; |
124 | 123 | ||
125 | struct nf_conntrack_expect | 124 | struct nf_conntrack_expect |
@@ -373,10 +372,23 @@ nf_conntrack_expect_event(enum ip_conntrack_expect_events event, | |||
373 | #define NF_CT_F_NUM 4 | 372 | #define NF_CT_F_NUM 4 |
374 | 373 | ||
375 | extern int | 374 | extern int |
376 | nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size, | 375 | nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size); |
377 | int (*init_conntrack)(struct nf_conn *, u_int32_t)); | ||
378 | extern void | 376 | extern void |
379 | nf_conntrack_unregister_cache(u_int32_t features); | 377 | nf_conntrack_unregister_cache(u_int32_t features); |
380 | 378 | ||
379 | /* valid combinations: | ||
380 | * basic: nf_conn, nf_conn .. nf_conn_help | ||
381 | * nat: nf_conn .. nf_conn_nat, nf_conn .. nf_conn_nat, nf_conn help | ||
382 | */ | ||
383 | static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) | ||
384 | { | ||
385 | unsigned int offset = sizeof(struct nf_conn); | ||
386 | |||
387 | if (!(ct->features & NF_CT_F_HELP)) | ||
388 | return NULL; | ||
389 | |||
390 | return (struct nf_conn_help *) ((void *)ct + offset); | ||
391 | } | ||
392 | |||
381 | #endif /* __KERNEL__ */ | 393 | #endif /* __KERNEL__ */ |
382 | #endif /* _NF_CONNTRACK_H */ | 394 | #endif /* _NF_CONNTRACK_H */ |
diff --git a/include/net/scm.h b/include/net/scm.h index c3fa3d5ab606..540619cb7160 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
@@ -37,10 +37,12 @@ static __inline__ void scm_destroy(struct scm_cookie *scm) | |||
37 | static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, | 37 | static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, |
38 | struct scm_cookie *scm) | 38 | struct scm_cookie *scm) |
39 | { | 39 | { |
40 | memset(scm, 0, sizeof(*scm)); | 40 | struct task_struct *p = current; |
41 | scm->creds.uid = current->uid; | 41 | scm->creds.uid = p->uid; |
42 | scm->creds.gid = current->gid; | 42 | scm->creds.gid = p->gid; |
43 | scm->creds.pid = current->tgid; | 43 | scm->creds.pid = p->tgid; |
44 | scm->fp = NULL; | ||
45 | scm->seq = 0; | ||
44 | if (msg->msg_controllen <= 0) | 46 | if (msg->msg_controllen <= 0) |
45 | return 0; | 47 | return 0; |
46 | return __scm_send(sock, msg, scm); | 48 | return __scm_send(sock, msg, scm); |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 072f407848a6..eba99f375517 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -514,6 +514,16 @@ struct sctp_af { | |||
514 | int optname, | 514 | int optname, |
515 | char __user *optval, | 515 | char __user *optval, |
516 | int __user *optlen); | 516 | int __user *optlen); |
517 | int (*compat_setsockopt) (struct sock *sk, | ||
518 | int level, | ||
519 | int optname, | ||
520 | char __user *optval, | ||
521 | int optlen); | ||
522 | int (*compat_getsockopt) (struct sock *sk, | ||
523 | int level, | ||
524 | int optname, | ||
525 | char __user *optval, | ||
526 | int __user *optlen); | ||
517 | struct dst_entry *(*get_dst) (struct sctp_association *asoc, | 527 | struct dst_entry *(*get_dst) (struct sctp_association *asoc, |
518 | union sctp_addr *daddr, | 528 | union sctp_addr *daddr, |
519 | union sctp_addr *saddr); | 529 | union sctp_addr *saddr); |
diff --git a/include/net/sock.h b/include/net/sock.h index f63d0d56712c..ec226f31dc2a 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -520,6 +520,14 @@ struct proto { | |||
520 | int (*getsockopt)(struct sock *sk, int level, | 520 | int (*getsockopt)(struct sock *sk, int level, |
521 | int optname, char __user *optval, | 521 | int optname, char __user *optval, |
522 | int __user *option); | 522 | int __user *option); |
523 | int (*compat_setsockopt)(struct sock *sk, | ||
524 | int level, | ||
525 | int optname, char __user *optval, | ||
526 | int optlen); | ||
527 | int (*compat_getsockopt)(struct sock *sk, | ||
528 | int level, | ||
529 | int optname, char __user *optval, | ||
530 | int __user *option); | ||
523 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, | 531 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, |
524 | struct msghdr *msg, size_t len); | 532 | struct msghdr *msg, size_t len); |
525 | int (*recvmsg)(struct kiocb *iocb, struct sock *sk, | 533 | int (*recvmsg)(struct kiocb *iocb, struct sock *sk, |
@@ -816,6 +824,10 @@ extern int sock_common_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
816 | struct msghdr *msg, size_t size, int flags); | 824 | struct msghdr *msg, size_t size, int flags); |
817 | extern int sock_common_setsockopt(struct socket *sock, int level, int optname, | 825 | extern int sock_common_setsockopt(struct socket *sock, int level, int optname, |
818 | char __user *optval, int optlen); | 826 | char __user *optval, int optlen); |
827 | extern int compat_sock_common_getsockopt(struct socket *sock, int level, | ||
828 | int optname, char __user *optval, int __user *optlen); | ||
829 | extern int compat_sock_common_setsockopt(struct socket *sock, int level, | ||
830 | int optname, char __user *optval, int optlen); | ||
819 | 831 | ||
820 | extern void sk_common_release(struct sock *sk); | 832 | extern void sk_common_release(struct sock *sk); |
821 | 833 | ||
diff --git a/include/net/tcp.h b/include/net/tcp.h index 77f21c65bbca..9418f4d1afbb 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -60,6 +60,9 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
60 | /* Minimal RCV_MSS. */ | 60 | /* Minimal RCV_MSS. */ |
61 | #define TCP_MIN_RCVMSS 536U | 61 | #define TCP_MIN_RCVMSS 536U |
62 | 62 | ||
63 | /* The least MTU to use for probing */ | ||
64 | #define TCP_BASE_MSS 512 | ||
65 | |||
63 | /* After receiving this amount of duplicate ACKs fast retransmit starts. */ | 66 | /* After receiving this amount of duplicate ACKs fast retransmit starts. */ |
64 | #define TCP_FASTRETRANS_THRESH 3 | 67 | #define TCP_FASTRETRANS_THRESH 3 |
65 | 68 | ||
@@ -219,6 +222,9 @@ extern int sysctl_tcp_nometrics_save; | |||
219 | extern int sysctl_tcp_moderate_rcvbuf; | 222 | extern int sysctl_tcp_moderate_rcvbuf; |
220 | extern int sysctl_tcp_tso_win_divisor; | 223 | extern int sysctl_tcp_tso_win_divisor; |
221 | extern int sysctl_tcp_abc; | 224 | extern int sysctl_tcp_abc; |
225 | extern int sysctl_tcp_mtu_probing; | ||
226 | extern int sysctl_tcp_base_mss; | ||
227 | extern int sysctl_tcp_workaround_signed_windows; | ||
222 | 228 | ||
223 | extern atomic_t tcp_memory_allocated; | 229 | extern atomic_t tcp_memory_allocated; |
224 | extern atomic_t tcp_sockets_allocated; | 230 | extern atomic_t tcp_sockets_allocated; |
@@ -347,6 +353,12 @@ extern int tcp_getsockopt(struct sock *sk, int level, | |||
347 | extern int tcp_setsockopt(struct sock *sk, int level, | 353 | extern int tcp_setsockopt(struct sock *sk, int level, |
348 | int optname, char __user *optval, | 354 | int optname, char __user *optval, |
349 | int optlen); | 355 | int optlen); |
356 | extern int compat_tcp_getsockopt(struct sock *sk, | ||
357 | int level, int optname, | ||
358 | char __user *optval, int __user *optlen); | ||
359 | extern int compat_tcp_setsockopt(struct sock *sk, | ||
360 | int level, int optname, | ||
361 | char __user *optval, int optlen); | ||
350 | extern void tcp_set_keepalive(struct sock *sk, int val); | 362 | extern void tcp_set_keepalive(struct sock *sk, int val); |
351 | extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, | 363 | extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, |
352 | struct msghdr *msg, | 364 | struct msghdr *msg, |
@@ -447,6 +459,10 @@ extern int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | |||
447 | 459 | ||
448 | extern void tcp_initialize_rcv_mss(struct sock *sk); | 460 | extern void tcp_initialize_rcv_mss(struct sock *sk); |
449 | 461 | ||
462 | extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); | ||
463 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); | ||
464 | extern void tcp_mtup_init(struct sock *sk); | ||
465 | |||
450 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) | 466 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) |
451 | { | 467 | { |
452 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | | 468 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 8d362c49b8a9..61b7504fc2ba 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/crypto.h> | 11 | #include <linux/crypto.h> |
12 | #include <linux/pfkeyv2.h> | 12 | #include <linux/pfkeyv2.h> |
13 | #include <linux/in6.h> | 13 | #include <linux/in6.h> |
14 | #include <linux/mutex.h> | ||
14 | 15 | ||
15 | #include <net/sock.h> | 16 | #include <net/sock.h> |
16 | #include <net/dst.h> | 17 | #include <net/dst.h> |
@@ -20,7 +21,11 @@ | |||
20 | 21 | ||
21 | #define XFRM_ALIGN8(len) (((len) + 7) & ~7) | 22 | #define XFRM_ALIGN8(len) (((len) + 7) & ~7) |
22 | 23 | ||
23 | extern struct semaphore xfrm_cfg_sem; | 24 | extern struct sock *xfrm_nl; |
25 | extern u32 sysctl_xfrm_aevent_etime; | ||
26 | extern u32 sysctl_xfrm_aevent_rseqth; | ||
27 | |||
28 | extern struct mutex xfrm_cfg_mutex; | ||
24 | 29 | ||
25 | /* Organization of SPD aka "XFRM rules" | 30 | /* Organization of SPD aka "XFRM rules" |
26 | ------------------------------------ | 31 | ------------------------------------ |
@@ -135,6 +140,16 @@ struct xfrm_state | |||
135 | /* State for replay detection */ | 140 | /* State for replay detection */ |
136 | struct xfrm_replay_state replay; | 141 | struct xfrm_replay_state replay; |
137 | 142 | ||
143 | /* Replay detection state at the time we sent the last notification */ | ||
144 | struct xfrm_replay_state preplay; | ||
145 | |||
146 | /* Replay detection notification settings */ | ||
147 | u32 replay_maxage; | ||
148 | u32 replay_maxdiff; | ||
149 | |||
150 | /* Replay detection notification timer */ | ||
151 | struct timer_list rtimer; | ||
152 | |||
138 | /* Statistics */ | 153 | /* Statistics */ |
139 | struct xfrm_stats stats; | 154 | struct xfrm_stats stats; |
140 | 155 | ||
@@ -169,6 +184,7 @@ struct km_event | |||
169 | u32 hard; | 184 | u32 hard; |
170 | u32 proto; | 185 | u32 proto; |
171 | u32 byid; | 186 | u32 byid; |
187 | u32 aevent; | ||
172 | } data; | 188 | } data; |
173 | 189 | ||
174 | u32 seq; | 190 | u32 seq; |
@@ -199,10 +215,13 @@ extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); | |||
199 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); | 215 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); |
200 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); | 216 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); |
201 | extern void km_state_notify(struct xfrm_state *x, struct km_event *c); | 217 | extern void km_state_notify(struct xfrm_state *x, struct km_event *c); |
202 | |||
203 | #define XFRM_ACQ_EXPIRES 30 | 218 | #define XFRM_ACQ_EXPIRES 30 |
204 | 219 | ||
205 | struct xfrm_tmpl; | 220 | struct xfrm_tmpl; |
221 | extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); | ||
222 | extern void km_state_expired(struct xfrm_state *x, int hard, u32 pid); | ||
223 | extern int __xfrm_state_delete(struct xfrm_state *x); | ||
224 | |||
206 | struct xfrm_state_afinfo { | 225 | struct xfrm_state_afinfo { |
207 | unsigned short family; | 226 | unsigned short family; |
208 | rwlock_t lock; | 227 | rwlock_t lock; |
@@ -305,7 +324,21 @@ struct xfrm_policy | |||
305 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; | 324 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; |
306 | }; | 325 | }; |
307 | 326 | ||
308 | #define XFRM_KM_TIMEOUT 30 | 327 | #define XFRM_KM_TIMEOUT 30 |
328 | /* which seqno */ | ||
329 | #define XFRM_REPLAY_SEQ 1 | ||
330 | #define XFRM_REPLAY_OSEQ 2 | ||
331 | #define XFRM_REPLAY_SEQ_MASK 3 | ||
332 | /* what happened */ | ||
333 | #define XFRM_REPLAY_UPDATE XFRM_AE_CR | ||
334 | #define XFRM_REPLAY_TIMEOUT XFRM_AE_CE | ||
335 | |||
336 | /* default aevent timeout in units of 100ms */ | ||
337 | #define XFRM_AE_ETIME 10 | ||
338 | /* Async Event timer multiplier */ | ||
339 | #define XFRM_AE_ETH_M 10 | ||
340 | /* default seq threshold size */ | ||
341 | #define XFRM_AE_SEQT_SIZE 2 | ||
309 | 342 | ||
310 | struct xfrm_mgr | 343 | struct xfrm_mgr |
311 | { | 344 | { |
@@ -865,6 +898,7 @@ extern int xfrm_state_delete(struct xfrm_state *x); | |||
865 | extern void xfrm_state_flush(u8 proto); | 898 | extern void xfrm_state_flush(u8 proto); |
866 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); | 899 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); |
867 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); | 900 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); |
901 | extern void xfrm_replay_notify(struct xfrm_state *x, int event); | ||
868 | extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); | 902 | extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); |
869 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); | 903 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); |
870 | extern int xfrm_init_state(struct xfrm_state *x); | 904 | extern int xfrm_init_state(struct xfrm_state *x); |
@@ -924,7 +958,7 @@ extern void xfrm_init_pmtu(struct dst_entry *dst); | |||
924 | 958 | ||
925 | extern wait_queue_head_t km_waitq; | 959 | extern wait_queue_head_t km_waitq; |
926 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); | 960 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); |
927 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard); | 961 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); |
928 | 962 | ||
929 | extern void xfrm_input_init(void); | 963 | extern void xfrm_input_init(void); |
930 | extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq); | 964 | extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq); |
@@ -965,4 +999,24 @@ static inline int xfrm_policy_id2dir(u32 index) | |||
965 | return index & 7; | 999 | return index & 7; |
966 | } | 1000 | } |
967 | 1001 | ||
1002 | static inline int xfrm_aevent_is_on(void) | ||
1003 | { | ||
1004 | struct sock *nlsk; | ||
1005 | int ret = 0; | ||
1006 | |||
1007 | rcu_read_lock(); | ||
1008 | nlsk = rcu_dereference(xfrm_nl); | ||
1009 | if (nlsk) | ||
1010 | ret = netlink_has_listeners(nlsk, XFRMNLGRP_AEVENTS); | ||
1011 | rcu_read_unlock(); | ||
1012 | return ret; | ||
1013 | } | ||
1014 | |||
1015 | static inline void xfrm_aevent_doreplay(struct xfrm_state *x) | ||
1016 | { | ||
1017 | if (xfrm_aevent_is_on()) | ||
1018 | xfrm_replay_notify(x, XFRM_REPLAY_UPDATE); | ||
1019 | } | ||
1020 | |||
1021 | |||
968 | #endif /* _NET_XFRM_H */ | 1022 | #endif /* _NET_XFRM_H */ |
diff --git a/include/rdma/ib_fmr_pool.h b/include/rdma/ib_fmr_pool.h index 86b7e93f198b..4ace54cd0cce 100644 --- a/include/rdma/ib_fmr_pool.h +++ b/include/rdma/ib_fmr_pool.h | |||
@@ -43,6 +43,7 @@ struct ib_fmr_pool; | |||
43 | /** | 43 | /** |
44 | * struct ib_fmr_pool_param - Parameters for creating FMR pool | 44 | * struct ib_fmr_pool_param - Parameters for creating FMR pool |
45 | * @max_pages_per_fmr:Maximum number of pages per map request. | 45 | * @max_pages_per_fmr:Maximum number of pages per map request. |
46 | * @page_shift: Log2 of sizeof "pages" mapped by this fmr | ||
46 | * @access:Access flags for FMRs in pool. | 47 | * @access:Access flags for FMRs in pool. |
47 | * @pool_size:Number of FMRs to allocate for pool. | 48 | * @pool_size:Number of FMRs to allocate for pool. |
48 | * @dirty_watermark:Flush is triggered when @dirty_watermark dirty | 49 | * @dirty_watermark:Flush is triggered when @dirty_watermark dirty |
@@ -55,6 +56,7 @@ struct ib_fmr_pool; | |||
55 | */ | 56 | */ |
56 | struct ib_fmr_pool_param { | 57 | struct ib_fmr_pool_param { |
57 | int max_pages_per_fmr; | 58 | int max_pages_per_fmr; |
59 | int page_shift; | ||
58 | enum ib_access_flags access; | 60 | enum ib_access_flags access; |
59 | int pool_size; | 61 | int pool_size; |
60 | int dirty_watermark; | 62 | int dirty_watermark; |
diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h index 2c133506742b..51ab8eddb295 100644 --- a/include/rdma/ib_mad.h +++ b/include/rdma/ib_mad.h | |||
@@ -33,7 +33,7 @@ | |||
33 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | 33 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
34 | * SOFTWARE. | 34 | * SOFTWARE. |
35 | * | 35 | * |
36 | * $Id: ib_mad.h 2775 2005-07-02 13:42:12Z halr $ | 36 | * $Id: ib_mad.h 5596 2006-03-03 01:00:07Z sean.hefty $ |
37 | */ | 37 | */ |
38 | 38 | ||
39 | #if !defined( IB_MAD_H ) | 39 | #if !defined( IB_MAD_H ) |
@@ -208,15 +208,23 @@ struct ib_class_port_info | |||
208 | /** | 208 | /** |
209 | * ib_mad_send_buf - MAD data buffer and work request for sends. | 209 | * ib_mad_send_buf - MAD data buffer and work request for sends. |
210 | * @next: A pointer used to chain together MADs for posting. | 210 | * @next: A pointer used to chain together MADs for posting. |
211 | * @mad: References an allocated MAD data buffer. | 211 | * @mad: References an allocated MAD data buffer for MADs that do not have |
212 | * RMPP active. For MADs using RMPP, references the common and management | ||
213 | * class specific headers. | ||
212 | * @mad_agent: MAD agent that allocated the buffer. | 214 | * @mad_agent: MAD agent that allocated the buffer. |
213 | * @ah: The address handle to use when sending the MAD. | 215 | * @ah: The address handle to use when sending the MAD. |
214 | * @context: User-controlled context fields. | 216 | * @context: User-controlled context fields. |
217 | * @hdr_len: Indicates the size of the data header of the MAD. This length | ||
218 | * includes the common MAD, RMPP, and class specific headers. | ||
219 | * @data_len: Indicates the total size of user-transferred data. | ||
220 | * @seg_count: The number of RMPP segments allocated for this send. | ||
221 | * @seg_size: Size of each RMPP segment. | ||
215 | * @timeout_ms: Time to wait for a response. | 222 | * @timeout_ms: Time to wait for a response. |
216 | * @retries: Number of times to retry a request for a response. | 223 | * @retries: Number of times to retry a request for a response. |
217 | * | 224 | * |
218 | * Users are responsible for initializing the MAD buffer itself, with the | 225 | * Users are responsible for initializing the MAD buffer itself, with the |
219 | * exception of specifying the payload length field in any RMPP MAD. | 226 | * exception of any RMPP header. Additional segment buffer space allocated |
227 | * beyond data_len is padding. | ||
220 | */ | 228 | */ |
221 | struct ib_mad_send_buf { | 229 | struct ib_mad_send_buf { |
222 | struct ib_mad_send_buf *next; | 230 | struct ib_mad_send_buf *next; |
@@ -224,6 +232,10 @@ struct ib_mad_send_buf { | |||
224 | struct ib_mad_agent *mad_agent; | 232 | struct ib_mad_agent *mad_agent; |
225 | struct ib_ah *ah; | 233 | struct ib_ah *ah; |
226 | void *context[2]; | 234 | void *context[2]; |
235 | int hdr_len; | ||
236 | int data_len; | ||
237 | int seg_count; | ||
238 | int seg_size; | ||
227 | int timeout_ms; | 239 | int timeout_ms; |
228 | int retries; | 240 | int retries; |
229 | }; | 241 | }; |
@@ -299,7 +311,7 @@ typedef void (*ib_mad_snoop_handler)(struct ib_mad_agent *mad_agent, | |||
299 | * @mad_recv_wc: Received work completion information on the received MAD. | 311 | * @mad_recv_wc: Received work completion information on the received MAD. |
300 | * | 312 | * |
301 | * MADs received in response to a send request operation will be handed to | 313 | * MADs received in response to a send request operation will be handed to |
302 | * the user after the send operation completes. All data buffers given | 314 | * the user before the send operation completes. All data buffers given |
303 | * to registered agents through this routine are owned by the receiving | 315 | * to registered agents through this routine are owned by the receiving |
304 | * client, except for snooping agents. Clients snooping MADs should not | 316 | * client, except for snooping agents. Clients snooping MADs should not |
305 | * modify the data referenced by @mad_recv_wc. | 317 | * modify the data referenced by @mad_recv_wc. |
@@ -485,17 +497,6 @@ int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent); | |||
485 | int ib_post_send_mad(struct ib_mad_send_buf *send_buf, | 497 | int ib_post_send_mad(struct ib_mad_send_buf *send_buf, |
486 | struct ib_mad_send_buf **bad_send_buf); | 498 | struct ib_mad_send_buf **bad_send_buf); |
487 | 499 | ||
488 | /** | ||
489 | * ib_coalesce_recv_mad - Coalesces received MAD data into a single buffer. | ||
490 | * @mad_recv_wc: Work completion information for a received MAD. | ||
491 | * @buf: User-provided data buffer to receive the coalesced buffers. The | ||
492 | * referenced buffer should be at least the size of the mad_len specified | ||
493 | * by @mad_recv_wc. | ||
494 | * | ||
495 | * This call copies a chain of received MAD segments into a single data buffer, | ||
496 | * removing duplicated headers. | ||
497 | */ | ||
498 | void ib_coalesce_recv_mad(struct ib_mad_recv_wc *mad_recv_wc, void *buf); | ||
499 | 500 | ||
500 | /** | 501 | /** |
501 | * ib_free_recv_mad - Returns data buffers used to receive a MAD. | 502 | * ib_free_recv_mad - Returns data buffers used to receive a MAD. |
@@ -590,9 +591,10 @@ int ib_process_mad_wc(struct ib_mad_agent *mad_agent, | |||
590 | * with an initialized work request structure. Users may modify the returned | 591 | * with an initialized work request structure. Users may modify the returned |
591 | * MAD data buffer before posting the send. | 592 | * MAD data buffer before posting the send. |
592 | * | 593 | * |
593 | * The returned data buffer will be cleared. Users are responsible for | 594 | * The returned MAD header, class specific headers, and any padding will be |
594 | * initializing the common MAD and any class specific headers. If @rmpp_active | 595 | * cleared. Users are responsible for initializing the common MAD header, |
595 | * is set, the RMPP header will be initialized for sending. | 596 | * any class specific header, and MAD data area. |
597 | * If @rmpp_active is set, the RMPP header will be initialized for sending. | ||
596 | */ | 598 | */ |
597 | struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent, | 599 | struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent, |
598 | u32 remote_qpn, u16 pkey_index, | 600 | u32 remote_qpn, u16 pkey_index, |
@@ -601,6 +603,16 @@ struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent, | |||
601 | gfp_t gfp_mask); | 603 | gfp_t gfp_mask); |
602 | 604 | ||
603 | /** | 605 | /** |
606 | * ib_get_rmpp_segment - returns the data buffer for a given RMPP segment. | ||
607 | * @send_buf: Previously allocated send data buffer. | ||
608 | * @seg_num: number of segment to return | ||
609 | * | ||
610 | * This routine returns a pointer to the data buffer of an RMPP MAD. | ||
611 | * Users must provide synchronization to @send_buf around this call. | ||
612 | */ | ||
613 | void *ib_get_rmpp_segment(struct ib_mad_send_buf *send_buf, int seg_num); | ||
614 | |||
615 | /** | ||
604 | * ib_free_send_mad - Returns data buffers used to send a MAD. | 616 | * ib_free_send_mad - Returns data buffers used to send a MAD. |
605 | * @send_buf: Previously allocated send data buffer. | 617 | * @send_buf: Previously allocated send data buffer. |
606 | */ | 618 | */ |
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h index 5ff1490c08db..338ed4333063 100644 --- a/include/rdma/ib_user_verbs.h +++ b/include/rdma/ib_user_verbs.h | |||
@@ -1,7 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2005 Topspin Communications. All rights reserved. | 2 | * Copyright (c) 2005 Topspin Communications. All rights reserved. |
3 | * Copyright (c) 2005 Cisco Systems. All rights reserved. | 3 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. |
4 | * Copyright (c) 2005 PathScale, Inc. All rights reserved. | 4 | * Copyright (c) 2005 PathScale, Inc. All rights reserved. |
5 | * Copyright (c) 2006 Mellanox Technologies. All rights reserved. | ||
5 | * | 6 | * |
6 | * This software is available to you under a choice of one of two | 7 | * This software is available to you under a choice of one of two |
7 | * licenses. You may choose to be licensed under the terms of the GNU | 8 | * licenses. You may choose to be licensed under the terms of the GNU |
@@ -43,7 +44,7 @@ | |||
43 | * Increment this value if any changes that break userspace ABI | 44 | * Increment this value if any changes that break userspace ABI |
44 | * compatibility are made. | 45 | * compatibility are made. |
45 | */ | 46 | */ |
46 | #define IB_USER_VERBS_ABI_VERSION 4 | 47 | #define IB_USER_VERBS_ABI_VERSION 6 |
47 | 48 | ||
48 | enum { | 49 | enum { |
49 | IB_USER_VERBS_CMD_GET_CONTEXT, | 50 | IB_USER_VERBS_CMD_GET_CONTEXT, |
@@ -265,6 +266,17 @@ struct ib_uverbs_create_cq_resp { | |||
265 | __u32 cqe; | 266 | __u32 cqe; |
266 | }; | 267 | }; |
267 | 268 | ||
269 | struct ib_uverbs_resize_cq { | ||
270 | __u64 response; | ||
271 | __u32 cq_handle; | ||
272 | __u32 cqe; | ||
273 | __u64 driver_data[0]; | ||
274 | }; | ||
275 | |||
276 | struct ib_uverbs_resize_cq_resp { | ||
277 | __u32 cqe; | ||
278 | }; | ||
279 | |||
268 | struct ib_uverbs_poll_cq { | 280 | struct ib_uverbs_poll_cq { |
269 | __u64 response; | 281 | __u64 response; |
270 | __u32 cq_handle; | 282 | __u32 cq_handle; |
@@ -338,6 +350,7 @@ struct ib_uverbs_create_qp_resp { | |||
338 | __u32 max_send_sge; | 350 | __u32 max_send_sge; |
339 | __u32 max_recv_sge; | 351 | __u32 max_recv_sge; |
340 | __u32 max_inline_data; | 352 | __u32 max_inline_data; |
353 | __u32 reserved; | ||
341 | }; | 354 | }; |
342 | 355 | ||
343 | /* | 356 | /* |
@@ -359,6 +372,47 @@ struct ib_uverbs_qp_dest { | |||
359 | __u8 port_num; | 372 | __u8 port_num; |
360 | }; | 373 | }; |
361 | 374 | ||
375 | struct ib_uverbs_query_qp { | ||
376 | __u64 response; | ||
377 | __u32 qp_handle; | ||
378 | __u32 attr_mask; | ||
379 | __u64 driver_data[0]; | ||
380 | }; | ||
381 | |||
382 | struct ib_uverbs_query_qp_resp { | ||
383 | struct ib_uverbs_qp_dest dest; | ||
384 | struct ib_uverbs_qp_dest alt_dest; | ||
385 | __u32 max_send_wr; | ||
386 | __u32 max_recv_wr; | ||
387 | __u32 max_send_sge; | ||
388 | __u32 max_recv_sge; | ||
389 | __u32 max_inline_data; | ||
390 | __u32 qkey; | ||
391 | __u32 rq_psn; | ||
392 | __u32 sq_psn; | ||
393 | __u32 dest_qp_num; | ||
394 | __u32 qp_access_flags; | ||
395 | __u16 pkey_index; | ||
396 | __u16 alt_pkey_index; | ||
397 | __u8 qp_state; | ||
398 | __u8 cur_qp_state; | ||
399 | __u8 path_mtu; | ||
400 | __u8 path_mig_state; | ||
401 | __u8 en_sqd_async_notify; | ||
402 | __u8 max_rd_atomic; | ||
403 | __u8 max_dest_rd_atomic; | ||
404 | __u8 min_rnr_timer; | ||
405 | __u8 port_num; | ||
406 | __u8 timeout; | ||
407 | __u8 retry_cnt; | ||
408 | __u8 rnr_retry; | ||
409 | __u8 alt_port_num; | ||
410 | __u8 alt_timeout; | ||
411 | __u8 sq_sig_all; | ||
412 | __u8 reserved[5]; | ||
413 | __u64 driver_data[0]; | ||
414 | }; | ||
415 | |||
362 | struct ib_uverbs_modify_qp { | 416 | struct ib_uverbs_modify_qp { |
363 | struct ib_uverbs_qp_dest dest; | 417 | struct ib_uverbs_qp_dest dest; |
364 | struct ib_uverbs_qp_dest alt_dest; | 418 | struct ib_uverbs_qp_dest alt_dest; |
@@ -415,7 +469,7 @@ struct ib_uverbs_sge { | |||
415 | }; | 469 | }; |
416 | 470 | ||
417 | struct ib_uverbs_send_wr { | 471 | struct ib_uverbs_send_wr { |
418 | __u64 wr_id; | 472 | __u64 wr_id; |
419 | __u32 num_sge; | 473 | __u32 num_sge; |
420 | __u32 opcode; | 474 | __u32 opcode; |
421 | __u32 send_flags; | 475 | __u32 send_flags; |
@@ -489,7 +543,7 @@ struct ib_uverbs_post_srq_recv_resp { | |||
489 | 543 | ||
490 | struct ib_uverbs_global_route { | 544 | struct ib_uverbs_global_route { |
491 | __u8 dgid[16]; | 545 | __u8 dgid[16]; |
492 | __u32 flow_label; | 546 | __u32 flow_label; |
493 | __u8 sgid_index; | 547 | __u8 sgid_index; |
494 | __u8 hop_limit; | 548 | __u8 hop_limit; |
495 | __u8 traffic_class; | 549 | __u8 traffic_class; |
@@ -551,6 +605,9 @@ struct ib_uverbs_create_srq { | |||
551 | 605 | ||
552 | struct ib_uverbs_create_srq_resp { | 606 | struct ib_uverbs_create_srq_resp { |
553 | __u32 srq_handle; | 607 | __u32 srq_handle; |
608 | __u32 max_wr; | ||
609 | __u32 max_sge; | ||
610 | __u32 reserved; | ||
554 | }; | 611 | }; |
555 | 612 | ||
556 | struct ib_uverbs_modify_srq { | 613 | struct ib_uverbs_modify_srq { |
@@ -561,6 +618,20 @@ struct ib_uverbs_modify_srq { | |||
561 | __u64 driver_data[0]; | 618 | __u64 driver_data[0]; |
562 | }; | 619 | }; |
563 | 620 | ||
621 | struct ib_uverbs_query_srq { | ||
622 | __u64 response; | ||
623 | __u32 srq_handle; | ||
624 | __u32 reserved; | ||
625 | __u64 driver_data[0]; | ||
626 | }; | ||
627 | |||
628 | struct ib_uverbs_query_srq_resp { | ||
629 | __u32 max_wr; | ||
630 | __u32 max_sge; | ||
631 | __u32 srq_limit; | ||
632 | __u32 reserved; | ||
633 | }; | ||
634 | |||
564 | struct ib_uverbs_destroy_srq { | 635 | struct ib_uverbs_destroy_srq { |
565 | __u64 response; | 636 | __u64 response; |
566 | __u32 srq_handle; | 637 | __u32 srq_handle; |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 22fc886b9695..c1ad6273ac6c 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * Copyright (c) 2004 Topspin Corporation. All rights reserved. | 5 | * Copyright (c) 2004 Topspin Corporation. All rights reserved. |
6 | * Copyright (c) 2004 Voltaire Corporation. All rights reserved. | 6 | * Copyright (c) 2004 Voltaire Corporation. All rights reserved. |
7 | * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. | 7 | * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. |
8 | * Copyright (c) 2005 Cisco Systems. All rights reserved. | 8 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. |
9 | * | 9 | * |
10 | * This software is available to you under a choice of one of two | 10 | * This software is available to you under a choice of one of two |
11 | * licenses. You may choose to be licensed under the terms of the GNU | 11 | * licenses. You may choose to be licensed under the terms of the GNU |
@@ -222,11 +222,13 @@ struct ib_port_attr { | |||
222 | }; | 222 | }; |
223 | 223 | ||
224 | enum ib_device_modify_flags { | 224 | enum ib_device_modify_flags { |
225 | IB_DEVICE_MODIFY_SYS_IMAGE_GUID = 1 | 225 | IB_DEVICE_MODIFY_SYS_IMAGE_GUID = 1 << 0, |
226 | IB_DEVICE_MODIFY_NODE_DESC = 1 << 1 | ||
226 | }; | 227 | }; |
227 | 228 | ||
228 | struct ib_device_modify { | 229 | struct ib_device_modify { |
229 | u64 sys_image_guid; | 230 | u64 sys_image_guid; |
231 | char node_desc[64]; | ||
230 | }; | 232 | }; |
231 | 233 | ||
232 | enum ib_port_modify_flags { | 234 | enum ib_port_modify_flags { |
@@ -649,7 +651,7 @@ struct ib_mw_bind { | |||
649 | struct ib_fmr_attr { | 651 | struct ib_fmr_attr { |
650 | int max_pages; | 652 | int max_pages; |
651 | int max_maps; | 653 | int max_maps; |
652 | u8 page_size; | 654 | u8 page_shift; |
653 | }; | 655 | }; |
654 | 656 | ||
655 | struct ib_ucontext { | 657 | struct ib_ucontext { |
@@ -880,7 +882,8 @@ struct ib_device { | |||
880 | struct ib_ucontext *context, | 882 | struct ib_ucontext *context, |
881 | struct ib_udata *udata); | 883 | struct ib_udata *udata); |
882 | int (*destroy_cq)(struct ib_cq *cq); | 884 | int (*destroy_cq)(struct ib_cq *cq); |
883 | int (*resize_cq)(struct ib_cq *cq, int cqe); | 885 | int (*resize_cq)(struct ib_cq *cq, int cqe, |
886 | struct ib_udata *udata); | ||
884 | int (*poll_cq)(struct ib_cq *cq, int num_entries, | 887 | int (*poll_cq)(struct ib_cq *cq, int num_entries, |
885 | struct ib_wc *wc); | 888 | struct ib_wc *wc); |
886 | int (*peek_cq)(struct ib_cq *cq, int wc_cnt); | 889 | int (*peek_cq)(struct ib_cq *cq, int wc_cnt); |
@@ -950,6 +953,7 @@ struct ib_device { | |||
950 | u64 uverbs_cmd_mask; | 953 | u64 uverbs_cmd_mask; |
951 | int uverbs_abi_ver; | 954 | int uverbs_abi_ver; |
952 | 955 | ||
956 | char node_desc[64]; | ||
953 | __be64 node_guid; | 957 | __be64 node_guid; |
954 | u8 node_type; | 958 | u8 node_type; |
955 | u8 phys_port_cnt; | 959 | u8 phys_port_cnt; |
@@ -986,6 +990,24 @@ static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len | |||
986 | return copy_to_user(udata->outbuf, src, len) ? -EFAULT : 0; | 990 | return copy_to_user(udata->outbuf, src, len) ? -EFAULT : 0; |
987 | } | 991 | } |
988 | 992 | ||
993 | /** | ||
994 | * ib_modify_qp_is_ok - Check that the supplied attribute mask | ||
995 | * contains all required attributes and no attributes not allowed for | ||
996 | * the given QP state transition. | ||
997 | * @cur_state: Current QP state | ||
998 | * @next_state: Next QP state | ||
999 | * @type: QP type | ||
1000 | * @mask: Mask of supplied QP attributes | ||
1001 | * | ||
1002 | * This function is a helper function that a low-level driver's | ||
1003 | * modify_qp method can use to validate the consumer's input. It | ||
1004 | * checks that cur_state and next_state are valid QP states, that a | ||
1005 | * transition from cur_state to next_state is allowed by the IB spec, | ||
1006 | * and that the attribute mask supplied is allowed for the transition. | ||
1007 | */ | ||
1008 | int ib_modify_qp_is_ok(enum ib_qp_state cur_state, enum ib_qp_state next_state, | ||
1009 | enum ib_qp_type type, enum ib_qp_attr_mask mask); | ||
1010 | |||
989 | int ib_register_event_handler (struct ib_event_handler *event_handler); | 1011 | int ib_register_event_handler (struct ib_event_handler *event_handler); |
990 | int ib_unregister_event_handler(struct ib_event_handler *event_handler); | 1012 | int ib_unregister_event_handler(struct ib_event_handler *event_handler); |
991 | void ib_dispatch_event(struct ib_event *event); | 1013 | void ib_dispatch_event(struct ib_event *event); |
@@ -1078,7 +1100,9 @@ int ib_destroy_ah(struct ib_ah *ah); | |||
1078 | * ib_create_srq - Creates a SRQ associated with the specified protection | 1100 | * ib_create_srq - Creates a SRQ associated with the specified protection |
1079 | * domain. | 1101 | * domain. |
1080 | * @pd: The protection domain associated with the SRQ. | 1102 | * @pd: The protection domain associated with the SRQ. |
1081 | * @srq_init_attr: A list of initial attributes required to create the SRQ. | 1103 | * @srq_init_attr: A list of initial attributes required to create the |
1104 | * SRQ. If SRQ creation succeeds, then the attributes are updated to | ||
1105 | * the actual capabilities of the created SRQ. | ||
1082 | * | 1106 | * |
1083 | * srq_attr->max_wr and srq_attr->max_sge are read the determine the | 1107 | * srq_attr->max_wr and srq_attr->max_sge are read the determine the |
1084 | * requested size of the SRQ, and set to the actual values allocated | 1108 | * requested size of the SRQ, and set to the actual values allocated |
@@ -1137,7 +1161,9 @@ static inline int ib_post_srq_recv(struct ib_srq *srq, | |||
1137 | * ib_create_qp - Creates a QP associated with the specified protection | 1161 | * ib_create_qp - Creates a QP associated with the specified protection |
1138 | * domain. | 1162 | * domain. |
1139 | * @pd: The protection domain associated with the QP. | 1163 | * @pd: The protection domain associated with the QP. |
1140 | * @qp_init_attr: A list of initial attributes required to create the QP. | 1164 | * @qp_init_attr: A list of initial attributes required to create the |
1165 | * QP. If QP creation succeeds, then the attributes are updated to | ||
1166 | * the actual capabilities of the created QP. | ||
1141 | */ | 1167 | */ |
1142 | struct ib_qp *ib_create_qp(struct ib_pd *pd, | 1168 | struct ib_qp *ib_create_qp(struct ib_pd *pd, |
1143 | struct ib_qp_init_attr *qp_init_attr); | 1169 | struct ib_qp_init_attr *qp_init_attr); |
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h index fabd879c2f2e..d160880b2a87 100644 --- a/include/scsi/scsi_eh.h +++ b/include/scsi/scsi_eh.h | |||
@@ -35,6 +35,9 @@ static inline int scsi_sense_valid(struct scsi_sense_hdr *sshdr) | |||
35 | } | 35 | } |
36 | 36 | ||
37 | 37 | ||
38 | extern void scsi_eh_finish_cmd(struct scsi_cmnd *scmd, | ||
39 | struct list_head *done_q); | ||
40 | extern void scsi_eh_flush_done_q(struct list_head *done_q); | ||
38 | extern void scsi_report_bus_reset(struct Scsi_Host *, int); | 41 | extern void scsi_report_bus_reset(struct Scsi_Host *, int); |
39 | extern void scsi_report_device_reset(struct Scsi_Host *, int, int); | 42 | extern void scsi_report_device_reset(struct Scsi_Host *, int, int); |
40 | extern int scsi_block_when_processing_errors(struct scsi_device *); | 43 | extern int scsi_block_when_processing_errors(struct scsi_device *); |