# Installing NDIS Windows-based driver in FreeBSD



## gespenst (Jun 20, 2011)

Hello all!

I got a wireless network 802.11n card, Planet WNL-9320, which I want to set up in FreeBSD 8.0 and I'm quite novice in BSD, but not in computers.

Alas, it wasn't detected during install, and Google did it best in finding nothing specific on query "FreeBSD Planet WNL-9320", so I've tried installing Windows driver via NDIS wrapper, which is described in FreeBSD manual on this site (http://www.freebsd.org/doc/handbook/config-network-setup.html)

Also, I figured out, that my network card is based on a Ralink chip RT2860 and has two needed files to wrap that driver, rt2860.sys and rt2860.inf.

So, after perfoming every exact step from a setting up a network card manual from this site and receiving no error messages, interactive wrapper went fine creating .ko file. After I've tried to *kldload* that created kernel module, I received that in dmesg output (and card doesn't actually work):


```
ndis0: <PLANET WNL-9320> mem 0xfdff0000-0xfdffffff irq 16 at device 5.0 on pci1
ndis0: [ITHREAD]
ndis0: NDIS API version: 5.0
NDIS: open file /compat/ndis/rt2860.bin failed: 2
NDIS: open file /compat/ndis/rate.bin failed: 2
wlan0: Ethernet address: 00:30:4f:50:90:76
```

What are these .bin files, are they necessary to run a netcard, and do I need them and where can I get them? Inf file from windows driver doesn't mention any .bin files.

My FreeBSD is 8.0 i386 and Windows drivers for that card are also x86-32.

Thank you in advance, any help would be appreciated.


----------



## SirDice (Jun 21, 2011)

Have you tried the ral(4) driver?


----------



## richardpl (Jun 21, 2011)

gespenst said:
			
		

> What are these .bin files, are they necessary to run a netcard, and do I need them and where can I get them? Inf file from windows driver doesn't mention any .bin files.



If there were no .bin files with .sys and .inf files this can be safely ignored.

How did you find out that that card actually does not work? What did you try to do? Can you get any scan results with: `# ifconfig wlan0 list scan`

Is the radio turned on?


----------



## richardpl (Jun 21, 2011)

SirDice said:
			
		

> Have you tried the ral(4) driver?



ral driver is part of GENERIC.


----------



## gespenst (Jun 26, 2011)

SirDice said:
			
		

> Have you tried the ral(4) driver?



I'll read now about it and try to figure if it suits.


----------



## gespenst (Jun 26, 2011)

richardpl said:
			
		

> How did you find out that that card actually does not work? What did you try to do?



Well, I've noticed the phrase 'no carrier' in *ipfconfig* output, tried some common things from wireless manual that I don't remember exactly with no success.



> Can you get any scan results with: `# ifconfig wlan0 list scan`



Nope, this command just passes absolutely quietly and all I see is command prompt next string.



> Is the radio turned on?



What's that? How to check it? If you speak about wi-fi network, then yes, there are several in the area, which I control, and Windows XP PCs, that are in the same place, wireless works just fine.


----------



## richardpl (Jun 26, 2011)

Is the wlan0 in "UP" state?

Try code from my signature, if problems appears to be scanning it should be solved with it.

Make sure you download correct - stable branch, which compiles for FreeBSD 8.X, and follow README instructions. Here is direct link: https://github.com/richardpl/NDISulator/archives/stable
Master branch is for CURRENT only.

If you are using anything lower than FreeBSD 8.X you will need first to upgrade/reinstall FreeBSD to 8.X.

If even this does not solve your problem than it probably means some Zw* calls need to be fully implemented.


----------



## wblock@ (Jun 26, 2011)

gespenst said:
			
		

> ```
> ndis0: <PLANET WNL-9320> mem 0xfdff0000-0xfdffffff irq 16 at device 5.0 on pci1
> ndis0: [ITHREAD]
> ndis0: NDIS API version: 5.0
> ...



A lot of wireless cards have separate firmware.  Those files should be included with the Windows driver.  Could be inside an archive file in the driver files.  Or maybe they're optional, updates that, if present, would override whatever is built in.



> My FreeBSD is 8.0 i386 and Windows drivers for that card are also x86-32.



8.0 came out in November 2009, and lots of things have been updated since then.  8.2 or 8-STABLE would be much better.  There's also an rt2860 driver that's been mentioned in the forums.  I don't have the hardware, so haven't paid much attention.


----------



## gespenst (Jun 26, 2011)

Thanks everyone, problem solved.

Searching forums I've came to this thread. It is about rt2870 chip, however, there is a link to a site that contains correct driver for rt2860 chipset also by Alexander Egorenkov.

This drivers works and I type this message using my wireless connection and Konqueror.  

I wonder is there a support for 300Mbit/sec 802.11n, I'll check this out soon.

I wasn't able to make it working with NDIS wrapper, however, searching freebsd forums I noticed that someone reported that wrapper worked with some netcard based on chip rt2860. I can guess that there may be some differences in windows drivers for that chip depending on which manufacturer made that specific netcard.

Thanks to everyone participated!


----------

