Skip to contentSkip to conversation

Use kernel crc32 for BlueZ BNEP

PATCH New Marcel Holtmann 1 participant 1 message Oct 7, 2002

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Use kernel crc32 for BlueZ BNEP

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================

[email protected], 2002-10-07 04:49:50+02:00, [email protected]
Use kernel crc32 for BlueZ BNEP

This patch modifies the BlueZ BNEP layer to use the CRC32 code from the lib/ directory and it makes some cosmetic changes to the BNEP code.

 b/lib/Makefile                    |    1 
 b/net/bluetooth/bnep/Makefile     |    2 -
 b/net/bluetooth/bnep/Makefile.lib |    1 
 b/net/bluetooth/bnep/bnep.h       |    5 +--
 b/net/bluetooth/bnep/core.c       |   20 ++++--------
 net/bluetooth/bnep/crc32.c        |   59 --------------------------------------
 net/bluetooth/bnep/crc32.h        |   10 ------
 7 files changed, 12 insertions(+), 86 deletions(-)
lib/Makefile +1 -0
diff -Nru a/lib/Makefile b/lib/Makefile
@@ -29,5 +29,6 @@
 include $(TOPDIR)/drivers/net/Makefile.lib
 include $(TOPDIR)/drivers/usb/class/Makefile.lib
 include $(TOPDIR)/fs/Makefile.lib
+include $(TOPDIR)/net/bluetooth/bnep/Makefile.lib
 
 include $(TOPDIR)/Rules.make
net/bluetooth/bnep/Makefile +1 -1
diff -Nru a/net/bluetooth/bnep/Makefile b/net/bluetooth/bnep/Makefile
@@ -4,6 +4,6 @@
 
 obj-$(CONFIG_BLUEZ_BNEP) += bnep.o
 
-bnep-objs := core.o sock.o netdev.o crc32.o
+bnep-objs := core.o sock.o netdev.o
 
 include $(TOPDIR)/Rules.make
net/bluetooth/bnep/Makefile.lib new file +1 -0
diff -Nru a/net/bluetooth/bnep/Makefile.lib b/net/bluetooth/bnep/Makefile.lib
@@ -0,0 +1 @@
+obj-$(CONFIG_BLUEZ_BNEP)	+= crc32.o
net/bluetooth/bnep/bnep.h +2 -3
diff -Nru a/net/bluetooth/bnep/bnep.h b/net/bluetooth/bnep/bnep.h
@@ -24,10 +24,9 @@
 #define _BNEP_H
 
 #include <linux/types.h>
+#include <linux/crc32.h>
 #include <net/bluetooth/bluetooth.h>
 
-#include "crc32.h"
-
 // Limits
 #define BNEP_MAX_PROTO_FILTERS     5
 #define BNEP_MAX_MULTICAST_FILTERS 20
@@ -179,7 +178,7 @@
 
 static inline int bnep_mc_hash(__u8 *addr)
 {
-        return (bnep_crc32(~0, addr, ETH_ALEN) >> 26);
+        return (crc32_be(~0, addr, ETH_ALEN) >> 26);
 }
 
 #endif
net/bluetooth/bnep/core.c +7 -13
diff -Nru a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
@@ -675,17 +675,13 @@
 
 static int __init bnep_init_module(void)
 {
-	BT_INFO("BNEP: BNEP2 ver %s\n"
-		"BNEP: Copyright (C) 2002 Inventel\n"
-		"BNEP: Written 2001,2002 by\n"
-		"BNEP: \tClement Moreau <[email protected]> "
-			"David Libault <[email protected]>\n"
-		"BNEP: Copyright (C) 2002 Maxim Krasnyanskiy <[email protected]>",
-			VERSION);
-
 	bnep_sock_init();
 
-	bnep_crc32_init();
+	BT_INFO("BlueZ BNEP ver %s", VERSION);
+	BT_INFO("Copyright (C) 2001,2002 Inventel Systemes");
+	BT_INFO("Written 2001,2002 by Clement Moreau <[email protected]>");
+	BT_INFO("Written 2001,2002 by David Libault <[email protected]>");
+	BT_INFO("Copyright (C) 2002 Maxim Krasnyanskiy <[email protected]>");
 
 	return 0;
 }
@@ -693,13 +689,11 @@
 static void __exit bnep_cleanup_module(void)
 {
 	bnep_sock_cleanup();
-
-	bnep_crc32_cleanup();
 }
 
 module_init(bnep_init_module);
 module_exit(bnep_cleanup_module);
 
-MODULE_DESCRIPTION("BNEP ver " VERSION);
-MODULE_AUTHOR("David Libault <[email protected]> Maxim Krasnyanskiy <[email protected]>");
+MODULE_DESCRIPTION("BlueZ BNEP ver " VERSION);
+MODULE_AUTHOR("David Libault <[email protected]>, Maxim Krasnyanskiy <[email protected]>");
 MODULE_LICENSE("GPL");
net/bluetooth/bnep/crc32.c deleted +0 -59

59 lines not on this page · raw message

net/bluetooth/bnep/crc32.h deleted +0 -10
diff -Nru a/net/bluetooth/bnep/crc32.h b/net/bluetooth/bnep/crc32.h
@@ -1,10 +0,0 @@
-/*
- * crc32.h
- * See crc32.c for license and changes
- *
- * FIXME: Remove in 2.5
- */
-
-int  bnep_crc32_init(void);
-void bnep_crc32_cleanup(void);
-u32  bnep_crc32(u32 crc, unsigned char const *p, size_t len);

===================================================================

This BitKeeper patch contains the following changesets:
+
## Wrapped with gzip_uu ##

begin 664 bkpatch8971 M'XL(`"/WH#T``\U8;4_;2!#^C'_%B/:DH!)G=_V>`T1)TC8J$!2@=[HOR"\; MXHMC<[9#R<GJ;[]9&VA(4FRG15R(O-A9/SOS/+,[L_L&+A,>M[>F=NSR0'H# MGZ(D;6^-HR"=VF$H1_$U/AQ&$3YLC:,I;SW\U'+\=,+Y#8];3C#C_S:9K$G8 M]\Q.W3'<\CAI;U%9>7R2SF]X>VO8^WAY_'XH2?O[T!G;X34_YRGL[TMI%-_:
M@9<<VNDXB$(YC>TPF?+4EMUHFCUVS1@A#/\T:BA$TS.J$]7(7.I1:JN4>X2I MIJY*A3N'BVXL85!"#+R:FID19BJ*U4J&X8"A+4H:1$#B-I6K;9&WA'6)@36 M0,([YI$.H)?:WQ'<H4J,.%QR-P8U=A,(IB.$*>_X*CT]X9]L#OQ=A/X"9G M=QIY_LCG":1COM/GO.8[0/9@@H?NL,.XCF1AZ'41Q-$44\#7RG!9X?<Q== MF8,=>N"GZ/($$1-4'5\0_O@NN+DSB8#,AQ*#"#19^@R,4FI(9]^%E9HU/Y)$ M;"(=X,AWD\-;'X-+;H11R'>RD*=YG*48BN.6$_*;5DZ,[#[(J3)%L1C-5%VQ M:&:,=,.R5*:JE&B*O5:_[,A//Q<A[/&I]QKR?A/\Q[XVS+&0N"HIM#/8JI> MS]KQJK6:HF7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