|
@@ -15,7 +15,7 @@
|
|
|
*
|
|
|
* it's best to have buff aligned on a 32-bit boundary
|
|
|
*/
|
|
|
-unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum);
|
|
|
+__wsum csum_partial(const void *buff, int len, __wsum sum);
|
|
|
|
|
|
/*
|
|
|
* the same as csum_partial, but copies from src while it
|
|
@@ -25,8 +25,8 @@ unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum);
|
|
|
* better 64-bit) boundary
|
|
|
*/
|
|
|
|
|
|
-unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst,
|
|
|
- int len, int sum);
|
|
|
+__wsum csum_partial_copy(const void *src, void *dst,
|
|
|
+ int len, __wsum sum);
|
|
|
|
|
|
/*
|
|
|
* the same as csum_partial_copy, but copies from user space.
|
|
@@ -35,20 +35,19 @@ unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst,
|
|
|
* better 64-bit) boundary
|
|
|
*/
|
|
|
|
|
|
-extern unsigned int csum_partial_copy_from_user(const unsigned char *src,
|
|
|
- unsigned char *dst, int len,
|
|
|
- int sum, int *csum_err);
|
|
|
+extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
|
|
+ int len, __wsum sum, int *csum_err);
|
|
|
|
|
|
#define csum_partial_copy_nocheck(src, dst, len, sum) \
|
|
|
csum_partial_copy((src), (dst), (len), (sum))
|
|
|
|
|
|
-unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl);
|
|
|
+__sum16 ip_fast_csum(unsigned char *iph, unsigned int ihl);
|
|
|
|
|
|
/*
|
|
|
* Fold a partial checksum
|
|
|
*/
|
|
|
|
|
|
-static inline unsigned int csum_fold(unsigned int sum)
|
|
|
+static inline __sum16 csum_fold(__wsum sum)
|
|
|
{
|
|
|
while (sum >> 16)
|
|
|
sum = (sum & 0xffff) + (sum >> 16);
|
|
@@ -60,9 +59,9 @@ static inline unsigned int csum_fold(unsigned int sum)
|
|
|
* returns a 16-bit checksum, already complemented
|
|
|
*/
|
|
|
|
|
|
-static inline unsigned int
|
|
|
-csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|
|
- unsigned short proto, unsigned int sum)
|
|
|
+static inline __wsum
|
|
|
+csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
|
|
+ unsigned short proto, __wsum sum)
|
|
|
{
|
|
|
|
|
|
__asm__ ("%0 = %0 + %1;\n\t"
|
|
@@ -84,9 +83,9 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|
|
return (sum);
|
|
|
}
|
|
|
|
|
|
-static inline unsigned short int
|
|
|
-csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|
|
- unsigned short proto, unsigned int sum)
|
|
|
+static inline __sum16
|
|
|
+csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
|
|
|
+ unsigned short proto, __wsum sum)
|
|
|
{
|
|
|
return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
|
|
|
}
|
|
@@ -96,6 +95,6 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|
|
* in icmp.c
|
|
|
*/
|
|
|
|
|
|
-extern unsigned short ip_compute_csum(const unsigned char *buff, int len);
|
|
|
+extern __sum16 ip_compute_csum(const void *buff, int len);
|
|
|
|
|
|
#endif /* _BFIN_CHECKSUM_H */
|