# HOW TO: get ipw2200 (iwi) working with ndis / WPA



## ocean (Dec 8, 2009)

i've done this on FreeBSD 8.0 so it could change a little for other versions.



			
				ocean said:
			
		

> iwi driver should work with 8.0 generic, with a compiled kernel there are problems with an interrupt storm, i did read something about an interrupt storm fix in 8.0-STABLE, this could be related.
> 
> i think this solution should be used if isn't possible to get iwi working at all (for example if it's compulsory to use a compiled kernel, and sometimes also ndis fails on this because of the interrupt storm)




*UPDATED* 12/10/2009

i've updated the how-to, there were some errors before, now it should be fine i think.

i've tried to keep this howto as simple as i can but please:
read ALL the post, and understand what you are doing don't simply copy/paste, i'm NOT responsible for any damage, loss, ghosts inside your pc... 

i've tested the script a few times, it should work fine.

*1.* download the tar attached to the post.
if you have wget jump to point 3

*2.* download the driver and put it in the same directory as the tar.

*3.* unpack the tar file containing the script and execute it:

```
tar -xvf gen_ndis_ipw.tar.gz
chmod +x gen_ndis_ipw.sh
./gen_ndis_ipw.sh
```

ndisgen will ask some questions, just press enter at every question.
at the end of the process you should see:

```
w29n51_sys.ko kernel module has been created here: /some/directory
```
(should be the same directory as the script)


*4.* now we have to copy the driver in kernel's directory and load it:

```
su
cp w29n51_sys.ko /boot/kernel
echo 'w29n51_load="YES"' >> /boot/loader.conf
kldload w29n51_sys.ko
```

a new interface "ndis0" should be created.

*5.*

```
ifconfig wlan0 create wlandev ndis0
```


*6.* create a wpa_supplicant.conf

for example containing:

```
network={
             ssid="home"
             scan_ssid=1
             key_mgmt=WPA-PSK
             psk="very secret passphrase"
     }
```

if it doesn't work try playing with these values and adding them to the top (read wpa_supplicant.conf(5)())

```
ap_scan=1
eapol_version=1
fast_reauth=1
```


```
wpa_supplicant -Dndis -iwlan0 -B -cwpa_supplicant.conf
dhclient wlan0
```

we could also add the informations to rc.conf to avoid to do this at every reboot, as proposed by richardpl:



			
				richardpl said:
			
		

> You dont need to manually run wpa_supplicant for ndis0's wlan0 every time machine boot:
> 
> Put this into /etc/rc.conf
> 
> ...



there can be some problems in the process though:

sometimes could be necessary to restart interfaces

```
/etc/rc.d/netif restart
```

keep present you shouldn't use iwi driver togheter so do NOT compile your kernel with it, and do NOT load it from loader.conf.
if it's already loaded execute this as root:

```
echo 'if_iwi_load="NO"' >> loader.conf
```
and reboot (seems unloading iwi don't work)

can happen to find error messages like

```
firmware stuck in state 4
```
 check that radio interface is on (from sysctl), or it gets to work again rebooting to a windows installation.

regards
ocean


----------



## larrypatrickmaloney (Dec 9, 2009)

*So is native IWI working in FreeBSD 8?*

My iwi interface has been working just fine in 7.2  Now, though in FreeBSD 8 (on my laptop) my native iwi interface won't come up.

Since there is a posting for making the ndis version work, does that mean that iwi is broken in 8?

Thanks.

Larry


----------



## ocean (Dec 9, 2009)

larrypatrickmaloney said:
			
		

> My iwi interface has been working just fine in 7.2  Now, though in FreeBSD 8 (on my laptop) my native iwi interface won't come up.
> 
> Since there is a posting for making the ndis version work, does that mean that iwi is broken in 8?
> 
> ...



have you tried getting wlan interface up?
http://forums.freebsd.org/showthread.php?t=8785

howewer for me iwi isn't working good


----------



## larrypatrickmaloney (Dec 11, 2009)

*Gz file is in tar format*

I just tried to gunzip that file, and it didn't work.  I then just did a tar -xf on it, and that did the trick.

Larry


----------



## ocean (Dec 11, 2009)

larrypatrickmaloney said:
			
		

> I just tried to gunzip that file, and it didn't work.  I then just did a tar -xf on it, and that did the trick.
> 
> Larry



i called it gzip cause i've tar-gzipped it

```
tar -czf gen_ndis_ipw.sh gen_ndis_ipw.tar.gz
```

it was already specified in the code to use tar:


			
				ocean said:
			
		

> ```
> tar -xvf gen_ndis_ipw.tar.gz
> chmod +x gen_ndis_ipw.sh
> ./gen_ndis_ipw.sh
> ```



howewer i've changed "gzip" with "tar".

thanks.

regards
ocean


----------



## ocean (Dec 21, 2009)

ocean said:
			
		

> have you tried getting wlan interface up?
> http://forums.freebsd.org/showthread.php?t=8785
> 
> howewer for me iwi isn't working good



iwi is working with a simple wpa AP, in GENERIC, with a kernel compiled with some optimizations there are interrupt storms, seems sometimes ndis work good without interrupt storms also on optimized kernel.


----------



## billt (Dec 29, 2009)

Thanks for putting up this HOWTO.

The link at step #2 is not valid. Any chance of a new link being available? If not, I have a website I'd be glad to host it at.

Thank you.


----------



## billt (Dec 29, 2009)

Also, where is the gen_ndis_ipw.sh script obtained?

It is so amazing this problem even exists.


----------



## ocean (Dec 30, 2009)

script is attached to the first post

the driver has been updated by intel: http://downloadmirror.intel.com/18404/eng/ICS_Dx32.exe

the gen_ndis_ipw.sh won't work with this version, i'll try and update it asap

P.S. iwi driver should work with 8.0 generic, with a compiled kernel there are problems with an interrupt storm, i did read something about an interrupt storm fix in 8.0-STABLE, this could be related.

this solution should better be used if isn't possible to get iwi working (for example if it's compulsory to use a compiled kernel)

regards
ocean


----------



## becoupama (Jan 4, 2010)

*still stuck...*

hi, i'm a rookie and i'm trying to set up wireless network... so i'm googling for a while, i tried some stuffs... in vain
well, i tried this how-to,
fetched the latest driver (still the 9.0.4.39 renamed) here, updated the script (few minor changes) (see attachment), and then followed the how-to.
everything worked well but in my case, that's not the point.
it looks like my adapter is not "listed"...
here is some hardware specification :
- asus (U1F) laptop with an intel core duo (proc), intel gma 950 (graphics)  and the classic 2200BG from intel (wireless). absolutely no exotic stuffs...
- Freebsd 8.0 release and a GENERIC kernel

ifconfig told me nothing about wlanN or something...

when i pull off the switch on the side of my laptop, i can sea on screen :

```
"ugen3.3: <vendor 0x0b05> at usbus3 (disconnected)"
```
but in fact that switch also controls the bluetooth adapter, so i do not even know if that message is about wifi or bluetooth...

loader.conf :

```
if_iwi_load="YES"
wlan_load="YES"
firmware_load="YES"
iwi_bss_load="YES"
iwi_ibss_load="YES"
iwi_monitor_load="YES"
legal.intel_iwi.license_ack=1
```
grrrrrr, what's wrong ?
thanks for help,

Becoup.


----------

