Blame view

include/crc.h 1.59 KB
cf48eb9ab   Wolfgang Denk   Some code cleanup
1
2
3
4
5
6
7
8
  /*
   *==========================================================================
   *
   *      crc.h
   *
   *      Interface for the CRC algorithms.
   *
   *==========================================================================
e85427fd6   Wolfgang Denk   Add eCos-2.0 SPDX...
9
   * SPDX-License-Identifier:	eCos-2.0
cf48eb9ab   Wolfgang Denk   Some code cleanup
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
   *==========================================================================
   *#####DESCRIPTIONBEGIN####
   *
   * Author(s):    Andrew Lunn
   * Contributors: Andrew Lunn
   * Date:         2002-08-06
   * Purpose:
   * Description:
   *
   * This code is part of eCos (tm).
   *
   *####DESCRIPTIONEND####
   *
   *==========================================================================
   */
f2841d377   Markus Klotzbuecher   Add support for y...
25
26
27
28
29
30
31
32
33
34
35
36
37
  
  #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
cf48eb9ab   Wolfgang Denk   Some code cleanup
38
39
  /* Compute a CRC, using the POSIX 1003 definition */
  extern uint32_t
f2841d377   Markus Klotzbuecher   Add support for y...
40
  cyg_posix_crc32(unsigned char *s, int len);
cf48eb9ab   Wolfgang Denk   Some code cleanup
41
  /* Gary S. Brown's 32 bit CRC */
f2841d377   Markus Klotzbuecher   Add support for y...
42

cf48eb9ab   Wolfgang Denk   Some code cleanup
43
  extern uint32_t
f2841d377   Markus Klotzbuecher   Add support for y...
44
  cyg_crc32(unsigned char *s, int len);
cf48eb9ab   Wolfgang Denk   Some code cleanup
45
46
  /* Gary S. Brown's 32 bit CRC, but accumulate the result from a */
  /* previous CRC calculation */
f2841d377   Markus Klotzbuecher   Add support for y...
47

cf48eb9ab   Wolfgang Denk   Some code cleanup
48
  extern uint32_t
f2841d377   Markus Klotzbuecher   Add support for y...
49
  cyg_crc32_accumulate(uint32_t crc, unsigned char *s, int len);
cf48eb9ab   Wolfgang Denk   Some code cleanup
50
  /* Ethernet FCS Algorithm */
f2841d377   Markus Klotzbuecher   Add support for y...
51

cf48eb9ab   Wolfgang Denk   Some code cleanup
52
  extern uint32_t
f2841d377   Markus Klotzbuecher   Add support for y...
53
  cyg_ether_crc32(unsigned char *s, int len);
cf48eb9ab   Wolfgang Denk   Some code cleanup
54
55
  /* Ethernet FCS algorithm, but accumulate the result from a previous */
  /* CRC calculation. */
f2841d377   Markus Klotzbuecher   Add support for y...
56

cf48eb9ab   Wolfgang Denk   Some code cleanup
57
  extern uint32_t
f2841d377   Markus Klotzbuecher   Add support for y...
58
  cyg_ether_crc32_accumulate(uint32_t crc, unsigned char *s, int len);
cf48eb9ab   Wolfgang Denk   Some code cleanup
59
  /* 16 bit CRC with polynomial x^16+x^12+x^5+1 */
f2841d377   Markus Klotzbuecher   Add support for y...
60
61
  
  extern uint16_t cyg_crc16(unsigned char *s, int len);
cf48eb9ab   Wolfgang Denk   Some code cleanup
62
  #endif /* _SERVICES_CRC_CRC_H_ */