Lines Matching refs:sum
37 #define FOLD_SUM(sum) \ argument
38 { sum = (sum >> 16) + (sum & 0xFFFF); sum = (sum >> 16) + (sum & 0xFFFF); }
71 ip_csum(mp, offset, sum) in ip_csum() argument
74 uint32_t sum;
97 sum += U16_FETCH(startp);
103 sum += U8_FETCH_FIRST(startp);
106 FOLD_SUM(sum);
113 sum = (sum << 8) + PREV_ONE(startp);
118 sum += PREV_TWO(startp);
124 sum += NEXT_ONE(endp);
129 sum += NEXT_TWO(endp);
151 #define SUM1(i) sum += (u1 & mask) + (u1 >> 16)
152 #define SUM2(i) sum += (u2 & mask) + (u2 >> 16)
159 #define SUM1(i) sum += u1
160 #define SUM2(i) sum += u2
164 #define SUM1(i) sum += ptr[i]
168 #define SUM1(i) sum += *((uint16_t *)ptr)++; sum += *((uint16_t *)ptr)++
188 sum += ((uint16_t *)ptr)[i * 2]; sum += ((uint16_t *)ptr)[(i * 2) + 1]
239 FOLD_SUM(sum);
242 sum = ((sum << 8) | (sum >> 8)) & 0xFFFF;
250 uint32_t u1 = sum;
260 sum += U8_FETCH_SECOND(startp);