kern/120915: [de] [patch] GENERIC does not boot: if_de is broken
John Baldwin
jhb at FreeBSD.org
Thu Apr 3 21:00:11 UTC 2008
The following reply was made to PR kern/120915; it has been noted by GNATS.
From: John Baldwin <jhb at freebsd.org>
To: Peter Much <pmc at citylink.dinoex.sub.org>
Cc: bug-followup at freebsd.org
Subject: Re: kern/120915: [de] [patch] GENERIC does not boot: if_de is broken
Date: Thu, 3 Apr 2008 16:53:22 -0400
On Thursday 27 March 2008 07:31:48 pm Peter Much wrote:
> On Wed, Mar 26, 2008 at 05:01:24PM -0400, John Baldwin wrote:
> ! This patch is a slight variant on the above and other places in the driver
use
> ! the DEVICEPROBE test to determine if the mediaselect testpacket bit is
being
> ! done:
>
> I tested this (still with 6.3-RELEASE-p1), it compiles, but, sorry to
> say, this one does panick on attach like before. (I did not yet check
> further for reasons like what this DEVICEPROBE value is supposed to
> contain.)
Try this instead then. It keeps DEVICEPROBE set slightly longer and shouldn't
clear it until BPF is fully setup.
Index: if_de.c
===================================================================
RCS file: /usr/cvs/src/sys/dev/de/if_de.c,v
retrieving revision 1.183
diff -u -r1.183 if_de.c
--- if_de.c 7 Jun 2007 00:28:47 -0000 1.183
+++ if_de.c 3 Apr 2008 20:51:51 -0000
@@ -4053,7 +4053,8 @@
/*
* bounce a copy to the bpf listener, if any.
*/
- BPF_MTAP(sc->tulip_ifp, m);
+ if (!(sc->tulip_flags & TULIP_DEVICEPROBE))
+ BPF_MTAP(sc->tulip_ifp, m);
/*
* The descriptors have been filled in. Now get ready
@@ -4437,13 +4438,16 @@
ifmedia_init(&sc->tulip_ifmedia, 0,
tulip_ifmedia_change,
tulip_ifmedia_status);
- sc->tulip_flags &= ~TULIP_DEVICEPROBE;
tulip_ifmedia_add(sc);
tulip_reset(sc);
TULIP_UNLOCK(sc);
ether_ifattach(sc->tulip_ifp, sc->tulip_enaddr);
+
+ TULIP_LOCK(sc);
+ sc->tulip_flags &= ~TULIP_DEVICEPROBE;
+ TULIP_UNLOCK(sc);
}
/* Release memory for a single descriptor ring. */
--
John Baldwin
More information about the freebsd-bugs
mailing list