Installing wireless networking support on a FreeBSD 6.1 laptop

I've installed FreeBSD 6.1 on my old IBM ThinkPad 600E laptop. This circa 1999 machine has a 366 MHz Pentium II processor and 192M of RAM, so it was underpowered to get through the installation requirements of Fedora Core 5. FreeBSD runs great on it. But the biggest challenge was getting wireless to work, and I noticed that the information I could find on the web about it was sketchy at best. So I am writing down the steps that worked for me in the hope that it will help someone.

Thinkpad 600E running FreeBSD 6.1
Figure 1 - Thinkpad 600E running FreeBSD 6.1

My wireless card is a D-Link DWL-G650, rev B. To find out which revision I had, I checked the D-Link support web site.  Be advised that even though two cards may have the same model number, they might be different inside because they are significantly different revisions. It's good to know exactly what you have.

My D-Link card is the one that looks like this:


DLink DWL-G650 card
Figure 2 - D-Link DWL-G650 rev B

I have also tested the install with the Netgear WG511T, which worked fine as well. This is the Netgear card:

Netgear WG511T
Figure 3 - Netgear WG511T

Both of these use the Atheros (ath) driver. A full list of wireless cards supported by FreeBSD, and their drivers, is located here: Hardware supported by FreeBSD 6.1 on i386.

To get the laptop to recognize the card, a little customization is required -- it wasn't completely plug-and-play.  I had to modify the file /boot/loader.conf to contain the following:

if_ath_load="YES"
hw.pci.allow_unsupported_io_range="1"
hw.cbb.start_memory="0x20000000"

This will ensure that when the laptop starts up, it will at least see the card. (At the end of this page is the "dmesg" output that I get when booting my laptop, for your reference.) The card won't really be on the network without a few more steps though.  You need to get the card to log on to the wireless network.  I'm using WPA for authentication (with an Apple Airport Extreme hub), so I need to run a utility called wpa_supplicant, and give it the correct configuration.  I created a file /etc/wpa_supplicant.conf containing the information about how to log on to my network, by copying the file /usr/src/contrib/wpa_supplicant/wpa_supplicant.conf, deleting all the other "network=" lines, and then adding my network as so:

network={
       ssid="My network name"
       psk="mypassword"
       priority=5
}

(There is a bunch of information at "man wpa_supplicant.conf" about this file.)

Then I added the following to my /etc/rc.local so that these commands get run every time I start the machine up.

wpa_supplicant -B -i ath0 -c /etc/wpa_supplicant.conf
kldload wlan_tkip
dhclient ath0

This isn't the "right" way to do this. I should actually modify the pccard startup scripts so that the card is started and stopped correctly if I insert or remove it. Since in my normal configuration I don't ever do that, I stopped here, but it would be a reasonable exercise to add that configuration too.

Works fine for me now.

Any more questions about what I did, send me email at mark.hill.webcontact@gmail.com and I'll be glad to help out if I can.

My dmesg output when I boot with the wireless card installed:
Copyright (c) 1992-2006 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
    The Regents of the University of California. All rights reserved.
FreeBSD 6.1-RELEASE #0: Sun May  7 04:42:56 UTC 2006
    root@opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Pentium II/Pentium II Xeon/Celeron (363.96-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x66a  Stepping = 10
  Features=0x183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR>
real memory  = 201129984 (191 MB)
avail memory = 187101184 (178 MB)
kbd1 at kbdmux0
ath_hal: 0.9.16.16 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
acpi0: <IBM TP600R> on motherboard
acpi0: Power Button (fixed)
acpi_ec0: <Embedded Controller: GPE 0x9> port 0x62,0x66 on acpi0
Timecounter "ACPI-safe" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0xef08-0xef0b on acpi0
cpu0: <ACPI CPU> on acpi0
acpi_throttle0: <ACPI CPU Throttling> on cpu0
acpi_lid0: <Control Method Lid Switch> on acpi0
acpi_button0: <Sleep Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci_link0: BIOS IRQ 9 for 0.6.INTA does not match previous BIOS IRQ 11
pci0: <ACPI PCI bus> on pcib0
agp0: <Intel 82443BX (440 BX) host to PCI bridge> mem 0x40000000-0x43ffffff at device 0.0 on pci0
pcib1: <ACPI PCI-PCI bridge> at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
pci1: <display, VGA> at device 0.0 (no driver attached)
cbb0: <TI1251 PCI-CardBus Bridge> mem 0x50102000-0x50102fff irq 11 at device 2.0 on pci0
cardbus0: <CardBus bus> on cbb0
pccard0: <16-bit PCCard bus> on cbb0
cbb1: <TI1251 PCI-CardBus Bridge> mem 0x50101000-0x50101fff irq 11 at device 2.1 on pci0
cardbus1: <CardBus bus> on cbb1
pccard1: <16-bit PCCard bus> on cbb1
pci0: <multimedia, audio> at device 6.0 (no driver attached)
isab0: <PCI-ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX4 UDMA33 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xfcf0-0xfcff at device 7.1 on pci0
ata0: <ATA channel 0> on atapci0
ata1: <ATA channel 1> on atapci0
uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0x8400-0x841f irq 11 at device 7.2 on pci0
uhci0: [GIANT-LOCKED]
usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
pci0: <bridge> at device 7.3 (no driver attached)
acpi_tz0: <Thermal Zone> on acpi0
acpi_tz1: <Thermal Zone> on acpi0
acpi_tz2: <Thermal Zone> on acpi0
acpi_tz3: <Thermal Zone> on acpi0
fdc0: <floppy drive controller (FDE)> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: [FAST]
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model Generic PS/2 mouse, device ID 0
battery0: <ACPI Control Method Battery> on acpi0
battery1: <ACPI Control Method Battery> on acpi0
acpi_acad0: <AC Adapter> on acpi0
pmtimer0 on isa0
orm0: <ISA Option ROM> at iomem 0xc0000-0xcbfff on isa0
ppc0: parallel port not found.
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio1: configured irq 3 not in bitmap of probed irqs 0
sio1: port may not be enabled
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounter "TSC" frequency 363961296 Hz quality 800
Timecounters tick every 1.000 msec
ath0: <Atheros 5212> mem 0x20000000-0x2000ffff irq 11 at device 0.0 on cardbus0
ath0: Ethernet address: 00:0d:88:c2:3e:43
ath0: mac 5.9 phy 4.3 radio 4.6
ad0: 6149MB <HITACHI DK239A-65B 00X5A0B7> at ata0-master UDMA33
acd0: CDROM <TOSHIBA CD-ROM XM-1902B/1717> at ata1-master PIO4
Trying to mount root from ufs:/dev/ad0s1a
ath0: link state changed to UP

Last updated 28 June 2006