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