blob: 5d5d18884c46258550334d64f1b959e2926c30f3 [file] [log] [blame]
Jens Axboe1e154bd2007-07-27 09:52:40 +02001#ifndef CRC7_H
2#define CRC7_H
3
4extern const unsigned char crc7_syndrome_table[256];
5
6static inline unsigned char crc7_byte(unsigned char crc, unsigned char data)
7{
8 return crc7_syndrome_table[(crc << 1) ^ data];
9}
10
Jens Axboe25dfa842012-02-29 10:01:34 +010011extern unsigned char fio_crc7(const unsigned char *buffer, unsigned int len);
Jens Axboe1e154bd2007-07-27 09:52:40 +020012
13#endif