From owner-freebsd-current@FreeBSD.ORG Sun Oct 2 10:43:12 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 243E616A41F for ; Sun, 2 Oct 2005 10:43:12 +0000 (GMT) (envelope-from fli+freebsd-current@shapeshifter.se) Received: from mx1.h3q.net (manticore.shapeshifter.se [212.37.5.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C91243D46 for ; Sun, 2 Oct 2005 10:43:11 +0000 (GMT) (envelope-from fli+freebsd-current@shapeshifter.se) Received: from localhost (localhost [127.0.0.1]) by mx1.h3q.net (Postfix) with ESMTP id D06F01A74D; Sun, 2 Oct 2005 12:43:06 +0200 (CEST) Received: from mx1.h3q.net ([127.0.0.1]) by localhost (manticore.shapeshifter.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 35238-17; Sun, 2 Oct 2005 12:43:05 +0200 (CEST) Received: from [192.168.0.94] (h4n2fls31o270.telia.com [217.208.199.4]) by mx1.h3q.net (Postfix) with ESMTP id E48481A743; Sun, 2 Oct 2005 12:43:04 +0200 (CEST) Message-ID: <433FB9B9.9020207@shapeshifter.se> Date: Sun, 02 Oct 2005 12:43:05 +0200 From: Fredrik Lindberg User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050928) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Scott Long References: <433F6018.2050900@datacomm.ch> <433F976F.6090501@samsco.org> In-Reply-To: <433F976F.6090501@samsco.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: at mail.hamnpolare.net Cc: Benjamin Lutz , current@freebsd.org Subject: Re: Linksys EG1032 rev. 3 patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2005 10:43:12 -0000 Scott Long wrote: > Benjamin Lutz wrote: > >> Hello, >> >> I picked up a Linksys EG1032 yesterday, and was surprised to see that it >> didn't work on FreeBSD 6.0-BETA5/i386. After some investigation I found >> out that apparently Linksys has silently changed the chip on the card. >> >> The EG1032 is a standard 32bit PCI gigabit ethernet card. Two drivers >> already support a card by that name, according to the manpages and >> hardware notes: >> >> nge(4), which works with National Semiconductor DP83820 / DP83821 >> chips. >> >> sk(4), which works with SysKonnect SK-984x and SK-982x chips. >> >> Now, this EG1032 I got here, marked as "rev. 3", comes with a Realtek >> RTL8169S chip. Unfortunately, it seems that the device ID was not >> changed, it is still 0x1032, which made the sk(4) driver try and fail to >> attach to the card. >> >> I got the card working with the two patches below. >> >> Cheers >> Benjamin >> >> >> --- sys/dev/re/if_re.c.orig Sun Oct 2 05:31:06 2005 >> +++ sys/dev/re/if_re.c Sun Oct 2 05:34:02 2005 >> @@ -173,6 +173,8 @@ >> "RealTek 8110S Single-chip Gigabit Ethernet" }, >> { COREGA_VENDORID, COREGA_DEVICEID_CGLAPCIGT, RL_HWREV_8169S, >> "Corega CG-LAPCIGT (RTL8169S) Gigabit Ethernet" }, >> + { LINKSYS_VENDORID, LINKSYS_DEVICEID_EG1032, RL_HWREV_8169S, >> + "Linksys EG1032 (RTL8169S) Gigabit Ethernet" }, >> { 0, 0, 0, NULL } >> }; >> >> >> --- sys/pci/if_rlreg.h.orig Sun Oct 2 05:35:58 2005 >> +++ sys/pci/if_rlreg.h Sun Oct 2 05:38:54 2005 >> @@ -826,6 +826,16 @@ >> #define COREGA_DEVICEID_CGLAPCIGT 0xc107 >> >> /* >> + * Linksys vendor ID >> + */ >> +#define LINKSYS_VENDORID 0x1737 >> + >> +/* >> + * Linksys EG1032 device ID >> + */ >> +#define LINKSYS_DEVICEID_EG1032 0x1032 >> + >> +/* >> * Peppercon vendor ID >> */ >> #define PEPPERCON_VENDORID 0x1743 >> >> > > Sounds like the if_sk driver needs to be made more intelligent so that > it doesn't try to claim this card, yes? > Something like this... Index: sys/pci/if_sk.c =================================================================== RCS file: /home/ncvs/src/sys/pci/if_sk.c,v retrieving revision 1.110 diff -u -r1.110 if_sk.c --- sys/pci/if_sk.c 16 Sep 2005 11:11:51 -0000 1.110 +++ sys/pci/if_sk.c 2 Oct 2005 09:55:54 -0000 @@ -143,39 +143,46 @@ { VENDORID_SK, DEVICEID_SK_V1, + -1, "SysKonnect Gigabit Ethernet (V1.0)" }, { VENDORID_SK, DEVICEID_SK_V2, + -1, "SysKonnect Gigabit Ethernet (V2.0)" }, { VENDORID_MARVELL, DEVICEID_SK_V2, + -1, "Marvell Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_BELKIN_5005, + -1, "Belkin F5D5005 Gigabit Ethernet" }, { VENDORID_3COM, DEVICEID_3COM_3C940, + -1, "3Com 3C940 Gigabit Ethernet" }, { VENDORID_LINKSYS, DEVICEID_LINKSYS_EG1032, + 0x12, "Linksys EG1032 Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE530T, + -1, "D-Link DGE-530T Gigabit Ethernet" }, - { 0, 0, NULL } + { 0, 0, 0, NULL } }; static int skc_probe(device_t); @@ -1311,7 +1318,8 @@ while(t->sk_name != NULL) { if ((pci_get_vendor(dev) == t->sk_vid) && - (pci_get_device(dev) == t->sk_did)) { + (pci_get_device(dev) == t->sk_did) && + (pci_get_revid(dev) == t->sk_rev || t->sk_rev == -1)) { device_set_desc(dev, t->sk_name); return (BUS_PROBE_DEFAULT); } Index: sys/pci/if_skreg.h =================================================================== RCS file: /home/ncvs/src/sys/pci/if_skreg.h,v retrieving revision 1.29 diff -u -r1.29 if_skreg.h --- sys/pci/if_skreg.h 10 Jun 2005 16:49:23 -0000 1.29 +++ sys/pci/if_skreg.h 2 Oct 2005 09:55:55 -0000 @@ -1300,6 +1300,7 @@ struct sk_type { u_int16_t sk_vid; u_int16_t sk_did; + int16_t sk_rev; char *sk_name; };