BCM4322 - WIFI Card - Freebsd 11.2 not working

joaf

New Member

Reaction score: 1
Messages: 6

Hello FreeBSD Users,

i have a problem to make the Wifi CARD BCM4322 (Rev. 01) running under Freebsd 11.2.

i have searched around the Net, and i found not description, or a howto to setup this Wifi Card.

i have read a lot of post regarding Broadcom Wifi Cards, but i found no solution.


- https://lists.freebsd.org/pipermail/freebsd-wireless/2016-July/006893.html
- i have modificed the GERNERIC Kernel and rebuild it
- https://basicbsd.wordpress.com/2018/01/28/broadcom-bcm4312-wireless-network-card-on-freebsd-11-1/
- i have modified the Makefile from bwn-firmware-kmod
- in the loader.conf i have acutally the following settings:
bwn_v4_ucode_load="YES"
bwn_v4_n_ucode_load="YES"
if_bwn_load="YES"

but the card is not listed in the System.

Please could told me someone if this card could be run under FreeBSD 11.2?

This would be very helpful for me.

Thank you all for your response.

Best regards

Joachim
 

Phishfry

Son of Beastie

Reaction score: 1,977
Messages: 4,967

Two possible avenues to pursue. There is a LP version of the firmware. You may want to try it.
There is also the bwi(4) driver which covers some older BCM devices with its own firmware.
Have you tried it? I would be tempted to try that first.
I also think adding the firmware settings to loader.conf is jumping the gun. The best way to determine what a module is doing is to load it with kldload from the command prompt. It will output text that could be important to debugging. With it loading via loader.conf you can easily miss these messages. Once you get it working then add your firmware settings to loader.conf.
 
OP
J

joaf

New Member

Reaction score: 1
Messages: 6

Two possible avenues to pursue. There is a LP version of the firmware. You may want to try it.
There is also the bwi(4) driver which covers some older BCM devices with its own firmware.
Have you tried it? I would be tempted to try that first.
I also think adding the firmware settings to loader.conf is jumping the gun. The best way to determine what a module is doing is to load it with kldload from the command prompt. It will output text that could be important to debugging. With it loading via loader.conf you can easily miss these messages. Once you get it working then add your firmware settings to loader.conf.

Hello Phishfrey, thank you for your answer.
I have no idea what you are meaning with LP Version? I understood that when i use the settings in the loader.conf, then i can't see the full
output messages. So i understand that i should use kldload to load the modules manually to see what happens.
But i have no idea how to use kldload with the modules ....

First of all i have modified my loader.conf and removed all settings
bwn_v4_ucode_load="YES"
bwn_v4_n_ucode_load="YES"
if_bwn_load="YES"

Then i have searched the net how is the correct syntax to load the modules with kldload, but i have now idea. Everything i tried i get the messsage ...."no such file or directory"..... .

I would be very nice if you could help me, to use the correct syntax to load the modules manually.

Thank you very much for your time and help.

Greetings
Joachim
 

Phishfry

Son of Beastie

Reaction score: 1,977
Messages: 4,967

There are two firmwares for bwn(4) driver. The regular one and the LP one.
Most cases you need to use bwn_v4_ucode module but if you are
a LP (low power) PHY user please uses bwn_v4_lp_ucode module.
To manually load any FreeBSD module just drop off the '_load' part from the loader.conf line.
Like so: kldload bwn_v4_lp_ucode
I don't know if that is the actual name. Just an example.
 
Last edited:
OP
J

joaf

New Member

Reaction score: 1
Messages: 6

Hello Phisfry, sorry for the delay, i was on a business trip.

Now i have tried something

I found out when i load the following:

kldload bwn_v4_ucode
kldload bwn_v4_n_ucode
kldload if_bwn_load

then i can see in demsg the following:
siba_bwn0: <Broadcom BCM4322 802.11a/b/g/n Wireless> mem 0xf2400000-0xf2403fff irq 17 at device 0.0 on pci1
siba_bwn0: warn: multiple PCI(E) cores
siba_bwn0: unsupported coreid (USB 2.0 Device)
siba_bwn0: unsupported coreid (unknown)
siba_bwn0: unsupported coreid (Internal Memory)
bwn0 on siba_bwn0
bwn0: bwn_phy_n_attach: BWN_GPL_PHY not in kernel config; no PHY-N support
bwn0: failed
device_attach: bwn0 attach returned 6

so for me it looks like that the BMC4322 is now detected but can't not loaded? Is my thinking correct?

Do you know what's going wrong? Do you have an idea how to fix it?

Thank you so much for your support.

greetings
Joachim
 

Phishfry

Son of Beastie

Reaction score: 1,977
Messages: 4,967

Let me know if you need help. It might seem daunting but it is not that bad.
So you need FreeBSD source. Do you have it installed? Check under /usr/src/. This is the top level source directory.
If you did not install the source on install then download it:
svnlite checkout https://svn.freebsd.org/base/releng/11.2 /usr/src/

First you need to add to your kernel configuration by making a custom kernconf.
https://www.freebsd.org/doc/handbook/kernelconfig-config.html
I am assuming here that you are using FreeBSD 11.2 AMD64 build.

cd /usr/src
## move to top level directory ##

cp /usr/src/sys/amd64/conf/GENERIC WIFI
## Copy the GENERIC kernconf to a file named WIFI ##

ee /usr/src/sys/amd64/conf/WIFI
## This is the easy editor. You are opening your new kernconf to add the options you need ##
Down around line 297 add the following:
option BWN_DEBUG
option BWN_GPL_PHY

Now hit the escape key>> a) leave editor >> a) save changes

This is the KERNCONF now fixed up with your custom kernel options and saved as your WIFI kernconf.

Now you must edit your makefile (shown using easy editor)
ee /usr/src/sys/modules/bwn/Makefile

Now notice the code comments:
# Uncomment this for the GPL PHY code; this requires the
# module be built with BWN_GPL_PHY set in the kernel
# configuration.

So all the lines below this comment need to have the pound symbol removed. (pound symbol = #)
You can use backspace or delete key to remove the # symbols.
Lines 21,22,23,24,25,26,27

Now hit the escape key>> a) leave editor >> a) save changes

So now all your editing is done and all you need to do is compile your custom kernel.
make buildkernel KERNCONF=WIFI
make installkernel KERNCONF=WIFI
This could take many, many hours. If you have multiple CPU cores you can speed it up by using the -j option flag.
For a 2 core Example:
make -j 2 buildkernel KERNCONF=WIFI
make -j 2 installkernel KERNCONF=WIFI
When complete reboot and see what you have.
if you followed my advice above you know which firmware needs to be kldload 'ed. Load it by hand and see what you get.
 
OP
J

joaf

New Member

Reaction score: 1
Messages: 6

Hello Phishfry,

thank you so mich for your detailed description. I will follow your step by step guide to build my custom kernel.

But this takes some time because i'm the next days on a business trip. I will inform you if i have tested.

Greetings from germany

Joachim
 
OP
J

joaf

New Member

Reaction score: 1
Messages: 6

Hello Phishfry,

after compiling and installing custom kernel with your howTo descprition. My Broadcom BMC4322 works now like a charme.

I have now used the following settings

in the loader.conf i use the settings:
bwn_v4_n_ucode_load="YES"
if_bwn_load="YES"


in the /etc/rc.conf i use the follwing settings:
wlans_bwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"


then i have my /etc/wpa_supplicant.conf
network={
ssid="Homezonexxxx-xxxxx"
psk="Komplexxxxx---xxxxx"
}


now my WIFI Device is activated, i can ping all resources. So for me it looks like that the custom kernel works great.

One question to the custom Kernel. What happens when i upgrade to a later Freebsd release? Have i also create the customer kernel new, as you descriped? Or can i use this custom kernel for further releases?

Thank you so much for your great help and your time. I have learned a lot of handling inside freebsd.

It was a pleasure to learn from you.

Greetings

Joachim
Let me know if you need help. It might seem daunting but it is not that bad.
So you need FreeBSD source. Do you have it installed? Check under /usr/src/. This is the top level source directory.
If you did not install the source on install then download it:
svnlite checkout https://svn.freebsd.org/base/releng/11.2 /usr/src/

First you need to add to your kernel configuration by making a custom kernconf.
https://www.freebsd.org/doc/handbook/kernelconfig-config.html
I am assuming here that you are using FreeBSD 11.2 AMD64 build.

cd /usr/src
## move to top level directory ##

cp /usr/src/sys/amd64/conf/GENERIC WIFI
## Copy the GENERIC kernconf to a file named WIFI ##

ee /usr/src/sys/amd64/conf/WIFI
## This is the easy editor. You are opening your new kernconf to add the options you need ##
Down around line 297 add the following:
option BWN_DEBUG
option BWN_GPL_PHY

Now hit the escape key>> a) leave editor >> a) save changes

This is the KERNCONF now fixed up with your custom kernel options and saved as your WIFI kernconf.

Now you must edit your makefile (shown using easy editor)
ee /usr/src/sys/modules/bwn/Makefile

Now notice the code comments:
# Uncomment this for the GPL PHY code; this requires the
# module be built with BWN_GPL_PHY set in the kernel
# configuration.

So all the lines below this comment need to have the pound symbol removed. (pound symbol = #)
You can use backspace or delete key to remove the # symbols.
Lines 21,22,23,24,25,26,27

Now hit the escape key>> a) leave editor >> a) save changes

So now all your editing is done and all you need to do is compile your custom kernel.
make buildkernel KERNCONF=WIFI
make installkernel KERNCONF=WIFI
This could take many, many hours. If you have multiple CPU cores you can speed it up by using the -j option flag.
For a 2 core Example:
make -j 2 buildkernel KERNCONF=WIFI
make -j 2 installkernel KERNCONF=WIFI
When complete reboot and see what you have.
if you followed my advice above you know which firmware needs to be kldload 'ed. Load it by hand and see what you get.
 

Phishfry

Son of Beastie

Reaction score: 1,977
Messages: 4,967

What happens when i upgrade to a later Freebsd release?
If you run freebsd-update it will create a GENERIC kernel only. You must re-compile WIFI again for your custom settings.
That is the reason you copy GENERIC to make a custom kernconf.
GENERIC kernconf might get changed during an update. WIFI kernconf will not be touched.
You could just modify GENERIC kernconf instead of making a custom WIFI kernconf, but you lose the settings during an upgrade.
https://www.freebsd.org/doc/handbook/updating-upgrading-freebsdupdate.html
Only the GENERIC kernel can be automatically updated by freebsd-update. If a custom kernel is installed, it will have to be rebuilt and reinstalled after freebsd-update finishes installing the updates. However, freebsd-update will detect and update the GENERIC kernel if /boot/GENERIC exists, even if it is not the current running kernel of the system.
Thanks for the feedback. I helped one person who had trouble building the bwn firmware from ports.
Unfortunately I did not know of the custom kernel requirement at the time.
I feel like I wasted his time. Now I know what I was missing.
 

Phishfry

Son of Beastie

Reaction score: 1,977
Messages: 4,967

OK how about the super cool refined method.
The problem: Your WIFI kernconf is 'static'. If you upgrade to FreeBSD 12 there maybe different options or devices.
One way to deal with this is to copy GENERIC kernconf to WIFI each upgrade and add your changes. Boring.

Solution is to borrow a method from GENERIC-NODEBUG kernconf that is used on FreeBSD -CURRENT
As seen here:https://github.com/freebsd/freebsd/blob/master/sys/amd64/conf/GENERIC-NODEBUG

So try this for your WIFI kernconf next time you update.
It will bring all the benefits of the upgraded GENERIC kernconf and keep your custom options.

/usr/src/sys/amd64/conf/WIFI
Code:
include GENERIC
ident   WIFI

option BWN_DEBUG
option BWN_GPL_PHY
 
OP
J

joaf

New Member

Reaction score: 1
Messages: 6

OK how about the super cool refined method.
The problem: Your WIFI kernconf is 'static'. If you upgrade to FreeBSD 12 there maybe different options or devices.
One way to deal with this is to copy GENERIC kernconf to WIFI each upgrade and add your changes. Boring.

Solution is to borrow a method from GENERIC-NODEBUG kernconf that is used on FreeBSD -CURRENT
As seen here:https://github.com/freebsd/freebsd/blob/master/sys/amd64/conf/GENERIC-NODEBUG

So try this for your WIFI kernconf next time you update.
It will bring all the benefits of the upgraded GENERIC kernconf and keep your custom options.

/usr/src/sys/amd64/conf/WIFI
Code:
include GENERIC
ident   WIFI

option BWN_DEBUG
option BWN_GPL_PHY

This sounds very interesting. I will try it for the next update. I will keep it in my description for my setup.
It's a great experience that you Grant me such detailed informations and instructions.

Greetings and thanks Form germany
 
Top