Lines Matching refs:sum
75 * @return host order (!) lwip checksum (non-inverted Internet sum)
111 /* This maybe a little confusing: reorder sum using htons()
113 The caller must invert bits for Internet sum ! */
131 * @return host order (!) lwip checksum (non-inverted Internet sum)
139 u32_t sum = 0;
151 sum += *ps++;
161 sum += t;
163 /* Fold 32-bit sum to 16 bits
165 sum = FOLD_U32T(sum);
166 sum = FOLD_U32T(sum);
170 sum = SWAP_BYTES_IN_WORD(sum);
173 return (u16_t)sum;
185 * @return host order (!) lwip checksum (non-inverted Internet sum)
196 u32_t sum = 0, tmp;
208 sum += *ps++;
215 tmp = sum + *pl++; /* ping */
216 if (tmp < sum) {
220 sum = tmp + *pl++; /* pong */
221 if (sum < tmp) {
222 sum++; /* add back carry */
229 sum = FOLD_U32T(sum);
235 sum += *ps++;
244 sum += t; /* add end bytes */
246 /* Fold 32-bit sum to 16 bits
248 sum = FOLD_U32T(sum);
249 sum = FOLD_U32T(sum);
252 sum = SWAP_BYTES_IN_WORD(sum);
255 return (u16_t)sum;
311 /* Fold 32-bit sum to 16 bits
377 /* Fold 32-bit sum to 16 bits