summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2002-10-20 16:46:29 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2002-10-20 16:46:29 +0000
commitdccdd51b88c74c7a74272545ae72bd99f77406ce (patch)
tree9e5af00ffa4c9aeb6a0214ca5192308d30113cb2 /sys/dev
parent11abdfebcfbd965d8eaf56da7e752c9e213f702f (diff)
add support for intel 21145
This chip is some strange abnormal 21143 variant. It really only works with 10 MBit/s halfduplex only and autonegotiation is totally broken in hardware. Should also have a HomePNA phy, but we don't support that. for now requires and explicit "media 10BaseT". if anybody has such a chip please mail me. nick@ is the only one who has the hardware and did an incredible amount of testing. Thanks for all the help, Nick! some hints and ok jason@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/dc.c5
-rw-r--r--sys/dev/ic/dcreg.h8
-rw-r--r--sys/dev/mii/dcphy.c5
-rw-r--r--sys/dev/pci/if_dc_pci.c12
4 files changed, 25 insertions, 5 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c
index 8ac6916f15c..8493b0d7e81 100644
--- a/sys/dev/ic/dc.c
+++ b/sys/dev/ic/dc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dc.c,v 1.51 2002/07/05 13:45:21 aaron Exp $ */
+/* $OpenBSD: dc.c,v 1.52 2002/10/20 16:46:27 henning Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1637,6 +1637,7 @@ void dc_attach(sc)
break;
case DC_TYPE_DM9102:
case DC_TYPE_21143:
+ case DC_TYPE_21145:
case DC_TYPE_ASIX:
dc_read_eeprom(sc, (caddr_t)&sc->sc_arpcom.ac_enaddr,
DC_EE_NODEADDR, 3, 0);
@@ -1759,6 +1760,8 @@ hasmac:
error = ENXIO;
ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE, 0, NULL);
ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE);
+ } else if (sc->dc_type == DC_TYPE_21145) {
+ ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_10_T);
} else
ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_AUTO);
diff --git a/sys/dev/ic/dcreg.h b/sys/dev/ic/dcreg.h
index 5fcff7c5464..e6d3d8dc82b 100644
--- a/sys/dev/ic/dcreg.h
+++ b/sys/dev/ic/dcreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dcreg.h,v 1.26 2002/06/11 18:28:30 aaron Exp $ */
+/* $OpenBSD: dcreg.h,v 1.27 2002/10/20 16:46:27 henning Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -84,6 +84,7 @@
#define DC_TYPE_PNIC 0xA /* 82c168/82c169 PNIC I */
#define DC_TYPE_XIRCOM 0xB /* Xircom X3201 */
#define DC_TYPE_CONEXANT 0xC /* Conexant LANfinity RS7112 */
+#define DC_TYPE_21145 0xD /* Intel 21145 */
#define DC_IS_MACRONIX(x) \
(x->dc_type == DC_TYPE_98713 || \
@@ -94,7 +95,10 @@
(x->dc_type == DC_TYPE_AL981 || \
x->dc_type == DC_TYPE_AN983)
-#define DC_IS_INTEL(x) (x->dc_type == DC_TYPE_21143)
+#define DC_IS_INTEL(x) \
+ (x->dc_type == DC_TYPE_21143 || \
+ x->dc_type == DC_TYPE_21145)
+
#define DC_IS_ASIX(x) (x->dc_type == DC_TYPE_ASIX)
#define DC_IS_COMET(x) (x->dc_type == DC_TYPE_AL981)
#define DC_IS_CENTAUR(x) (x->dc_type == DC_TYPE_AN983)
diff --git a/sys/dev/mii/dcphy.c b/sys/dev/mii/dcphy.c
index 10916328794..e99bb8a1174 100644
--- a/sys/dev/mii/dcphy.c
+++ b/sys/dev/mii/dcphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dcphy.c,v 1.7 2002/05/04 11:30:06 fgsch Exp $ */
+/* $OpenBSD: dcphy.c,v 1.8 2002/10/20 16:46:28 henning Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -168,6 +168,9 @@ dcphy_attach(parent, self, aux)
break;
}
+ if (dc_sc->dc_type == DC_TYPE_21145)
+ sc->mii_capabilities = BMSR_10THDX;
+
sc->mii_capabilities &= ma->mii_capmask;
if (sc->mii_capabilities & BMSR_MEDIAMASK)
mii_phy_add_media(sc);
diff --git a/sys/dev/pci/if_dc_pci.c b/sys/dev/pci/if_dc_pci.c
index 6d0af1de47d..50df4b65d7c 100644
--- a/sys/dev/pci/if_dc_pci.c
+++ b/sys/dev/pci/if_dc_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_dc_pci.c,v 1.33 2002/06/09 05:49:35 art Exp $ */
+/* $OpenBSD: if_dc_pci.c,v 1.34 2002/10/20 16:46:28 henning Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -100,6 +100,7 @@ struct dc_type dc_devs[] = {
{ PCI_VENDOR_ACCTON, PCI_PRODUCT_ACCTON_EN1217 },
{ PCI_VENDOR_ACCTON, PCI_PRODUCT_ACCTON_EN2242 },
{ PCI_VENDOR_CONEXANT, PCI_PRODUCT_CONEXANT_RS7112 },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_21145 },
{ 0, 0 }
};
@@ -299,6 +300,15 @@ void dc_pci_attach(parent, self, aux)
dc_read_srom(sc, sc->dc_romwidth);
}
break;
+ case PCI_VENDOR_INTEL:
+ if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_21145) {
+ found = 1;
+ sc->dc_type = DC_TYPE_21145;
+ sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;
+ sc->dc_flags |= DC_REDUCED_MII_POLL;
+ dc_eeprom_width(sc);
+ dc_read_srom(sc, sc->dc_romwidth);
+ }
case PCI_VENDOR_DAVICOM:
if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_DAVICOM_DM9100 ||
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_DAVICOM_DM9102) {