diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-06-14 11:00:42 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-06-14 11:00:42 -0400 |
commit | 3767f3f1ee11da55760616a2c68a09c02babdd9b (patch) | |
tree | 41f01349b06063bd9ba52c6bb852cb34797a9331 /arch/sh/include | |
parent | 2b74b85693c7c0772e8787883230cd15314555f8 (diff) |
sh: Convert sh64 to use the generic checksum code.
This plugs in GENERIC_CSUM support on sh64, and kills off all of the old
references.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include')
-rw-r--r-- | arch/sh/include/asm/checksum.h | 2 | ||||
-rw-r--r-- | arch/sh/include/asm/checksum_64.h | 78 |
2 files changed, 1 insertions, 79 deletions
diff --git a/arch/sh/include/asm/checksum.h b/arch/sh/include/asm/checksum.h index 67496ab0ef04..fc26d1f4b590 100644 --- a/arch/sh/include/asm/checksum.h +++ b/arch/sh/include/asm/checksum.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifdef CONFIG_SUPERH32 | 1 | #ifdef CONFIG_SUPERH32 |
2 | # include "checksum_32.h" | 2 | # include "checksum_32.h" |
3 | #else | 3 | #else |
4 | # include "checksum_64.h" | 4 | # include <asm-generic/checksum.h> |
5 | #endif | 5 | #endif |
diff --git a/arch/sh/include/asm/checksum_64.h b/arch/sh/include/asm/checksum_64.h deleted file mode 100644 index 9c62a031a8f5..000000000000 --- a/arch/sh/include/asm/checksum_64.h +++ /dev/null | |||
@@ -1,78 +0,0 @@ | |||
1 | #ifndef __ASM_SH_CHECKSUM_64_H | ||
2 | #define __ASM_SH_CHECKSUM_64_H | ||
3 | |||
4 | /* | ||
5 | * include/asm-sh/checksum_64.h | ||
6 | * | ||
7 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
8 | * | ||
9 | * This file is subject to the terms and conditions of the GNU General Public | ||
10 | * License. See the file "COPYING" in the main directory of this archive | ||
11 | * for more details. | ||
12 | */ | ||
13 | |||
14 | /* | ||
15 | * computes the checksum of a memory block at buff, length len, | ||
16 | * and adds in "sum" (32-bit) | ||
17 | * | ||
18 | * returns a 32-bit number suitable for feeding into itself | ||
19 | * or csum_tcpudp_magic | ||
20 | * | ||
21 | * this function must be called with even lengths, except | ||
22 | * for the last fragment, which may be odd | ||
23 | * | ||
24 | * it's best to have buff aligned on a 32-bit boundary | ||
25 | */ | ||
26 | asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); | ||
27 | |||
28 | /* | ||
29 | * Note: when you get a NULL pointer exception here this means someone | ||
30 | * passed in an incorrect kernel address to one of these functions. | ||
31 | * | ||
32 | * If you use these functions directly please don't forget the | ||
33 | * access_ok(). | ||
34 | */ | ||
35 | |||
36 | |||
37 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, | ||
38 | __wsum sum); | ||
39 | |||
40 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, | ||
41 | int len, __wsum sum, int *err_ptr); | ||
42 | |||
43 | static inline __sum16 csum_fold(__wsum csum) | ||
44 | { | ||
45 | u32 sum = (__force u32)csum; | ||
46 | sum = (sum & 0xffff) + (sum >> 16); | ||
47 | sum = (sum & 0xffff) + (sum >> 16); | ||
48 | return (__force __sum16)~sum; | ||
49 | } | ||
50 | |||
51 | __sum16 ip_fast_csum(const void *iph, unsigned int ihl); | ||
52 | |||
53 | __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, | ||
54 | unsigned short len, unsigned short proto, | ||
55 | __wsum sum); | ||
56 | |||
57 | /* | ||
58 | * computes the checksum of the TCP/UDP pseudo-header | ||
59 | * returns a 16-bit checksum, already complemented | ||
60 | */ | ||
61 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, | ||
62 | unsigned short len, | ||
63 | unsigned short proto, | ||
64 | __wsum sum) | ||
65 | { | ||
66 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | ||
67 | } | ||
68 | |||
69 | /* | ||
70 | * this routine is used for miscellaneous IP-like checksums, mainly | ||
71 | * in icmp.c | ||
72 | */ | ||
73 | static inline __sum16 ip_compute_csum(const void *buff, int len) | ||
74 | { | ||
75 | return csum_fold(csum_partial(buff, len, 0)); | ||
76 | } | ||
77 | |||
78 | #endif /* __ASM_SH_CHECKSUM_64_H */ | ||