/linux-6.1.9/arch/s390/include/asm/ |
D | checksum.h | 49 u32 csum = (__force u32) sum; in csum_fold() local 51 csum += (csum >> 16) | (csum << 16); in csum_fold() 52 csum >>= 16; in csum_fold() 53 return (__force __sum16) ~csum; in csum_fold() 62 __u64 csum = 0; in ip_fast_csum() local 65 csum += *ptr++; in ip_fast_csum() 66 csum += *ptr++; in ip_fast_csum() 67 csum += *ptr++; in ip_fast_csum() 68 csum += *ptr++; in ip_fast_csum() 71 csum += *ptr++; in ip_fast_csum() [all …]
|
/linux-6.1.9/net/netfilter/ |
D | utils.c | 14 __sum16 csum = 0; in nf_ip_checksum() local 21 !csum_fold(skb->csum)) || in nf_ip_checksum() 24 skb->csum)) { in nf_ip_checksum() 31 skb->csum = 0; in nf_ip_checksum() 33 skb->csum = csum_tcpudp_nofold(iph->saddr, iph->daddr, in nf_ip_checksum() 36 csum = __skb_checksum_complete(skb); in nf_ip_checksum() 38 return csum; in nf_ip_checksum() 48 __sum16 csum = 0; in nf_ip_checksum_partial() local 56 skb->csum = csum_tcpudp_nofold(iph->saddr, iph->daddr, protocol, in nf_ip_checksum_partial() 61 return csum; in nf_ip_checksum_partial() [all …]
|
/linux-6.1.9/arch/mips/include/asm/ |
D | checksum.h | 77 static inline __sum16 csum_fold(__wsum csum) in csum_fold() argument 79 u32 sum = (__force u32)csum; in csum_fold() 82 csum = (__force __wsum)(sum < (__force u32)csum); in csum_fold() 84 sum += (__force u32)csum; in csum_fold() 101 unsigned int csum; in ip_fast_csum() local 104 csum = word[0]; in ip_fast_csum() 105 csum += word[1]; in ip_fast_csum() 106 carry = (csum < word[1]); in ip_fast_csum() 107 csum += carry; in ip_fast_csum() 109 csum += word[2]; in ip_fast_csum() [all …]
|
/linux-6.1.9/include/net/ |
D | checksum.h | 57 static __always_inline __wsum csum_add(__wsum csum, __wsum addend) in csum_add() argument 59 u32 res = (__force u32)csum; in csum_add() 65 static __always_inline __wsum csum_sub(__wsum csum, __wsum addend) in csum_sub() argument 67 return csum_add(csum, ~addend); in csum_sub() 70 static __always_inline __sum16 csum16_add(__sum16 csum, __be16 addend) in csum16_add() argument 72 u16 res = (__force u16)csum; in csum16_add() 78 static __always_inline __sum16 csum16_sub(__sum16 csum, __be16 addend) in csum16_sub() argument 80 return csum16_add(csum, ~addend); in csum16_sub() 94 csum_block_add(__wsum csum, __wsum csum2, int offset) in csum_block_add() argument 96 return csum_add(csum, csum_shift(csum2, offset)); in csum_block_add() [all …]
|
D | udp.h | 131 __wsum csum = csum_partial(skb_transport_header(skb), in udp_csum_outgoing() local 134 csum = csum_add(csum, skb->csum); in udp_csum_outgoing() 136 return csum; in udp_csum_outgoing() 141 __wsum csum = csum_partial(skb_transport_header(skb), in udp_csum() local 142 sizeof(struct udphdr), skb->csum); in udp_csum() 145 csum = csum_add(csum, skb->csum); in udp_csum() 147 return csum; in udp_csum() 162 skb->csum = csum_partial(skb->data, sizeof(struct udphdr), in udp_csum_pull_header() 163 skb->csum); in udp_csum_pull_header()
|
D | seg6.h | 22 skb->csum = ~csum_partial((char *)diff, sizeof(diff), ~skb->csum); in update_csum_diff4() 33 skb->csum = ~csum_partial((char *)diff, sizeof(diff), ~skb->csum); in update_csum_diff16()
|
/linux-6.1.9/samples/bpf/ |
D | xdp_adjust_tail_kern.c | 58 static __always_inline __u16 csum_fold_helper(__u32 csum) in csum_fold_helper() argument 60 return ~((csum & 0xffff) + (csum >> 16)); in csum_fold_helper() 64 __u32 *csum) in ipv4_csum() argument 66 *csum = bpf_csum_diff(0, 0, data_start, data_size, *csum); in ipv4_csum() 67 *csum = csum_fold_helper(*csum); in ipv4_csum() 85 __u32 csum = 0; in send_icmp4_too_big() local 100 ipv4_csum(icmp_hdr, ICMP_TOOBIG_PAYLOAD_SIZE, &csum); in send_icmp4_too_big() 101 icmp_hdr->checksum = csum; in send_icmp4_too_big() 112 csum = 0; in send_icmp4_too_big() 113 ipv4_csum(iph, sizeof(struct iphdr), &csum); in send_icmp4_too_big() [all …]
|
/linux-6.1.9/arch/powerpc/lib/ |
D | checksum_wrappers.c | 17 __wsum csum; in csum_and_copy_from_user() local 22 csum = csum_partial_copy_generic((void __force *)src, dst, len); in csum_and_copy_from_user() 25 return csum; in csum_and_copy_from_user() 30 __wsum csum; in csum_and_copy_to_user() local 35 csum = csum_partial_copy_generic(src, (void __force *)dst, len); in csum_and_copy_to_user() 38 return csum; in csum_and_copy_to_user()
|
/linux-6.1.9/drivers/infiniband/hw/qib/ |
D | qib_eeprom.c | 117 u8 csum = 0, len; in flash_csum() local 128 csum += *ip++; in flash_csum() 129 csum -= ifp->if_csum; in flash_csum() 130 csum = ~csum; in flash_csum() 132 ifp->if_csum = csum; in flash_csum() 134 return csum; in flash_csum() 150 u8 csum, *bguid; in qib_get_eeprom_info() local 199 csum = flash_csum(ifp, 0); in qib_get_eeprom_info() 200 if (csum != ifp->if_csum) { in qib_get_eeprom_info() 203 csum, ifp->if_csum); in qib_get_eeprom_info()
|
/linux-6.1.9/fs/ext4/ |
D | bitmap.c | 45 __u32 csum; in ext4_inode_bitmap_csum_set() local 51 csum = ext4_chksum(sbi, sbi->s_csum_seed, (__u8 *)bh->b_data, sz); in ext4_inode_bitmap_csum_set() 52 gdp->bg_inode_bitmap_csum_lo = cpu_to_le16(csum & 0xFFFF); in ext4_inode_bitmap_csum_set() 54 gdp->bg_inode_bitmap_csum_hi = cpu_to_le16(csum >> 16); in ext4_inode_bitmap_csum_set() 88 __u32 csum; in ext4_block_bitmap_csum_set() local 94 csum = ext4_chksum(sbi, sbi->s_csum_seed, (__u8 *)bh->b_data, sz); in ext4_block_bitmap_csum_set() 95 gdp->bg_block_bitmap_csum_lo = cpu_to_le16(csum & 0xFFFF); in ext4_block_bitmap_csum_set() 97 gdp->bg_block_bitmap_csum_hi = cpu_to_le16(csum >> 16); in ext4_block_bitmap_csum_set()
|
/linux-6.1.9/arch/s390/kernel/ |
D | os_info.c | 42 os_info.csum = os_info_csum(&os_info); in os_info_crashkernel_add() 52 os_info.entry[nr].csum = (__force u32)csum_partial(ptr, size, 0); in os_info_entry_add() 53 os_info.csum = os_info_csum(&os_info); in os_info_entry_add() 67 os_info.csum = os_info_csum(&os_info); in os_info_init() 84 u32 csum; in os_info_old_alloc() local 102 csum = (__force u32)csum_partial(buf_align, size, 0); in os_info_old_alloc() 103 if (csum != os_info_old->entry[nr].csum) { in os_info_old_alloc() 142 if (os_info_old->csum != os_info_csum(os_info_old)) in os_info_old_init()
|
/linux-6.1.9/arch/csky/include/asm/ |
D | checksum.h | 9 static inline __sum16 csum_fold(__wsum csum) in csum_fold() argument 18 : "=r"(csum), "=r"(tmp) in csum_fold() 19 : "0"(csum)); in csum_fold() 21 return (__force __sum16) ~csum; in csum_fold()
|
/linux-6.1.9/block/partitions/ |
D | sgi.c | 32 __be32 csum; /* Disk label checksum */ member 38 int i, csum; in sgi_partition() local 59 for(csum = 0; ui >= ((__be32 *) label);) { in sgi_partition() 61 csum += be32_to_cpu(cs); in sgi_partition() 63 if(csum) { in sgi_partition()
|
D | sun.c | 24 __be16 csum; in sun_partition() local 64 __be16 csum; /* Label xor'd checksum */ in sun_partition() member 84 for (csum = 0; ush >= ((__be16 *) label);) in sun_partition() 85 csum ^= *ush--; in sun_partition() 86 if (csum) { in sun_partition()
|
/linux-6.1.9/net/sched/ |
D | act_csum.c | 156 skb->csum = csum_partial(icmph, ipl - ihl, 0); in tcf_csum_ipv4_icmp() 157 icmph->checksum = csum_fold(skb->csum); in tcf_csum_ipv4_icmp() 173 igmph->csum = 0; in tcf_csum_ipv4_igmp() 174 skb->csum = csum_partial(igmph, ipl - ihl, 0); in tcf_csum_ipv4_igmp() 175 igmph->csum = csum_fold(skb->csum); in tcf_csum_ipv4_igmp() 194 skb->csum = csum_partial(icmp6h, ipl - ihl, 0); in tcf_csum_ipv6_icmp() 197 skb->csum); in tcf_csum_ipv6_icmp() 219 skb->csum = csum_partial(tcph, ipl - ihl, 0); in tcf_csum_ipv4_tcp() 221 iph->saddr, iph->daddr, skb->csum); in tcf_csum_ipv4_tcp() 243 skb->csum = csum_partial(tcph, ipl - ihl, 0); in tcf_csum_ipv6_tcp() [all …]
|
/linux-6.1.9/drivers/gpu/drm/amd/amdgpu/ |
D | amdgpu_ras_eeprom.c | 231 u8 *pp, csum; in __calc_hdr_byte_sum() local 237 csum = 0; in __calc_hdr_byte_sum() 239 csum += *pp; in __calc_hdr_byte_sum() 241 return csum; in __calc_hdr_byte_sum() 251 u8 csum; in amdgpu_ras_eeprom_correct_header_tag() local 253 csum = -hdr->checksum; in amdgpu_ras_eeprom_correct_header_tag() 256 csum -= (hh[0] + hh[1] + hh[2] + hh[3]); in amdgpu_ras_eeprom_correct_header_tag() 258 csum += hh[0] + hh[1] + hh[2] + hh[3]; in amdgpu_ras_eeprom_correct_header_tag() 259 csum = -csum; in amdgpu_ras_eeprom_correct_header_tag() 262 hdr->checksum = csum; in amdgpu_ras_eeprom_correct_header_tag() [all …]
|
/linux-6.1.9/arch/powerpc/include/asm/ |
D | checksum.h | 95 static __always_inline __wsum csum_add(__wsum csum, __wsum addend) in csum_add() argument 98 u64 res = (__force u64)csum; in csum_add() 103 if (__builtin_constant_p(csum) && csum == 0) in csum_add() 106 return csum; in csum_add() 110 : "+r" (csum) : "r" (addend) : "xer"); in csum_add() 111 return csum; in csum_add()
|
/linux-6.1.9/arch/sparc/include/asm/ |
D | checksum_64.h | 133 static inline __wsum csum_add(__wsum csum, __wsum addend) in csum_add() argument 138 : "=r" (csum) in csum_add() 139 : "r" (addend), "0" (csum)); in csum_add() 141 return csum; in csum_add()
|
D | checksum_32.h | 199 static inline __wsum csum_add(__wsum csum, __wsum addend) in csum_add() argument 204 : "=r" (csum) in csum_add() 205 : "r" (addend), "0" (csum)); in csum_add() 207 return csum; in csum_add()
|
/linux-6.1.9/tools/bootconfig/ |
D | main.c | 180 uint32_t size = 0, csum = 0, rcsum; in load_xbc_from_initrd() local 208 if (read(fd, &csum, sizeof(uint32_t)) < 0) in load_xbc_from_initrd() 210 csum = le32toh(csum); in load_xbc_from_initrd() 228 if (csum != rcsum) { in load_xbc_from_initrd() 229 pr_err("checksum error: %d != %d\n", csum, rcsum); in load_xbc_from_initrd() 366 uint32_t size, csum; in apply_xbc() local 376 csum = xbc_calc_checksum(buf, size); in apply_xbc() 398 printf("\tChecksum: %d\n", (unsigned int)csum); in apply_xbc() 437 *(uint32_t *)p = htole32(csum); in apply_xbc()
|
/linux-6.1.9/sound/drivers/vx/ |
D | vx_core.c | 687 unsigned int csum = 0; in snd_vx_dsp_load() local 706 csum ^= *cptr; in snd_vx_dsp_load() 707 csum = (csum >> 24) | (csum << 8); in snd_vx_dsp_load() 709 csum ^= *cptr; in snd_vx_dsp_load() 710 csum = (csum >> 24) | (csum << 8); in snd_vx_dsp_load() 712 csum ^= *cptr; in snd_vx_dsp_load() 713 csum = (csum >> 24) | (csum << 8); in snd_vx_dsp_load() 716 snd_printdd(KERN_DEBUG "checksum = 0x%08x\n", csum); in snd_vx_dsp_load()
|
/linux-6.1.9/net/sunrpc/ |
D | socklib.c | 31 __wsum csum; member 75 desc->csum = csum_block_add(desc->csum, csum2, pos); in xdr_skb_read_and_csum_bits() 181 desc.csum = csum_partial(skb->data, desc.offset, skb->csum); in csum_partial_copy_to_xdr() 187 desc.csum = csum_block_add(desc.csum, csum2, desc.offset); in csum_partial_copy_to_xdr() 191 if (csum_fold(desc.csum)) in csum_partial_copy_to_xdr()
|
/linux-6.1.9/drivers/input/touchscreen/ |
D | elo.c | 59 unsigned char csum; member 73 elo->csum = 0xaa; in elo_process_data_10() 83 if (data != elo->csum) { in elo_process_data_10() 86 data, elo->csum); in elo_process_data_10() 114 elo->csum += data; in elo_process_data_10() 224 unsigned char csum = 0xaa + ELO10_LEAD_BYTE; in elo_command_10() local 237 csum += packet[i]; in elo_command_10() 242 if (serio_write(elo->serio, csum)) in elo_command_10()
|
/linux-6.1.9/drivers/net/ethernet/sgi/ |
D | ioc3-eth.c | 303 u32 csum, ehsum; in ioc3_tcpudp_checksum() local 331 csum = hwsum + in ioc3_tcpudp_checksum() 344 csum += 0xffff ^ ehsum; in ioc3_tcpudp_checksum() 351 csum += 0xffff ^ (u16)((cp[1] << 8) | cp[0]); in ioc3_tcpudp_checksum() 352 csum += 0xffff ^ (u16)((cp[3] << 8) | cp[2]); in ioc3_tcpudp_checksum() 354 csum += 0xffff ^ (u16)((cp[0] << 8) | cp[1]); in ioc3_tcpudp_checksum() 355 csum += 0xffff ^ (u16)((cp[2] << 8) | cp[3]); in ioc3_tcpudp_checksum() 358 csum = (csum & 0xffff) + (csum >> 16); in ioc3_tcpudp_checksum() 359 csum = (csum & 0xffff) + (csum >> 16); in ioc3_tcpudp_checksum() 361 if (csum == 0xffff) in ioc3_tcpudp_checksum() [all …]
|
/linux-6.1.9/drivers/crypto/cavium/zip/ |
D | zip_inflate.c | 84 zip_cmd->s.adlercrc32 = zip_ops->csum; in prepare_inflate_zcmd() 179 zip_ops->csum = result_ptr->s.adler32; in zip_inflate() 200 zip_ops->csum = result_ptr->s.adler32; in zip_inflate() 205 zip_ops->csum = result_ptr->s.adler32; in zip_inflate() 210 zip_ops->csum = result_ptr->s.crc32; in zip_inflate()
|