From owner-freebsd-stable@FreeBSD.ORG Mon May 8 05:54:25 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E8B8416A419 for ; Mon, 8 May 2006 05:54:25 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E2D743D53 for ; Mon, 8 May 2006 05:54:23 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by nz-out-0102.google.com with SMTP id i11so1084784nzi for ; Sun, 07 May 2006 22:54:22 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=ZpprkwilkVA4Z0P2z6IvdWiFUDmBFehFTnQPjU/E5wGx7L+lTLi5PleMobLM4wmoOxcI/HbeJTg+dsxboX2RW0vg3V+46lmEf5VW56O9PrOVpvk3iWGzxoOlbeJoZdij2ZWhTC25qm0pWCFrM5BBzwXf7CRK1AZd6rBgn5RTYRk= Received: by 10.36.250.10 with SMTP id x10mr2945081nzh; Sun, 07 May 2006 22:54:22 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.gmail.com with ESMTP id 10sm3737645nzo.2006.05.07.22.54.21; Sun, 07 May 2006 22:54:22 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id k485rg6P003063 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 May 2006 14:53:42 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id k485rfcX003062; Mon, 8 May 2006 14:53:41 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Mon, 8 May 2006 14:53:41 +0900 From: Pyun YongHyeon To: Ganbold Message-ID: <20060508055341.GC1239@cdnetworks.co.kr> References: <20060327185142.GC24315@soaustin.net> <200603271848.19010.joao@matik.com.br> <200603280221.28996.pieter@degoeje.nl> <20060328020840.GA8189@cdnetworks.co.kr> <20060328034846.GA81006@0lsen.net> <20060328142215.GC65098@freebie.xs4all.nl> <20060329104842.GA12679@cdnetworks.co.kr> <445EC5FA.10103@micom.mng.net> <20060508045559.GA1239@cdnetworks.co.kr> <445ED65C.1010703@micom.mng.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <445ED65C.1010703@micom.mng.net> User-Agent: Mutt/1.4.2.1i Cc: freebsd-stable@FreeBSD.ORG Subject: Re: new sk driver [was: nve timeout (and down) regression?] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2006 05:54:26 -0000 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, May 08, 2006 at 02:25:48PM +0900, Ganbold wrote: > Pyun YongHyeon wrote: > >On Mon, May 08, 2006 at 01:15:54PM +0900, Ganbold wrote: > > > Pyun, > > > > > > ... > > > Is this NIC supported by if_sk driver? > > > > > > >Hmm, It seems that the NIC is SysKonnect V2.0(SK98XX2) which is > >supposed to work with sk(4). Did it ever work with sk(4)? > > > No, it is new server and it came with such additional NIC. > >I see there is differences between sk(4) and Linux skge driver > >in determining physical media type. It seems OpenBSD also > >used Linux skge approach. > > > I'll try to take a look at linux/openbsd drivers. > How about attached one? It's not tested but it may help your situation. > Ganbold > > > thanks, > > > > > > Ganbold > > > > > > > > -- Regards, Pyun YongHyeon --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="if_sk.media.patch" --- if_sk.c.orig Thu May 4 10:27:39 2006 +++ if_sk.c Mon May 8 14:48:33 2006 @@ -1604,14 +1604,15 @@ } } else { if (sc_if->sk_phytype < SK_PHYTYPE_MARV_COPPER && - sc->sk_pmd == IFM_1000_T) { + sc->sk_pmd != 'S') { /* not initialized, punt */ sc_if->sk_phytype = SK_PHYTYPE_MARV_COPPER; + sc->sk_coppertype = 1; } sc_if->sk_phyaddr = SK_PHYADDR_MARV; - if (sc->sk_pmd != IFM_1000_T && sc->sk_pmd != IFM_1000_CX) + if (!(sc->sk_coppertype)) sc_if->sk_phytype = SK_PHYTYPE_MARV_FIBER; } @@ -1788,31 +1789,12 @@ } /* Read and save physical media type */ - switch(sk_win_read_1(sc, SK_PMDTYPE)) { - case SK_PMD_1000BASESX: - sc->sk_pmd = IFM_1000_SX; - break; - case SK_PMD_1000BASELX: - sc->sk_pmd = IFM_1000_LX; - break; - case SK_PMD_1000BASECX: - sc->sk_pmd = IFM_1000_CX; - break; - case SK_PMD_1000BASETX: - sc->sk_pmd = IFM_1000_T; - break; - default: - if (SK_YUKON_FAMILY(sc->sk_type) && (sk_win_read_1(sc, SK_EPROM1) - & 0xF) < SK_PHYTYPE_MARV_COPPER) { - /* not initialized, punt */ - sc->sk_pmd = IFM_1000_T; - break; - } - device_printf(dev, "unknown media type: 0x%x\n", - sk_win_read_1(sc, SK_PMDTYPE)); - error = ENXIO; - goto fail; - } + sc->sk_pmd = sk_win_read_1(sc, SK_PMDTYPE); + + if (sc->sk_pmd == 'T' || sc->sk_pmd == '1') + sc->sk_coppertype = 1; + else + sc->sk_coppertype = 0; /* Determine whether to name it with VPD PN or just make it up. * Marvell Yukon VPD PN seems to freqently be bogus. */ @@ -3722,17 +3704,10 @@ phy = SK_GPHY_INT_POL_HI | SK_GPHY_DIS_FC | SK_GPHY_DIS_SLEEP | SK_GPHY_ENA_XC | SK_GPHY_ANEG_ALL | SK_GPHY_ENA_PAUSE; - switch(sc_if->sk_softc->sk_pmd) { - case IFM_1000_SX: - case IFM_1000_LX: - phy |= SK_GPHY_FIBER; - break; - - case IFM_1000_CX: - case IFM_1000_T: + if (sc->sk_coppertype) phy |= SK_GPHY_COPPER; - break; - } + else + phy |= SK_GPHY_FIBER; SK_IF_WRITE_4(sc_if, 0, SK_GPHY_CTRL, phy | SK_GPHY_RESET_SET); DELAY(1000); --- if_skreg.h.orig Tue May 2 11:12:42 2006 +++ if_skreg.h Mon May 8 14:48:33 2006 @@ -1535,6 +1535,7 @@ u_int32_t sk_rboff; /* RAMbuffer offset */ u_int32_t sk_ramsize; /* amount of RAM on NIC */ u_int32_t sk_pmd; /* physical media type */ + u_int32_t sk_coppertype; u_int32_t sk_intrmask; int sk_int_mod; int sk_int_ticks; --EVF5PPMfhYS0aIcm--