For those with Intel Centrino 2200BG wireless...

Bill Paul wpaul at FreeBSD.ORG
Sun Mar 21 18:52:07 PST 2004


If you are one of the people with a laptop that has an Intel Centrino
2200BG 802.11b/g miniPCI card, you can now use this card with the
NDISulator. However, there is one big gotcha to be aware of. The
w22n51.sys driver does an alloca() of approximately 5000 bytes when
it associates with a network. This is a little unfriendly, but it
works in Windows because the Windows kernel stack is large enough to
accomodate it. The FreeBSD kernel stack is 2 pages (8192 bytes on
i386) whic is smaller than the Windows kernel size. This means the
alloca() will overflow the stack and kill the kernel.

There's two ways to deal with this problem: one is to run the offending
code in a kthread that has more than the default number of stack pages.
You're supposed to be able to create such a thread by specifying a
non-zero 'pages' argument to kthread_create().

The only problem is, vm_machdep.c is buggy and always initializes the
stack pointer for a thread using the compile-time constant KTHREAD_PAGES
rather than the dynamically selected pages value passed to kthread_create(),
so no matter how many extra stack pages you try to allocate, the alloca()
still smashes the stack.

Long story short, if you want to use the Intel 2200BG card, you need
to do one of the following:

- If you use -current, then just make sure you sync up all of your
  sources, including all of the NDISulator code and
  sys/i386/i386/vm_machdep.c, which I fixed today.

Or:

- If you use 5.2-RELEASE or 5.2.1-RELEASE, grab the latest NDISulator
  code from -current _AND_ add compile a new kernel with the following
  line added to your kernel config file:

options		KSTACK_PAGES=8


The vm_machdep fix should get propagated to all the other arches soon.

-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 freebsd-mobile mailing list