xref: /rk3399_rockchip-uboot/include/crc.h (revision 0299c2efb1acc61a746f2a08f84e8eea75783a01)
1cf48eb9aSWolfgang Denk /*
2cf48eb9aSWolfgang Denk  *==========================================================================
3cf48eb9aSWolfgang Denk  *
4cf48eb9aSWolfgang Denk  *      crc.h
5cf48eb9aSWolfgang Denk  *
6cf48eb9aSWolfgang Denk  *      Interface for the CRC algorithms.
7cf48eb9aSWolfgang Denk  *
8cf48eb9aSWolfgang Denk  *==========================================================================
9e85427fdSWolfgang Denk  * SPDX-License-Identifier:	eCos-2.0
10cf48eb9aSWolfgang Denk  *==========================================================================
11cf48eb9aSWolfgang Denk  *#####DESCRIPTIONBEGIN####
12cf48eb9aSWolfgang Denk  *
13cf48eb9aSWolfgang Denk  * Author(s):    Andrew Lunn
14cf48eb9aSWolfgang Denk  * Contributors: Andrew Lunn
15cf48eb9aSWolfgang Denk  * Date:         2002-08-06
16cf48eb9aSWolfgang Denk  * Purpose:
17cf48eb9aSWolfgang Denk  * Description:
18cf48eb9aSWolfgang Denk  *
19cf48eb9aSWolfgang Denk  * This code is part of eCos (tm).
20cf48eb9aSWolfgang Denk  *
21cf48eb9aSWolfgang Denk  *####DESCRIPTIONEND####
22cf48eb9aSWolfgang Denk  *
23cf48eb9aSWolfgang Denk  *==========================================================================
24cf48eb9aSWolfgang Denk  */
25f2841d37SMarkus Klotzbuecher 
26f2841d37SMarkus Klotzbuecher #ifndef _SERVICES_CRC_CRC_H_
27f2841d37SMarkus Klotzbuecher #define _SERVICES_CRC_CRC_H_
28f2841d37SMarkus Klotzbuecher 
29f2841d37SMarkus Klotzbuecher #include <linux/types.h>
30f2841d37SMarkus Klotzbuecher 
31f2841d37SMarkus Klotzbuecher #ifndef __externC
32f2841d37SMarkus Klotzbuecher # ifdef __cplusplus
33f2841d37SMarkus Klotzbuecher #  define __externC extern "C"
34f2841d37SMarkus Klotzbuecher # else
35f2841d37SMarkus Klotzbuecher #  define __externC extern
36f2841d37SMarkus Klotzbuecher # endif
37f2841d37SMarkus Klotzbuecher #endif
38f2841d37SMarkus Klotzbuecher 
39*ecb57f69SStefan Roese /* 16 bit CRC with polynomial x^16+x^12+x^5+1 (CRC-CCITT) */
40f2841d37SMarkus Klotzbuecher 
41*ecb57f69SStefan Roese uint16_t crc16_ccitt(uint16_t crc_start, unsigned char *s, int len);
42f2841d37SMarkus Klotzbuecher 
43cf48eb9aSWolfgang Denk #endif /* _SERVICES_CRC_CRC_H_ */
44