The NVM Express specification extended data integrity fields to 64 bits using the Rocksoft parameters. Add the poly to the crc64 table generation, and provide a generic library routine implementing the algorithm. The Rocksoft 64-bit CRC model parameters are as follows: Poly: 0xAD93D23594C93659 Initial value: 0xFFFFFFFFFFFFFFFF Reflected Input: True Reflected Output: True Xor Final: 0xFFFFFFFFFFFFFFFF Since this model used reflected bits, the implementation generates the reflected table so the result is ordered consistently.
Showing the changes to include (1 of 3 files). Show all
Unified · Split
| @@ -8,4 +8,6 @@ · 7 unmodified lines | |||
| 8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
| 9 | 9 | ||
| 10 | u64 __pure crc64_be(u64 crc, const void *p, size_t len); | 10 | u64 __pure crc64_be(u64 crc, const void *p, size_t len); |
| 11 | u64 __pure crc64_rocksoft_generic(u64 crc, const void *p, size_t len); | ||
| 12 | |||
| 11 | #endif /* _LINUX_CRC64_H */ | 13 | #endif /* _LINUX_CRC64_H */ |