Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: eCos-2.0 */ |
Wolfgang Denk | ebd3deb | 2006-04-16 10:51:58 +0200 | [diff] [blame] | 2 | /* |
| 3 | *========================================================================== |
| 4 | * |
| 5 | * crc.h |
| 6 | * |
| 7 | * Interface for the CRC algorithms. |
| 8 | * |
| 9 | *========================================================================== |
Wolfgang Denk | ebd3deb | 2006-04-16 10:51:58 +0200 | [diff] [blame] | 10 | *========================================================================== |
| 11 | *#####DESCRIPTIONBEGIN#### |
| 12 | * |
| 13 | * Author(s): Andrew Lunn |
| 14 | * Contributors: Andrew Lunn |
| 15 | * Date: 2002-08-06 |
| 16 | * Purpose: |
| 17 | * Description: |
| 18 | * |
| 19 | * This code is part of eCos (tm). |
| 20 | * |
| 21 | *####DESCRIPTIONEND#### |
| 22 | * |
| 23 | *========================================================================== |
| 24 | */ |
Markus Klotzbuecher | 387f541 | 2006-03-30 13:40:55 +0200 | [diff] [blame] | 25 | |
| 26 | #ifndef _SERVICES_CRC_CRC_H_ |
| 27 | #define _SERVICES_CRC_CRC_H_ |
| 28 | |
| 29 | #include <linux/types.h> |
| 30 | |
| 31 | #ifndef __externC |
| 32 | # ifdef __cplusplus |
| 33 | # define __externC extern "C" |
| 34 | # else |
| 35 | # define __externC extern |
| 36 | # endif |
| 37 | #endif |
| 38 | |
Stefan Roese | 084ff1e | 2016-03-03 09:34:12 +0100 | [diff] [blame] | 39 | /* 16 bit CRC with polynomial x^16+x^12+x^5+1 (CRC-CCITT) */ |
Markus Klotzbuecher | 387f541 | 2006-03-30 13:40:55 +0200 | [diff] [blame] | 40 | |
Stefan Roese | 084ff1e | 2016-03-03 09:34:12 +0100 | [diff] [blame] | 41 | uint16_t crc16_ccitt(uint16_t crc_start, unsigned char *s, int len); |
Markus Klotzbuecher | 387f541 | 2006-03-30 13:40:55 +0200 | [diff] [blame] | 42 | |
Wolfgang Denk | ebd3deb | 2006-04-16 10:51:58 +0200 | [diff] [blame] | 43 | #endif /* _SERVICES_CRC_CRC_H_ */ |