/linux/drivers/gpu/drm/ |
H A D | drm_debugfs_crc.c | 43 * 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/arch/loongarch/lib/ |
H A D | crc32-loongarch.c | 3 * CRC32 and CRC32C using LoongArch crc* instructions 18 #define _CRC32(crc, value, size, type) \ argument 22 : "+r" (crc) \ 27 #define CRC32(crc, value, size) _CRC32(crc, value, size, crc) argument 28 #define CRC32C(crc, value, size) _CRC32(crc, value, size, crcc) argument 32 u32 crc32_le_arch(u32 crc, const u8 *p, size_t len) in crc32_le_arch() argument 35 return crc32_le_base(crc, p, len); in crc32_le_arch() 40 CRC32(crc, value, d); in crc32_le_arch() 48 CRC32(crc, value, w); in crc32_le_arch() 55 CRC32(crc, value, h); in crc32_le_arch() [all …]
|
/linux/fs/xfs/libxfs/ |
H A D | xfs_cksum.h | 8 * 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/tools/power/acpi/tools/acpidbg/ |
H A D | acpidbg.c | 123 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/Documentation/staging/ |
H A D | crc32.rst | 2 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/arch/s390/lib/ |
H A D | crc32le-vx.c | 3 * 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 …]
|
H A D | crc32be-vx.c | 3 * 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/fs/bcachefs/ |
H A D | extents.c | 407 lp.crc = bch2_extent_crc_unpack(l.k, NULL); in bch2_extent_merge() 408 rp.crc = bch2_extent_crc_unpack(r.k, NULL); in bch2_extent_merge() 414 if (lp.ptr.offset + lp.crc.offset + lp.crc.live_size != in bch2_extent_merge() 415 rp.ptr.offset + rp.crc.offset || in bch2_extent_merge() 436 if (lp.crc.compression_type != rp.crc.compression_type || in bch2_extent_merge() 437 lp.crc.nonce != rp.crc.nonce) in bch2_extent_merge() 440 if (lp.crc.offset + lp.crc.live_size + rp.crc.live_size <= in bch2_extent_merge() 441 lp.crc.uncompressed_size) { in bch2_extent_merge() 442 /* can use left extent's crc entry */ in bch2_extent_merge() 443 } else if (lp.crc.live_size <= rp.crc.offset) { in bch2_extent_merge() [all …]
|
H A D | io_write.c | 784 struct bch_extent_crc_unpacked crc) in init_append_extent() argument 788 op->pos.offset += crc.uncompressed_size; in init_append_extent() 792 e->k.size = crc.uncompressed_size; in init_append_extent() 795 if (crc.csum_type || in init_append_extent() 796 crc.compression_type || in init_append_extent() 797 crc.nonce) in init_append_extent() 798 bch2_extent_crc_append(&e->k_i, crc); in init_append_extent() 800 bch2_alloc_sectors_append_ptrs_inlined(op->c, wp, &e->k_i, crc.compressed_size, in init_append_extent() 867 if (bch2_csum_type_is_encryption(op->crc.csum_type) != in bch2_write_rechecksum() 869 new_csum_type = op->crc.csum_type; in bch2_write_rechecksum() [all …]
|
/linux/Documentation/w1/slaves/ |
H A D | w1_ds2423.rst | 27 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 …]
|
/linux/drivers/ipack/ |
H A D | ipack.c | 265 static u16 ipack_crc_byte(u16 crc, u8 c) in ipack_crc_byte() argument 269 crc ^= c << 8; in ipack_crc_byte() 271 crc = (crc << 1) ^ ((crc & 0x8000) ? 0x1021 : 0); in ipack_crc_byte() 272 return crc; in ipack_crc_byte() 276 * The algorithm in lib/crc-ccitt.c does not seem to apply since it uses the 282 u16 crc; in ipack_calc_crc1() local 285 crc = 0xffff; in ipack_calc_crc1() 288 crc = ipack_crc_byte(crc, c); in ipack_calc_crc1() 290 crc = ~crc; in ipack_calc_crc1() 291 return crc & 0xff; in ipack_calc_crc1() [all …]
|
/linux/include/linux/ |
H A D | crc8.h | 25 * Return value of crc8() indicating valid message+crc. This is true 26 * if a CRC is inverted before transmission. The CRC computed over the 40 * crc8_populate_lsb - fill crc table for given polynomial in regular bit order. 46 * regular bit order (lsb first). Polynomials in CRC algorithms are typically 58 * crc8_populate_msb - fill crc table for given polynomial in reverse bit order. 64 * reverse bit order (msb first). Polynomials in CRC algorithms are typically 78 * @table: crc table used for calculation. 81 * @crc: previous returned crc8 value. 88 * discontiguous blocks of data. When generating the CRC the 95 * "A Painless Guide to CRC Error Detection Algorithms", ver 3, Aug 1993 [all …]
|
H A D | crc-itu-t.h | 3 * crc-itu-t.h - CRC ITU-T V.41 routine 5 * Implements the standard CRC ITU-T V.41: 18 extern u16 crc_itu_t(u16 crc, const u8 *buffer, size_t len); 20 static inline u16 crc_itu_t_byte(u16 crc, const u8 data) in crc_itu_t_byte() argument 22 return (crc << 8) ^ crc_itu_t_table[((crc >> 8) ^ data) & 0xff]; in crc_itu_t_byte()
|
/linux/kernel/module/ |
H A D | version.c | 16 const u32 *crc) in check_version() argument 25 if (!crc) in check_version() 33 if (*version_ext.crc == *crc) in check_version() 36 *crc, *version_ext.crc); in check_version() 58 crcval = *crc; in check_version() 59 if (versions[i].crc == crcval) in check_version() 62 crcval, versions[i].crc); in check_version() 93 return check_version(info, "module_layout", mod, fsa.crc); in check_modstruct_version() [all...] |
/linux/drivers/net/can/spi/mcp251xfd/ |
H A D | mcp251xfd-crc16.c | 58 static inline u16 mcp251xfd_crc16_byte(u16 crc, const u8 data) in mcp251xfd_crc16_byte() argument 60 u8 index = (crc >> 8) ^ data; in mcp251xfd_crc16_byte() 62 return (crc << 8) ^ mcp251xfd_crc16_table[index]; in mcp251xfd_crc16_byte() 65 static u16 mcp251xfd_crc16(u16 crc, u8 const *buffer, size_t len) in mcp251xfd_crc16() argument 68 crc = mcp251xfd_crc16_byte(crc, *buffer++); in mcp251xfd_crc16() 70 return crc; in mcp251xfd_crc16() 75 u16 crc = 0xffff; in mcp251xfd_crc16_compute() local 77 return mcp251xfd_crc16(crc, data, data_size); in mcp251xfd_crc16_compute() 83 u16 crc; in mcp251xfd_crc16_compute2() local 85 crc = mcp251xfd_crc16_compute(cmd, cmd_size); in mcp251xfd_crc16_compute2() [all …]
|
/linux/lib/ |
H A D | crc-itu-t.c | 3 * crc-itu-t.c 8 #include <linux/crc-itu-t.h> 10 /* CRC table for the CRC ITU-T V.41 0x1021 (x^16 + x^12 + x^5 + 1) */ 49 * crc_itu_t - Compute the CRC-ITU-T for the data buffer 51 * @crc: previous CRC value 55 * Returns the updated CRC value 57 u16 crc_itu_t(u16 crc, const u8 *buffer, size_t len) in crc_itu_t() argument 60 crc = crc_itu_t_byte(crc, *buffer++); in crc_itu_t() 61 return crc; in crc_itu_t() 65 MODULE_DESCRIPTION("CRC ITU-T V.41 calculations");
|
H A D | crc-ccitt.c | 3 * linux/lib/crc-ccitt.c 8 #include <linux/crc-ccitt.h> 11 * This mysterious table is just the CRC of each possible byte. It can be 14 * Add the implicit x^16, and you have the standard CRC-CCITT. 53 * crc_ccitt - recompute the CRC (CRC-CCITT variant) for the data 55 * @crc: previous CRC value 59 u16 crc_ccitt(u16 crc, u8 const *buffer, size_t len) in crc_ccitt() argument 62 crc = crc_ccitt_byte(crc, *buffer++); in crc_ccitt() 63 return crc; in crc_ccitt() 67 MODULE_DESCRIPTION("CRC-CCITT calculations");
|
/linux/drivers/iio/common/ms_sensors/ |
H A D | ms_sensors_i2c.c | 136 * ms_sensors_crc_valid() - CRC check function 137 * @value: input and CRC compare value 140 * This function performs a x^8 + x^5 + x^4 + 1 polynomial CRC. 141 * The argument contains CRC value in LSB byte while the bytes 1 and 2 142 * are used for CRC computation. 144 * Return: 1 if CRC is valid, 0 otherwise. 152 u8 crc = value & 0xFF; in ms_sensors_crc_valid() local 163 return result == crc; in ms_sensors_crc_valid() 177 * [ SNB3, CRC, SNB2, CRC, SNB1, CRC, SNB0, CRC] 179 * [ X, X, SNC1, SNC0, CRC, SNA1, SNA0, CRC] [all …]
|
/linux/drivers/nfc/nxp-nci/ |
H A D | firmware.c | 76 u16 crc = 0xffff; in nxp_nci_fw_crc() local 79 crc = ((crc >> 8) | (crc << 8)) ^ *buffer++; in nxp_nci_fw_crc() 80 crc ^= (crc & 0xff) >> 4; in nxp_nci_fw_crc() 81 crc ^= (crc & 0xff) << 12; in nxp_nci_fw_crc() 82 crc ^= (crc & 0xff) << 5; in nxp_nci_fw_crc() 85 return crc; in nxp_nci_fw_crc() 91 u16 header, crc; in nxp_nci_fw_send_chunk() local 116 crc = nxp_nci_fw_crc(skb->data, chunk_len + NXP_NCI_FW_HDR_LEN); in nxp_nci_fw_send_chunk() 117 put_unaligned_be16(crc, skb_put(skb, NXP_NCI_FW_CRC_LEN)); in nxp_nci_fw_send_chunk() 280 u16 crc, frame_crc; in nxp_nci_fw_check_crc() local [all …]
|
/linux/drivers/w1/slaves/ |
H A D | w1_ds2423.c | 43 int crc; in w1_slave_show() local 59 * 2 bytes for crc in w1_slave_show() 75 c, "crc=NO\n"); in w1_slave_show() 78 crc = crc16(CRC16_INIT, wrbuf, 3); in w1_slave_show() 79 crc = crc16(crc, rbuf, 11); in w1_slave_show() 82 * DS2423 calculates crc from all bytes in w1_slave_show() 83 * read after the previous crc bytes. in w1_slave_show() 85 crc = crc16(CRC16_INIT, in w1_slave_show() 90 if (crc == CRC16_VALID) { in w1_slave_show() 98 c, "crc=YES c=%d\n", result); in w1_slave_show() [all …]
|
/linux/tools/firewire/ |
H A D | nosy-dump.h | 95 uint32_t crc; member 101 uint32_t crc; member 108 uint32_t crc; member 115 uint32_t crc; member 117 /* crc and ack follows. */ 123 uint32_t crc; member 130 uint32_t crc; member 132 /* crc and ack follows. */ 137 uint32_t crc; member 143 uint32_t crc; member [all …]
|
/linux/include/media/ |
H A D | vsp1.h | 38 void (*callback)(void *data, unsigned int status, u32 crc); 72 * enum vsp1_du_crc_source - Source used for CRC calculation 73 * @VSP1_DU_CRC_NONE: CRC calculation disabled 74 * @VSP1_DU_CRC_PLANE: Perform CRC calculation on an input plane 75 * @VSP1_DU_CRC_OUTPUT: Perform CRC calculation on the composed output 84 * struct vsp1_du_crc_config - VSP CRC computation configuration parameters 85 * @source: source for CRC calculation 86 * @index: index of the CRC source plane (when source is set to plane) 107 * @crc: CRC computatio member [all...] |
/linux/fs/jffs2/ |
H A D | read.c | 29 uint32_t crc; in jffs2_read_dnode() local 51 crc = crc32(0, ri, sizeof(*ri)-8); in jffs2_read_dnode() 53 …jffs2_dbg(1, "Node read from %08x: node_crc %08x, calculated CRC %08x. dsize %x, csize %x, offset … in jffs2_read_dnode() 55 crc, je32_to_cpu(ri->dsize), je32_to_cpu(ri->csize), in jffs2_read_dnode() 57 if (crc != je32_to_cpu(ri->node_crc)) { in jffs2_read_dnode() 58 pr_warn("Node CRC %08x != calculated CRC %08x for node at %08x\n", in jffs2_read_dnode() 59 je32_to_cpu(ri->node_crc), crc, ref_offset(fd->raw)); in jffs2_read_dnode() 85 Reading whole node and it's uncompressed - read directly to buffer provided, check CRC. in jffs2_read_dnode() 86 …Reading whole node and it's compressed - read into comprbuf, check CRC and decompress to buffer pr… in jffs2_read_dnode() 87 Reading partial node and it's uncompressed - read into readbuf, check CRC, and copy in jffs2_read_dnode() [all …]
|
/linux/drivers/iio/humidity/ |
H A D | am2315.c | 75 /* CRC calculation algorithm, as specified in the datasheet (page 13). */ 79 u16 crc = 0xffff; in am2315_crc() local 82 crc ^= *data++; in am2315_crc() 84 if (crc & 0x01) { in am2315_crc() 85 crc >>= 1; in am2315_crc() 86 crc ^= 0xA001; in am2315_crc() 88 crc >>= 1; in am2315_crc() 93 return crc; in am2315_crc() 112 * <CRC LSB> <CRC MSB> in am2315_read_data() 115 u16 crc; in am2315_read_data() local [all …]
|
/linux/lib/xz/ |
H A D | xz_crc32.c | 13 * accelerated CRC instruction are 3-5 times as fast as this version, 48 uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc) in xz_crc32() argument 50 crc = ~crc; in xz_crc32() 53 crc = xz_crc32_table[*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); in xz_crc32() 57 return ~crc; in xz_crc32()
|