From 7996a3d79d55b7f879dfd62e202bbfe2963718d3 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 27 Jul 2013 22:15:01 +0000 Subject: really properly move files --- libdde-linux26/contrib/include/linux/crc16.h | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 libdde-linux26/contrib/include/linux/crc16.h (limited to 'libdde-linux26/contrib/include/linux/crc16.h') diff --git a/libdde-linux26/contrib/include/linux/crc16.h b/libdde-linux26/contrib/include/linux/crc16.h new file mode 100644 index 00000000..9443c084 --- /dev/null +++ b/libdde-linux26/contrib/include/linux/crc16.h @@ -0,0 +1,30 @@ +/* + * crc16.h - CRC-16 routine + * + * Implements the standard CRC-16: + * Width 16 + * Poly 0x8005 (x^16 + x^15 + x^2 + 1) + * Init 0 + * + * Copyright (c) 2005 Ben Gardner + * + * This source code is licensed under the GNU General Public License, + * Version 2. See the file COPYING for more details. + */ + +#ifndef __CRC16_H +#define __CRC16_H + +#include + +extern u16 const crc16_table[256]; + +extern u16 crc16(u16 crc, const u8 *buffer, size_t len); + +static inline u16 crc16_byte(u16 crc, const u8 data) +{ + return (crc >> 8) ^ crc16_table[(crc ^ data) & 0xff]; +} + +#endif /* __CRC16_H */ + -- cgit v1.2.3