Jan Nikitenko | ad24152 | 2007-07-17 04:04:03 -0700 | [diff] [blame] | 1 | #ifndef _LINUX_CRC7_H |
| 2 | #define _LINUX_CRC7_H |
| 3 | #include <linux/types.h> |
| 4 | |
George Spelvin | 1836eea | 2014-05-10 10:32:57 -0400 | [diff] [blame] | 5 | extern const u8 crc7_be_syndrome_table[256]; |
Jan Nikitenko | ad24152 | 2007-07-17 04:04:03 -0700 | [diff] [blame] | 6 | |
George Spelvin | 1836eea | 2014-05-10 10:32:57 -0400 | [diff] [blame] | 7 | static inline u8 crc7_be_byte(u8 crc, u8 data) |
Jan Nikitenko | ad24152 | 2007-07-17 04:04:03 -0700 | [diff] [blame] | 8 | { |
George Spelvin | 1836eea | 2014-05-10 10:32:57 -0400 | [diff] [blame] | 9 | return crc7_be_syndrome_table[crc ^ data]; |
Jan Nikitenko | ad24152 | 2007-07-17 04:04:03 -0700 | [diff] [blame] | 10 | } |
| 11 | |
George Spelvin | 1836eea | 2014-05-10 10:32:57 -0400 | [diff] [blame] | 12 | extern u8 crc7_be(u8 crc, const u8 *buffer, size_t len); |
Jan Nikitenko | ad24152 | 2007-07-17 04:04:03 -0700 | [diff] [blame] | 13 | |
| 14 | #endif |