Today has been a good BSD day. I got my wireless adapter working and as a bonus, both my CD and DVD drives are working also. :D The trick was upgrading to FreeBSD 7.0 RC1 (Stable).
* * * * story time * * * *
So was I started down the path of trying to get my Belkin N1 PCI card to work. I had attempted NDIS again. I found a link here (
http://lists.freebsd.org/pipermail/freebsd-questions/2004-August/056835.html) that indicated I should first make and load ndis.ko (the generic support module) followed by custom .ko module (which I made using ndisgen, not ndiscvt as in that link). The result was promising! NDIS0 device popped up and I thought that was it. But unfortunately I could not set my SSID and according to this link (
http://www.bsdforums.org/forums/archive/index.php/t-34181.html) that may be due to limits with NDIS.
Fortunately there was still hope. In going through the process of making the .ko file, I had needed to grab the .inf and .sys Windows files. The .sys file was named ar5416.sys and the inf file was net5416.inf. Looking at the contents of the .inf file strongly hinted that this card had an Atheros chipset. That was good news because FreeBSD has had good support for the Atheros chipsets thanks in large part to a very dedicated programmer named Sam Leffler who has signed a NDA with Atheros to port the drivers to FreeBSD (and Linux) and has been part of the FreeBSD community since the 1980s. So the hunt was on to try to find native FreeBSD drivers.
The 5416 model is the PCI version of the 5008 chipset. I came across this message (
http://lists.freebsd.org/pipermail/freebsd-drivers/2007-December/000585.html) from just a couple weeks ago. So here was the hardware abstraction layer files (HAL) that I needed. Poking and prodding around my system and the internet led to me understand that these should go in the /usr/src/sys/contrib/dev/ath folder. So I tried to rebuild my kernel around this new Atheros module but no matter what I tried, I kept getting failure messages when attempting to make buildkernel:
../../../dev/ath/ath_rate/sample/sample.c:492: error: structure has no member named `ds_us'
I knew something wasn't in sync. I had tried clearing out all the old objects to no avail. Finally I figured it was time to get new source codes for everything. I looked at the FreeBSD website at 7.0RC1 distribution release notes (ftp://ftp.freebsd.com/pub/FreeBSD/releases/i386/7.0-RC1/RELNOTES.TXT) and found that the ath(4) driver had been updated to 0.9.20.3 -- not as new Leffler's link to 0.9.30.13 but newer than my current 0.9.17.2. So I figured maybe there was a chance if I updated 7.0RC1, I could at least try to rebuild my kernel from there with the 0.9.30.13 HAL. I retraced my steps in performing a dual boot of FreeBSD with WinXP. It went quickly.
I was given a nice surprise after installing 7.0RC1: my CD/DVD drives were detected (the names of the CDs that were in there were even labeled correctly)! I wasn't even trying to fix that! :D Then to my amazement, rebuilding the kernel compiled without error! I rebooted and behold, a beautiful ath0 device in my dmesg. And unlike ndis, this baby responded to every ifconfig command I sent it.
I did have to shutdown my onboard LAN however to get it the routing tables to cooperate. I had to do that for Windows too. But I have no problem with that.
For those of you who haven't experienced the fun of wireless on Linux or FreeBSD, it's a real treat. The level of detail given is sweet. I know that I'm running at 2412 Mhz in 11g mode with a -68dB:-94dB signal to noise ratio. I can also see the SSIDs, encryptions, S/N ratios, channels, and data rates of all my neighbors. :p
Now the big challenge is getting X to work...