Skip to contentSkip to conversation

in drivers/net/dl2k.h

BUG Jörn Engel 1 participant 1 message Jan 28, 2003

lore
Share & tools
lore
#0 lore raw

Hi!

The patch below should be enough to verify the bug and create a proper fix, I hope.

Jörn

Signature · 28 lines
If you're willing to restrict the flexibility of your approach,
you can almost always do something better.
-- John Carmack

diff -Naur linux-2.4.21-pre3-ac4/drivers/net/dl2k.c scratch/drivers/net/dl2k.c
--- linux-2.4.21-pre3-ac4/drivers/net/dl2k.c	Fri Jan 24 15:25:37 2003
+++ scratch/drivers/net/dl2k.c	Tue Jan 28 15:45:02 2003
@@ -1743,6 +1743,8 @@
 		anar.image = mii_read (dev, phy_addr, MII_ANAR);
 		anar.bits.half_duplex = 
 			esr.bits.media_1000BT_HD | esr.bits.media_1000BX_HD;
+		/* BUG: esr.bits.media_1000BT_FD is uninitialized.
+		 * 	see sl2k.h */
 		anar.bits.full_duplex = 
 			esr.bits.media_1000BT_FD | esr.bits.media_1000BX_FD;
 		anar.bits.pause = 1;
diff -Naur linux-2.4.21-pre3-ac4/drivers/net/dl2k.h scratch/drivers/net/dl2k.h
--- linux-2.4.21-pre3-ac4/drivers/net/dl2k.h	Fri Jan 24 15:25:37 2003
+++ scratch/drivers/net/dl2k.h	Tue Jan 28 15:46:33 2003
@@ -513,6 +513,8 @@
 	u16 image;
 	struct {
 		u16 _bit_11_0:12;	// bit 11:0
+		/* BUG: ":2" should be ":1", if this is really only bit 12.
+		 * 	This should cause the bug in dl2k.c */
 		u16 media_1000BT_HD:2;	// bit 12
 		u16 media_1000BT_FD:1;	// bit 13
 		u16 media_1000BX_HD:1;	// bit 14