drm/ast: Only warn about unsupported TX chips on Gen4 and later
[drm/drm-misc.git] / arch / csky / include / asm / checksum.h
blobaa12ef4b90806c26e017196e7aeea973382dd400
1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __ASM_CSKY_CHECKSUM_H
4 #define __ASM_CSKY_CHECKSUM_H
6 #include <linux/in6.h>
7 #include <asm/byteorder.h>
9 static inline __sum16 csum_fold(__wsum csum)
11 u32 tmp;
13 asm volatile(
14 "mov %1, %0\n"
15 "rori %0, 16\n"
16 "addu %0, %1\n"
17 "lsri %0, 16\n"
18 : "=r"(csum), "=r"(tmp)
19 : "0"(csum));
21 return (__force __sum16) ~csum;
23 #define csum_fold csum_fold
25 static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
26 unsigned short len, unsigned short proto, __wsum sum)
28 asm volatile(
29 "clrc\n"
30 "addc %0, %1\n"
31 "addc %0, %2\n"
32 "addc %0, %3\n"
33 "inct %0\n"
34 : "=r"(sum)
35 : "r"((__force u32)saddr), "r"((__force u32)daddr),
36 #ifdef __BIG_ENDIAN
37 "r"(proto + len),
38 #else
39 "r"((proto + len) << 8),
40 #endif
41 "0" ((__force unsigned long)sum)
42 : "cc");
43 return sum;
45 #define csum_tcpudp_nofold csum_tcpudp_nofold
47 #include <asm-generic/checksum.h>
49 #endif /* __ASM_CSKY_CHECKSUM_H */