summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2000-07-15 17:54:30 +0000
committerwpaul <wpaul@FreeBSD.org>2000-07-15 17:54:30 +0000
commita6eab227616d406c63fc686cef5971a1e47f29a0 (patch)
tree1752576450d09480161aabbce62c36c0ab94195c /sys/pci
parentb45cd0c3e0421e00804202184c0af2c30fcc0b45 (diff)
downloadFreeBSD-src-a6eab227616d406c63fc686cef5971a1e47f29a0.zip
FreeBSD-src-a6eab227616d406c63fc686cef5971a1e47f29a0.tar.gz
Apply patch to the dc driver to handle Macronix MX98715AEC-C/D/E chips,
which differ slightly from the Macronix MX98715AEC chip on the sample adapter that I have in that the multicast hash table is only 128 bits wide instead of 512. New adapters are popping up with this chip, and due to improper handling of the smaller hash table, broadcast packets were not being received correctly.
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_dc.c37
-rw-r--r--sys/pci/if_dcreg.h3
2 files changed, 33 insertions, 7 deletions
diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c
index c26e6e0..92da26b 100644
--- a/sys/pci/if_dc.c
+++ b/sys/pci/if_dc.c
@@ -184,6 +184,8 @@ static struct dc_type dc_devs[] = {
{ DC_VENDORID_MX, DC_DEVICEID_987x5,
"Macronix 98715/98715A 10/100BaseTX" },
{ DC_VENDORID_MX, DC_DEVICEID_987x5,
+ "Macronix 98715AEC-C 10/100BaseTX" },
+ { DC_VENDORID_MX, DC_DEVICEID_987x5,
"Macronix 98725 10/100BaseTX" },
{ DC_VENDORID_LO, DC_DEVICEID_82C115,
"LC82C115 PNIC II 10/100BaseTX" },
@@ -899,8 +901,9 @@ static void dc_miibus_mediainit(dev)
}
#define DC_POLY 0xEDB88320
-#define DC_BITS 9
-#define DC_BITS_PNIC_II 7
+#define DC_BITS_512 9
+#define DC_BITS_128 7
+#define DC_BITS_64 6
static u_int32_t dc_crc_le(sc, addr)
struct dc_softc *sc;
@@ -916,11 +919,18 @@ static u_int32_t dc_crc_le(sc, addr)
crc = (crc >> 1) ^ (((crc ^ data) & 1) ? DC_POLY : 0);
}
- /* The hash table on the PNIC II is only 128 bits wide. */
- if (DC_IS_PNICII(sc))
- return (crc & ((1 << DC_BITS_PNIC_II) - 1));
+ /*
+ * The hash table on the PNIC II and the MX98715AEC-C/D/E
+ * chips is only 128 bits wide.
+ */
+ if (sc->dc_flags & DC_128BIT_HASH)
+ return (crc & ((1 << DC_BITS_128) - 1));
- return (crc & ((1 << DC_BITS) - 1));
+ /* The hash table on the MX98715BEC is only 64 bits wide. */
+ if (sc->dc_flags & DC_64BIT_HASH)
+ return (crc & ((1 << DC_BITS_64) - 1));
+
+ return (crc & ((1 << DC_BITS_512) - 1));
}
/*
@@ -1345,6 +1355,9 @@ static struct dc_type *dc_devtype(dev)
rev >= DC_REVISION_98713A)
t++;
if (t->dc_did == DC_DEVICEID_987x5 &&
+ rev >= DC_REVISION_98715AEC_C)
+ t++;
+ if (t->dc_did == DC_DEVICEID_987x5 &&
rev >= DC_REVISION_98725)
t++;
if (t->dc_did == DC_DEVICEID_AX88140A &&
@@ -1552,13 +1565,23 @@ static int dc_attach(dev)
break;
case DC_DEVICEID_987x5:
case DC_DEVICEID_EN1217:
+ /*
+ * Macronix MX98715AEC-C/D/E parts have only a
+ * 128-bit hash table. We need to deal with these
+ * in the same manner as the PNIC II so that we
+ * get the right number of bits out of the
+ * CRC routine.
+ */
+ if (revision >= DC_REVISION_98715AEC_C &&
+ revision < DC_REVISION_98725)
+ sc->dc_flags |= DC_128BIT_HASH;
sc->dc_type = DC_TYPE_987x5;
sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;
sc->dc_flags |= DC_REDUCED_MII_POLL|DC_21143_NWAY;
break;
case DC_DEVICEID_82C115:
sc->dc_type = DC_TYPE_PNICII;
- sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;
+ sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR|DC_128BIT_HASH;
sc->dc_flags |= DC_REDUCED_MII_POLL|DC_21143_NWAY;
break;
case DC_DEVICEID_82C168:
diff --git a/sys/pci/if_dcreg.h b/sys/pci/if_dcreg.h
index 4f56a45..1e441d7 100644
--- a/sys/pci/if_dcreg.h
+++ b/sys/pci/if_dcreg.h
@@ -672,6 +672,8 @@ struct dc_softc {
#define DC_REDUCED_MII_POLL 0x00000200
#define DC_TX_INTR_ALWAYS 0x00000400
#define DC_21143_NWAY 0x00000800
+#define DC_128BIT_HASH 0x00001000
+#define DC_64BIT_HASH 0x00002000
/*
* register space access macros
@@ -714,6 +716,7 @@ struct dc_softc {
#define DC_REVISION_98713 0x00
#define DC_REVISION_98713A 0x10
#define DC_REVISION_98715 0x20
+#define DC_REVISION_98715AEC_C 0x25
#define DC_REVISION_98725 0x30
/*
OpenPOWER on IntegriCloud