2
*==========================================================================
6
* Interface for the CRC algorithms.
8
*==========================================================================
9
* SPDX-License-Identifier: eCos-2.0
10
*==========================================================================
11
*#####DESCRIPTIONBEGIN####
13
* Author(s): Andrew Lunn
14
* Contributors: Andrew Lunn
19
* This code is part of eCos (tm).
21
*####DESCRIPTIONEND####
23
*==========================================================================
26
#ifndef _SERVICES_CRC_CRC_H_
27
#define _SERVICES_CRC_CRC_H_
29
#include <linux/types.h>
33
# define __externC extern "C"
35
# define __externC extern
39
/* Compute a CRC, using the POSIX 1003 definition */
41
cyg_posix_crc32(unsigned char *s, int len);
43
/* Gary S. Brown's 32 bit CRC */
46
cyg_crc32(unsigned char *s, int len);
48
/* Gary S. Brown's 32 bit CRC, but accumulate the result from a */
49
/* previous CRC calculation */
52
cyg_crc32_accumulate(uint32_t crc, unsigned char *s, int len);
54
/* Ethernet FCS Algorithm */
57
cyg_ether_crc32(unsigned char *s, int len);
59
/* Ethernet FCS algorithm, but accumulate the result from a previous */
60
/* CRC calculation. */
63
cyg_ether_crc32_accumulate(uint32_t crc, unsigned char *s, int len);
65
/* 16 bit CRC with polynomial x^16+x^12+x^5+1 */
67
extern uint16_t cyg_crc16(unsigned char *s, int len);
69
#endif /* _SERVICES_CRC_CRC_H_ */