22 #include <linux/errno.h>
23 #include <asm/types.h>
24 #include <asm/byteorder.h>
25 #include <asm/uaccess.h>
26 #include <asm/checksum.h>
28 #ifndef _HAVE_ARCH_COPY_AND_CSUM_FROM_USER
43 #ifndef HAVE_CSUM_COPY_USER
45 (
const void *src,
void __user *dst,
int len,
__wsum sum,
int *err_ptr)
69 return csum_add(csum, ~addend);
77 sum = ((sum&0xFF00FF)<<8)+((sum>>8)&0xFF00FF);
86 sum = ((sum&0xFF00FF)<<8)+((sum>>8)&0xFF00FF);
95 #define CSUM_MANGLED_0 ((__force __sum16)0xffff)
99 __be32 diff[] = { ~from, to };
101 *sum = csum_fold(
csum_partial(diff,
sizeof(diff), ~csum_unfold(*sum)));
121 (
__force __be32)to, pseudohdr);