summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2006-12-24 22:56:49 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2006-12-24 22:56:49 +0000
commit8766a604c1d1d194b32b8103a7441e25da89cc7a (patch)
tree94d836aa9bcaa23535790c9f72436db31a03cd93 /sys
parentcdf6b9367dd4209ca60448d12a3522fd25f88179 (diff)
Make non-autonegotiated 10baseT and 100baseTX work.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_msk.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c
index 1ab101b7b06..3aa29f7f30c 100644
--- a/sys/dev/pci/if_msk.c
+++ b/sys/dev/pci/if_msk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_msk.c,v 1.33 2006/12/24 14:34:27 kettenis Exp $ */
+/* $OpenBSD: if_msk.c,v 1.34 2006/12/24 22:56:48 kettenis Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -310,6 +310,41 @@ msk_marv_miibus_writereg(struct device *dev, int phy, int reg, int val)
void
msk_marv_miibus_statchg(struct device *dev)
{
+ struct sk_if_softc *sc_if = (struct sk_if_softc *)dev;
+ struct mii_data *mii = &sc_if->sk_mii;
+ struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
+ int gpcr;
+
+ gpcr = SK_YU_READ_2(sc_if, YUKON_GPCR);
+ gpcr &= (YU_GPCR_TXEN | YU_GPCR_RXEN);
+
+ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
+ /* Set speed. */
+ gpcr |= YU_GPCR_SPEED_DIS;
+ switch (IFM_SUBTYPE(mii->mii_media_active)) {
+ case IFM_1000_SX:
+ case IFM_1000_LX:
+ case IFM_1000_CX:
+ case IFM_1000_T:
+ gpcr |= (YU_GPCR_GIG | YU_GPCR_SPEED);
+ break;
+ case IFM_100_TX:
+ gpcr |= YU_GPCR_SPEED;
+ break;
+ }
+
+ /* Set duplex. */
+ gpcr |= YU_GPCR_DPLX_DIS;
+ if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX)
+ gpcr |= YU_GPCR_DUPLEX;
+
+ /* Disable flow control. */
+ gpcr |= YU_GPCR_FCTL_DIS;
+ gpcr |= (YU_GPCR_FCTL_TX_DIS | YU_GPCR_FCTL_RX_DIS);
+ }
+
+ SK_YU_WRITE_2(sc_if, YUKON_GPCR, gpcr);
+
DPRINTFN(9, ("msk_marv_miibus_statchg: gpcr=%x\n",
SK_YU_READ_2(((struct sk_if_softc *)dev), YUKON_GPCR)));
}