2.6.7-mm2, Add common CRC16 module
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | 2.6.7-mm2, Use it in async PPP driverdrivers/ drivers/ include/ | +5 | 0 replies | |
| 2/4 | 2.6.7-mm2, Use it in IRDA driversinclude/ net/ net/ +1 more | +5 | 0 replies | |
| 3/4 | 2.6.7-mm2, Use it in ISDN driversdrivers/ drivers/ drivers/ +3 more | +15 | 0 replies | |
| 4/4 | 2.6.7-mm2, Use it in AX.25 driversdrivers/ drivers/ drivers/ | +10 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/4] 2.6.7-mm2, Add common CRC16 module
Currently we have 8 copies of CRC16 calculation table in different device drivers, this patch creates common crc16.c module to replace them.
Please take a look.
Signed-off-by Andrey Panin <[email protected]>
include/linux/crc16.h | 15 ++++++++++ lib/Kconfig | 8 +++++ lib/Makefile | 1 lib/crc16.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+)
include/linux/crc16.h +15 -0
@@ -0,0 +1,15 @@ +#ifndef _LINUX_CRC16_H +#define _LINUX_CRC16_H + +#include <linux/types.h> + +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 c) +{ +return (crc >>8 ) ^ crc16_table[(crc ^ c) &0xff ]; +} + +#endif /* _LINUX_CRC16_H */
lib/crc16.c +69 -0
69 lines not on this page · raw message
lib/Kconfig +8 -0
@@ -4,6 +4,14 @@ menu "Library routines" +config CRC16 + tristate "CRC16 functions" + help + This option is provided for the case where no in-kernel-tree + modules require CRC16 functions, but a module built outside the + kernel tree does. Such modules that use library CRC16 functions + require M here. + config CRC32 tristate "CRC32 functions" help
lib/Makefile +1 -0
@@ -18,6 +18,7 @@ ifneq ($(CONFIG_HAVE_DEC_LOCK),y) lib-y += dec_and_lock.o endif +obj-$(CONFIG_CRC16) += crc16.o obj-$(CONFIG_CRC32) += crc32.o obj-$(CONFIG_LIBCRC32C) += libcrc32c.o