#ifndef _UBOOT_CRC_H
#define _UBOOT_CRC_H
+#include <compiler.h> /* 'uint*' definitions */
+
/**
* crc8() - Calculate and return CRC-8 of the data
*
* @crc_start: CRC8 start value
* @vptr: Buffer to checksum
* @len: Length of buffer in bytes
- * @return CRC8 checksum
+ * Return: CRC8 checksum
*/
unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len);
-/* lib/crc16.c - 16 bit CRC with polynomial x^16+x^12+x^5+1 (CRC-CCITT) */
+void crc8_wd_buf(const unsigned char *input, unsigned int len,
+ unsigned char output[1], unsigned int chunk_sz);
+
+/* lib/crc16.c - 16 bit CRC with polynomial x^16 + x^15 + x^2 + 1 */
+uint16_t crc16(uint16_t crc, const unsigned char *buffer, size_t len);
+
+/* lib/crc16-ccitt.c - 16 bit CRC with polynomial x^16+x^12+x^5+1 (CRC-CCITT) */
uint16_t crc16_ccitt(uint16_t crc_start, const unsigned char *s, int len);
/**
* crc16_ccitt_wd_buf - Perform CRC16-CCIT on an input buffer and return the
* calculation)
* @buf: Bytes to checksum
* @len: Number of bytes to checksum
- * @return checksum value
+ * Return: checksum value
*/
uint32_t crc32(uint32_t crc, const unsigned char *buf, uint len);
* @buf: Bytes to checksum
* @len: Number of bytes to checksum
* @chunk_sz: Chunk size to use between watchdog resets
- * @return checksum
+ * Return: checksum
*/
uint32_t crc32_wd(uint32_t crc, const unsigned char *buf, uint len,
uint chunk_sz);
* calculation)
* @buf: Bytes to checksum
* @len: Number of bytes to checksum
- * @return checksum value
+ * Return: checksum value
*/
uint32_t crc32_no_comp(uint32_t crc, const unsigned char *buf, uint len);
* @data: Data bytes to checksum
* @length: Number of bytes to process
* @crc32c_table:: CRC table
- * @return checksum value
+ * Return: checksum value
*/
uint32_t crc32c_cal(uint32_t crc, const char *data, int length,
uint32_t *crc32c_table);