From: Hauke Mehrtens Date: Sun, 8 Jun 2014 15:47:50 +0000 (+0200) Subject: backports: add crc7_be() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=060d904cd4b42db7a034cdee832732edb172f3c5;p=openwrt%2Fstaging%2Fblogic.git backports: add crc7_be() This was added in: commit 1836eea209546b870dd83f3f4ef234d6598a560d Author: George Spelvin Date: Sat May 10 10:32:57 2014 -0400 lib/crc7: Shift crc7() output left 1 bit Signed-off-by: Hauke Mehrtens --- diff --git a/backport/backport-include/linux/crc7.h b/backport/backport-include/linux/crc7.h new file mode 100644 index 000000000000..12747f8cbfab --- /dev/null +++ b/backport/backport-include/linux/crc7.h @@ -0,0 +1,14 @@ +#ifndef _BACKPORT_LINUX_CRC7_H +#define _BACKPORT_LINUX_CRC7_H +#include_next +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) +#define crc7_be LINUX_BACKPORT(crc7_be) +static inline u8 crc7_be(u8 crc, const u8 *buffer, size_t len) +{ + return crc7(crc, buffer, len) << 1; +} +#endif /* < 3.16 */ + +#endif /* _BACKPORT_LINUX_CRC7_H */