From owner-freebsd-net@FreeBSD.ORG Sat Jun 30 09:30:09 2007 Return-Path: X-Original-To: freebsd-net@hub.freebsd.org Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7AFF016A400 for ; Sat, 30 Jun 2007 09:30:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 5EE6613C45A for ; Sat, 30 Jun 2007 09:30:09 +0000 (UTC) (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 l5U9U8EH018500 for ; Sat, 30 Jun 2007 09:30:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5U9U8gT018499; Sat, 30 Jun 2007 09:30:08 GMT (envelope-from gnats) Date: Sat, 30 Jun 2007 09:30:08 GMT Message-Id: <200706300930.l5U9U8gT018499@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: Pyun YongHyeon Cc: Subject: Re: kern/112710: [re] if_re driver detects incorrect b243a405a405 MAC address on SMC9452TX-1 pci gigabit cards X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Pyun YongHyeon List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2007 09:30:09 -0000 The following reply was made to PR kern/112710; it has been noted by GNATS. From: Pyun YongHyeon To: W Forms Cc: freebsd-net@FreeBSD.org, bug-followup@FreeBSD.org Subject: Re: kern/112710: [re] if_re driver detects incorrect b243a405a405 MAC address on SMC9452TX-1 pci gigabit cards Date: Sat, 30 Jun 2007 18:01:15 +0900 --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jun 29, 2007 at 08:20:08PM +0000, W Forms wrote: > The following reply was made to PR kern/112710; it has been noted by GNATS. > > From: W Forms > To: bug-followup@FreeBSD.org > Cc: > Subject: Re: kern/112710: [re] if_re driver detects incorrect b243a405a405 MAC address on SMC9452TX-1 pci gigabit cards > Date: Fri, 29 Jun 2007 22:16:23 +0200 > > Today I run a test using the "NetBSD Live! 2007" live-CD, which is > apparently based on NetBSD 4.0 BETA. > NetBSD also uses the re driver for these cards. Upon boot all the "5 > bad cards" are detected as RealTek 8169SB gigabit adapters and > believe or not, each and every single adapter uses its own correct > MAC address. > SO whatever the problem is in the FreeBSD and OpenBSD re driver, the > NetBSD guys have already solved it. Or, they didn't scew it up in the > first place! :-) > Either way, it might be worthwile talking to them about this defect > or having a thorough look at their re driver code (or the code of any > related networking module). > I also run a test with a Gentoo Linux Live CD which also uses the > correct MAC addresses. > Unfortunately this is where my abilities stop. > > Somebody, Please! > You don't have to reinvent the solution, NetBSD already/still has the > answer. > How about attached patch? -- Regards, Pyun YongHyeon --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="re.eeprom.patch" Index: if_re.c =================================================================== RCS file: /home/ncvs/src/sys/dev/re/if_re.c,v retrieving revision 1.90 diff -u -r1.90 if_re.c --- if_re.c 16 Jun 2007 02:54:19 -0000 1.90 +++ if_re.c 30 Jun 2007 08:58:13 -0000 @@ -1211,10 +1211,10 @@ hw_rev++; } - sc->rl_eewidth = 6; + sc->rl_eewidth = RL_9356_ADDR_LEN; re_read_eeprom(sc, (caddr_t)&re_did, 0, 1); if (re_did != 0x8129) - sc->rl_eewidth = 8; + sc->rl_eewidth = RL_9346_ADDR_LEN; /* * Get station address from the EEPROM. Index: ../../pci/if_rlreg.h =================================================================== RCS file: /home/ncvs/src/sys/pci/if_rlreg.h,v retrieving revision 1.65 diff -u -r1.65 if_rlreg.h --- ../../pci/if_rlreg.h 18 Apr 2007 00:40:43 -0000 1.65 +++ ../../pci/if_rlreg.h 30 Jun 2007 08:58:13 -0000 @@ -312,6 +312,8 @@ #define RL_EEMODE_WRITECFG (0x80|0x40) /* 9346 EEPROM commands */ +#define RL_9346_ADDR_LEN 6 /* 93C46 1K: 128x16 */ +#define RL_9356_ADDR_LEN 8 /* 93C56 2K: 256x16 */ #define RL_9346_WRITE 0x5 #define RL_9346_READ 0x6 --45Z9DzgjV8m4Oswq--