From owner-freebsd-hardware@FreeBSD.ORG Mon Dec 29 02:29:31 2003 Return-Path: Delivered-To: freebsd-hardware@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BB52E16A4CE for ; Mon, 29 Dec 2003 02:29:31 -0800 (PST) Received: from iscan1.intra.oki.co.jp (okigate.oki.co.jp [202.226.91.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF53D43D46 for ; Mon, 29 Dec 2003 02:29:28 -0800 (PST) (envelope-from yamamoto436@oki.com) Received: from aoi.okilab.oki.co.jp (localhost.localdomain [127.0.0.1]) by iscan1.intra.oki.co.jp (8.9.3/8.9.3) with SMTP id TAA10492 for ; Mon, 29 Dec 2003 19:29:27 +0900 Received: (qmail 25622 invoked from network); 29 Dec 2003 19:29:26 +0900 Received: from tulip.okilab.oki.co.jp (172.24.23.187) by aoi.okilab.oki.co.jp with SMTP; 29 Dec 2003 19:29:26 +0900 Received: from localhost (tulip [172.24.23.187])hBTAVqG5071086; Mon, 29 Dec 2003 19:31:52 +0900 (JST) (envelope-from yamamoto436@oki.com) Date: Mon, 29 Dec 2003 19:31:52 +0900 (JST) Message-Id: <20031229.193152.104097268.yamamoto436@oki.com> To: ohoyer@gaff.hhhr.ision.net From: Hideki Yamamoto In-Reply-To: <20031229100720.X65076@gaff.hhhr.ision.net> References: <20031229.150542.41696894.yamamoto436@oki.com> <20031229100720.X65076@gaff.hhhr.ision.net> X-Mailer: Mew version 2.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hardware@freebsd.org Subject: Re: Link up problem between 1000base-SX(bge) and SUN X-BeenThere: freebsd-hardware@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: General discussion of FreeBSD hardware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2003 10:29:31 -0000 Hello again, Thank you for your reply. From: Olaf Hoyer Message-ID: <20031229100720.X65076@gaff.hhhr.ision.net> > On Mon, 29 Dec 2003, Hideki Yamamoto wrote: > > > > > Hello, > > > > I'm having a problem about link up between 1000base-SX(bge) and SUN. > > > > I tried yesterday's 4.9-stable on a FreeBSD box with two 3COM > > 3C996-SXs and two onboard BMC5703 chips. Two 3COM 3C996-SX board link > > went up, but the other side, a 1000base-SX I/F on SUN F280 did not go > > up. When doing ping command to SUN from FreeBSD box, LED on 3C996 > > were brinking but nothing happened to SUN board. I changed bge0 to > > bge2, but the situation was the same. Hardware diagram is as follows. > > bge0 can send or receive packates to the router or another PC with > > intel SX board. > > > > Is this related to AUTO negotiation? > > Hi! > > Sometimes SUN cards are a bit picky. > But, lets start gathering additional data: > > I assume you have a ge-card in, or which card are you using in the 280? > The man page says that autoneg is performed, but chooses : Yes, I have three 'ge' cards in one F280R. > > The GEM PCS is capable of performing auto-negotiation > using the remote (or link partner) link end and receives the > capabilities > of the remote end. It selects the highest common demonina- > tor mode of operation based on priorities. The ge driver > also supports forced-mode operation under which the driver > selects the mode of operation > > > > > I assume that the interface is plumbed, and shows up in ifconfig as > well, could you also post the snippet of the ifconfig entry? The machine is in a data center now. I cannot type ifconfig now. > > I cannot find any parameters about AUTO negotiation in 'bge' driver > > source. I checked Linux 2.4.22 kernel source and have found the > > several code about auto negotiation. I wonder if a linux box works > > well. I do not need full support of auto negotiation, but sample code > > that handles auto negotiation with Solaris machine. > > in bge(4) it is stated, that the bge's also support autoneg over a > cross-cable-config (which this basically is). > But: have a look at the link0 option there (can be adjusted via > ifconfig) normally, autoneg shall do, but over a cross-cable you need to > designate one end being master, other end being slave. > > My suspicion is, that autoneg procedure somewhere fails, and you should > try to set the bge to be link master. > Thank you for your advice. I am reading both FreeBSD and Linux driver. The following seems the definition of link master of Linux kernel source code in 'tg3.h'. -------------- |/* Tigon3 specific PHY MII registers. */ |#define TG3_BMCR_SPEED1000 0x0040 | |#define MII_TG3_CTRL 0x09 /* 1000-baseT control register */ |#define MII_TG3_CTRL_ADV_1000_HALF 0x0100 |#define MII_TG3_CTRL_ADV_1000_FULL 0x0200 |#define MII_TG3_CTRL_AS_MASTER 0x0800 |#define MII_TG3_CTRL_ENABLE_AS_MASTER 0x1000 -------------- In 'tg3.c', the following code seems to set the link master. ------------------------------------------ | if (tp->link_config.advertising & | (ADVERTISED_1000baseT_Half | ADVERTISED_1000baseT_Full)) { | new_adv = 0; | - | - | if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY) && | (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 || | tp->pci_chip_rev_id == CHIPREV_ID_5701_B0)) | new_adv |= (MII_TG3_CTRL_AS_MASTER | | MII_TG3_CTRL_ENABLE_AS_MASTER); | tg3_writephy(tp, MII_TG3_CTRL, new_adv); | - | - | } ------------------------------------------ In 'if_bge.c' in FreeBSD kernel, the following function seems problem, because it checks only IFM_1000_TX. I feel that IFM_1000_SX also have to be checked. I have another strange thing about 'dmesg' I showed in the original mail. Both bge0 and bge1 which specifiy SX cards did not have miibus or PHY in dmesg. Is this related to the link-up problem? ------------------------------------------ |static void |bge_miibus_statchg(dev) | device_t dev; |{ | struct bge_softc *sc; | struct mii_data *mii; | | sc = device_get_softc(dev); | mii = device_get_softc(sc->bge_miibus); | | BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE); | if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_TX) { | BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII); | } else { | BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII); | } | | if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) { | BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); | } else { | BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); | } | | return; |} ---------------------- > Just my 0.02 EUR > -- > Olaf Hoyer ohoyer@gaff.hhhr.ision.net > Fuerchterliche Erlebniss geben zu raten, > ob der, welcher sie erlebt, nicht etwas Fuerchterliches ist. > (Nietzsche, Jenseits von Gut und Boese) Regards, Hideki Yamammoto ----------------------------------------------------------------- Hideki YAMAMOTO | Broadband Media Solutions Department | E-mail: yamamoto436@oki.com Broadband Media Company | Tel: +81-3-3455-0870 Oki Electric Industry Co., Ltd. | FAX: +81-3-3798-7670