xref: /openbmc/linux/include/linux/crc7.h (revision b2441318)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2ad241528SJan Nikitenko #ifndef _LINUX_CRC7_H
3ad241528SJan Nikitenko #define _LINUX_CRC7_H
4ad241528SJan Nikitenko #include <linux/types.h>
5ad241528SJan Nikitenko 
61836eea2SGeorge Spelvin extern const u8 crc7_be_syndrome_table[256];
7ad241528SJan Nikitenko 
crc7_be_byte(u8 crc,u8 data)81836eea2SGeorge Spelvin static inline u8 crc7_be_byte(u8 crc, u8 data)
9ad241528SJan Nikitenko {
101836eea2SGeorge Spelvin 	return crc7_be_syndrome_table[crc ^ data];
11ad241528SJan Nikitenko }
12ad241528SJan Nikitenko 
131836eea2SGeorge Spelvin extern u8 crc7_be(u8 crc, const u8 *buffer, size_t len);
14ad241528SJan Nikitenko 
15ad241528SJan Nikitenko #endif
16