FreeBSD Wifi on a BCM4328 Wireless Card


Notes about configuring a wifi wireless network on FreeBSD 12.1, using an old laptop with an unsupported wireless card. Lots of forums said that the card is not supported and that it could not be done. But I refused to believe it, and this is a testimony to the resilience of FreeBSD.

    OS: FreeBSD 12.1-RELEASE-p10
    Laptop: Dell Inspiron 1525 (circa 2007)
    Memory: 4GB
    Wireless Card: 802.11g Broadcom BCM4328 SIBA bus BCM4312 rev 15

The history: while running FreeBSD 12.1 everything worked on my old Dell Inspiron 1525 laptop, except my wifi network. Going through blogs I discovered that the wifi card is not supported by generic FreeBSD kernel, so it does not work by default; and requires special tweaking. There’s no official guide for this wireless card. Tried many different recommendations from forum postings. Below is what what worked for me. There may be better ways; but if so then please comment.

Query Hardware

While running the GENERIC kernel, investigate which hardware is detectable. Take note of all the device names.

# dmesg | more
# pciconf -lv

My hardware is as follows:

CPU: Pentium Pentium Dual Core T3200 2.0GHz
Vid: Intel Crestline GM965
Mem: Intel PM965/GM965/GL960 
Aud: Sigmatel 9205 hdacc2 pcm1 STAC9228X
Modem: hdaac0 Conexant HDA D330 MDC
SD Card: Ricoh R5C832/22/42/92
HD Toshiba ada0 
        320g, 7200 RPM
	cyl 16383
	hd 16
	s/t 63
	lba 625
	sec 142448
CDROM: cd0 Removable SCSI device.
Wifi:	bwn0 Broadcom 802.11  BCM4328/4312 
	bhnd0 BCM4312 SIBA Bus
	gpio0 Broadcom Chip GPIO
USB: Intel 82801H ICH8 USB-D 2.0
Ethernet:	msck0 Marvell Yukon 88E8040
		e1000phy0 Marvell E3016 

Install Latest Ports

# portsnap fetch
# portsnap extract

Compile Broadcom BCM Drivers

Install the latest port for the Ports Management:

# cd /usr/ports/ports-mgmt/pkg/
# make install clean

Install the latest port for the Broadcom BCM wifi drivers:

# cd /usr/ports/net/bwn-firmware-kmod/
# make install clean

Download Latest Source

# /usr/src
# wget
# tar -xf src.txz -C /

Compile Kernel

Download source tree and compile a new kernel. Remove all the unnecessary drivers. My kernel went from 30MB to 19MB. A more lean compiled kernel reduces memory footprint, boots faster and overall performs better with less overhead.

Copy the kernel config, create a symblink, then edit:

# cd /usr/src/sys/`uname -m`/conf
# mkdir /root/kernels
# cp GENERIC /root/kernels/INSPIRON
# ln -s /root/mykernels/INSPIRON

Go through the settings, or download my kernel config file that I already made, which works:

# wget
# xz -dc INSPIRON.xz > /root/kernels/INSPIRON

Verify that the following entries are present in the kernel config file:

    device bhnd
    device bhndb
    device bhndb_pci
    device bcma
    device siba
    device gpio
    device wlan
    device wlan_amrr
    device firmware

Begin the compilation. This took 20 minutes with an Intel i7, but with the Dell Inspiron 1525 it took 2 hours. The kernel should be reduced from 30MB to 19MB. I did notice performance improvements afterward:

# /usr/sbin/config INSPIRON
# cd ../compile/INSPIRON
# make cleandepend
# make depend
# make install

Wifi Configuration

For simplicity I am using wifi WEP authentication for now. Configure the following system settings (follow the logic):

# vi /boot/loader.conf 
# vi /etc/rc.conf
create_args_wlan0="country US regdomain FCC"

Create the encrypted WEP key encryption. Add it to your wpa file below:

# wpa_passphrase myssid mypassword
# vi /etc/wpa_supplicant.conf 

Wifi Script

Running the wifi settings from rc.conf does not work. The only way I was able to make it work was via a script. Every time you want to use use wifi simply run the following script as root. It disables all interfaces, then enables wifi, then restarts networking processes.

# vi /root/

ifconfig msk0 destroy
ifconfig wlan0 destroy
sleep 1
ifconfig wlan0 create wlandev bwn0 
ifconfig wlan0 inet netmask authmode open ssid myssid wepmode on weptxkey 1 wepkey 1:0xAAAAAAAAAA mode 11g
route add default
sleep 1
service sshd restart
service ntpd restart

Diagnostic Commands

Some diagnostic commands to try:

# bsdconfig wireless
# ifconfig wlan0 list scan
# sysctl net.wlan.devices


Broadcom Wifi drivers do not work well with FreeBSD, and I also heard similar comments about Broadcom wifi with Linux. Apparently this model was designed for Windows XP. This wifi not so great on FreeBSD 12.1. It is slow some times and seems very unstable. Sometimes I can connect via SSH and run commands, and other times it gets stuck and I have to retry again; like there is a memory cache problem. But for the sake of learning it is cool to be able to make it run and boast about it when nobody else can.


Install the i386 or x86 32 bit distros. They run much better. Do not install the 64bit AMD64 or x86_64 versions. Although they both install on this machine, the 64 bit versions don’t run well. Debian 9 i386 (32bit) is the best distro that I’ve been able to make run the best on this laptop. Install the firmware:

# cat /etc/debian_version
# uname -m
# vi /etc/apt/sources.list
 deb stretch main contrib non-free
# apt-get update
# apt-get install firmware-b43-installer b43-fwcutter firmware-misc-nonfree firmware-brcm80211
# reboot

Afterward the b43 firmware errors go away and the wlan0 interface appears connected via DHCP. Configure via gnome-control-center network.

After successfully configuring wlan0, running with a discoverable IP address, run:

# update-grub2
# reboot

Conclusion: Even in Linux this old Broadcom wifi card runs crappy. Lots of errors and slow downs occur. DHCP does not work well or at all. Disabling the wifi works. As an alternative used an external antenna wifi USB dongle stick: Eastech Ralink RT5370.

The End.