From owner-freebsd-bugs@FreeBSD.ORG Wed Mar 22 16:50:59 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D68C16A43E for ; Wed, 22 Mar 2006 16:50:59 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A64943D91 for ; Wed, 22 Mar 2006 16:50:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k2MGoG0S013393 for ; Wed, 22 Mar 2006 16:50:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k2MGoGuQ013392; Wed, 22 Mar 2006 16:50:16 GMT (envelope-from gnats) Resent-Date: Wed, 22 Mar 2006 16:50:16 GMT Resent-Message-Id: <200603221650.k2MGoGuQ013392@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Devon H. O'Dell" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 09F2416A422 for ; Wed, 22 Mar 2006 16:45:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4653543D58 for ; Wed, 22 Mar 2006 16:45:12 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k2MGjC9H081177 for ; Wed, 22 Mar 2006 16:45:12 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k2MGjCOr081173; Wed, 22 Mar 2006 16:45:12 GMT (envelope-from nobody) Message-Id: <200603221645.k2MGjCOr081173@www.freebsd.org> Date: Wed, 22 Mar 2006 16:45:12 GMT From: "Devon H. O'Dell" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: misc/94833: [patch] Make BGE_FAKE_AUTONEG a system tunable X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Mar 2006 16:50:59 -0000 >Number: 94833 >Category: misc >Synopsis: [patch] Make BGE_FAKE_AUTONEG a system tunable >Confidential: no >Severity: non-critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 22 16:50:15 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Devon H. O'Dell >Release: 6.1-PRERELEASE >Organization: iXsystems >Environment: FreeBSD maria.fdev.iXsystems.com 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #3: Sat Mar 11 15:33:24 PST 2006 root@maria.fdev.iXsystems.com:/usr/src/sys/amd64/compile/BLADE amd64 >Description: As is apparent by the commit logs surrounding BGE_FAKE_AUTONEG, bge(4) is weird, especially on Intel / IBM blade platforms. This patch makes the BGE_FAKE_AUTONEG a tunable. This patch allows one to change the behavior of the driver pre-boot. Originally, this was not useful due to issues with the switch packaged with the blade; however, the new switch package for the blade doesn't have the same quirkiness factor, so it should be OK. NOTE: This patch was made for DragonFly BSD by Sepherosa Ziehau -- please credit him for the patch. >How-To-Repeat: Boot a SBX82 blade with GENERIC and try to access the network. Fail miserably. >Fix: Original patch: http://leaf.dragonflybsd.org/~sephe/bge_fake.diff Patch against -HEAD: http://www.sitetronics.com/~dodell/bge_fix.patch -- begin patch -- Index: if_bge.c =================================================================== RCS file: /opt/df_cvs/src/sys/dev/netif/bge/if_bge.c,v retrieving revision 1.46 diff -u -p -r1.46 if_bge.c --- if_bge.c 22 Aug 2005 18:29:52 -0000 1.46 +++ if_bge.c 5 Sep 2005 09:49:52 -0000 @@ -257,6 +257,9 @@ static void bge_miibus_statchg(device_t) static void bge_reset(struct bge_softc *); +static int bge_fake_autoneg = 0; +TUNABLE_INT("hw.bge.fake_autoneg", &bge_fake_autoneg); + static device_method_t bge_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bge_probe), @@ -2550,13 +2553,13 @@ bge_ifmedia_upd(struct ifnet *ifp) return(EINVAL); switch(IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: -#ifndef BGE_FAKE_AUTONEG /* * The BCM5704 ASIC appears to have a special * mechanism for programming the autoneg * advertisement registers in TBI mode. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5704) { + if (!bge_fake_autoneg && + sc->bge_asicrev == BGE_ASICREV_BCM5704) { uint32_t sgdig; CSR_WRITE_4(sc, BGE_TX_TBI_AUTONEG, 0); @@ -2569,7 +2572,6 @@ bge_ifmedia_upd(struct ifnet *ifp) DELAY(5); CSR_WRITE_4(sc, BGE_SGDIG_CFG, sgdig); } -#endif /* !BEG_FAKE_AUTONEG */ break; case IFM_1000_SX: if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) { -- end patch -- >Release-Note: >Audit-Trail: >Unformatted: