From owner-cvs-src@FreeBSD.ORG Thu Jan 8 23:49:39 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 618) id 28CEC16A4D0; Thu, 8 Jan 2004 23:49:39 -0800 (PST) In-Reply-To: <20040109003257.GH9623@elvis.mu.org> from Alfred Perlstein at "Jan 8, 2004 04:32:57 pm" To: alfred@freebsd.org (Alfred Perlstein) Date: Thu, 8 Jan 2004 23:49:39 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20040109074939.28CEC16A4D0@hub.freebsd.org> From: wpaul@FreeBSD.ORG (Bill Paul) cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/compat/ndis ndis_var.h src/sys/dev/if_ndis if_ndis.c if_ndisvar.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2004 07:49:39 -0000 > * Bill Paul [040108 02:44] wrote: > > Using these tweaks, I can now get the Broadcom BCM5701 NDIS > > driver to load and run. Unfortunately, the version I have seems > > to suffer from the same bug as the SMC 83820 driver, which is > > that it creates a spinlock during its DriverEntry() routine. > > I'm still debating the right way to deal with this. > > What problem does that present? Here are the comments in subr_ndis.c:ndis_lock() which you chose not to read: /* * Workaround for certain broken NDIS drivers. I have * encountered one case where a driver creates a spinlock * within its DriverEntry() routine, which is then destroyed * in its MiniportHalt() routine. This is a bug, because * MiniportHalt() is meant to only destroy what MiniportInit() * creates. This leads to the following problem: * DriverEntry() <- spinlock created * MiniportInit() <- NIC initialized * MiniportHalt() <- NIC halted, spinlock destroyed * MiniportInit() <- NIC initialized, spinlock not recreated * NdisAcquireSpinLock(boguslock) <- panic * To work around this, we poison the spinlock on destroy, and * if we try to re-acquire the poison pill^Wspinlock, we init * it again so subsequent calls will work. * * Drivers that behave in this way are likely not officially * certified by Microsoft, since their I would expect the * Microsoft NDIS test tool to catch mistakes like this. */ The BCM5701 driver I used came off a CD that 3Com sent me with the card a year or two ago, so it's possible they've fixed/changed the behavior. -Bill -- ============================================================================= -Bill Paul (510) 749-2329 | Senior Engineer, Master of Unix-Fu wpaul@windriver.com | Wind River Systems ============================================================================= you're just BEGGING to face the moose =============================================================================