Bug 18526

Summary: mx does not receive ethernet broadcast packet
Product: Base System Reporter: yab <yab>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.4-RELEASE   
Hardware: Any   
OS: Any   

Description yab 2000-05-13 09:20:01 UTC
The following NICs does not receive ethernet broadcast, so that
the machine does not reply to ARP request. 
  corega FetherA
  BUFFALO LGY-PCI-TXL
The NICs are using MX98715A.  When using them in promiscuous mode, 
they can receive it and reply to ARP request.

Fix: 

Using the NIC with promiscuous mode, for example run tcpdump 
background:
  tcpdump -i mx0 proto xnet &
How-To-Repeat: Install FreeBSD 3.4-RELEASE with GENERIC kernel.  Reboot, and ping 
from another machine which does not have arp entry of the installed.
Comment 1 kondo 2000-05-22 03:38:38 UTC
I check "http://www.macronix.com/" MX98715 Data sheet.


MX98715		512-bit hash + 1 perfect filtering
MX98715A	512-bit hash + 1 perfect filtering
MX98715AL	512-bit hash + 1 perfect filtering
MX98715AEC-C	128-bit hash + 1 perfect filtering
MX98715AEC-E	128-bit hash + 1 perfect filtering
MX98715BEC	512-bit hash + 1 perfect filtering


dc driver change MX98715AEC use 128-bit hash.

FreeBSD 4.0-RELESE dc_driver DIFF

=============================================================================
diff -u pci.old/if_dc.c pci/if_dc.c
--- pci.old/if_dc.c	Fri May 19 19:46:42 2000
+++ pci/if_dc.c	Mon May 22 09:40:40 2000
@@ -184,6 +184,8 @@
 	{ DC_VENDORID_CP, DC_DEVICEID_98713_CP,
 		"Compex RL100-TX 10/100BaseTX" },
 	{ DC_VENDORID_MX, DC_DEVICEID_987x5,
+		"Macronix 98715AEC 10/100BaseTX" },
+	{ DC_VENDORID_MX, DC_DEVICEID_987x5,
 		"Macronix 98715/98715A 10/100BaseTX" },
 	{ DC_VENDORID_MX, DC_DEVICEID_987x5,
 		"Macronix 98725 10/100BaseTX" },
@@ -917,7 +919,7 @@
 	}
 
 	/* The hash table on the PNIC II is only 128 bits wide. */
-	if (DC_IS_PNICII(sc))
+	if (DC_IS_MX98715AEC(sc) || DC_IS_PNICII(sc))
 		return (crc & ((1 << DC_BITS_PNIC_II) - 1));
 
 	return (crc & ((1 << DC_BITS) - 1));
@@ -1160,7 +1162,7 @@
 	struct dc_softc		*sc;
 {
 	if (DC_IS_INTEL(sc) || DC_IS_MACRONIX(sc) || DC_IS_PNIC(sc) ||
-	    DC_IS_PNICII(sc) || DC_IS_DAVICOM(sc))
+	    DC_IS_MX98715AEC(sc) || DC_IS_PNICII(sc) || DC_IS_DAVICOM(sc))
 		dc_setfilt_21143(sc);
 
 	if (DC_IS_ASIX(sc))
@@ -1344,6 +1346,9 @@
 			    rev >= DC_REVISION_98713A)
 				t++;
 			if (t->dc_did == DC_DEVICEID_987x5 &&
+			    rev != DC_REVISION_98715AEC)
+				t++;
+			if (t->dc_did == DC_DEVICEID_987x5 &&
 			    rev >= DC_REVISION_98725)
 				t++;
 			if (t->dc_did == DC_DEVICEID_AX88140A &&
@@ -1548,7 +1553,11 @@
 		sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;
 		break;
 	case DC_DEVICEID_987x5:
-		sc->dc_type = DC_TYPE_987x5;
+	        if (revision == DC_REVISION_98715AEC) {
+		  sc->dc_type = DC_TYPE_98715AEC;
+		} else {
+		  sc->dc_type = DC_TYPE_987x5;
+		}
 		sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;
 		break;
 	case DC_DEVICEID_82C115:
@@ -1622,7 +1631,8 @@
 		 */
 		if (media == 0)
 			sc->dc_pmode = DC_PMODE_MII;
-	} else if (DC_IS_MACRONIX(sc) || DC_IS_PNICII(sc)) {
+	} else if (DC_IS_MACRONIX(sc) || DC_IS_MX98715AEC(sc) ||
+		   DC_IS_PNICII(sc)) {
 		if (sc->dc_type == DC_TYPE_98713)
 			sc->dc_pmode = DC_PMODE_MII;
 		else
@@ -2647,7 +2657,7 @@
 	DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_NO_RXCRC);
 	DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_TX_BACKOFF);
 
-	if (DC_IS_MACRONIX(sc) || DC_IS_PNICII(sc)) {
+	if (DC_IS_MACRONIX(sc) || DC_IS_MX98715AEC(sc) || DC_IS_PNICII(sc)) {
 		/*
 		 * The app notes for the 98713 and 98715A say that
 		 * in order to have the chips operate properly, a magic
diff -u pci.old/if_dcreg.h pci/if_dcreg.h
--- pci.old/if_dcreg.h	Sat Mar 11 14:20:56 2000
+++ pci/if_dcreg.h	Mon May 22 11:08:50 2000
@@ -75,6 +75,7 @@
 #define DC_TYPE_DM9102		0x8	/* Davicom DM9102 */
 #define DC_TYPE_PNICII		0x9	/* 82c115 PNIC II */
 #define DC_TYPE_PNIC		0xA	/* 82c168/82c169 PNIC I */
+#define DC_TYPE_98715AEC	0xB     /* MACRONIX MX98715AEC */
 
 #define DC_IS_MACRONIX(x)			\
 	(x->dc_type == DC_TYPE_98713 ||		\
@@ -92,6 +93,7 @@
 #define DC_IS_DAVICOM(x)	(x->dc_type == DC_TYPE_DM9102)
 #define DC_IS_PNICII(x)		(x->dc_type == DC_TYPE_PNICII)
 #define DC_IS_PNIC(x)		(x->dc_type == DC_TYPE_PNIC)
+#define DC_IS_MX98715AEC(x)	(x->dc_type == DC_TYPE_98715AEC)
 
 /* MII/symbol mode port types */
 #define DC_PMODE_MII		0x1
@@ -713,8 +715,8 @@
 #define DC_REVISION_98713	0x00
 #define DC_REVISION_98713A	0x10
 #define DC_REVISION_98715	0x20
+#define DC_REVISION_98715AEC	0x25
 #define DC_REVISION_98725	0x30
-
 /*
  * Compex PCI vendor ID.
  */

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

------------------------------------------------------------
kondo hiroshi   Email   kondo@ysyslab.co.jp
                WWW     http://www.ysyslab.co.jp/~kondo/
                TEL     045-682-4800        FAX 045-682-4801
Comment 2 kondo 2000-05-22 04:04:48 UTC
sorry. little bug.

=====================================================================
diff -u pci.old/if_dc.c pci/if_dc.c
--- pci.old/if_dc.c	Fri May 19 19:46:42 2000
+++ pci/if_dc.c	Mon May 22 09:40:40 2000
@@ -1343,6 +1345,9 @@
 			if (t->dc_did == DC_DEVICEID_98713_CP &&
 			    rev >= DC_REVISION_98713A)
 				t++;
+			if (t->dc_did == DC_DEVICEID_987x5)
+			  if (rev != DC_REVISION_98715AEC)
+				t++;
 			if (t->dc_did == DC_DEVICEID_987x5 &&
 			    rev >= DC_REVISION_98725)
 				t++;
=====================================================================



------------------------------------------------------------
kondo hiroshi   Email   kondo@ysyslab.co.jp
                WWW     http://www.ysyslab.co.jp/~kondo/
                TEL     045-682-4800        FAX 045-682-4801
Comment 3 yab 2000-05-25 11:14:49 UTC
I ported 4.0 dc driver fix to 3.0 mx driver.

--- if_mx.c	2000/05/25 09:08:27	1.1
+++ if_mx.c	2000/05/25 10:05:28
@@ -110,6 +110,8 @@
 	{ CP_VENDORID, CP_DEVICEID_98713,
 		"Compex RL100-TX 10/100BaseTX" },
 	{ MX_VENDORID, MX_DEVICEID_987x5,
+		"Macronix 98715AEC 10/100BaseTX" },
+	{ MX_VENDORID, MX_DEVICEID_987x5,
 		"Macronix 98715/98715A 10/100BaseTX" },
 	{ MX_VENDORID, MX_DEVICEID_987x5,
 		"Macronix 98725 10/100BaseTX" },
@@ -586,7 +588,8 @@
 	}
 
 	/* The hash table on the PNIC II is only 128 bits wide. */
-	if (sc->mx_info->mx_vid == PN_VENDORID)
+	if (sc->mx_info->mx_vid == PN_VENDORID
+	    || sc->mx_type == MX_TYPE_98715AEC)
 		return (crc & ((1 << MX_BITS_PNIC_II) - 1));
 
 	return (crc & ((1 << MX_BITS) - 1));
@@ -1200,9 +1203,11 @@
 			if (t->mx_did == CP_DEVICEID_98713 &&
 						rev >= MX_REVISION_98713A)
 				t++;
-			if (t->mx_did == MX_DEVICEID_987x5 &&
-						rev >= MX_REVISION_98725)
-				t++;
+			if (t->mx_did == MX_DEVICEID_987x5)
+				if (rev != MX_REVISION_98715AEC)
+					t++;
+				else if (rev >= MX_REVISION_98725)
+					t++;
 			return(t);
 		}
 		t++;
@@ -1359,7 +1364,9 @@
 		sc->mx_type = MX_TYPE_98713;
 	else if (pci_id == MX_DEVICEID_98713 && revision >=
MX_REVISION_98713A)
 		sc->mx_type = MX_TYPE_98713A;
-	else
+	else if (revision == MX_REVISION_98715AEC) 
+		sc->mx_type = MX_TYPE_98715AEC;
+	else 
 		sc->mx_type = MX_TYPE_987x5;
 
 	/* Save the cache line size. */
--- if_mxreg.h	2000/05/25 09:19:59	1.1
+++ if_mxreg.h	2000/05/25 09:22:07
@@ -69,6 +69,7 @@
 #define MX_REVISION_98713	0x00
 #define MX_REVISION_98713A	0x10
 #define MX_REVISION_98715	0x20
+#define MX_REVISION_98715AEC	0x25
 #define MX_REVISION_98725	0x30
 
 /*
@@ -83,6 +84,7 @@
 #define MX_TYPE_98713		0x1
 #define MX_TYPE_98713A		0x2
 #define MX_TYPE_987x5		0x3
+#define MX_TYPE_98715AEC	0xB /* used in 4.0 driver */
 
 /*
  * Bus control bits.
Comment 4 yab 2000-05-26 07:27:40 UTC
Sorry, more fix.

--- if_mx.c	2000/05/25 10:05:41	1.2
+++ if_mx.c	2000/05/26 06:22:03
@@ -1204,10 +1204,9 @@
 						rev >= MX_REVISION_98713A)
 				t++;
 			if (t->mx_did == MX_DEVICEID_987x5)
-				if (rev != MX_REVISION_98715AEC)
-					t++;
-				else if (rev >= MX_REVISION_98725)
-					t++;
+				if (rev != MX_REVISION_98715AEC
+					|| rev >= MX_REVISION_98725)
+						t++;
 			return(t);
 		}
 		t++;
Comment 5 Mike Barcroft freebsd_committer freebsd_triage 2001-07-22 03:24:56 UTC
State Changed
From-To: open->feedback


Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE?
Comment 6 Sheldon Hearn freebsd_committer freebsd_triage 2002-01-18 16:14:39 UTC
State Changed
From-To: feedback->closed

Automatic feedback timeout.  If additional feedback that warrants 
the re-opening of this PR is available but not included in the 
audit trail, please include the feedback in a reply to this message 
(preserving the Subject line) and ask that the PR be re-opened.