Date: Mon, 28 Aug 2006 08:08:27 -0400 (EDT) From: "Brian A. Seklecki" <lavalamp@spiritual-machines.org> To: Oleg Bulyzhin <oleg@freebsd.org> Cc: netops@collaborativefusion.com, Gleb Smirnoff <glebius@freebsd.org>, freebsd-current@freebsd.org Subject: Re: Dell PowerEdge 850 bge(4) RELENG_6 (WAS: Re: bge(4) problem) Message-ID: <20060828080516.A65578@arbitor.digitalfreaks.org> In-Reply-To: <20060818065340.GA42776@lath.rinet.ru> References: <43767.150.101.159.26.1140420612.squirrel@mailbox.TU-Berlin.DE> <20060720104238.L8726@arbitor.digitalfreaks.org> <20060807100622.GY96644@cell.sick.ru> <20060810160126.E55918@arbitor.digitalfreaks.org> <20060816191152.J69548@arbitor.digitalfreaks.org> <20060818065340.GA42776@lath.rinet.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
>>>
>>> ~BAS
>>>
>
> Could you please try attached patch? (can be applied to -current or releng_6).
>
Yes I confirm that this seems to facilitate proper speed/duplex
negotiation. I will beat up the driver a bit now with some aggressive NFS
work.
~BAS
[-- Attachment #2 --]
Index: if_bge.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/bge/if_bge.c,v
retrieving revision 1.137
diff -u -r1.137 if_bge.c
--- if_bge.c 17 Aug 2006 09:53:04 -0000 1.137
+++ if_bge.c 18 Aug 2006 06:41:18 -0000
@@ -3226,17 +3226,19 @@
static int
bge_ifmedia_upd(struct ifnet *ifp)
{
- struct bge_softc *sc;
+ struct bge_softc *sc = ifp->if_softc;
struct mii_data *mii;
struct ifmedia *ifm;
- sc = ifp->if_softc;
+ BGE_LOCK(sc);
ifm = &sc->bge_ifmedia;
/* If this is a 1000baseX NIC, enable the TBI port. */
if (sc->bge_tbi) {
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
+ if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) {
+ BGE_UNLOCK(sc);
return (EINVAL);
+ }
switch(IFM_SUBTYPE(ifm->ifm_media)) {
case IFM_AUTO:
/*
@@ -3268,8 +3270,10 @@
}
break;
default:
+ BGE_UNLOCK(sc);
return (EINVAL);
}
+ BGE_UNLOCK(sc);
return (0);
}
@@ -3283,6 +3287,7 @@
}
mii_mediachg(mii);
+ BGE_UNLOCK(sc);
return (0);
}
@@ -3292,11 +3297,10 @@
static void
bge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
{
- struct bge_softc *sc;
+ struct bge_softc *sc = ifp->if_softc;
struct mii_data *mii;
- sc = ifp->if_softc;
-
+ BGE_LOCK(sc);
if (sc->bge_tbi) {
ifmr->ifm_status = IFM_AVALID;
ifmr->ifm_active = IFM_ETHER;
@@ -3305,6 +3309,7 @@
ifmr->ifm_status |= IFM_ACTIVE;
else {
ifmr->ifm_active |= IFM_NONE;
+ BGE_UNLOCK(sc);
return;
}
ifmr->ifm_active |= IFM_1000_SX;
@@ -3312,6 +3317,7 @@
ifmr->ifm_active |= IFM_HDX;
else
ifmr->ifm_active |= IFM_FDX;
+ BGE_UNLOCK(sc);
return;
}
@@ -3319,6 +3325,8 @@
mii_pollstat(mii);
ifmr->ifm_active = mii->mii_media_active;
ifmr->ifm_status = mii->mii_media_status;
+
+ BGE_UNLOCK(sc);
}
static int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060828080516.A65578>
