checksum.h (e11e367e9fe57164ea609807ed27184c85263355) checksum.h (a04c192eabfb76824d00f1b4cd0f25844a59d0f0)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Checksum routines
4 *
5 * Copyright (C) 2023 Rivos Inc.
6 */
7#ifndef __ASM_RISCV_CHECKSUM_H
8#define __ASM_RISCV_CHECKSUM_H
9
10#include <linux/in6.h>
11#include <linux/uaccess.h>
12
13#define ip_fast_csum ip_fast_csum
14
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Checksum routines
4 *
5 * Copyright (C) 2023 Rivos Inc.
6 */
7#ifndef __ASM_RISCV_CHECKSUM_H
8#define __ASM_RISCV_CHECKSUM_H
9
10#include <linux/in6.h>
11#include <linux/uaccess.h>
12
13#define ip_fast_csum ip_fast_csum
14
15extern unsigned int do_csum(const unsigned char *buff, int len);
16#define do_csum do_csum
17
18/* Default version is sufficient for 32 bit */
19#ifndef CONFIG_32BIT
20#define _HAVE_ARCH_IPV6_CSUM
21__sum16 csum_ipv6_magic(const struct in6_addr *saddr,
22 const struct in6_addr *daddr,
23 __u32 len, __u8 proto, __wsum sum);
24#endif
25
15/* Define riscv versions of functions before importing asm-generic/checksum.h */
16#include <asm-generic/checksum.h>
17
18/**
19 * Quickly compute an IP checksum with the assumption that IPv4 headers will
20 * always be in multiples of 32-bits, and have an ihl of at least 5.
21 *
22 * @ihl: the number of 32 bit segments and must be greater than or equal to 5.

--- 60 unchanged lines hidden ---
26/* Define riscv versions of functions before importing asm-generic/checksum.h */
27#include <asm-generic/checksum.h>
28
29/**
30 * Quickly compute an IP checksum with the assumption that IPv4 headers will
31 * always be in multiples of 32-bits, and have an ihl of at least 5.
32 *
33 * @ihl: the number of 32 bit segments and must be greater than or equal to 5.

--- 60 unchanged lines hidden ---