Recently I’m having unstable WiFi connections. The Router is running Openwrt which works with all others Wifi clients reliably, but my own PC running Ubuntu 18.04 64bit keeps getting disconnected and the performance is also below par.

First I need know what Wifi chip is used on the PC.

    02:00.0 Network controller: Broadcom Limited BCM4313 802.11bgn \
      Wireless Network Adapter (rev 01)
lsmod | grep wl

Obviously Broadcom BCM4313 chip is used for Wifi, but for whatever reason it is running an old driver named wl in Ubuntu 18.04 by default.

Based on I decide to try a new open source driver instead: brcmsmac

sudo modprobe -r wl
sudo modprobe brcmsmac

After that the wifi becomes stable.

To make sure the above changes survives next reboot, I blacklisted the wl driver and enabled brcmsmac driver:

sudo -i
echo brcmsmac >> /etc/modules
echo wl >> /etc/modprobe.d/blacklist-broadcom-wireless.conf