Home
last modified time | relevance | path

Searched refs:csum (Results 1 – 25 of 436) sorted by relevance

12345678910>>...18

/openbmc/linux/arch/s390/include/asm/
H A Dchecksum.h52 csum += (csum >> 16) | (csum << 16); in csum_fold()
53 csum >>= 16; in csum_fold()
63 __u64 csum = 0; in ip_fast_csum() local
66 csum += *ptr++; in ip_fast_csum()
67 csum += *ptr++; in ip_fast_csum()
68 csum += *ptr++; in ip_fast_csum()
69 csum += *ptr++; in ip_fast_csum()
73 csum += (csum >> 32) | (csum << 32); in ip_fast_csum()
88 csum += len; in csum_tcpudp_nofold()
89 csum += proto; in csum_tcpudp_nofold()
[all …]
/openbmc/linux/arch/mips/include/asm/
H A Dchecksum.h82 csum = (__force __wsum)(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()
107 csum += carry; in ip_fast_csum()
109 csum += word[2]; in ip_fast_csum()
111 csum += carry; in ip_fast_csum()
113 csum += word[3]; in ip_fast_csum()
115 csum += carry; in ip_fast_csum()
119 csum += *word; in ip_fast_csum()
[all …]
/openbmc/linux/include/net/
H A Dchecksum.h61 u32 res = (__force u32)csum; in csum_add()
69 return csum_add(csum, ~addend); in csum_sub()
74 u16 res = (__force u16)csum; in csum16_add()
82 return csum16_add(csum, ~addend); in csum16_sub()
98 return csum_add(csum, csum_shift(csum2, offset)); in csum_block_add()
104 return csum_block_add(csum, csum2, offset); in csum_block_add_ext()
110 return csum_block_add(csum, ~csum2, offset); in csum_block_sub()
151 *csum = csum_add(csum_sub(*csum, old), new); in csum_replace()
178 csum = csum_sub(csum, csum_partial(ptr, start, 0)); in remcsum_adjust()
181 delta = csum_sub((__force __wsum)csum_fold(csum), in remcsum_adjust()
[all …]
H A Dudp.h132 __wsum csum = csum_partial(skb_transport_header(skb), in udp_csum_outgoing() local
135 csum = csum_add(csum, skb->csum); in udp_csum_outgoing()
137 return csum; in udp_csum_outgoing()
142 __wsum csum = csum_partial(skb_transport_header(skb), in udp_csum() local
143 sizeof(struct udphdr), skb->csum); in udp_csum()
146 csum = csum_add(csum, skb->csum); in udp_csum()
148 return csum; in udp_csum()
163 skb->csum = csum_partial(skb->data, sizeof(struct udphdr), in udp_csum_pull_header()
164 skb->csum); in udp_csum_pull_header()
H A Dseg6.h22 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()
/openbmc/linux/net/netfilter/
H A Dutils.c14 __sum16 csum = 0; in nf_ip_checksum() local
31 skb->csum = 0; in nf_ip_checksum()
38 return csum; in nf_ip_checksum()
48 __sum16 csum = 0; in nf_ip_checksum_partial() local
61 return csum; in nf_ip_checksum_partial()
68 __sum16 csum = 0; in nf_ip6_checksum() local
93 return csum; in nf_ip6_checksum()
103 __sum16 csum = 0; in nf_ip6_checksum_partial() local
120 return csum; in nf_ip6_checksum_partial()
138 return csum; in nf_checksum()
[all …]
/openbmc/linux/samples/bpf/
H A Dxdp_adjust_tail_kern.c58 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 …]
/openbmc/linux/arch/powerpc/lib/
H A Dchecksum_wrappers.c17 __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()
/openbmc/linux/drivers/infiniband/hw/qib/
H A Dqib_eeprom.c117 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()
/openbmc/linux/fs/ext4/
H A Dbitmap.c45 __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()
85 __u32 csum; in ext4_block_bitmap_csum_set() local
91 csum = ext4_chksum(sbi, sbi->s_csum_seed, (__u8 *)bh->b_data, sz); in ext4_block_bitmap_csum_set()
92 gdp->bg_block_bitmap_csum_lo = cpu_to_le16(csum & 0xFFFF); in ext4_block_bitmap_csum_set()
94 gdp->bg_block_bitmap_csum_hi = cpu_to_le16(csum >> 16); in ext4_block_bitmap_csum_set()
/openbmc/linux/arch/s390/kernel/
H A Dos_info.c42 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()
66 os_info.csum = os_info_csum(&os_info); in os_info_init()
83 u32 csum; in os_info_old_alloc() local
101 csum = (__force u32)csum_partial(buf_align, size, 0); in os_info_old_alloc()
102 if (csum != os_info_old->entry[nr].csum) { in os_info_old_alloc()
141 if (os_info_old->csum != os_info_csum(os_info_old)) in os_info_old_init()
/openbmc/u-boot/board/Synology/ds414/
H A Dcmd_syno.c60 unsigned char csum = 0; in do_syno_populate() local
64 csum += bufp[i]; in do_syno_populate()
69 if (csum != bufp[i]) { /* seventh byte is checksum value */ in do_syno_populate()
86 int csum = 0; in do_syno_populate() local
91 csum += bufp[n]; in do_syno_populate()
106 if (strict_strtoul(csump, 10, &c) || c != csum) { in do_syno_populate()
114 unsigned char csum = 0; in do_syno_populate() local
117 csum += bufp[n]; in do_syno_populate()
119 if (csum != bufp[n]) { in do_syno_populate()
/openbmc/linux/drivers/gpu/drm/amd/amdgpu/
H A Damdgpu_fru_eeprom.c105 u8 csum; in amdgpu_fru_get_product_info() local
129 for (csum = 0; len > 0; len--) in amdgpu_fru_get_product_info()
130 csum += buf[len - 1]; in amdgpu_fru_get_product_info()
131 if (csum) { in amdgpu_fru_get_product_info()
132 DRM_ERROR("Bad IPMI Common Header checksum: 0x%02x", csum); in amdgpu_fru_get_product_info()
169 for (csum = 0; size > 0; size--) in amdgpu_fru_get_product_info()
170 csum += pia[size - 1]; in amdgpu_fru_get_product_info()
171 if (csum) { in amdgpu_fru_get_product_info()
172 DRM_ERROR("Bad Product Info Area checksum: 0x%02x", csum); in amdgpu_fru_get_product_info()
H A Damdgpu_ras_eeprom.c360 csum = 0; in __calc_hdr_byte_sum()
364 return csum; in __calc_hdr_byte_sum()
375 csum = 0; in __calc_ras_info_byte_sum()
379 return csum; in __calc_ras_info_byte_sum()
389 u8 csum; in amdgpu_ras_eeprom_correct_header_tag() local
397 csum = -csum; in amdgpu_ras_eeprom_correct_header_tag()
420 u8 csum; in amdgpu_ras_eeprom_reset_table() local
452 csum = -csum; in amdgpu_ras_eeprom_reset_table()
787 csum = 0; in amdgpu_ras_eeprom_update_header()
795 csum = -csum; in amdgpu_ras_eeprom_update_header()
[all …]
/openbmc/linux/arch/csky/include/asm/
H A Dchecksum.h9 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()
/openbmc/linux/net/sched/
H A Dact_csum.c158 icmph->checksum = csum_fold(skb->csum); in tcf_csum_ipv4_icmp()
174 igmph->csum = 0; in tcf_csum_ipv4_igmp()
176 igmph->csum = csum_fold(skb->csum); in tcf_csum_ipv4_igmp()
198 skb->csum); in tcf_csum_ipv6_icmp()
222 iph->saddr, iph->daddr, skb->csum); in tcf_csum_ipv4_tcp()
247 skb->csum); in tcf_csum_ipv6_tcp()
293 skb->csum = csum_partial(udph, ul, 0); in tcf_csum_ipv4_udp()
298 skb->csum); in tcf_csum_ipv4_udp()
341 skb->csum = csum_partial(udph, ul, 0); in tcf_csum_ipv6_udp()
349 skb->csum = csum_partial(udph, ul, 0); in tcf_csum_ipv6_udp()
[all …]
/openbmc/linux/block/partitions/
H A Dsgi.c32 __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()
H A Dsun.c24 __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()
/openbmc/qemu/net/
H A Dchecksum.c64 uint16_t csum; in net_checksum_calculate() local
113 csum = net_raw_checksum((uint8_t *)ip, IP_HDR_GET_LEN(ip)); in net_checksum_calculate()
114 stw_be_p(&ip->ip_sum, csum); in net_checksum_calculate()
146 csum = net_checksum_tcpudp(ip_len, ip->ip_p, in net_checksum_calculate()
151 stw_be_p(&tcp->th_sum, csum); in net_checksum_calculate()
170 csum = net_checksum_tcpudp(ip_len, ip->ip_p, in net_checksum_calculate()
175 stw_be_p(&udp->uh_sum, csum); in net_checksum_calculate()
/openbmc/qemu/hw/net/
H A Dnet_rx_pkt.c477 uint16_t csum; in net_rx_pkt_validate_l3_csum() local
493 csum = net_checksum_finish(cntr); in net_rx_pkt_validate_l3_csum()
495 *csum_valid = (csum == 0); in net_rx_pkt_validate_l3_csum()
507 uint16_t csum; in _net_rx_pkt_calc_l4_csum() local
548 csum = net_checksum_finish_nozero(cntr); in _net_rx_pkt_calc_l4_csum()
552 return csum; in _net_rx_pkt_calc_l4_csum()
593 uint32_t csum; in net_rx_pkt_validate_l4_csum() local
611 *csum_valid = ((csum == 0) || (csum == 0xFFFF)); in net_rx_pkt_validate_l4_csum()
630 uint16_t csum = 0; in net_rx_pkt_fix_l4_csum() local
663 &csum, sizeof(csum)); in net_rx_pkt_fix_l4_csum()
[all …]
H A Dnet_tx_pkt.c93 uint16_t csum; in net_tx_pkt_update_ip_hdr_checksum() local
100 csum = net_raw_checksum(pkt->l3_hdr.octets, in net_tx_pkt_update_ip_hdr_checksum()
102 pkt->l3_hdr.ip.ip_sum = cpu_to_be16(csum); in net_tx_pkt_update_ip_hdr_checksum()
107 uint16_t csum; in net_tx_pkt_update_ip_checksums() local
136 pkt->virt_hdr.csum_offset, &csum, sizeof(csum)); in net_tx_pkt_update_ip_checksums()
141 uint32_t csum = 0; in net_tx_pkt_update_sctp_checksum() local
148 if (iov_from_buf(pl_start_frag, pkt->payload_frags, 8, &csum, sizeof(csum)) < sizeof(csum)) { in net_tx_pkt_update_sctp_checksum()
153 if (iov_from_buf(pl_start_frag, pkt->payload_frags, 8, &csum, sizeof(csum)) < sizeof(csum)) { in net_tx_pkt_update_sctp_checksum()
507 uint16_t csum = 0; in net_tx_pkt_do_sw_csum() local
514 iov_from_buf(iov, iov_len, csum_offset, &csum, sizeof csum); in net_tx_pkt_do_sw_csum()
[all …]
/openbmc/u-boot/tools/gdb/
H A Dremote.c635 unsigned char csum = 0; local
654 csum += buf[i];
658 *p++ = tohex ((csum >> 4) & 0xf);
659 *p++ = tohex (csum & 0xf);
753 unsigned char csum; in read_frame() local
757 csum = 0; in read_frame()
784 if (csum == pktcsum) in read_frame()
793 pktcsum, csum); in read_frame()
800 csum += c; in read_frame()
802 csum += c; in read_frame()
[all …]
/openbmc/u-boot/drivers/misc/
H A Dcros_ec_spi.c88 int csum, len; in cros_ec_spi_command() local
127 csum = cros_ec_calc_checksum(out, 3) in cros_ec_spi_command()
129 out[3 + dout_len] = (uint8_t)csum; in cros_ec_spi_command()
158 csum = cros_ec_calc_checksum(p, len + 2); in cros_ec_spi_command()
159 if (csum != p[len + 2]) { in cros_ec_spi_command()
161 p[2 + len], csum); in cros_ec_spi_command()
H A Dcros_ec_lpc.c87 int csum; in cros_ec_lpc_command() local
101 csum = cmd + args.flags + args.command_version + args.data_size; in cros_ec_lpc_command()
103 csum += *d; in cros_ec_lpc_command()
105 args.checksum = (uint8_t)csum; in cros_ec_lpc_command()
166 csum = cmd + args.flags + args.command_version + args.data_size; in cros_ec_lpc_command()
168 csum += *d; in cros_ec_lpc_command()
170 if (args.checksum != (uint8_t)csum) { in cros_ec_lpc_command()
/openbmc/linux/arch/powerpc/include/asm/
H A Dchecksum.h95 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()

12345678910>>...18