diff options
author | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2018-11-25 19:22:18 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-12-08 20:18:32 -0500 |
commit | a740ee913ec8ba04cc53100440f94841648324e2 (patch) | |
tree | 5e7ce4280365bce24a5747118d1c857a560faeeb /include | |
parent | c49aff3e66b930aa06936afee401cf5e19377958 (diff) |
lib: merge CRC16-CCITT into u-boot/crc.h
This merges the CRC16-CCITT headers into u-boot/crc.h to prepare for
rolling CRC16 into the hash infrastructure. Given that CRC8, CRC32
and CRC32-C already have their prototypes in a single header file, it
seems a good idea to also include CRC16-CCITT in the same.
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/crc.h | 43 | ||||
-rw-r--r-- | include/u-boot/crc.h | 3 |
2 files changed, 3 insertions, 43 deletions
diff --git a/include/crc.h b/include/crc.h deleted file mode 100644 index 2a00af5be4..0000000000 --- a/include/crc.h +++ /dev/null @@ -1,43 +0,0 @@ -/* SPDX-License-Identifier: eCos-2.0 */ -/* - *========================================================================== - * - * crc.h - * - * Interface for the CRC algorithms. - * - *========================================================================== - *========================================================================== - *#####DESCRIPTIONBEGIN#### - * - * Author(s): Andrew Lunn - * Contributors: Andrew Lunn - * Date: 2002-08-06 - * Purpose: - * Description: - * - * This code is part of eCos (tm). - * - *####DESCRIPTIONEND#### - * - *========================================================================== - */ - -#ifndef _SERVICES_CRC_CRC_H_ -#define _SERVICES_CRC_CRC_H_ - -#include <linux/types.h> - -#ifndef __externC -# ifdef __cplusplus -# define __externC extern "C" -# else -# define __externC extern -# endif -#endif - -/* 16 bit CRC with polynomial x^16+x^12+x^5+1 (CRC-CCITT) */ - -uint16_t crc16_ccitt(uint16_t crc_start, unsigned char *s, int len); - -#endif /* _SERVICES_CRC_CRC_H_ */ diff --git a/include/u-boot/crc.h b/include/u-boot/crc.h index e98cb46c90..111b22c4b6 100644 --- a/include/u-boot/crc.h +++ b/include/u-boot/crc.h @@ -11,6 +11,9 @@ /* lib/crc8.c */ 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) */ +uint16_t crc16_ccitt(uint16_t crc_start, const unsigned char *s, int len); + /* lib/crc32.c */ uint32_t crc32 (uint32_t, const unsigned char *, uint); uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint); |