Some notes we've thrown together.

Here are a few articles we've prepared on technical topics which other people may find helpful.

Wireless Network Adventures under FreeBSD v5.x :

What follows below are my continuing notes and experiences in regards to setting up wireless networking under FreeBSD v5.x. The hardware installation and testing performed below were all attempted using FreeBSD v5.4.

D-Link DWL-G520B "AirPlusXtremeG" PCI adapter

UPC # : 790069250736
Model # : DWL-G520
Hardware Version : B3
Firmware Version : 4.20

The D-Link DWL-G520B card was listed on the hardware compatibility list as being a supported card, so I picked one up at Costco when I saw that they had some there. The card was supposed to be operable using the ath driver, but unfortunately it did not work properly. The ath driver requires that the following lines be added to the kernel configuration file :

device wlan
device ath
device ath_hal

After adding those lines and recompiling my kernel, the following errors were noted upon rebooting in the dmesg output :

ath0: mem 0xd9800000-0xd980ffff irq 11 at device 17.0 on pci0
ath0: unable to attach hardware; HAL status 13
device_attach: ath0 attach returned 6

HAL status 13 is supposedly the generic response to an unknown card or improper hardware match. Some additional reading on the internet revealed that D-Link have updated this particular wireless card in the recent past, but kept the model number the same. This updated version of the card uses a slightly different version of radio (AR5213) compared with the ones supported in the Atheros driver (AR5211 and AR5212). As such, the card will not function properly using the Atheros (ath) driver native to FreeBSD v5.4.

The recommended courses of action are to either :

  1. Return this card to your vendor in lieu of an older version of the same model card, hopefully containing a supported radio chipset. This course of action is unlikely considering Costco carries only the single model of card.
  2. Attempt to use the Windows driver in FreeBSD using the NDIS wrapper (aka Project Evil). This process is described at the bottom of this page in the handbook. Results may vary.
In this case, I decided to try to use the NDIS wrapper solution in hopes of getting the card working.

The procedure involves incorporating the Windows drivers with kernel sources, and compiling some custom modules which will be used to create a custom driver for the unsupported card. The specific procedure for doing this can be found on many other webpages, so I will omit it here. Don't forget to put the following lines in /boot/loader.conf :


Those lines were not specifically mentioned in the FreeBSD handbook, but were discussed on a webpage from another person outlining their experiences with the NDIS wrapper driver. After rebooting, the following lines were seen in the dmesg output :

ndis0: mem 0xd9800000-0xd980ffff irq 11 at device 17.0 on pci0
can't re-use a leaf (BusType)!
ndis0: NDIS API version: 5.1
NDIS: could not find file regAdd.txt in linker list
NDIS: and no filesystems mounted yet, aborting NdisOpenFile()
ndis0: Ethernet address: 00:11:95:ea:be:70
ndis0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 1Mbps 2Mbps 5.5Mbps 11Mbps
ndis0: 11g rates: 6Mbps 12Mbps 24Mbps 36Mbps 48Mbps 54Mbps

The card, however, was not working properly in FreeBSD. Issuing ifconfig commands to the ndis0 device gave mixed results, sometimes setting parameters while other times failing. The device would also not go into hostap mode, throwing a "device not configured" message. At this point, I will be returning the card, and attempting to lock down a more precise match to the existing native FreeBSD wifi drivers.

Morals of the Story

  • For less headaches, avoid manufacturers who change their hardware specifications and technology platforms on a whim while keeping the same model number on the items. This is a tacky move on D-Link's part as experienced with the card I purchased, but supposedly Linksys and some other vendors are equally as guilty of this type of foolishness.
  • A lot of people are reporting success with the "Project Evil" / NDISulator wrapper drivers, but we had no luck in this particular case. Go with known working drivers for devices when possible, rather than buying devices and hoping the tricks like these will work.

Get In Touch

Lets talk about your project or online needs!
Contact Us