broadcom-sta and Gentoo

I have a dell E6520 and I have come quite attached to my wireless. Recently I’ve upgraded my kernel to the 3.6 series and things went almost flawlessly except for the wireless driver. The driver wl.ko kernel module barfed in kernel land and did very very bad things. I was seeing something similar to this in the logs:

general protection fault: 0000 [#1] PREEMPT SMP
Modules linked in: nls_cp437 vfat fat usb_storage uas bbswitch(O) uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core videodev media tg3 libphy mei i2c_i801 lib80211_crypt_tkip wl(PO) cfg80211 lib80211 microcode acer_wmi sparse_keymap rfkill mxm_wmi pcspkr wmi ghash_clmulni_intel cryptd kvm_intel snd_hda_codec_hdmi snd_hda_codec_realtek kvm coretemp iTCO_wdt iTCO_vendor_support crc32c_intel snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_page_alloc snd_timer snd serio_raw sdhci_pci sdhci mmc_core soundcore lpc_ich psmouse joydev evdev battery ac acpi_cpufreq mperf processor ext4 crc16 jbd2 mbcache hid_generic hid_logitech_dj usbhid hid sr_mod sd_mod cdrom ahci libahci libata ehci_hcd scsi_mod usbcore usb_common i915 video button i2c_algo_bit drm_kms_helper drm i2c_core intel_agp
intel_gtt [last unloaded: nvidia]
NetworkManager[1733]: wpa_supplicant stopped
NetworkManager[1733]: (wlan0): supplicant interface state: inactive -> down
NetworkManager[1733]: (wlan0): device state change: disconnected -> unavailable (reason 'supplicant-failed') [30 20 10]
NetworkManager[1733]: (wlan0): deactivating device (reason 'supplicant-failed') [10]
systemd[1]: wpa_supplicant.service: main process exited, code=killed, status=11
kernel: CPU 0
kernel: Pid: 1737, comm: wpa_supplicant Tainted: P O 3.6.2-1-ck #1 Acer Aspire 5750G/JE50_HR
kernel: RIP: 0010:[] [] wl_cfg80211_scan+0x8c/0x480 [wl]
kernel: RSP: 0018:ffff880159eb5978 EFLAGS: 00010202
kernel: RAX: ffffffffa085f290 RBX: ffff8801580cd200 RCX: ffff8801580cd200
kernel: RDX: ffff8801580cd200 RSI: ffff88013c912000 RDI: ffff8801580cd200
kernel: RBP: ffff880159eb59b8 R08: 00000000000162c0 R09: 000000000000007c
kernel: R10: 0000000000000000 R11: 0000000000000000 R12: 0084161c00000001
kernel: R13: ffff88013c912000 R14: ffff88013c912000 R15: 0000000000000000
kernel: FS: 00007f37e3427700(0000) GS:ffff88015fa00000(0000) knlGS:0000000000000000
kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel: CR2: 0000000001bdb6e8 CR3: 000000013c839000 CR4: 00000000000407f0
kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
kernel: DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
kernel: Process wpa_supplicant (pid: 1737, threadinfo ffff880159eb4000, task ffff88015823a080)
kernel: Stack:
kernel: ffff880159eb5a18 ffffffffa03fd5d8 ffff880159eb59c8 ffff880159eb5a38
kernel: ffff8801580cd000 0000000000000001 ffff88013c912000 0000000000000000
kernel: ffff880159eb5a18 ffffffffa04022f5 000000000000007c 0000000000000004
kernel: Call Trace:
kernel: [] ? nl80211_pre_doit+0x318/0x3f0 [cfg80211]
kernel: [] nl80211_trigger_scan+0x485/0x610 [cfg80211]
kernel: [] genl_rcv_msg+0x298/0x2d0
kernel: [] ? genl_rcv+0x40/0x40
kernel: [] netlink_rcv_skb+0xa1/0xb0
kernel: [] genl_rcv+0x25/0x40
kernel: [] netlink_unicast+0x19d/0x220
kernel: [] netlink_sendmsg+0x30a/0x390
kernel: [] sock_sendmsg+0xda/0xf0
kernel: [] ? find_get_page+0x60/0x90
kernel: [] ? filemap_fault+0x87/0x440
kernel: [] __sys_sendmsg+0x371/0x380
kernel: [] ? handle_mm_fault+0x249/0x310
kernel: [] ? do_page_fault+0x2c4/0x580
kernel: [] ? restore_i387_xstate+0x1af/0x260
kernel: [] sys_sendmsg+0x49/0x90
kernel: [] system_call_fastpath+0x1a/0x1f
kernel: Code: 8b 6d e8 4c 8b 75 f0 4c 8b 7d f8 c9 c3 66 90 48 8b 86 48 02 00 00 48 85 c0 0f 84 6c 03 00 00 4c 8b 20 4d 85 e4 0f 84 2f 03 00 00 8b 84 24 a8 0a 00 00 4d 8b b4 24 48 06 00 00 a8 02 75 60 49
kernel: RIP [] wl_cfg80211_scan+0x8c/0x480 [wl]
kernel: RSP
kernel: ---[ end trace 62b60f7a71b18301 ]---

The solution I implemented was taken from the gentoo bugtracker and fourms. Below is the reference information.
and the solution here:

At a high level I created a local overlay, created my own broadcom-sta ebuild and re-emerged the driver.

This is how I implemented the path step by step:

  • vi /etc/make.conf


  • mkdir -p /var/lib/localoverlay/net-wireless/broadcom-sta
  • cd /var/lib/localoverlay/net-wireless/broadcom-sta
  • cp /usr/portage/net-wireless/broadcom-sta/broadcom-sta- /var/lib/localoverlay/net-wireless/broadcom-sta/broadcom-sta-
  • vi /var/lib/localoverlay/net-wireless/broadcom-sta/broadcom-sta-
  • I manually added the patch at
  • emerge -v broadcom-sta

– done