summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_vge.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2006-12-04 14:35:21 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2006-12-04 14:35:21 +0000
commit6961c0f1d598184fe794e20b8ad22a9b949e5edf (patch)
treed6a51cd5257341057a5961e08113fe554f11dff8 /sys/dev/pci/if_vge.c
parent55899a0de13423b13a2121ec51128031dd5a6936 (diff)
report full/half duplex state for non-MII interfaces
ok brad@
Diffstat (limited to 'sys/dev/pci/if_vge.c')
-rw-r--r--sys/dev/pci/if_vge.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c
index 15f85660592..844a56c0055 100644
--- a/sys/dev/pci/if_vge.c
+++ b/sys/dev/pci/if_vge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vge.c,v 1.31 2006/11/23 02:00:54 brad Exp $ */
+/* $OpenBSD: if_vge.c,v 1.32 2006/12/04 14:35:20 reyk Exp $ */
/* $FreeBSD: if_vge.c,v 1.3 2004/09/11 22:13:25 wpaul Exp $ */
/*
* Copyright (c) 2004
@@ -1198,7 +1198,12 @@ vge_tick(void *xsc)
if (mii->mii_media_status & IFM_ACTIVE &&
IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) {
sc->vge_link = 1;
- ifp->if_link_state = LINK_STATE_UP;
+ if (mii->mii_media_status & IFM_FDX)
+ ifp->if_link_state = LINK_STATE_FULL_DUPLEX;
+ else if (mii->mii_media_status & IFM_HDX)
+ ifp->if_link_state = LINK_STATE_HALF_DUPLEX;
+ else
+ ifp->if_link_state = LINK_STATE_UP;
if_link_state_change(ifp);
if (!IFQ_IS_EMPTY(&ifp->if_snd))
vge_start(ifp);