FreeBSD 14 and WiFi BCM43228

none3@pci0:36:0:0: class=0x028000 rev=0x00 hdr=0x00 vendor=0x14e4 device=0x4359 subvendor=0x103c subdevice=0x182c
vendor = 'Broadcom Inc. and subsidiaries'
device = 'BCM43228 802.11a/b/g/n'
class = network
 
i hacked the driver and made it work somehow on 13.x
not really worth the trouble
if your card is removable you better replace it with something else
Code:
bwn0: <Broadcom 802.11 MAC/PHY/Radio, rev 30> mem 0x18001000-0x18001fff,0x18101000-0x18101fff irq 1 at core 1 on bhnd0
bwn0: WLAN (BCM43228 rev 30 sromrev 8) PHY (analog 9 type 4 rev 16) RADIO (manuf 0x17f ver 0x2057 rev 9)
bwn0: DMA (64 bits)
bwn0: Note: compiled with BWN_GPL_PHY; includes GPLv2 code
wlan0: Ethernet address: 5c:93:a2:d0:68:d6
bwn0: ucode fw: ucode30_mimo
bwn0: firmware version (rev 832 patch 127 date 0xe913 time 0x356d)
bwn0: ucode fw: ucode30_mimo
if you want the patch ill attach it
 
you need to build the kernel or module with
option BWN_GPL_PHY
you need to install bwn-firmware-kmod
you need this in loader.conf or load them from rc.conf
bwn_v4_n_ucode_load="YES"
if_bwn_load="YES"
i used this script in /sys/modules/bwn to build the module while testing for convenience
you don't need to use it you may use the official build method
Code:
#!/bin/sh
COPTS=-g DEBUG=1 DEBUG_FLAGS=-g make KERN_OPTS="BWN_GPL_PHY BWN_DEBUG" && \
make install  && \
cp /boot/modules/if_bwn.ko /boot/kernel/ && \
cp if_bwn.ko.debug /usr/lib/debug//boot/kernel/if_bwn.ko.debug
most likely the card sits in a minipcie slot and can be replaced
a better supported intel or ral nic is about $5 on used market
 

Attachments

  • if_bwn.c.txt
    198.6 KB · Views: 64
No results.
There are some mistakes during kernel building with option BWN_GPL_PHY.
Tried to build as is written in BWN(4) man, no mistakes but the same result.
 
kldstat:
1 21 0xffffffff80200000 1d4eb28 kernerl
1 1 0xffffffff82910000 3390 acpi_wmi.ko
1 1 0xffffffff82914000 4d20 ng_ubt.ko
1 6 0xffffffff82919000 abb8 netgraph.ko
1 2 0xffffffff82924000 a250 ng_hci.ko
1 4 0xffffffff8292f000 2670 ng_bluetooth.ko
1 1 0xffffffff82939000 e268 ng_l2cap.ko
1 1 0xffffffff82941000 abf68 ng_btsocket.ko
1 1 0xffffffff8295d000 38f8 ng_socket.ko
 
is your bwn/bhnd stuff statically linked into the kernel ?
the modules don't look like loaded
also the firmware module is not loaded
try kldload bwn at the prompt
 
I tried the following.
-rebuild kernel (following variants):
1/ as is manual:
device bwn
device bhnd
device bhndb
device bhndb_pci
device bcma
device siba
device gpio
device wlan
device wlan_amrr
device firmware
No mistakes

2/ as in your instructions:
only
option BWN_GPL_PHY
No mistakes

3/ as in your instructions but only
options BWN_GPL_PHY
No mistakes

4/ as in manual and your instructions:
device bwn
device bhnd
device bhndb
device bhndb_pci
device bcma
device siba
device gpio
device wlan
device wlan_amrr
device firmware
option BWN_GPL_PHY
There are errors during rebuilding (/usr/src/sys/dev/bwn/if_bwn_phy_n.c)

5/ as in manual and your instructions:
device bwn
device bhnd
device bhndb
device bhndb_pci
device bcma
device siba
device gpio
device wlan
device wlan_amrr
device firmware
options BWN_GPL_PHY
There are errors during rebuilding (/usr/src/sys/dev/bwn/if_bwn_phy_n.c)

-install bwn-firmware-kmod from ports

-add
bwn_v4_n_ucode_load="YES"
if_bwn_load="YES"
in rc.conf
in loader.conf
in rc.conf and in loader.conf

Any case no results.

kldload bwn:
can't load bwn: module already loaded or in kernel
 
sysctl hw.bwn:
hw.bwn.wme: 1
hw.bwn.usedma: 1
hw.bwn.hwpctl: 0
hw.bwn.bluetooth: 1
hw.bwn.bfp: 0
 

Attachments

  • dmesg.txt
    74 KB · Views: 44
C:
/** BCMA Devices */
static const struct bwn_pci_device bcma_devices[] = {
        BWN_BCM_DEV(BCM4331_D11N,       "BCM4331 802.11n Dual-Band",    0),
        BWN_BCM_DEV(BCM4331_D11N2G,     "BCM4331 802.11n 2GHz",         0),
        BWN_BCM_DEV(BCM4331_D11N5G,     "BCM4331 802.11n 5GHz",         0),
        BWN_BCM_DEV(BCM43224_D11N,      "BCM43224 802.11n Dual-Band",   0),
        BWN_BCM_DEV(BCM43224_D11N_ID_VEN1, "BCM43224 802.11n Dual-Band",0),
        BWN_BCM_DEV(BCM43225_D11N2G,    "BCM43225 802.11n 2GHz",        0),
        BWN_BCM_DEV(BCM43228_D11N,      "BCM43228 802.11n 2GHz",        0),
        { 0, 0, NULL, 0}
};
in the file /sys/dev/bwn/if_bwn_pci.c replace the original block with this
or just insert the BCM43228
 
did you rebuild/reboot after adding ?
Code:
BWN_BCM_DEV(BCM43228_D11N,      "BCM43228 802.11n 2GHz",        0)
,
you should have bwn_pci detected with this regardless if BWN_GPL_PHY is compiled in or noted
also if you had my if_bwn.c compiled you should have hw.bwn.bwn_hacks in sysctl
 
-added string in /sys/dev/bwn/if_bwn_pci.c
-rebuild and install kernel with
device bwn
device bhnd
device bhndb
device bhndb_pci
device bcma
device siba
device gpio
device wlan
device wlan_amrr
device firmware
-rebooted the system

YES!!! :)
pciconf -lv:
bwn_pci0@pci0:36:0:0 xxxxxxx

But how to get something like bwn0 ?
 
I ran covacat's script to rebuild the module & rebooted but nothing. This is on a mid 2012 model of MBP. Running 14.0

$ pciconf -lv|grep bwn
bwn_pci0@pci0:2:0:0: class=0x028000 rev=0x02 hdr=0x00 vendor=0x14e4 device=0x4331 subvendor=0x14e4 subdevice=0x4331
$ dmesg |grep 4331
bwn_pci0: <Broadcom BCM4331 802.11n Dual-Band Wireless> mem 0xa0600000-0xa0603fff at device 0.0 on pci3
bhnd0: <BCM4331 BCMA bus> on bhndb0
$ grep bwn /boot/loader.conf
bwn_v4_n_ucode_load="YES"
if_bwn_load="YES"
$ kldstat | grep bwn
6 1 0xffffffff82545000 808d8 if_bwn.ko
17 1 0xffffffff82699000 e160 bwn_v4_n_ucode.ko
$ sysctl net.wlan.devices
net.wlan.devices: // this should show bwn0 or something
 
boot -v and look at anything broadcom related
the patch adds support for bhnd0: <BCM43228 BCMA bus> on bhndb0 but iirc boot -v showed why wont attach
 
I tried all three firmware kmods but looks like no driver is attached, even though the corresponding bwn_v4_{,lp_,n_}ucode.ko is loaded.


bwn_pci0: <Broadcom BCM4331 802.11n Dual-Band Wireless> mem 0xa0600000-0xa0603fff at device 0.0 on pci3
bhndb0: <PCI-BHND bridge> on bwn_pci0
bhndb0: Using MSI interrupts on bwn_pci0
bhnd0: <BCM4331 BCMA bus> on bhndb0
bhnd_chipc0: <Broadcom ChipCommon I/O Controller, rev 37> mem 0x18000000-0x18000fff,0x18100000-0x18100fff irq 0 at core 0 on bhnd0
bhnd_nvram0: <SPROM/OTP> mem 0x18000800-0x18000bff on bhnd_chipc0
bhnd_pmu0: <Broadcom ChipCommon PMU, rev 10> on bhnd_chipc0
gpio0: <Broadcom ChipCommon GPIO> mem 0x18000000-0x18000fff on bhnd_chipc0
bhnd_hostb0: <Broadcom PCIe-G1 Host-PCI bridge, rev 19> mem 0x18002000-0x18002fff,0x8000000-0xfffffff,0x8000000000000000-0xffffffffffffffff,0x18102000-0x18102fff,0x18103000-0x18103fff irq 2 at core 2 on bhnd0
bhnd0: <Broadcom 802.11 MAC/PHY/Radio, rev 29> mem 0x18001000-0x18001fff,0x18101000-0x18101fff irq 1 at core 1 (no driver attached)
 
bhnd0: <Broadcom 802.11 MAC/PHY/Radio, rev 29> mem 0x18001000-0x18001fff,0x18101000-0x18101fff irq 1 at core 1 (no driver attached)
this should be bwn0 if it worked
i think rev 29 is not supported by the bsd driver (phy type ht)
it seems it is in the linux b43 version (from where i picked the bits to support mine)
at a first look does not look impossible to hack, don't know if its worth the effort
 
also keep in mind that the linux b43 driver aint that great (on my board performance kind of sucks with the b43 - same as what ive got in freebsd) so you may want to test it in linux first if you decide to start porting the diffs
 
Hello, How does the battle go for this Broadcom Wifi PCI Chip set?
<Broadcom BCM4331 802.11n Dual-Band Wireless>
vendor=0x14e4 device=0x4331 subvendor=0x14e4 subdevice=0x4331
I wrote a long list of notes about setup and firmware installation over at https://forums.ghostbsd.org that may have a tid bit you can use on FreeBSD.
https://forums.ghostbsd.org/viewtopic.php?f=64&t=2469
https://forums.ghostbsd.org/viewtopic.php?f=64&t=411

put these lines in
/boot/loader.conf

Code:
boot_verbose="1"
verbose_loading="YES"
bwn_pci="YES"
bwn_v4_n_ucode_load="YES"
if_bwn_load="YES"

/etc/rc.conf

Code:
rc_debug="YES"
rc_info="YES"
network_interfaces="AUTO"
wpa_supplicant_enable="YES"

# wlans_bwn0="wlan0"
# ifconfig_wlan0="WPA SYNCDHCP"

wlans_bwn0="wlan0"
create_args_wlan0="down country US"
ifconfig_wlan0="WPA DHCP"

Broadcom bwn BCM43xx BCM43xxx wifi setup

Working chipsets BCM4311
https://forums.ghostbsd.org/viewtopic.p ... 331#p10712 place 3 different firmwares in /boot/modules
/boot/loader.conf select one firmware to load.
This driver requires firmware to be loaded before it will work.The ports/net/bwn-firmware-kmod port needs to be installed before ifconfig(8) will work. In most cases the bwn_v4_ucode kernel module from the port should be used. However, if an LP (low power) PHY is being used, the bwn_v4_lp_ucode module should be used. or maybe bwn_v4_n_ucode_load be used with BCM4322 chipset

bwn_v4_ucode_load="YES"
or
bwn_v4_lp_ucode_load="YES"
or
bwn_v4_n_ucode_load="YES"
 
Back
Top