summaryrefslogtreecommitdiff
path: root/include/linux/crc4.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2017-06-07 00:08:39 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-09 12:52:07 +0300
commit0cbaa44841db3d06d2a21ae4ab679882033f3dbe (patch)
treec400ed524386505865c81fe8f11396f98e529c48 /include/linux/crc4.h
parent414c1026319bc10796a868c1fa0ba312c4ca9e67 (diff)
downloadlinux-0cbaa44841db3d06d2a21ae4ab679882033f3dbe.tar.xz
lib: Add crc4 module
Add a little helper for crc4 calculations. This works 4-bits-at-a-time, using a simple table approach. We will need this in the FSI core code, as well as any master implementations that need to calculate CRCs in software. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Chris Bostic <cbostic@linux.vnet.ibm.com> Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/crc4.h')
-rw-r--r--include/linux/crc4.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/crc4.h b/include/linux/crc4.h
new file mode 100644
index 000000000000..8f739f1d794f
--- /dev/null
+++ b/include/linux/crc4.h
@@ -0,0 +1,8 @@
+#ifndef _LINUX_CRC4_H
+#define _LINUX_CRC4_H
+
+#include <linux/types.h>
+
+extern uint8_t crc4(uint8_t c, uint64_t x, int bits);
+
+#endif /* _LINUX_CRC4_H */