Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Add a MIIF_FORCEANEG flag to be passed to mii_attach...
details: https://anonhg.NetBSD.org/src/rev/e08b3a0d94ad
branches: trunk
changeset: 543230:e08b3a0d94ad
user: matt <matt%NetBSD.org@localhost>
date: Thu Feb 20 00:55:21 2003 +0000
description:
Add a MIIF_FORCEANEG flag to be passed to mii_attach. This forces an
autonegotiation to take place if IFM_AUTO is selected in mii_media_set.
Make the gem driver use it. (XXX hme probably should use it but I can't
test that).
diffstat:
sys/dev/ic/gem.c | 6 +++---
sys/dev/mii/mii_physubr.c | 7 ++++---
sys/dev/mii/miivar.h | 3 ++-
3 files changed, 9 insertions(+), 7 deletions(-)
diffs (72 lines):
diff -r b26ad456606b -r e08b3a0d94ad sys/dev/ic/gem.c
--- a/sys/dev/ic/gem.c Wed Feb 19 23:55:48 2003 +0000
+++ b/sys/dev/ic/gem.c Thu Feb 20 00:55:21 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gem.c,v 1.24 2003/01/31 00:26:30 thorpej Exp $ */
+/* $NetBSD: gem.c,v 1.25 2003/02/20 00:55:21 matt Exp $ */
/*
*
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.24 2003/01/31 00:26:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.25 2003/02/20 00:55:21 matt Exp $");
#include "bpfilter.h"
@@ -259,7 +259,7 @@
gem_mifinit(sc);
mii_attach(&sc->sc_dev, mii, 0xffffffff,
- MII_PHY_ANY, MII_OFFSET_ANY, 0);
+ MII_PHY_ANY, MII_OFFSET_ANY, MIIF_FORCEANEG);
child = LIST_FIRST(&mii->mii_phys);
if (child == NULL) {
diff -r b26ad456606b -r e08b3a0d94ad sys/dev/mii/mii_physubr.c
--- a/sys/dev/mii/mii_physubr.c Wed Feb 19 23:55:48 2003 +0000
+++ b/sys/dev/mii/mii_physubr.c Thu Feb 20 00:55:21 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mii_physubr.c,v 1.34 2002/11/07 07:41:24 thorpej Exp $ */
+/* $NetBSD: mii_physubr.c,v 1.35 2003/02/20 00:55:21 matt Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.34 2002/11/07 07:41:24 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.35 2003/02/20 00:55:21 matt Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -114,7 +114,8 @@
int bmcr, anar, gtcr;
if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO) {
- if ((PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN) == 0)
+ if ((PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN) == 0 ||
+ (sc->mii_flags & MIIF_FORCEANEG))
(void) mii_phy_auto(sc, 1);
return;
}
diff -r b26ad456606b -r e08b3a0d94ad sys/dev/mii/miivar.h
--- a/sys/dev/mii/miivar.h Wed Feb 19 23:55:48 2003 +0000
+++ b/sys/dev/mii/miivar.h Thu Feb 20 00:55:21 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: miivar.h,v 1.34 2002/11/07 07:45:03 thorpej Exp $ */
+/* $NetBSD: miivar.h,v 1.35 2003/02/20 00:55:22 matt Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -150,6 +150,7 @@
#define MIIF_IS_1000X 0x0080 /* is a 1000BASE-X device */
#define MIIF_DOPAUSE 0x0100 /* advertise PAUSE capability */
#define MIIF_IS_HPNA 0x0200 /* is a HomePNA device */
+#define MIIF_FORCEANEG 0x0400 /* is a HomePNA device */
#define MIIF_INHERIT_MASK (MIIF_NOISOLATE|MIIF_NOLOOP|MIIF_AUTOTSLEEP)
Home |
Main Index |
Thread Index |
Old Index