Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jul 2004 07:01:55 -0300
From:      Joey Mingrone <joey@mingrone.org>
To:        freebsd-hardware@freebsd.org
Subject:   Re: NDISulator with Intel 2200 b/g on 5.2.1-RELEASE-p9
Message-ID:  <200407180701.55899.joey@mingrone.org>
In-Reply-To: <200407180409.55686.joey@mingrone.org>
References:  <200407180409.55686.joey@mingrone.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On July 18, 2004 04:09, Joey Mingrone wrote:
> Hi all,
>
> Here are the steps I took:
>
> I built a new kernel with "options KSTACK_PAGES=8" to accommodate the large
> alloc the w22n51.sys driver makes on the kernel stack
>
> I added the following directories from CURRENT under my source tree:
> src/sys/compat/ndis
> sys/modules/ndis
> sys/modules/if_ndis
> src/sys/dev/if_ndis
> src/usr.sbin/ndiscvt
>
> In /sys/compat/ndis/subr_ntoskrnl.c I had to comment out the following
> lines to get everything to build:
> #include <sys/kdb.h>
> kdb_enter("ntoskrnl_debugger(): breakpoint");
>
> cd /usr/src/usr.sbin/ndiscvt
> make
> make install
>
> cd /sys/modules/ndis
> make
> make install
>
> I put w22n51.sys and w22n51.INF in /sys/modules/if_ndis.
> If anyone is looking for these file they can be found inside this zip:
> http://www.powernotebooks.com/Support/intel_2200_wlan.zip
>
> cd /sys/modules/if_ndis
> ndiscvt -i w22n51.INF -s w22n51.sys -o ndis_driver_data.h
> make
>
> I got an an error: "make: don't know how to make pccarddevs.h. Stop", so I
> removed pccarddevs.h from /sys/modules/if_ndis/Makefile an it built okay.
>
> make install
>
> kldload -v ndis -> Loaded ndis, id=3
> kldload -v if_ndis -> worked sometimes, other times the command would just
> hang, but the system would still be usable
>
> when kldload if_ndis did work, the output would look like:
> ndis0: <Intel(R) PRO/Wireless 2200BG Network Connection> mem
> 0xff9ee000-0xff9eef
> ff irq 11 at device 2.0 on pci2
> ndis0: NDIS API version: 5.1
> ndis0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 5.5Mbps 11Mbps
> ndis0: 11g rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
> Loaded if_ndis, id=7
>
> Then ifconfig -a would show:
>
> bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
>         inet6 fe80::20e:a6ff:fec4:a0b1%bge0 prefixlen 64 scopeid 0x1
>         inet 192.168.0.4 netmask 0xffffff00 broadcast 192.168.0.255
>         ether 00:0e:a6:c4:a0:b1
>         media: Ethernet autoselect (100baseTX <full-duplex>)
>         status: active
> plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
>         inet 127.0.0.1 netmask 0xff000000
>         inet6 ::1 prefixlen 128
>         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
> ndis0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
>         ether 00:0e:35:1f:df:57
>         media: IEEE 802.11 Wireless Ethernet autoselect
>         status: no carrier
>         ssid ""
>         channel -1 authmode OPEN powersavemode OFF powersavesleep 100
>         wepmode OFF weptxkey 1
>
> Next I did:
>
> wicontrol -i ndis0 -l
> output: 0 stations:
>
> ifconfig ndis0 inet 192.168.0.5 netmask 255.255.255.0 ssid 5270-4
>
> Sometimes this would output:
> ifconfig: ioctl (SIOCAIFADDR): File exists
>
> Other times it would work.  I think doing "ifconfig bge0 down" first
> helped.
>
> now the output from "ifconfig -a" looked like:
>
> bge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
>         options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
>         inet6 fe80::20e:a6ff:fec4:a0b1%bge0 prefixlen 64 scopeid 0x1
>         inet 192.168.0.4 netmask 0xffffff00 broadcast 192.168.0.255
>         ether 00:0e:a6:c4:a0:b1
>         media: Ethernet autoselect (100baseTX <full-duplex>)
>         status: active
> plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
>         inet 127.0.0.1 netmask 0xff000000
>         inet6 ::1 prefixlen 128
>         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
> ndis0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         inet6 fe80::20e:35ff:fe1f:df57%ndis0 prefixlen 64 duplicated
> scopeid 0x4
>         inet 192.168.0.5 netmask 0xffffff00 broadcast 192.168.0.255
>         ether 00:0e:35:1f:df:57
>         media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps)
>         status: associated
>         ssid 5270-4 1:5270-4
>         channel 6 authmode OPEN powersavemode OFF powersavesleep 100
>         wepmode OFF weptxkey 1
>
> wicontrol -i ndis0 -l:
> 1 station:
> ap[0]:
>         netname (SSID):                 [ 5270-4 ]
>         BSSID:                          [ 00:0f:66:36:cb:e8 ]
>         Channel:                        [ 6 ]
>         Quality/Signal/Noise [signal]:  [ 115 / 115 / 0 ]
>                                 [dBm]:  [ 115 / -34 / -149 ]
>         BSS Beacon Interval [msec]:     [ 0 ]
>         Capinfo:                        [ ]
>
> Now I unplugged bge0 and successfully pinged 192.168.0.x addresses on the
> local LAN using the ndis0.
>
> So that's what successfully worked.  Here's are some of the problems:
>
> Even with a defaultrouter entry in rc.conf, nothing outside the local LAN
> could be reached.
>
> Trying to loading the two ndis kernel modules from /boot/loader.conf
> wouldn't allow the system to boot.
>
> I hope that all makes sense.
>
> Joey
> _______________________________________________
> freebsd-hardware@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hardware
> To unsubscribe, send any mail to "freebsd-hardware-unsubscribe@freebsd.org"

I hope my previous post was somewhat understandable.  ....posting at 4:30 
isn't such a good idea. 

So now it's after 6:00 and I'm replying to myself... 

I've managed to get a the driver working.  I can ping outside hosts.
What I did was disable everything to do with bge0 in rc.conf and when the 
system booted I just did:

dhclient ndis0 
(etc/dhclient.conf has: interface "ndis0" { media "ssid 5270-4"; })

and the modules were loaded automatically.

Putting:

ndis_load="YES"
if_ndis_load="YES"

if /boot/loader/conf fails with the following errors in /var/run/dmesg.boot 
had:

Preloaded elf kernel "/boot/kernel/kernel" at 0xc0a5d000.
Preloaded elf module "/boot/kernel/if_ndis.ko" at 0xc0a5d1cc.
Preloaded elf module "/boot/kernel/ndis.ko" at 0xc0a5d278.
Preloaded elf module "/boot/kernel/wlan.ko" at 0xc0a5d324.
Preloaded elf module "/boot/kernel/rc4.ko" at 0xc0a5d3d0.
Preloaded elf module "/boot/kernel/acpi.ko" at 0xc0a5d478

ndis0: <Intel(R) PRO/Wireless 2200BG Network Connection> mem 
0xff9ee000-0xff9eefff irq 11 at device 2.0 on pci2
ndis0: NDIS API version: 5.1
ndis0: NDIS ERROR: c00013a7 (unknown error)
ndis0: NDIS NUMERRORS: 2
ndis0: argptr: 0x4e4f4c41
ndis0: argptr: 0x2cf
ndis0: NDIS ERROR: c00013a7 (unknown error)
ndis0: NDIS NUMERRORS: 2
ndis0: argptr: 0x4e4f4c41
ndis0: argptr: 0x2cf
ndis0: NDIS ERROR: c00013a7 (unknown error)
ndis0: NDIS NUMERRORS: 2
ndis0: argptr: 0x4e4f4c41
ndis0: argptr: 0x2cf
ndis0: NDIS ERROR: c00013a7 (unknown error)
ndis0: NDIS NUMERRORS: 2
ndis0: argptr: 0x4e4f4c41
ndis0: argptr: 0x2cf
ndis0: NDIS ERROR: c00013a7 (unknown error)
ndis0: NDIS NUMERRORS: 2
ndis0: argptr: 0x4e4f4c41
ndis0: argptr: 0x2cf
ndis0: NDIS ERROR: c00013a7 (unknown error)
ndis0: NDIS NUMERRORS: 2
ndis0: argptr: 0x4e4f4c41
ndis0: argptr: 0x2cf
ndis0: NDIS ERROR: c00013a7 (unknown error)
ndis0: NDIS NUMERRORS: 2
ndis0: argptr: 0x4e4f4c41
ndis0: argptr: 0x2cf
ndis0: NDIS ERROR: c00013a7 (unknown error)
ndis0: NDIS NUMERRORS: 2
ndis0: argptr: 0x4e4f4c41
ndis0: argptr: 0x184
ndis0: NDIS ERROR: c000138d (unknown error)
ndis0: NDIS NUMERRORS: 0
ndis0: init handler failed
device_probe_and_attach: ndis0 attach returned 6

I'm also seeing the following errors after running dhclient although the 
interface still get's an ip and everything seems to work:

ndis0: couldn't retrieve channel info: 19
ndis0: couldn't retrieve channel info: 19
ndis0: couldn't retrieve channel info: 19
ndis0: link up
Jul 18 05:34:01 karlsruhe kernel: ndis0: DAD detected duplicate IPv6 address 
f780:0104::021e:32ff:fe2f:df27: NS in/out=1/1, NA in=0
Jul 18 05:34:01 karlsruhe kernel: ndis0: DAD complete for 
f780:0104::021e:32ff:fe2f:df27 - duplicate found
Jul 18 05:34:01 karlsruhe kernel: ndis0: manual intervention required

Joey



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