This source file includes following definitions.
- crc32_posix_end
- crc32_posix
1
2
3
4 #ifndef NFP_CRC32_H
5 #define NFP_CRC32_H
6
7 #include <linux/kernel.h>
8 #include <linux/crc32.h>
9
10
11
12
13
14
15
16
17 static inline u32 crc32_posix_end(u32 crc, size_t total_len)
18 {
19
20 while (total_len != 0) {
21 u8 c = total_len & 0xff;
22
23 crc = crc32_be(crc, &c, 1);
24 total_len >>= 8;
25 }
26
27 return ~crc;
28 }
29
30 static inline u32 crc32_posix(const void *buff, size_t len)
31 {
32 return crc32_posix_end(crc32_be(0, buff, len), len);
33 }
34
35 #endif