Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / u-boot / include / linux / crc8.h
diff --git a/qemu/roms/u-boot/include/linux/crc8.h b/qemu/roms/u-boot/include/linux/crc8.h
new file mode 100644 (file)
index 0000000..b5fd2ac
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2013 Google, Inc
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+
+#ifndef __linux_crc8_h
+#define __linux_crc8_h
+
+/**
+ * crc8() - Calculate and return CRC-8 of the data
+ *
+ * This uses an x^8 + x^2 + x + 1 polynomial.  A table-based algorithm would
+ * be faster, but for only a few bytes it isn't worth the code size
+ *
+ * @vptr: Buffer to checksum
+ * @len: Length of buffer in bytes
+ * @return CRC8 checksum
+ */
+unsigned int crc8(const unsigned char *vptr, int len);
+
+#endif