cvs commit: src/sys/compat/ndis ndis_var.h src/sys/dev/if_ndis
if_ndis.c if_ndisvar.h
Bill Paul
wpaul at FreeBSD.ORG
Thu Jan 8 23:49:39 PST 2004
> * Bill Paul <wpaul at FreeBSD.org> [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 at windriver.com | Wind River Systems
=============================================================================
<adamw> you're just BEGGING to face the moose
=============================================================================
More information about the cvs-src
mailing list