summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/crc16.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/crc16.h b/include/linux/crc16.h
new file mode 100644
index 000000000000..a077021e1c38
--- /dev/null
+++ b/include/linux/crc16.h
@@ -0,0 +1,15 @@
+#ifndef _LINUX_CRC16_H
+#define _LINUX_CRC16_H
+
+#include <linux/types.h>
+
+extern u16 const crc16_table[256];
+
+extern u16 crc16(u16 crc, const u8 *buffer, size_t len);
+
+static inline u16 crc16_byte(u16 crc, const u8 c)
+{
+ return (crc >> 8) ^ crc16_table[(crc ^ c) & 0xff];
+}
+
+#endif /* _LINUX_CRC16_H */