public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] 2.6.7-mm6, fix CRC16 misnaming
@ 2004-07-08 13:01 Andrey Panin
  2004-07-08 13:01 ` [PATCH 1/5] 2.6.7-mm6, CRC16 renaming in AX25 drivers Andrey Panin
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Andrey Panin @ 2004-07-08 13:01 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel

As pointed by Thomas Sailer, crc16.c module contains CRC16-CCITT (x^16 + x^12 + x^5 + 1)
implementation, not IBM CRC16 (x^16 + x^15 + x^2 + 1) one. Looks like we need to rename
it accordingly and this patchset does exactly this.

Please consider applying. 

Signed-off-by: Andrey Panin <pazke@donpac.ru>

 include/linux/crc-ccitt.h |   15 ++++++++++
 include/linux/crc16.h     |   15 ----------
 lib/Kconfig               |   10 +++---
 lib/Makefile              |    2 -
 lib/crc-ccitt.c           |   69 ++++++++++++++++++++++++++++++++++++++++++++++
 lib/crc16.c               |   69 ----------------------------------------------
 6 files changed, 90 insertions(+), 90 deletions(-)

diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/lib/Kconfig linux-2.6.7-mm5/lib/Kconfig
--- linux-2.6.7-mm5.vanilla/lib/Kconfig	Thu Jul  1 20:58:31 2004
+++ linux-2.6.7-mm5/lib/Kconfig	Thu Jul  1 21:28:03 2004
@@ -4,13 +4,13 @@
 
 menu "Library routines"
 
-config CRC16
-	tristate "CRC16 functions"
+config CRC_CCITT
+	tristate "CRC-CCITT 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.
+	  modules require CRC-CCITT functions, but a module built outside
+	  the kernel tree does. Such modules that use library CRC-CCITT
+	  functions require M here.
 
 config CRC32
 	tristate "CRC32 functions"
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/lib/Makefile linux-2.6.7-mm5/lib/Makefile
--- linux-2.6.7-mm5.vanilla/lib/Makefile	Thu Jul  1 20:58:31 2004
+++ linux-2.6.7-mm5/lib/Makefile	Thu Jul  1 21:28:26 2004
@@ -18,7 +18,7 @@ ifneq ($(CONFIG_HAVE_DEC_LOCK),y) 
   lib-y += dec_and_lock.o
 endif
 
-obj-$(CONFIG_CRC16)	+= crc16.o
+obj-$(CONFIG_CRC_CCITT)	+= crc-ccitt.o
 obj-$(CONFIG_CRC32)	+= crc32.o
 obj-$(CONFIG_LIBCRC32C)	+= libcrc32c.o
 
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/lib/crc-ccitt.c linux-2.6.7-mm5/lib/crc-ccitt.c
--- linux-2.6.7-mm5.vanilla/lib/crc-ccitt.c	Thu Jan  1 03:00:00 1970
+++ linux-2.6.7-mm5/lib/crc-ccitt.c	Thu Jul  1 22:51:21 2004
@@ -0,0 +1,69 @@
+/*
+ *	linux/lib/crc-ccitt.c
+ *
+ *	This source code is licensed under the GNU General Public License,
+ *	Version 2. See the file COPYING for more details.
+ */
+
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/crc-ccitt.h>
+
+/*
+ * This mysterious table is just the CRC of each possible byte. It can be
+ * computed using the standard bit-at-a-time methods. The polynomial can
+ * be seen in entry 128, 0x8408. This corresponds to x^0 + x^5 + x^12.
+ * Add the implicit x^16, and you have the standard CRC-CCITT.
+ */
+u16 const crc_ccitt_table[256] = {
+	0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
+	0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
+	0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
+	0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
+	0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
+	0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
+	0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
+	0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
+	0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
+	0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
+	0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
+	0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
+	0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
+	0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
+	0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
+	0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
+	0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
+	0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
+	0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
+	0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
+	0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
+	0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
+	0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
+	0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
+	0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
+	0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
+	0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
+	0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
+	0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
+	0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
+	0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
+	0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
+};
+EXPORT_SYMBOL(crc_ccitt_table);
+
+/**
+ *	crc_ccitt - recompute the CRC for the data buffer
+ *	@crc - previous CRC value
+ *	@buffer - data pointer
+ *	@len - number of bytes in the buffer
+ */
+u16 crc_ccitt(u16 crc, u8 const *buffer, size_t len)
+{
+	while (len--)
+		crc = crc_ccitt_byte(crc, *buffer++);
+	return crc;
+}
+EXPORT_SYMBOL(crc_ccitt);
+
+MODULE_DESCRIPTION("CRC-CCITT calculations");
+MODULE_LICENSE("GPL");
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/lib/crc16.c linux-2.6.7-mm5/lib/crc16.c
--- linux-2.6.7-mm5.vanilla/lib/crc16.c	Thu Jul  1 20:58:31 2004
+++ linux-2.6.7-mm5/lib/crc16.c	Thu Jan  1 03:00:00 1970
@@ -1,69 +0,0 @@
-/*
- *	linux/lib/crc16.c
- *
- *	This source code is licensed under the GNU General Public License,
- *	Version 2. See the file COPYING for more details.
- */
-
-#include <linux/types.h>
-#include <linux/module.h>
-#include <linux/crc16.h>
-
-/*
- * This mysterious table is just the CRC of each possible byte. It can be
- * computed using the standard bit-at-a-time methods. The polynomial can
- * be seen in entry 128, 0x8408. This corresponds to x^0 + x^5 + x^12.
- * Add the implicit x^16, and you have the standard CRC-CCITT.
- */
-u16 const crc16_table[256] = {
-	0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
-	0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
-	0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
-	0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
-	0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
-	0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
-	0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
-	0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
-	0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
-	0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
-	0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
-	0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
-	0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
-	0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
-	0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
-	0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
-	0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
-	0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
-	0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
-	0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
-	0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
-	0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
-	0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
-	0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
-	0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
-	0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
-	0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
-	0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
-	0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
-	0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
-	0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
-	0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
-};
-EXPORT_SYMBOL(crc16_table);
-
-/**
- *	crc16 - recompute the CRC for the data buffer
- *	@crc - previous CRC value
- *	@buffer - data pointer
- *	@len - number of bytes in the buffer
- */
-u16 crc16(u16 crc, u8 const *buffer, size_t len)
-{
-	while (len--)
-		crc = crc16_byte(crc, *buffer++);
-	return crc;
-}
-EXPORT_SYMBOL(crc16);
-
-MODULE_DESCRIPTION("CRC16 calculations");
-MODULE_LICENSE("GPL");
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/include/linux/crc-ccitt.h linux-2.6.7-mm5/include/linux/crc-ccitt.h
--- linux-2.6.7-mm5.vanilla/include/linux/crc-ccitt.h	Thu Jan  1 03:00:00 1970
+++ linux-2.6.7-mm5/include/linux/crc-ccitt.h	Thu Jul  1 21:27:19 2004
@@ -0,0 +1,15 @@
+#ifndef _LINUX_CRC_CCITT_H
+#define _LINUX_CRC_CCITT_H
+
+#include <linux/types.h>
+
+extern u16 const crc_ccitt_table[256];
+
+extern u16 crc_ccitt(u16 crc, const u8 *buffer, size_t len);
+
+static inline u16 crc_ccitt_byte(u16 crc, const u8 c)
+{
+	return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff];
+}
+
+#endif /* _LINUX_CRC_CCITT_H */
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/include/linux/crc16.h linux-2.6.7-mm5/include/linux/crc16.h
--- linux-2.6.7-mm5.vanilla/include/linux/crc16.h	Thu Jul  1 20:58:29 2004
+++ linux-2.6.7-mm5/include/linux/crc16.h	Thu Jan  1 03:00:00 1970
@@ -1,15 +0,0 @@
-#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 */


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/5] 2.6.7-mm6, CRC16 renaming in AX25 drivers
  2004-07-08 13:01 [PATCH 0/5] 2.6.7-mm6, fix CRC16 misnaming Andrey Panin
@ 2004-07-08 13:01 ` Andrey Panin
  2004-07-08 13:01   ` [PATCH 2/5] 2.6.7-mm6, CRC16 renaming in IRDA drivers Andrey Panin
  2004-07-08 13:10 ` [PATCH 0/5] 2.6.7-mm6, fix CRC16 misnaming David Weinehall
  2004-07-09  2:06 ` Andrew Morton
  2 siblings, 1 reply; 9+ messages in thread
From: Andrey Panin @ 2004-07-08 13:01 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel


Signed-off-by: Andrey Panin <pazke@donpac.ru>

 drivers/net/hamradio/baycom_epp.c |    6 +++---
 drivers/net/hamradio/hdlcdrv.c    |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/drivers/net/hamradio/baycom_epp.c linux-2.6.7-mm5/drivers/net/hamradio/baycom_epp.c
--- linux-2.6.7-mm5.vanilla/drivers/net/hamradio/baycom_epp.c	Thu Jul  1 20:58:11 2004
+++ linux-2.6.7-mm5/drivers/net/hamradio/baycom_epp.c	Thu Jul  1 22:48:50 2004
@@ -58,7 +58,7 @@
 /* prototypes for ax25_encapsulate and ax25_rebuild_header */
 #include <net/ax25.h> 
 #endif /* CONFIG_AX25 || CONFIG_AX25_MODULE */
-#include <linux/crc16.h>
+#include <linux/crc-ccitt.h>
 
 /* --------------------------------------------------------------------- */
 
@@ -281,14 +281,14 @@ static inline void append_crc_ccitt(unsi
 
 static inline int check_crc_ccitt(const unsigned char *buf, int cnt)
 {
-	return (crc16(0xffff, buf, cnt) & 0xffff) == 0xf0b8;
+	return (crc_ccitt(0xffff, buf, cnt) & 0xffff) == 0xf0b8;
 }
 
 /*---------------------------------------------------------------------------*/
 
 static inline int calc_crc_ccitt(const unsigned char *buf, int cnt)
 {
-	return (crc16(0xffff, buf, cnt) ^ 0xffff) & 0xffff;
+	return (crc_ccitt(0xffff, buf, cnt) ^ 0xffff) & 0xffff;
 }
 
 /* ---------------------------------------------------------------------- */
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/drivers/net/hamradio/hdlcdrv.c linux-2.6.7-mm5/drivers/net/hamradio/hdlcdrv.c
--- linux-2.6.7-mm5.vanilla/drivers/net/hamradio/hdlcdrv.c	Thu Jul  1 20:58:11 2004
+++ linux-2.6.7-mm5/drivers/net/hamradio/hdlcdrv.c	Thu Jul  1 22:48:27 2004
@@ -66,7 +66,7 @@
 #include <linux/ip.h>
 #include <linux/udp.h>
 #include <linux/tcp.h>
-#include <linux/crc16.h>
+#include <linux/crc-ccitt.h>
 
 /* --------------------------------------------------------------------- */
 
@@ -105,7 +105,7 @@ static char ax25_nocall[AX25_ADDR_LEN] =
 
 static inline void append_crc_ccitt(unsigned char *buffer, int len)
 {
- 	unsigned int crc = crc16(0xffff, buffer, len) ^ 0xffff;
+ 	unsigned int crc = crc_ccitt(0xffff, buffer, len) ^ 0xffff;
 	*buffer++ = crc;
 	*buffer++ = crc >> 8;
 }
@@ -114,7 +114,7 @@ static inline void append_crc_ccitt(unsi
 
 static inline int check_crc_ccitt(const unsigned char *buf, int cnt)
 {
-	return (crc16(0xffff, buf, cnt) & 0xffff) == 0xf0b8;
+	return (crc_ccitt(0xffff, buf, cnt) & 0xffff) == 0xf0b8;
 }
 
 /*---------------------------------------------------------------------------*/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 2/5] 2.6.7-mm6, CRC16 renaming in IRDA drivers
  2004-07-08 13:01 ` [PATCH 1/5] 2.6.7-mm6, CRC16 renaming in AX25 drivers Andrey Panin
@ 2004-07-08 13:01   ` Andrey Panin
  2004-07-08 13:01     ` [PATCH 3/5] 2.6.7-mm6, CRC16 renaming in ISDN drivers Andrey Panin
  0 siblings, 1 reply; 9+ messages in thread
From: Andrey Panin @ 2004-07-08 13:01 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel


Signed-off-by: Andrey Panin <pazke@donpac.ru>

 include/net/irda/crc.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/include/net/irda/crc.h linux-2.6.7-mm5/include/net/irda/crc.h
--- linux-2.6.7-mm5.vanilla/include/net/irda/crc.h	Thu Jul  1 20:58:31 2004
+++ linux-2.6.7-mm5/include/net/irda/crc.h	Thu Jul  1 22:45:07 2004
@@ -15,15 +15,15 @@
 #define IRDA_CRC_H
 
 #include <linux/types.h>
-#include <linux/crc16.h>
+#include <linux/crc-ccitt.h>
 
 #define INIT_FCS  0xffff   /* Initial FCS value */
 #define GOOD_FCS  0xf0b8   /* Good final FCS value */
 
 /* Recompute the FCS with one more character appended. */
-#define irda_fcs(fcs, c) crc16_byte(fcs, c)
+#define irda_fcs(fcs, c) crc_ccitt_byte(fcs, c)
 
 /* Recompute the FCS with len bytes appended. */
-#define irda_calc_crc16(fcs, buf, len) crc16(fcs, buf, len)
+#define irda_calc_crc16(fcs, buf, len) crc_ccitt(fcs, buf, len)
 
 #endif


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 3/5] 2.6.7-mm6, CRC16 renaming in ISDN drivers
  2004-07-08 13:01   ` [PATCH 2/5] 2.6.7-mm6, CRC16 renaming in IRDA drivers Andrey Panin
@ 2004-07-08 13:01     ` Andrey Panin
  2004-07-08 13:01       ` [PATCH 4/5] 2.6.7-mm6, CRC16 renaming in PPP driver Andrey Panin
  0 siblings, 1 reply; 9+ messages in thread
From: Andrey Panin @ 2004-07-08 13:01 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel


Signed-off-by: Andrey Panin <pazke@donpac.ru>

 drivers/isdn/hisax/isdnhdlc.c    |    6 +++---
 drivers/isdn/hisax/st5481_hdlc.c |    6 +++---
 drivers/isdn/tpam/tpam_crcpc.c   |    8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/drivers/isdn/hisax/isdnhdlc.c linux-2.6.7-mm5/drivers/isdn/hisax/isdnhdlc.c
--- linux-2.6.7-mm5.vanilla/drivers/isdn/hisax/isdnhdlc.c	Thu Jul  1 20:58:08 2004
+++ linux-2.6.7-mm5/drivers/isdn/hisax/isdnhdlc.c	Thu Jul  1 22:47:30 2004
@@ -22,7 +22,7 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/crc16.h>
+#include <linux/crc-ccitt.h>
 #include "isdnhdlc.h"
 
 /*-------------------------------------------------------------------*/
@@ -305,7 +305,7 @@ int isdnhdlc_decode (struct isdnhdlc_var
 			if(hdlc->data_bits==8){
 				hdlc->data_bits = 0;
 				hdlc->data_received = 1;
-				hdlc->crc = crc16_byte(hdlc->crc, hdlc->shift_reg);
+				hdlc->crc = crc_ccitt_byte(hdlc->crc, hdlc->shift_reg);
 
 				// good byte received
 				if (dsize--) {
@@ -482,7 +482,7 @@ int isdnhdlc_encode(struct isdnhdlc_vars
 				break;
 			}
 			if(hdlc->bit_shift==8){
-				hdlc->crc = crc16_byte(hdlc->crc, hdlc->shift_reg);
+				hdlc->crc = crc_ccitt_byte(hdlc->crc, hdlc->shift_reg);
 			}
 			if(hdlc->shift_reg & 0x01){
 				hdlc->hdlc_bits1++;
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/drivers/isdn/hisax/st5481_hdlc.c linux-2.6.7-mm5/drivers/isdn/hisax/st5481_hdlc.c
--- linux-2.6.7-mm5.vanilla/drivers/isdn/hisax/st5481_hdlc.c	Thu Jul  1 20:58:08 2004
+++ linux-2.6.7-mm5/drivers/isdn/hisax/st5481_hdlc.c	Thu Jul  1 22:47:08 2004
@@ -10,7 +10,7 @@
  *
  */
 
-#include <linux/crc16.h>
+#include <linux/crc-ccitt.h>
 #include "st5481_hdlc.h"
 
 
@@ -262,7 +262,7 @@ int hdlc_decode(struct hdlc_vars *hdlc, 
 			if(hdlc->data_bits==8){
 				hdlc->data_bits = 0;
 				hdlc->data_received = 1;
-				hdlc->crc = crc16_byte(hdlc->crc, hdlc->shift_reg);
+				hdlc->crc = crc_ccitt_byte(hdlc->crc, hdlc->shift_reg);
 
 				// good byte received
 				if (dsize--) {
@@ -439,7 +439,7 @@ int hdlc_encode(struct hdlc_vars *hdlc, 
 				break;
 			}
 			if(hdlc->bit_shift==8){
-				hdlc->crc = crc16_byte(hdlc->crc, hdlc->shift_reg);
+				hdlc->crc = crc_ccitt_byte(hdlc->crc, hdlc->shift_reg);
 			}
 			if(hdlc->shift_reg & 0x01){
 				hdlc->hdlc_bits1++;
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/drivers/isdn/tpam/tpam_crcpc.c linux-2.6.7-mm5/drivers/isdn/tpam/tpam_crcpc.c
--- linux-2.6.7-mm5.vanilla/drivers/isdn/tpam/tpam_crcpc.c	Thu Jul  1 20:58:09 2004
+++ linux-2.6.7-mm5/drivers/isdn/tpam/tpam_crcpc.c	Thu Jul  1 22:46:06 2004
@@ -27,7 +27,7 @@ Revision History:
 
 ---------------------------------------------------------------------------*/
 
-#include <linux/crc16.h>
+#include <linux/crc-ccitt.h>
 #include "tpam.h"
 
 #define  HDLC_CTRL_CHAR_CMPL_MASK	0x20	/* HDLC control character complement mask */
@@ -85,7 +85,7 @@ void hdlc_encode_modem(u8 *buffer_in, u3
 		/*
 		 *   FCS calculation
 		 */
-		fcs = crc16_byte(fcs, data);
+		fcs = crc_ccitt_byte(fcs, data);
 
 		ESCAPE_CHAR(p_data_out, data);
 	}
@@ -121,7 +121,7 @@ void hdlc_no_accm_encode(u8 *buffer_in, 
 	while (lng_in--) {
 		data = *buffer_in++;
 		/* calculate FCS */
-		fcs = crc16_byte(fcs, data);
+		fcs = crc_ccitt_byte(fcs, data);
 		*p_data_out++ = data;
 	}
 
@@ -151,7 +151,7 @@ u32 hdlc_no_accm_decode(u8 *buffer_in, u
 	while (lng_in--) {
 		data = *buffer_in++;
 		/* calculate FCS */
-		fcs = crc16_byte(fcs, data);
+		fcs = crc_ccitt_byte(fcs, data);
 	}
 
 	if (fcs == HDLC_FCS_OK) 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 4/5] 2.6.7-mm6, CRC16 renaming in PPP driver
  2004-07-08 13:01     ` [PATCH 3/5] 2.6.7-mm6, CRC16 renaming in ISDN drivers Andrey Panin
@ 2004-07-08 13:01       ` Andrey Panin
  2004-07-08 13:01         ` [PATCH 5/5] 2.6.7-mm6, CRC16 renaming in VIA Velocity ethernet driver Andrey Panin
  0 siblings, 1 reply; 9+ messages in thread
From: Andrey Panin @ 2004-07-08 13:01 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel


Signed-off-by: Andrey Panin <pazke@donpac.ru>

 drivers/net/ppp_async.c  |    2 +-
 include/linux/ppp_defs.h |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/drivers/net/ppp_async.c linux-2.6.7-mm5/drivers/net/ppp_async.c
--- linux-2.6.7-mm5.vanilla/drivers/net/ppp_async.c	Thu Jul  1 20:58:12 2004
+++ linux-2.6.7-mm5/drivers/net/ppp_async.c	Thu Jul  1 22:47:57 2004
@@ -24,7 +24,7 @@
 #include <linux/tty.h>
 #include <linux/netdevice.h>
 #include <linux/poll.h>
-#include <linux/crc16.h>
+#include <linux/crc-ccitt.h>
 #include <linux/ppp_defs.h>
 #include <linux/if_ppp.h>
 #include <linux/ppp_channel.h>
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/include/linux/ppp_defs.h linux-2.6.7-mm5/include/linux/ppp_defs.h
--- linux-2.6.7-mm5.vanilla/include/linux/ppp_defs.h	Thu Jul  1 20:58:31 2004
+++ linux-2.6.7-mm5/include/linux/ppp_defs.h	Thu Jul  1 22:45:25 2004
@@ -42,7 +42,7 @@
 #ifndef _PPP_DEFS_H_
 #define _PPP_DEFS_H_
 
-#include <linux/crc16.h>
+#include <linux/crc-ccitt.h>
 
 /*
  * The basic PPP frame.
@@ -97,7 +97,7 @@
 
 #define PPP_INITFCS	0xffff	/* Initial FCS value */
 #define PPP_GOODFCS	0xf0b8	/* Good final FCS value */
-#define PPP_FCS(fcs, c) crc16_byte(fcs, c)
+#define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c)
 
 /*
  * Extended asyncmap - allows any character to be escaped.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 5/5] 2.6.7-mm6, CRC16 renaming in VIA Velocity ethernet driver
  2004-07-08 13:01       ` [PATCH 4/5] 2.6.7-mm6, CRC16 renaming in PPP driver Andrey Panin
@ 2004-07-08 13:01         ` Andrey Panin
  0 siblings, 0 replies; 9+ messages in thread
From: Andrey Panin @ 2004-07-08 13:01 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel


Signed-off-by: Andrey Panin <pazke@donpac.ru>

 drivers/net/via-velocity.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -urpNX /usr/share/dontdiff linux-2.6.7-mm6.vanilla/drivers/net/via-velocity.c linux-2.6.7-mm6/drivers/net/via-velocity.c
--- linux-2.6.7-mm6.vanilla/drivers/net/via-velocity.c	Wed Jul  7 20:07:11 2004
+++ linux-2.6.7-mm6/drivers/net/via-velocity.c	Wed Jul  7 20:36:19 2004
@@ -78,7 +78,7 @@
 #include <linux/ip.h>
 #include <linux/tcp.h>
 #include <linux/udp.h>
-#include <linux/crc16.h>
+#include <linux/crc-ccitt.h>
 #include <linux/crc32.h>
 
 #include "via-velocity.h"
@@ -3086,7 +3086,7 @@ u16 wol_calc_crc(int size, u8 * pattern,
 				continue;
 			}
 			mask >>= 1;
-			crc = crc16(crc, &(pattern[i * 8 + j]), 1);
+			crc = crc_ccitt(crc, &(pattern[i * 8 + j]), 1);
 		}
 	}
 	/*	Finally, invert the result once to get the correct data */


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/5] 2.6.7-mm6, fix CRC16 misnaming
  2004-07-08 13:01 [PATCH 0/5] 2.6.7-mm6, fix CRC16 misnaming Andrey Panin
  2004-07-08 13:01 ` [PATCH 1/5] 2.6.7-mm6, CRC16 renaming in AX25 drivers Andrey Panin
@ 2004-07-08 13:10 ` David Weinehall
  2004-07-08 19:11   ` Thomas Sailer
  2004-07-09  2:06 ` Andrew Morton
  2 siblings, 1 reply; 9+ messages in thread
From: David Weinehall @ 2004-07-08 13:10 UTC (permalink / raw)
  To: Andrey Panin; +Cc: Andrew Morton, linux-kernel

On Thu, Jul 08, 2004 at 05:01:18PM +0400, Andrey Panin wrote:
[snip]
> -config CRC16
> -	tristate "CRC16 functions"
> +config CRC_CCITT
> +	tristate "CRC-CCITT functions"

Wouldn't it be better to keep the size here too?

CRC16-CCITT instead of just CRC-CCITT.


Regards: David Weinehall
-- 
 /) David Weinehall <tao@acc.umu.se> /) Northern lights wander      (\
//  Maintainer of the v2.0 kernel   //  Dance across the winter sky //
\)  http://www.acc.umu.se/~tao/    (/   Full colour fire           (/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/5] 2.6.7-mm6, fix CRC16 misnaming
  2004-07-08 13:10 ` [PATCH 0/5] 2.6.7-mm6, fix CRC16 misnaming David Weinehall
@ 2004-07-08 19:11   ` Thomas Sailer
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Sailer @ 2004-07-08 19:11 UTC (permalink / raw)
  To: David Weinehall; +Cc: Andrey Panin, Andrew Morton, linux-kernel

On Thu, 2004-07-08 at 15:10, David Weinehall wrote:

> Wouldn't it be better to keep the size here too?
> 
> CRC16-CCITT instead of just CRC-CCITT.

IMO not necessary, the size is clear from the return type, and CCITT
AFAIK never defined a 32bit CRC Poly

Tom


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/5] 2.6.7-mm6, fix CRC16 misnaming
  2004-07-08 13:01 [PATCH 0/5] 2.6.7-mm6, fix CRC16 misnaming Andrey Panin
  2004-07-08 13:01 ` [PATCH 1/5] 2.6.7-mm6, CRC16 renaming in AX25 drivers Andrey Panin
  2004-07-08 13:10 ` [PATCH 0/5] 2.6.7-mm6, fix CRC16 misnaming David Weinehall
@ 2004-07-09  2:06 ` Andrew Morton
  2 siblings, 0 replies; 9+ messages in thread
From: Andrew Morton @ 2004-07-09  2:06 UTC (permalink / raw)
  To: Andrey Panin; +Cc: linux-kernel

Andrey Panin <pazke@donpac.ru> wrote:
>
> As pointed by Thomas Sailer, crc16.c module contains CRC16-CCITT (x^16 + x^12 + x^5 + 1)
>  implementation, not IBM CRC16 (x^16 + x^15 + x^2 + 1) one. Looks like we need to rename
>  it accordingly and this patchset does exactly this.

Needs this:


drivers/net/hamradio/Kconfig:116:warning: 'select' used by config symbol 'BAYCOM_SER_FDX' refer to undefined symbol 'CRC16'
drivers/net/hamradio/Kconfig:136:warning: 'select' used by config symbol 'BAYCOM_SER_HDX' refer to undefined symbol 'CRC16'
drivers/net/hamradio/Kconfig:154:warning: 'select' used by config symbol 'BAYCOM_PAR' refer to undefined symbol 'CRC16'
drivers/net/hamradio/Kconfig:169:warning: 'select' used by config symbol 'BAYCOM_EPP' refer to undefined symbol 'CRC16'
net/irda/Kconfig:8:warning: 'select' used by config symbol 'IRDA' refer to undefined symbol 'CRC16'
drivers/net/Kconfig:1749:warning: 'select' used by config symbol 'VIA_VELOCITY' refer to undefined symbol 'CRC16'
drivers/net/Kconfig:2465:warning: 'select' used by config symbol 'PPP_ASYNC' refer to undefined symbol 'CRC16'
drivers/isdn/hisax/Kconfig:403:warning: 'select' used by config symbol 'HISAX_ST5481' refer to undefined symbol 'CRC16'
drivers/isdn/hisax/Kconfig:7:warning: 'select' used by config symbol 'ISDN_DRV_HISAX' refer to undefined symbol 'CRC16'
drivers/isdn/tpam/Kconfig:7:warning: 'select' used by config symbol 'ISDN_DRV_TPAM' refer to undefined symbol 'CRC16'

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/isdn/hisax/Kconfig   |    4 ++--
 25-akpm/drivers/isdn/tpam/Kconfig    |    2 +-
 25-akpm/drivers/net/Kconfig          |    4 ++--
 25-akpm/drivers/net/hamradio/Kconfig |    8 ++++----
 25-akpm/net/irda/Kconfig             |    2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff -puN drivers/net/hamradio/Kconfig~crc16-kconfig-touchups drivers/net/hamradio/Kconfig
--- 25/drivers/net/hamradio/Kconfig~crc16-kconfig-touchups	2004-07-08 19:06:03.962450720 -0700
+++ 25-akpm/drivers/net/hamradio/Kconfig	2004-07-08 19:06:03.973449048 -0700
@@ -113,7 +113,7 @@ config SCC_TRXECHO
 config BAYCOM_SER_FDX
 	tristate "BAYCOM ser12 fullduplex driver for AX.25"
 	depends on AX25
-	select CRC16
+	select CRC_CCITT
 	---help---
 	  This is one of two drivers for Baycom style simple amateur radio
 	  modems that connect to a serial interface. The driver supports the
@@ -133,7 +133,7 @@ config BAYCOM_SER_FDX
 config BAYCOM_SER_HDX
 	tristate "BAYCOM ser12 halfduplex driver for AX.25"
 	depends on AX25
-	select CRC16
+	select CRC_CCITT
 	---help---
 	  This is one of two drivers for Baycom style simple amateur radio
 	  modems that connect to a serial interface. The driver supports the
@@ -151,7 +151,7 @@ config BAYCOM_SER_HDX
 config BAYCOM_PAR
 	tristate "BAYCOM picpar and par96 driver for AX.25"
 	depends on PARPORT && AX25
-	select CRC16
+	select CRC_CCITT
 	---help---
 	  This is a driver for Baycom style simple amateur radio modems that
 	  connect to a parallel interface. The driver supports the picpar and
@@ -166,7 +166,7 @@ config BAYCOM_PAR
 config BAYCOM_EPP
 	tristate "BAYCOM epp driver for AX.25"
 	depends on PARPORT && AX25 && !64BIT
-	select CRC16
+	select CRC_CCITT
 	---help---
 	  This is a driver for Baycom style simple amateur radio modems that
 	  connect to a parallel interface. The driver supports the EPP
diff -puN net/irda/Kconfig~crc16-kconfig-touchups net/irda/Kconfig
--- 25/net/irda/Kconfig~crc16-kconfig-touchups	2004-07-08 19:06:03.964450416 -0700
+++ 25-akpm/net/irda/Kconfig	2004-07-08 19:06:03.973449048 -0700
@@ -5,7 +5,7 @@
 menuconfig IRDA
 	depends on NET
 	tristate "IrDA (infrared) subsystem support"
-	select CRC16
+	select CRC_CCITT
 	---help---
 	  Say Y here if you want to build support for the IrDA (TM) protocols.
 	  The Infrared Data Associations (tm) specifies standards for wireless
diff -puN drivers/net/Kconfig~crc16-kconfig-touchups drivers/net/Kconfig
--- 25/drivers/net/Kconfig~crc16-kconfig-touchups	2004-07-08 19:06:03.966450112 -0700
+++ 25-akpm/drivers/net/Kconfig	2004-07-08 19:06:03.976448592 -0700
@@ -1746,7 +1746,7 @@ config VIA_VELOCITY
 	tristate "VIA Velocity support"
 	depends on NET_PCI && PCI
 	select CRC32
-	select CRC16
+	select CRC_CCITT
 	select MII
 	help
 	  If you have a VIA "Velocity" based network card say Y here.
@@ -2462,7 +2462,7 @@ config PPP_FILTER
 config PPP_ASYNC
 	tristate "PPP support for async serial ports"
 	depends on PPP
-	select CRC16
+	select CRC_CCITT
 	---help---
 	  Say Y (or M) here if you want to be able to use PPP over standard
 	  asynchronous serial ports, such as COM1 or COM2 on a PC.  If you use
diff -puN drivers/isdn/hisax/Kconfig~crc16-kconfig-touchups drivers/isdn/hisax/Kconfig
--- 25/drivers/isdn/hisax/Kconfig~crc16-kconfig-touchups	2004-07-08 19:06:03.968449808 -0700
+++ 25-akpm/drivers/isdn/hisax/Kconfig	2004-07-08 19:06:03.977448440 -0700
@@ -4,7 +4,7 @@ menu "Passive cards"
 
 config ISDN_DRV_HISAX
 	tristate "HiSax SiemensChipSet driver support"
-	select CRC16
+	select CRC_CCITT
 	---help---
 	  This is a driver supporting the Siemens chipset on various
 	  ISDN-cards (like AVM A1, Elsa ISDN cards, Teles S0-16.0, Teles
@@ -400,7 +400,7 @@ comment "HiSax sub driver modules"
 config HISAX_ST5481
 	tristate "ST5481 USB ISDN modem (EXPERIMENTAL)"
 	depends on USB && EXPERIMENTAL
-	select CRC16
+	select CRC_CCITT
 	help
 	  This enables the driver for ST5481 based USB ISDN adapters,
 	  e.g. the BeWan Gazel 128 USB
diff -puN drivers/isdn/tpam/Kconfig~crc16-kconfig-touchups drivers/isdn/tpam/Kconfig
--- 25/drivers/isdn/tpam/Kconfig~crc16-kconfig-touchups	2004-07-08 19:06:03.969449656 -0700
+++ 25-akpm/drivers/isdn/tpam/Kconfig	2004-07-08 19:06:03.977448440 -0700
@@ -4,7 +4,7 @@
 config ISDN_DRV_TPAM
 	tristate "Auvertech TurboPAM support (EXPERIMENTAL)"
 	depends on EXPERIMENTAL && ISDN_I4L && PCI
-	select CRC16
+	select CRC_CCITT
 	help
 	  This enables support for the Auvertech TurboPAM ISDN-card.
 	  For running this card, additional firmware is necessary, which has
_


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-07-09  2:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-08 13:01 [PATCH 0/5] 2.6.7-mm6, fix CRC16 misnaming Andrey Panin
2004-07-08 13:01 ` [PATCH 1/5] 2.6.7-mm6, CRC16 renaming in AX25 drivers Andrey Panin
2004-07-08 13:01   ` [PATCH 2/5] 2.6.7-mm6, CRC16 renaming in IRDA drivers Andrey Panin
2004-07-08 13:01     ` [PATCH 3/5] 2.6.7-mm6, CRC16 renaming in ISDN drivers Andrey Panin
2004-07-08 13:01       ` [PATCH 4/5] 2.6.7-mm6, CRC16 renaming in PPP driver Andrey Panin
2004-07-08 13:01         ` [PATCH 5/5] 2.6.7-mm6, CRC16 renaming in VIA Velocity ethernet driver Andrey Panin
2004-07-08 13:10 ` [PATCH 0/5] 2.6.7-mm6, fix CRC16 misnaming David Weinehall
2004-07-08 19:11   ` Thomas Sailer
2004-07-09  2:06 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox