diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-05-07 02:55:41 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-05-07 02:55:41 +0000 |
commit | dcec8a13bf565e47942a1751a9cec21bec5648fe (patch) | |
tree | 548b69625b18cc2e88c3e68d0923be546c9ebb03 /include/asm-mips/checksum.h | |
parent | 2e0f55e79c49509b7ff70ff1a10e1e9e90a3dfd4 (diff) |
o Merge with Linux 2.1.99.
o Fix ancient bug in the ELF loader making ldd crash.
o Fix ancient bug in the keyboard code for SGI, SNI and Jazz.
Diffstat (limited to 'include/asm-mips/checksum.h')
-rw-r--r-- | include/asm-mips/checksum.h | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h index b3bfcae7c..d2ce1edcd 100644 --- a/include/asm-mips/checksum.h +++ b/include/asm-mips/checksum.h @@ -1,11 +1,10 @@ -/* - * include/asm-mips/checksum.h +/* $Id: checksum.h,v 1.4 1998/05/06 02:50:12 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1995 by Ralf Baechle + * Copyright (C) 1995, 1996, 1997, 1998 by Ralf Baechle */ #ifndef __ASM_MIPS_CHECKSUM_H #define __ASM_MIPS_CHECKSUM_H @@ -25,13 +24,18 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); /* - * the same as csum_partial, but copies from src while it - * checksums - * - * here even more important to align src and dst on a 32-bit (or even - * better 64-bit) boundary + * this is a new version of the above that records errors it finds in *errp, + * but continues and zeros the rest of the buffer. */ -unsigned int csum_partial_copy(const char *src, char *dst, int len, unsigned int sum); +unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len, + unsigned int sum); + +/* + * this is a new version of the above that records errors it finds in *errp, + * but continues and zeros the rest of the buffer. + */ +unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len, + unsigned int sum, int *errp); /* * the same as csum_partial, but copies from user space (but on MIPS @@ -40,14 +44,9 @@ unsigned int csum_partial_copy(const char *src, char *dst, int len, unsigned int * this is obsolete and will go away. */ #define csum_partial_copy_fromuser csum_partial_copy +unsigned int csum_partial_copy(const char *src, char *dst, int len, unsigned int sum); /* - * this is a new version of the above that records errors it finds in *errp, - * but continues and zeros the rest of the buffer. - */ -unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len, unsigned int sum, int *errp); - -/* * Fold a partial checksum without adding pseudo headers */ static inline unsigned short int csum_fold(unsigned int sum) @@ -126,11 +125,11 @@ static inline unsigned short ip_fast_csum(unsigned char * iph, * computes the checksum of the TCP/UDP pseudo-header * returns a 16-bit checksum, already complemented */ -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 unsigned long csum_tcpudp_nofold(unsigned long saddr, + unsigned long daddr, + unsigned short len, + unsigned short proto, + unsigned int sum) { __asm__(" .set noat @@ -156,7 +155,20 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, "r"(sum) : "$1"); - return csum_fold(sum); + return sum; +} + +/* + * computes the checksum of the TCP/UDP pseudo-header + * returns a 16-bit checksum, already complemented + */ +static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, + unsigned long daddr, + unsigned short len, + unsigned short proto, + unsigned int sum) +{ + return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); } /* |