aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-generic/checksum.h4
-rw-r--r--lib/checksum.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/include/asm-generic/checksum.h b/include/asm-generic/checksum.h
index c084767c88bc..59811df58c5b 100644
--- a/include/asm-generic/checksum.h
+++ b/include/asm-generic/checksum.h
@@ -38,12 +38,15 @@ extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
38 csum_partial_copy((src), (dst), (len), (sum)) 38 csum_partial_copy((src), (dst), (len), (sum))
39#endif 39#endif
40 40
41#ifndef ip_fast_csum
41/* 42/*
42 * This is a version of ip_compute_csum() optimized for IP headers, 43 * This is a version of ip_compute_csum() optimized for IP headers,
43 * which always checksum on 4 octet boundaries. 44 * which always checksum on 4 octet boundaries.
44 */ 45 */
45extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl); 46extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
47#endif
46 48
49#ifndef csum_fold
47/* 50/*
48 * Fold a partial checksum 51 * Fold a partial checksum
49 */ 52 */
@@ -54,6 +57,7 @@ static inline __sum16 csum_fold(__wsum csum)
54 sum = (sum & 0xffff) + (sum >> 16); 57 sum = (sum & 0xffff) + (sum >> 16);
55 return (__force __sum16)~sum; 58 return (__force __sum16)~sum;
56} 59}
60#endif
57 61
58#ifndef csum_tcpudp_nofold 62#ifndef csum_tcpudp_nofold
59/* 63/*
diff --git a/lib/checksum.c b/lib/checksum.c
index 12dceb27ff20..129775eb6de6 100644
--- a/lib/checksum.c
+++ b/lib/checksum.c
@@ -102,6 +102,7 @@ out:
102} 102}
103#endif 103#endif
104 104
105#ifndef ip_fast_csum
105/* 106/*
106 * This is a version of ip_compute_csum() optimized for IP headers, 107 * This is a version of ip_compute_csum() optimized for IP headers,
107 * which always checksum on 4 octet boundaries. 108 * which always checksum on 4 octet boundaries.
@@ -111,6 +112,7 @@ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
111 return (__force __sum16)~do_csum(iph, ihl*4); 112 return (__force __sum16)~do_csum(iph, ihl*4);
112} 113}
113EXPORT_SYMBOL(ip_fast_csum); 114EXPORT_SYMBOL(ip_fast_csum);
115#endif
114 116
115/* 117/*
116 * computes the checksum of a memory block at buff, length len, 118 * computes the checksum of a memory block at buff, length len,