Commit 64e69073 authored by Vineet Gupta's avatar Vineet Gupta

asm-generic headers: Allow yet more arch overrides in checksum.h

arches can have more efficient implementation of these routines
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
parent 0a5eae45
...@@ -38,12 +38,15 @@ extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, ...@@ -38,12 +38,15 @@ extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
csum_partial_copy((src), (dst), (len), (sum)) csum_partial_copy((src), (dst), (len), (sum))
#endif #endif
#ifndef ip_fast_csum
/* /*
* This is a version of ip_compute_csum() optimized for IP headers, * This is a version of ip_compute_csum() optimized for IP headers,
* which always checksum on 4 octet boundaries. * which always checksum on 4 octet boundaries.
*/ */
extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl); extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
#endif
#ifndef csum_fold
/* /*
* Fold a partial checksum * Fold a partial checksum
*/ */
...@@ -54,6 +57,7 @@ static inline __sum16 csum_fold(__wsum csum) ...@@ -54,6 +57,7 @@ static inline __sum16 csum_fold(__wsum csum)
sum = (sum & 0xffff) + (sum >> 16); sum = (sum & 0xffff) + (sum >> 16);
return (__force __sum16)~sum; return (__force __sum16)~sum;
} }
#endif
#ifndef csum_tcpudp_nofold #ifndef csum_tcpudp_nofold
/* /*
......
...@@ -102,6 +102,7 @@ static unsigned int do_csum(const unsigned char *buff, int len) ...@@ -102,6 +102,7 @@ static unsigned int do_csum(const unsigned char *buff, int len)
} }
#endif #endif
#ifndef ip_fast_csum
/* /*
* This is a version of ip_compute_csum() optimized for IP headers, * This is a version of ip_compute_csum() optimized for IP headers,
* which always checksum on 4 octet boundaries. * which always checksum on 4 octet boundaries.
...@@ -111,6 +112,7 @@ __sum16 ip_fast_csum(const void *iph, unsigned int ihl) ...@@ -111,6 +112,7 @@ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
return (__force __sum16)~do_csum(iph, ihl*4); return (__force __sum16)~do_csum(iph, ihl*4);
} }
EXPORT_SYMBOL(ip_fast_csum); EXPORT_SYMBOL(ip_fast_csum);
#endif
/* /*
* computes the checksum of a memory block at buff, length len, * computes the checksum of a memory block at buff, length len,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment