blob: b462842f3c32c72abb1aca2c57a9cc07ff14338b [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Jan Nikitenkoad241522007-07-17 04:04:03 -07002#ifndef _LINUX_CRC7_H
3#define _LINUX_CRC7_H
4#include <linux/types.h>
5
George Spelvin1836eea2014-05-10 10:32:57 -04006extern const u8 crc7_be_syndrome_table[256];
Jan Nikitenkoad241522007-07-17 04:04:03 -07007
George Spelvin1836eea2014-05-10 10:32:57 -04008static inline u8 crc7_be_byte(u8 crc, u8 data)
Jan Nikitenkoad241522007-07-17 04:04:03 -07009{
George Spelvin1836eea2014-05-10 10:32:57 -040010 return crc7_be_syndrome_table[crc ^ data];
Jan Nikitenkoad241522007-07-17 04:04:03 -070011}
12
George Spelvin1836eea2014-05-10 10:32:57 -040013extern u8 crc7_be(u8 crc, const u8 *buffer, size_t len);
Jan Nikitenkoad241522007-07-17 04:04:03 -070014
15#endif