From owner-freebsd-current@FreeBSD.ORG Sat Jun 25 18:05:08 2005 Return-Path: X-Original-To: freebsd-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 6364216A41C; Sat, 25 Jun 2005 18:05:08 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.village.org (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CAC143D4C; Sat, 25 Jun 2005 18:05:07 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.3) with ESMTP id j5PI4Kgs001673; Sat, 25 Jun 2005 12:04:20 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 25 Jun 2005 12:05:54 -0600 (MDT) Message-Id: <20050625.120554.35973385.imp@bsdimp.com> To: maksim.yevmenkin@savvis.net From: "M. Warner Losh" In-Reply-To: <42BD6865.4090608@savvis.net> References: <20050625115421.GA13063@ip.net.ua> <20050625120226.GK14567@elvis.mu.org> <42BD6865.4090608@savvis.net> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: [patch] ep(4) panic 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: Sat, 25 Jun 2005 18:05:08 -0000 In message: <42BD6865.4090608@savvis.net> Maksim Yevmenkin writes: : Maxime Henrion wrote: : : > Ruslan Ermilov wrote: : > : >>On Sat, Jun 25, 2005 at 01:48:42PM +0200, Maxime Henrion wrote: : >> : >>>Ruslan Ermilov wrote: : >>> : >>>>On Fri, Jun 24, 2005 at 05:09:04PM -0700, Maksim Yevmenkin wrote: : >>>> : >>>>>Dear Hackers, : >>>>> : >>>>>my -current panics when i insert ep(4) pcmcia network adapter. following : >>>>>is the patch to fix the panic. : >>>>> : >>>>>--- if_ep_pccard.c.orig Fri Jun 10 12:04:44 2005 : >>>>>+++ if_ep_pccard.c Fri Jun 24 16:51:12 2005 : >>>>>@@ -73,6 +73,7 @@ : >>>>> struct ep_board *epb = &sc->epb; : >>>>> const char *desc; : >>>>> uint16_t result; : >>>>>+ u_char eaddr[6]; : >>>>> int error; : >>>>> : >>>>> error = ep_alloc(dev); : >>>>>@@ -120,7 +121,7 @@ : >>>>> * Newer cards supported by this device need to have their : >>>>> * MAC address set. : >>>>> */ : >>>>>- error = ep_get_macaddr(sc, (u_char *)&IFP2ENADDR(sc->ifp)); : >>>>>+ error = ep_get_macaddr(sc, eaddr); : >>>>> : >>>>> ep_free(dev); : >>>>> return (0); : >>>>> : >>>> : >>>>That's odd. You're saving the MAC address nowhere (it's reused : >>>>later). : >>> : >>>But ep_get_macaddr() does a little bit more than what its name suggests. : >>> : >> : >>I fail to see what else it does. My point, on the other hand, is : >>that we should be saving it in IFP2ENADDR here, for later reuse. : > : > : > Hmm, I apparently read the code wrong. It would be interesting to know : > if just removing the call the ep_get_macaddr() fixes the panic as well : > and lets the card work OK. The comment above the call to : > ep_get_macaddr() looks weird given that ep_get_macaddr() does nothing : > more than reading the MAC address and doesn't apparently set it. : : the way i understand it: this code is in the "probe" routine and when : its called ifp structure was not allocated/setup yet. the "attach" : routine will call "ep_attach" later that will allocate/setup ifp and : read/set mac address (once again). so, the card works just fine. : : it is interesting that my 4.x has different comment : : $FreeBSD: /repoman/r/ncvs/src/sys/dev/ep/if_ep_pccard.c,v 1.12.2.3 : 2003/10/06 02:53:51 imp Exp $ : : /* : * For some reason the 3c574 needs this. : */ : ep_get_macaddr(sc, (u_char *)&sc->arpcom.ac_enaddr); : : : perhaps the comment in -current should be changed as well? can anyone : please shed some light on this? I'll take a look into the issue. I have *ALL* the ep pccard hardware and report back. Warner