Home
last modified time | relevance | path

Searched full:crc (Results 1 – 25 of 1559) sorted by relevance

12345678910>>...63

/linux-6.14.4/drivers/gpu/drm/
Ddrm_debugfs_crc.c43 * DOC: CRC ABI
45 * DRM device drivers can provide to userspace CRC information of each frame as
46 * it reached a given hardware component (a CRC sampling "source").
49 * file dri/0/crtc-N/crc/control in debugfs, with N being the :ref:`index of
54 * Once frame CRC generation is enabled, userspace can capture them by reading
55 * the dri/0/crtc-N/crc/data file. Each line in that file contains the frame
57 * containing the CRC data. Fields are separated by a single space and the number
58 * of CRC fields is source-specific.
60 * Note that though in some cases the CRC is computed in a specified way and on
61 * the frame contents as supplied by userspace (eDP 1.3), in general the CRC
[all …]
/linux-6.14.4/drivers/gpu/drm/nouveau/dispnv50/
Dcrc.c21 #include "crc.h"
79 core->func->crc->set_ctx(head, ctx); in nv50_crc_program_ctx()
86 struct nv50_crc *crc = container_of(work, struct nv50_crc, flip_work); in nv50_crc_ctx_flip_work() local
87 struct nv50_head *head = container_of(crc, struct nv50_head, crc); in nv50_crc_ctx_flip_work()
93 u8 new_idx = crc->ctx_idx ^ 1; in nv50_crc_ctx_flip_work()
100 drm_dbg_kms(dev, "Lock contended, delaying CRC ctx flip for %s\n", crtc->name); in nv50_crc_ctx_flip_work()
106 crtc->name, crc->ctx_idx, new_idx); in nv50_crc_ctx_flip_work()
109 nv50_crc_program_ctx(head, &crc->ctx[new_idx]); in nv50_crc_ctx_flip_work()
115 "Failed to flip CRC context on %s on time (%llu > %llu)\n", in nv50_crc_ctx_flip_work()
118 spin_lock_irq(&crc->lock); in nv50_crc_ctx_flip_work()
[all …]
/linux-6.14.4/drivers/crypto/stm32/
Dstm32-crc32.c104 struct stm32_crc *crc; in stm32_crc_get_next_crc() local
107 crc = list_first_entry_or_null(&crc_list.dev_list, struct stm32_crc, list); in stm32_crc_get_next_crc()
108 if (crc) in stm32_crc_get_next_crc()
109 list_move_tail(&crc->list, &crc_list.dev_list); in stm32_crc_get_next_crc()
112 return crc; in stm32_crc_get_next_crc()
119 struct stm32_crc *crc; in stm32_crc_init() local
122 crc = stm32_crc_get_next_crc(); in stm32_crc_init()
123 if (!crc) in stm32_crc_init()
126 pm_runtime_get_sync(crc->dev); in stm32_crc_init()
128 spin_lock_irqsave(&crc->lock, flags); in stm32_crc_init()
[all …]
/linux-6.14.4/arch/mips/lib/
Dcrc32-mips.c44 #define __CRC32(crc, value, op, SZ, TYPE) \ argument
52 : "+r" (crc) \
56 #define _CRC32_crc32b(crc, value) __CRC32(crc, value, crc32b, 0, 0) argument
57 #define _CRC32_crc32h(crc, value) __CRC32(crc, value, crc32h, 1, 0) argument
58 #define _CRC32_crc32w(crc, value) __CRC32(crc, value, crc32w, 2, 0) argument
59 #define _CRC32_crc32d(crc, value) __CRC32(crc, value, crc32d, 3, 0) argument
60 #define _CRC32_crc32cb(crc, value) __CRC32(crc, value, crc32cb, 0, 1) argument
61 #define _CRC32_crc32ch(crc, value) __CRC32(crc, value, crc32ch, 1, 1) argument
62 #define _CRC32_crc32cw(crc, value) __CRC32(crc, value, crc32cw, 2, 1) argument
63 #define _CRC32_crc32cd(crc, value) __CRC32(crc, value, crc32cd, 3, 1) argument
[all …]
/linux-6.14.4/arch/riscv/lib/
Dcrc32-riscv.c62 static inline u64 crc32_le_prep(u32 crc, unsigned long const *ptr) in crc32_le_prep() argument
64 return (u64)crc ^ (__force u64)__cpu_to_le64(*ptr); in crc32_le_prep()
69 u32 crc; in crc32_le_zbc() local
80 : "=&r" (crc) in crc32_le_zbc()
85 return crc; in crc32_le_zbc()
88 static inline u64 crc32_be_prep(u32 crc, unsigned long const *ptr) in crc32_be_prep() argument
90 return ((u64)crc << 32) ^ (__force u64)__cpu_to_be64(*ptr); in crc32_be_prep()
100 static inline u32 crc32_le_prep(u32 crc, unsigned long const *ptr) in crc32_le_prep() argument
102 return crc ^ (__force u32)__cpu_to_le32(*ptr); in crc32_le_prep()
107 u32 crc; in crc32_le_zbc() local
[all …]
/linux-6.14.4/lib/
Dcrc32.c40 u32 __pure crc32_le_base(u32 crc, const u8 *p, size_t len) in crc32_le_base() argument
43 crc = (crc >> 8) ^ crc32table_le[(crc & 255) ^ *p++]; in crc32_le_base()
44 return crc; in crc32_le_base()
48 u32 __pure crc32c_le_base(u32 crc, const u8 *p, size_t len) in crc32c_le_base() argument
51 crc = (crc >> 8) ^ crc32ctable_le[(crc & 255) ^ *p++]; in crc32c_le_base()
52 return crc; in crc32c_le_base()
58 * This follows the "little-endian" CRC convention that the lsbit
76 * crc32_generic_shift - Append @len 0 bytes to crc, in logarithmic time
77 * @crc: The original little-endian CRC (i.e. lsbit is x^31 coefficient)
78 * @len: The number of bytes. @crc is multiplied by x^(8*@len)
[all …]
Dcrc_kunit.c3 * Unit tests and benchmarks for the CRC library functions
11 #include <linux/crc-t10dif.h>
27 * struct crc_variant - describes a CRC variant
28 * @bits: Number of bits in the CRC, 1 <= @bits <= 64.
29 * @le: true if it's a "little endian" CRC (reversed mapping between bits and
30 * polynomial coefficients in each byte), false if it's a "big endian" CRC
34 * @func: The function to compute a CRC. The type signature uses u64 so that it
35 * can fit any CRC up to CRC-64.
42 u64 (*func)(u64 crc, const u8 *p, size_t len);
63 /* Reference implementation of any CRC variant */
[all …]
Dcrc64.c3 * Normal 64-bit CRC calculation.
9 * Dr. Ross N. Williams has a great document to introduce the idea of CRC
13 * http://www.ross.net/crc/download/crc_v3.txt
15 * crc64table[256] is the lookup table of a table-driven 64-bit CRC
46 * @crc: seed value for computation. 0 or (u64)~0 for a new CRC calculation,
51 u64 __pure crc64_be(u64 crc, const void *p, size_t len) in crc64_be() argument
58 t = ((crc >> 56) ^ (*_p++)) & 0xFF; in crc64_be()
59 crc = crc64table[t] ^ (crc << 8); in crc64_be()
62 return crc; in crc64_be()
68 * @crc: seed value for computation. 0 for a new CRC calculation, or the
[all …]
Dgen_crc64table.c27 uint64_t i, j, c, crc; in generate_reflected_crc64_table() local
30 crc = 0ULL; in generate_reflected_crc64_table()
34 if ((crc ^ (c >> j)) & 1) in generate_reflected_crc64_table()
35 crc = (crc >> 1) ^ poly; in generate_reflected_crc64_table()
37 crc >>= 1; in generate_reflected_crc64_table()
39 table[i] = crc; in generate_reflected_crc64_table()
45 uint64_t i, j, c, crc; in generate_crc64_table() local
48 crc = 0; in generate_crc64_table()
52 if ((crc ^ c) & 0x8000000000000000ULL) in generate_crc64_table()
53 crc = (crc << 1) ^ poly; in generate_crc64_table()
[all …]
/linux-6.14.4/arch/arm64/lib/
Dcrc32-glue.c17 asmlinkage u32 crc32_le_arm64(u32 crc, unsigned char const *p, size_t len);
18 asmlinkage u32 crc32c_le_arm64(u32 crc, unsigned char const *p, size_t len);
19 asmlinkage u32 crc32_be_arm64(u32 crc, unsigned char const *p, size_t len);
21 asmlinkage u32 crc32_le_arm64_4way(u32 crc, unsigned char const *p, size_t len);
22 asmlinkage u32 crc32c_le_arm64_4way(u32 crc, unsigned char const *p, size_t len);
23 asmlinkage u32 crc32_be_arm64_4way(u32 crc, unsigned char const *p, size_t len);
25 u32 __pure crc32_le_arch(u32 crc, const u8 *p, size_t len) in crc32_le_arch() argument
28 return crc32_le_base(crc, p, len); in crc32_le_arch()
32 crc = crc32_le_arm64_4way(crc, p, len); in crc32_le_arch()
39 return crc; in crc32_le_arch()
[all …]
/linux-6.14.4/arch/loongarch/lib/
Dcrc32-loongarch.c3 * CRC32 and CRC32C using LoongArch crc* instructions
17 #define _CRC32(crc, value, size, type) \ argument
21 : "+r" (crc) \
26 #define CRC32(crc, value, size) _CRC32(crc, value, size, crc) argument
27 #define CRC32C(crc, value, size) _CRC32(crc, value, size, crcc) argument
31 u32 crc32_le_arch(u32 crc, const u8 *p, size_t len) in crc32_le_arch() argument
34 return crc32_le_base(crc, p, len); in crc32_le_arch()
39 CRC32(crc, value, d); in crc32_le_arch()
47 CRC32(crc, value, w); in crc32_le_arch()
54 CRC32(crc, value, h); in crc32_le_arch()
[all …]
/linux-6.14.4/arch/arm/lib/
Dcrc32-glue.c3 * Accelerated CRC32(C) using ARM CRC, NEON and Crypto Extensions instructions
32 static u32 crc32_le_scalar(u32 crc, const u8 *p, size_t len) in crc32_le_scalar() argument
35 return crc32_armv8_le(crc, p, len); in crc32_le_scalar()
36 return crc32_le_base(crc, p, len); in crc32_le_scalar()
39 u32 crc32_le_arch(u32 crc, const u8 *p, size_t len) in crc32_le_arch() argument
47 crc = crc32_le_scalar(crc, p, n); in crc32_le_arch()
53 crc = crc32_pmull_le(p, n, crc); in crc32_le_arch()
58 return crc32_le_scalar(crc, p, len); in crc32_le_arch()
62 static u32 crc32c_le_scalar(u32 crc, const u8 *p, size_t len) in crc32c_le_scalar() argument
65 return crc32c_armv8_le(crc, p, len); in crc32c_le_scalar()
[all …]
/linux-6.14.4/fs/xfs/libxfs/
Dxfs_cksum.h8 * Calculate the intermediate checksum for a buffer that has the CRC field
9 * inside it. The offset of the 32bit crc fields is passed as the
11 * hence we have to split the CRC calculation across the cksum_offset.
17 uint32_t crc; in xfs_start_cksum_safe() local
19 /* Calculate CRC up to the checksum. */ in xfs_start_cksum_safe()
20 crc = crc32c(XFS_CRC_SEED, buffer, cksum_offset); in xfs_start_cksum_safe()
23 crc = crc32c(crc, &zero, sizeof(__u32)); in xfs_start_cksum_safe()
25 /* Calculate the rest of the CRC. */ in xfs_start_cksum_safe()
26 return crc32c(crc, &buffer[cksum_offset + sizeof(__be32)], in xfs_start_cksum_safe()
31 * Fast CRC method where the buffer is modified. Callers must have exclusive
[all …]
/linux-6.14.4/arch/x86/lib/
Dcrc32-glue.c23 u32 crc32_pclmul_le_16(u32 crc, const u8 *buffer, size_t len);
25 u32 crc32_le_arch(u32 crc, const u8 *p, size_t len) in crc32_le_arch() argument
33 crc = crc32_le_base(crc, p, n); in crc32_le_arch()
39 crc = crc32_pclmul_le_16(crc, p, n); in crc32_le_arch()
45 crc = crc32_le_base(crc, p, len); in crc32_le_arch()
46 return crc; in crc32_le_arch()
62 asmlinkage u32 crc32c_x86_3way(u32 crc, const u8 *buffer, size_t len);
64 u32 crc32c_le_arch(u32 crc, const u8 *p, size_t len) in crc32c_le_arch() argument
69 return crc32c_le_base(crc, p, len); in crc32c_le_arch()
74 crc = crc32c_x86_3way(crc, p, len); in crc32c_le_arch()
[all …]
/linux-6.14.4/tools/power/acpi/tools/acpidbg/
Dacpidbg.c123 static int acpi_aml_read(int fd, struct circ_buf *crc) in acpi_aml_read() argument
128 p = &crc->buf[crc->head]; in acpi_aml_read()
129 len = circ_space_to_end(crc); in acpi_aml_read()
134 crc->head = (crc->head + len) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_read()
138 static int acpi_aml_read_batch_cmd(int unused, struct circ_buf *crc) in acpi_aml_read_batch_cmd() argument
144 p = &crc->buf[crc->head]; in acpi_aml_read_batch_cmd()
145 len = circ_space_to_end(crc); in acpi_aml_read_batch_cmd()
155 crc->head = (crc->head + len) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_read_batch_cmd()
159 static int acpi_aml_read_batch_log(int fd, struct circ_buf *crc) in acpi_aml_read_batch_log() argument
165 p = &crc->buf[crc->head]; in acpi_aml_read_batch_log()
[all …]
/linux-6.14.4/Documentation/staging/
Dcrc32.rst2 Brief tutorial on CRC computation
5 A CRC is a long-division remainder. You add the CRC to the message,
6 and the whole thing (message+CRC) is a multiple of the given
7 CRC polynomial. To check the CRC, you can either check that the
8 CRC matches the recomputed value, *or* you can check that the
9 remainder computed on the message+CRC is 0. This latter approach
11 protocols put the end-of-frame flag after the CRC.
21 To produce a 32-bit CRC, the divisor is actually a 33-bit CRC polynomial.
23 CRC is written in hex with the most significant bit omitted. (If you're
26 Note that a CRC is computed over a string of *bits*, so you have
[all …]
/linux-6.14.4/arch/s390/lib/
Dcrc32le-vx.c3 * Hardware-accelerated CRC-32 variants for Linux on z Systems
6 * computing of bitreflected CRC-32 checksums for IEEE 802.3 Ethernet
9 * This CRC-32 implementation algorithm is bitreflected and processes
20 /* Vector register range containing CRC-32 constants */
29 * The CRC-32 constant block contains reduction constants to fold and
32 * For the CRC-32 variants, the constants are precomputed according to
48 * CRC-32 (IEEE 802.3 Ethernet, ...) polynomials:
53 * CRC-32C (Castagnoli) polynomials:
78 * crc32_le_vgfm_generic - Compute CRC-32 (LE variant) with vector registers
79 * @crc: Initial CRC value, typically ~0.
[all …]
Dcrc32-glue.c3 * CRC-32 implemented with the z/Architecture Vector Extension Facility.
24 * DEFINE_CRC32_VX() - Define a CRC-32 function using the vector extension
26 * Creates a function to perform a particular CRC-32 computation. Depending
32 u32 ___fname(u32 crc, const u8 *data, size_t datalen) \
39 return ___crc32_sw(crc, data, datalen); \
45 crc = ___crc32_sw(crc, data, prealign); \
53 crc = ___crc32_vx(crc, data, aligned); \
57 crc = ___crc32_sw(crc, data + aligned, remaining); \
59 return crc; \
91 MODULE_DESCRIPTION("CRC-32 algorithms using z/Architecture Vector Extension Facility");
Dcrc32be-vx.c3 * Hardware-accelerated CRC-32 variants for Linux on z Systems
6 * computing of CRC-32 checksums.
8 * This CRC-32 implementation algorithm processes the most-significant
19 /* Vector register range containing CRC-32 constants */
28 * The CRC-32 constant block contains reduction constants to fold and
31 * For the CRC-32 variants, the constants are precomputed according to
52 * CRC-32 (IEEE 802.3 Ethernet, ...) polynomials:
68 * crc32_be_vgfm_16 - Compute CRC-32 (BE variant) with vector registers
69 * @crc: Initial CRC value, typically ~0.
75 * V0: Initial CRC value and intermediate constants and results.
[all …]
/linux-6.14.4/arch/powerpc/lib/
Dcrc-t10dif-glue.c3 * Calculate a CRC T10-DIF with vpmsum acceleration
9 #include <linux/crc-t10dif.h>
26 u32 __crct10dif_vpmsum(u32 crc, unsigned char const *p, size_t len);
32 u32 crc = crci; in crc_t10dif_arch() local
36 return crc_t10dif_generic(crc, p, len); in crc_t10dif_arch()
40 crc = crc_t10dif_generic(crc, p, prealign); in crc_t10dif_arch()
46 crc <<= 16; in crc_t10dif_arch()
50 crc = __crct10dif_vpmsum(crc, p, len & ~VMX_ALIGN_MASK); in crc_t10dif_arch()
54 crc >>= 16; in crc_t10dif_arch()
60 crc = crc_t10dif_generic(crc, p, tail); in crc_t10dif_arch()
[all …]
Dcrc32-glue.c18 u32 __crc32c_vpmsum(u32 crc, const u8 *p, size_t len);
20 u32 crc32_le_arch(u32 crc, const u8 *p, size_t len) in crc32_le_arch() argument
22 return crc32_le_base(crc, p, len); in crc32_le_arch()
26 u32 crc32c_le_arch(u32 crc, const u8 *p, size_t len) in crc32c_le_arch() argument
33 return crc32c_le_base(crc, p, len); in crc32c_le_arch()
37 crc = crc32c_le_base(crc, p, prealign); in crc32c_le_arch()
46 crc = __crc32c_vpmsum(crc, p, len & ~VMX_ALIGN_MASK); in crc32c_le_arch()
55 crc = crc32c_le_base(crc, p, tail); in crc32c_le_arch()
58 return crc; in crc32c_le_arch()
62 u32 crc32_be_arch(u32 crc, const u8 *p, size_t len) in crc32_be_arch() argument
[all …]
/linux-6.14.4/crypto/
Dcrc64_rocksoft_generic.c10 u64 *crc = shash_desc_ctx(desc); in chksum_init() local
12 *crc = 0; in chksum_init()
20 u64 *crc = shash_desc_ctx(desc); in chksum_update() local
22 *crc = crc64_rocksoft_generic(*crc, data, length); in chksum_update()
29 u64 *crc = shash_desc_ctx(desc); in chksum_final() local
31 put_unaligned_le64(*crc, out); in chksum_final()
35 static int __chksum_finup(u64 crc, const u8 *data, unsigned int len, u8 *out) in __chksum_finup() argument
37 crc = crc64_rocksoft_generic(crc, data, len); in __chksum_finup()
38 put_unaligned_le64(crc, out); in __chksum_finup()
45 u64 *crc = shash_desc_ctx(desc); in chksum_finup() local
[all …]
/linux-6.14.4/include/linux/
Dcrc32.h11 u32 __pure crc32_le_arch(u32 crc, const u8 *p, size_t len);
12 u32 __pure crc32_le_base(u32 crc, const u8 *p, size_t len);
13 u32 __pure crc32_be_arch(u32 crc, const u8 *p, size_t len);
14 u32 __pure crc32_be_base(u32 crc, const u8 *p, size_t len);
15 u32 __pure crc32c_le_arch(u32 crc, const u8 *p, size_t len);
16 u32 __pure crc32c_le_base(u32 crc, const u8 *p, size_t len);
18 static inline u32 __pure crc32_le(u32 crc, const u8 *p, size_t len) in crc32_le() argument
21 return crc32_le_arch(crc, p, len); in crc32_le()
22 return crc32_le_base(crc, p, len); in crc32_le()
25 static inline u32 __pure crc32_be(u32 crc, const u8 *p, size_t len) in crc32_be() argument
[all …]
/linux-6.14.4/fs/bcachefs/
Dextents.c283 lp.crc = bch2_extent_crc_unpack(l.k, NULL); in bch2_extent_merge()
284 rp.crc = bch2_extent_crc_unpack(r.k, NULL); in bch2_extent_merge()
288 if (lp.ptr.offset + lp.crc.offset + lp.crc.live_size != in bch2_extent_merge()
289 rp.ptr.offset + rp.crc.offset || in bch2_extent_merge()
312 if (lp.crc.compression_type != rp.crc.compression_type || in bch2_extent_merge()
313 lp.crc.nonce != rp.crc.nonce) in bch2_extent_merge()
316 if (lp.crc.offset + lp.crc.live_size + rp.crc.live_size <= in bch2_extent_merge()
317 lp.crc.uncompressed_size) { in bch2_extent_merge()
318 /* can use left extent's crc entry */ in bch2_extent_merge()
319 } else if (lp.crc.live_size <= rp.crc.offset) { in bch2_extent_merge()
[all …]
/linux-6.14.4/Documentation/w1/slaves/
Dw1_ds2423.rst27 memory page along the crc=YES or NO for indicating whether the read operation
28 was successful and CRC matched.
37 - 2 bytes for crc16 which was calculated from the data read since the previous crc bytes
39 - crc=YES/NO indicating whether read was ok and crc matched
44 … ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
45 … ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
46 …0 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=408798761
47 … ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=YES c=5
49 example from the read with crc errors::
51 … ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
[all …]

12345678910>>...63