From owner-freebsd-net@FreeBSD.ORG Fri Aug 21 22:20:13 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8656C106568B for ; Fri, 21 Aug 2009 22:20:13 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id 380D78FC0C for ; Fri, 21 Aug 2009 22:20:13 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 3so638488qwe.7 for ; Fri, 21 Aug 2009 15:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:subject :message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=zkAXBGtH+AF8nE5pqJcWFLk9yaLFadzlFHG4f2j/Brc=; b=phIJLhBPsP9D54TuoDS6JAERGGIFagUND4cw8athMrUCYUrjBoZaN2QThDuMknEvZ1 RTAg54fVfPq/hN9KHDUJgB/dJUNnX85oeF5vVELztMtmyoYjEixIqGVfNT+Lgic/bwBL cy0b1YAaw++jm70j8G7a+qdKt03TS2aZRwLnA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=N/HBy/Vp6oWIE3qMq5htyzya1wUpdRxsaRO86i05+ECGwf3k5w3O0Rff8s1Z0k7kev EB3dd4RkspIwW7KesiafyHeeH8x38+6MECsYjaBv/ICz1eTJMtk65qi0h2Jk1ib8gVd2 3Us3ebOONacoEbxtXj9cZaoJ3+ftPYXuNKHus= Received: by 10.224.118.142 with SMTP id v14mr1248964qaq.41.1250893212523; Fri, 21 Aug 2009 15:20:12 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 2sm2695104qwi.23.2009.08.21.15.20.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 21 Aug 2009 15:20:11 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 21 Aug 2009 15:19:32 -0700 From: Pyun YongHyeon Date: Fri, 21 Aug 2009 15:19:32 -0700 To: freebsd-net@freebsd.org Message-ID: <20090821221932.GE1262@michelle.cdnetworks.com> References: <20090821142039.GA40018@traktor.dnepro.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090821142039.GA40018@traktor.dnepro.net> User-Agent: Mutt/1.4.2.3i Subject: Re: D-Link DGE-560SX (Marvell 88E8061-based) doesn't see link X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2009 22:20:13 -0000 On Fri, Aug 21, 2009 at 05:20:39PM +0300, Eugene Perevyazko wrote: > Hello, Freebsd-net subscribers! > > This is on 7.2-Stable. > I've got a D-Link DGE-560SX GigE fiber adapter. It's Marvell 88E8061 so > I hoped it will work as msk(4). > D-Link has changed PCI Id for the chip: > none1@pci0:1:0:0: class=0x020000 card=0x4b021186 chip=0x4b021186 rev=0x10 > hdr=0x00 > vendor = 'D-Link System Inc' > device = 'DGE-560SX PCIe Gigabit Ethernet Adapter' > class = network > subclass = ethernet > > > So I've patched the driver to recognize new IDs. > Your patch looks to me. [...] > Then the driver recognizes the card: > > mskc0: port 0x4000-0x40ff mem 0xdc100000-0xdc103fff irq 16 at device 0.0 on pci1 > msk0: on mskc0 > msk0: Ethernet address: 00:21:91:52:4f:09 > miibus1: on msk0 > e1000phy0: PHY 0 on miibus1 > e1000phy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This part is problem, you have finer media, so you should have just 1000baseSX. > mskc0: [FILTER] > > Now I'm stuck because it doesn't see link. > # ifconfig msk0 up > # ifconfig -m msk0 > msk0: flags=8843 metric 0 mtu 1500 > options=11a > capabilities=11a > ether 00:21:91:52:4f:09 > media: Ethernet autoselect (100baseTX ) > status: no carrier > supported media: > media autoselect > media 1000baseTX mediaopt full-duplex > media 1000baseTX > media 100baseTX mediaopt full-duplex > media 100baseTX > media 10baseT/UTP mediaopt full-duplex > media 10baseT/UTP > media none > > The adapter is definitely not broken, I've tested it on Win and there it works > normally. Also on Win it has no speed/duplex settings, while msk driver allows > to change media. > ATM there is no easy/clean way to pass driver specific data to mii layer in FreeBSD so e1000phy(4) incorrectly thinks it found copper PHY. Marvell PHYs seem to have no reliable way to know configured media type of PHY hardware unless parent driver(msk) gives hint to it. If you have just 1 NIC which uses e1000phy(4) on your system, modify e1000phy(4) to force it having fiber media by inserting the following line around line 114 in e1000phy.c. sc->mii_flags |= MIIF_HAVEFIBER; > I've also tried Marvell's binary if_myk driver, but it doesn't know about d-link. > > Can anyone propose something to get it working? > > -- > Eugene Perevyazko