Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jan 2004 23:49:39 -0800 (PST)
From:      wpaul@FreeBSD.ORG (Bill Paul)
To:        alfred@freebsd.org (Alfred Perlstein)
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
Message-ID:  <20040109074939.28CEC16A4D0@hub.freebsd.org>
In-Reply-To: <20040109003257.GH9623@elvis.mu.org> from Alfred Perlstein at "Jan 8, 2004 04:32:57 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> * Bill Paul <wpaul@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@windriver.com | Wind River Systems
=============================================================================
              <adamw> you're just BEGGING to face the moose
=============================================================================



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040109074939.28CEC16A4D0>