1
2
3
4
5
6
7#define CRCPOLY_LE 0xedb88320
8#define CRCPOLY_BE 0x04c11db7
9
10
11
12
13
14
15#define CRC32C_POLY_LE 0x82F63B78
16
17
18#ifdef CONFIG_CRC32_SLICEBY8
19# define CRC_LE_BITS 64
20# define CRC_BE_BITS 64
21#endif
22#ifdef CONFIG_CRC32_SLICEBY4
23# define CRC_LE_BITS 32
24# define CRC_BE_BITS 32
25#endif
26#ifdef CONFIG_CRC32_SARWATE
27# define CRC_LE_BITS 8
28# define CRC_BE_BITS 8
29#endif
30#ifdef CONFIG_CRC32_BIT
31# define CRC_LE_BITS 1
32# define CRC_BE_BITS 1
33#endif
34
35
36
37
38
39
40
41
42#ifndef CRC_LE_BITS
43# ifdef CONFIG_64BIT
44# define CRC_LE_BITS 64
45# else
46# define CRC_LE_BITS 32
47# endif
48#endif
49#ifndef CRC_BE_BITS
50# ifdef CONFIG_64BIT
51# define CRC_BE_BITS 64
52# else
53# define CRC_BE_BITS 32
54# endif
55#endif
56
57
58
59
60
61#if CRC_LE_BITS > 64 || CRC_LE_BITS < 1 || CRC_LE_BITS == 16 || \
62 CRC_LE_BITS & CRC_LE_BITS-1
63# error "CRC_LE_BITS must be one of {1, 2, 4, 8, 32, 64}"
64#endif
65
66
67
68
69
70#if CRC_BE_BITS > 64 || CRC_BE_BITS < 1 || CRC_BE_BITS == 16 || \
71 CRC_BE_BITS & CRC_BE_BITS-1
72# error "CRC_BE_BITS must be one of {1, 2, 4, 8, 32, 64}"
73#endif
74