# [PC-BSD] Broadcom BCM4311 WiFi



## Demontager (Apr 24, 2013)

Today put PC-BSD on my old laptop HP tx1000 and first problem which *I* faced was its WiFi module -

```
03:00.0 Network controller: Broadcom Corporation BCM4311 802.11b/g WLAN (rev 02)
```

The system tray is showing WiFi connection icon, but actually can't find any networks. Guess it missed firmware. Found this port sysutils/b43-fwcutter as *I* see it only extracts firmware but does not fetch as it does on Ubuntu, for example.

How to get this chip working on PC-BSD 9.1?


----------



## cpm@ (Apr 24, 2013)

You must install net/bwn-firmware-kmod port. Read http://wiki.pcbsd.org/index.php/Wireless_Testing for more details.

Please, read the Forum Rules, specially this topic PC-BSD, DesktopBSD, FreeNAS, NAS4Free, m0N0WALL, pfSense, ArchBSD, kFreeBSD topics


----------



## Demontager (Apr 24, 2013)

Tried to install it:

```
----
Extracting v4/b0g0bsinitvals5.fw
Extracting v4/b0g0initvals5.fw
/usr/bin/touch /usr/ports/net/bwn-firmware-kmod/work/bg/v4/ucode.fw
"/usr/share/mk/bsd.kmod.mk", line 12: "can't find kernel source tree"
*** [do-build] Error code 1

Stop in /usr/ports/net/bwn-firmware-kmod.
```
Yes, kernel sources were missed. Installed -

```
svn checkout svn://svn.freebsd.org/base/stable/9/ /usr/src
```
Tring again

```
....
Extracting v4/a0g0initvals5.fw
Extracting v4/b0g0bsinitvals5.fw
Extracting v4/b0g0initvals5.fw
/usr/bin/touch /usr/ports/net/bwn-firmware-kmod/work/bg/v4/ucode.fw
"/sys/conf/kmod.mk", line 76: Could not find bsd.compiler.mk
"/sys/conf/kmod.mk", line 112: Malformed conditional (${COMPILER_TYPE} != "clang")
"/sys/conf/kmod.mk", line 116: if-less endif
"/sys/conf/kern.mk", line 18: Malformed conditional (${COMPILER_TYPE} == "clang")
"/sys/conf/kern.mk", line 33: if-less endif
"/sys/conf/kern.mk", line 55: Malformed conditional (${COMPILER_TYPE} != "clang")
"/sys/conf/kern.mk", line 62: if-less endif
make: fatal errors encountered -- cannot continue
*** [do-build] Error code 1

Stop in /usr/ports/net/bwn-firmware-kmod.
```

Do I need to add something more?


----------



## cpm@ (Apr 24, 2013)

Please, show your /etc/make.conf and `# uname -a` output. Probably, you installed a wrong version of the source tree.


----------



## Demontager (Apr 25, 2013)

```
uname -a
FreeBSD pcbsd-6217 9.1-RELEASE FreeBSD 9.1-RELEASE #2: Tue Nov 27 03:06:52 UTC 2012     root@darkstar:/usr/obj/pcbsd-build90/fbsd-source/9.1/sys/GENERIC  i386
```


```
cat /etc/make.conf
# Uncomment this if you want to do port builds with no interaction
#BATCH=yes

# Keep KDE4 in /usr/local, fixes sharing of icons / mime and others
KDE4_PREFIX=/usr/local
# added by use.perl 2012-12-03 16:20:22
PERL_VERSION=5.14.2
```

Copied this source -

```
svn checkout svn://svn.freebsd.org/base/release/9.1.0/ /usr/src
```
the installation of net/bwn-firmware-kmod then passed fine


```
===>  Installing for bwn-firmware-kmod-0.1.0
===>   Generating temporary packing list
===>  Checking if net/bwn-firmware-kmod already installed
install -o root -g wheel -m 555   bwn_v4_ucode.ko /boot/modules
kldxref /boot/modules
install -o root -g wheel -m 555   bwn_v4_lp_ucode.ko /boot/modules
kldxref /boot/modules
===>   Registering installation for bwn-firmware-kmod-0.1.0
===>  Cleaning for bwn-firmware-kmod-0.1.0
```
But WiFi chip still not operational, scanning giving no results

P.S. 	
@cpu82, *I* read rules regarding FreeBSD derivatives, ok, that will be my first and last question related to PC-BSD here.


----------



## Demontager (Apr 25, 2013)

Futher Googling brings me to adding

```
#Wifi
if_bwn_load="YES"
bwn_v4_lp_ucode_load="YES"
bwn_v4_ucode_load="YES"
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```
to /boot/loader.conf.

*T*hen found error in `dmesg`:

```
firmware_register: cannot register image bwi_v3_a0g0initvals5, firmware table full!
module_register_init: MOD_LOAD (bwi_v3_ucode_fw, 0xcbcddb00, 0) error 6
--
firmware_register: cannot register image iwn6050fw, firmware table full!
module_register_init: MOD_LOAD (iwn6050fw_fw, 0xcc202360, 0) error 6
```
Regarding "firmware table full", Googled this topic http://forums.freebsd.org/showthread.php?p=109663#post109663 where the second poster suggested to recompile the kernel with increased

```
FIRMWARE_MAX	60
```

Is it worth doing, or is there an easier wasy


----------



## wblock@ (Apr 25, 2013)

Does bwn(4) even support that chip?  It is not mentioned in the man page.  Nor is it mentioned in bwi(4).

When I last fought with a Broadcom chip, only one firmware module was needed.  Which one had to be determined by testing.  Any more, I replace them with Atheros wireless cards, which are much better supported on FreeBSD: https://wiki.freebsd.org/dev/ath_hal(4)/HardwareSupport


----------



## cpm@ (Apr 25, 2013)

Demontager said:
			
		

> P.S.
> @cpu82, *I* read rules regarding FreeBSD derivatives, ok, that will be my first and last question related to PC-BSD here.



Ok! It just was a reminder 



			
				Demontager said:
			
		

> *T*hen found error in `dmesg`:
> 
> ```
> firmware_register: cannot register image bwi_v3_a0g0initvals5, firmware table full!
> ...



Just modify macro definition at line 124 of file /usr/src/sys/kern/subr_firmware.c

```
#define FIRMWARE_MAX    60
```
 and recompile the kernel.


----------



## Demontager (Apr 25, 2013)

In short words - it's not working. Seems @wblock@ was right: bwn does not support Broadcom BCM4311. Nevertheless did everything as expected - recompiled kernel with 

```
define FIRMWARE_MAX    100
```
Error - "firmware table full!" gone. Also `kldstat` reported successful load:

```
# kldstat
Id Refs Address            Size     Name
 1  156 0xffffffff80200000 1324008  kernel
 2    1 0xffffffff81525000 2084f8   zfs.ko
 3    2 0xffffffff8172e000 5c68     opensolaris.ko
 4    1 0xffffffff81734000 1f9a0    geom_eli.ko
 5    4 0xffffffff81754000 2b4a8    crypto.ko
 6    3 0xffffffff81780000 dde0     zlib.ko
 7    1 0xffffffff8178e000 1ebe0    geom_journal.ko
 8    1 0xffffffff817ad000 21910    geom_mirror.ko
 9    1 0xffffffff817cf000 415d8    if_bwn.ko
10    2 0xffffffff81811000 cc20     siba_bwn.ko
11    1 0xffffffff8181f000 8858     sdhci.ko
12    1 0xffffffff81828000 4a30     aesni.ko
13    1 0xffffffff8182d000 de10     tmpfs.ko
14    1 0xffffffff8183b000 ee73e8   nvidia.ko
15    4 0xffffffff82723000 484f8    linux.ko
16    1 0xffffffff8276c000 2d358    bwn_v4_lp_ucode.ko
17    1 0xffffffff8279a000 2ba18    bwn_v4_ucode.ko
18    1 0xffffffff82812000 3dff     linprocfs.ko
19    6 0xffffffff82816000 30ca     libiconv.ko
20    3 0xffffffff8281a000 d70      libmchain.ko
21    1 0xffffffff8281b000 27a      msdosfs_iconv.ko
22    1 0xffffffff8281c000 15213    if_bwi.ko
23    1 0xffffffff82832000 17761    bwi_v3_ucode.ko
24    1 0xffffffff8284a000 21b9     runfw.ko
25    1 0xffffffff8284d000 328d     ng_ubt.ko
26    1 0xffffffff82851000 8b3d     ng_hci.ko
27    2 0xffffffff8285a000 a79      ng_bluetooth.ko
28    3 0xffffffff8285b000 87b2     netgraph.ko
29    1 0xffffffff82864000 336d     cuse4bsd.ko
30    1 0xffffffff82868000 23dd     sem.ko
31    2 0xffffffff8286b000 6c95     ntfs.ko
32    1 0xffffffff82872000 271      ntfs_iconv.ko
33    2 0xffffffff82873000 4513     udf.ko
34    1 0xffffffff82878000 271      udf_iconv.ko
35    1 0xffffffff82879000 bf1d     ext2fs.ko
36    1 0xffffffff82885000 53a8     mmc.ko
37    1 0xffffffff8288b000 171e     mmcsd.ko
38    1 0xffffffff8288d000 28bb     scd.ko
39    1 0xffffffff82890000 10ff     geom_uzip.ko
40    1 0xffffffff82892000 c1e3     pefs.ko
41    1 0xffffffff8289f000 5e098    xfs.ko
42    1 0xffffffff828fe000 5f80     reiserfs.ko
43    1 0xffffffff82904000 15c7e    smbfs.ko
44    1 0xffffffff8291a000 15c2     fdescfs.ko
45    1 0xffffffff8291c000 a11      linsysfs.ko
46    1 0xffffffff8291d000 2e01d    iwn4965fw.ko
47    1 0xffffffff8294c000 5283d    iwn1000fw.ko
48    1 0xffffffff8299f000 534ad    iwn5000fw.ko
49    1 0xffffffff829f3000 527cd    iwn5150fw.ko
50    1 0xffffffff82a46000 6f19d    iwn6000fw.ko
51    1 0xffffffff82ab6000 6c8ad    iwn6000g2afw.ko
52    1 0xffffffff82b23000 70a3d    iwn6000g2bfw.ko
53    1 0xffffffff82b94000 72ced    iwn6050fw.ko
54    1 0xffffffff82c07000 25ab     acpi_video.ko
55    1 0xffffffff82c0a000 4fb9     vkbd.ko
56    1 0xffffffff82c0f000 2a4b9    pf.ko
57    1 0xffffffff82c3a000 1695e    ng_btsocket.ko
58    1 0xffffffff82c51000 a9bb     fuse.ko
59    1 0xffffffff82c5c000 697e     if_lagg.ko
```
Tried to load and unload

```
bwi_v3_ucode.ko
bwn_v4_lp_ucode.ko
bwn_v4_ucode.ko
```
same no results when doing
`ifconfig wlan1 up scan` or `ifconfig wlan1 scan`

P.S. Got onother PCI mini WIFI card Intel 5120 from another laptop, but when inserted HP tx 1000 reported unsupported wireless device. Maybe some marketing protection against non-HP parts. 

I'm stuck.


----------



## cpm@ (Apr 25, 2013)

Try using ndis(4) driver wrapper.

Quoted from http://wiki.pcbsd.org/index.php/Wireless_Testing:


> Download this WinXP[5] driver, add bcmwl5.inf and bcmwl5.sys (bcmwl564.sys if using the amd64 version of freebsd) as driver files and both bcm43xx.cat (bcm43xx64.cat for amd64) and bcmwlcoi.dll (bcmwlcoi64.dll for amd64) as firmware files (this is important, if you do not add them through the ndisgen interface you will get a kernel panic as soon as you kldload the bcmwl5_sys.ko or bcmwl564_sys.ko file), move all the generated *.ko files to /boot/modules, add this[6] to your /etc/rc.conf (this[7] for amd64 users), and this[8] to your /boot/loader.conf, add your wpa_supplicant.conf file to /etc and finally reboot the PC to get the drivers loaded and interfaces created.
> 
> Note: The WinXP drivers mentioned above work only on FreeBSD 9.0RC3 and later, if you need to use FreeBSD 8.2 or 7.4 use the curtiebo's Win98 driver, also the drivers listed are extremelly sensitive to correct timing during installation and can brick your *BSD install, and are also very unstable and cause lots of kernel panics.


----------



## leth (Apr 26, 2013)

I have an HP tx2-1070 (second generation of your tx-1000) and faced the same issue; an unsupported Broadcom BCM43xx-series card.  I tried using a few different Windows drivers via NDIS but to no success (no APs found when scanning, kernel panics.)  In the end I replaced the wireless card, but be warned that many (all?) HP laptops have code in their BIOS to prevent booting with wireless cards not on their whitelist (search online for "HP BIOS error 104".)  This whitelist varies by laptop, so even if you find an HP-branded card with a supported chipset, your laptop may not boot with it.  After a few hours searching online I eventually installed a cracked BIOS image with the whitelist feature removed.  I'm now using this laptop with a Fujitsu-branded Intel card (5300, iwn(4) driver) and it's been working flawlessly for weeks.  I'm somewhat uncomfortable using a third-party BIOS image, and I do not recommend it, but it was that or find a new laptop (or run Linux, which has a proprietary driver for the BCM 43xx-series).


----------



## Demontager (Apr 26, 2013)

@leth,
"104 problem" met me as well. Actually was happy to install Linux Lubuntu flavour on it and get BCM 4311 worked fine, but on Linux more weird problems exist:

Laptop battery old and Linux does not boot when use battery power only
SSD drive produce parity check error and randomly locking booting into X.
Advantages of PC-BSD:

No SSD errors, no boot locks
Always boot nevertheless battery already weak(4 yrs old).
But...
Right now searching modded BIOS to install some Atheros card (they are very cheap -5 - 10$ second hand)
Having issue with sound card - no sound (will post this problem as promised on PC-BSD forum).


----------



## grahamperrin@ (Mar 11, 2016)

cpm said:


> … http://wiki.pcbsd.org/index.php/Wireless_Testing …



For posterity: http://web.archive.org/web/*/http://wiki.pcbsd.org/index.php/Wireless_Testing


----------



## cpm@ (Mar 14, 2016)

grahamperrin said:


> For posterity: http://web.archive.org/web/*/http://wiki.pcbsd.org/index.php/Wireless_Testing



I just check out that wiki.pcbsd.org was removed because it was considered redundant.

https://bugs.pcbsd.org/issues/13311


----------

