home *** CD-ROM | disk | FTP | other *** search
- #include "global.h"
- #include "timer.h"
- #include "ip.h"
- /*
- * Word aligned linear buffer checksum routine. Called from mbuf checksum
- * routine with simple args. Intent is that this routine may be replaced
- * by assembly language routine for speed if so desired.
- */
- int16 lcsum(register int16 *wp, register int16 len)
- {
- register int32 sum = 0;
- int16 result;
-
- while(len-- != 0)
- sum += *wp++;
- result = eac(sum);
- /* Swap the result because of the (char *) to (int *) type punning */
- result = (result << 8) | (result >> 8);
- return result;
- }
-
-