Wireless not working

Hi all, first post here.
Installed FreeBSD for the first time on my laptop. Have followed the Handbook and got most things like X, XFCE, X config etc working.

However, I am really having trouble trying to get wireless working. I have tried the following till now:

This is an extract about the wireless hardware from pciconf:

Code:
vendor     = 'Broadcom Corporation'
    device     = 'BCM4312 802.11b/g LP-PHY'
    class      = network

So, as per the Handbook, I should use the bwn(4) driver.

i have done the following till now:

  • Installed bwn-firmware-kmod from ports
  • Added the following to /boot/loader.conf
    Code:
    if_bwn_load="YES"
    bwn_v4__lp_ucode_load="YES"
    
    # if_bwi_load="YES"
    wlan_scan_ap_load="YES"
    wlan_scan_sta_load="YES"
    wlan_wep_load="YES"
    wlan_ccmp_load="YES"
    wlan_tkip_load="YES"
  • added this to rc.conf
    Code:
    wlans_bwn0="wlan0"
    ifconfig_wlan0="ssid HSD DHCP"

    And tried all that's shown here http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-wireless.html.

    But still it doesn't work. ifconfig wlan0 up scan gives nothing:
    Code:
    root@BSDbox:~ # ifconfig wlan0 scan
    root@BSDbox:~ #

    dmesg output is:

    Code:
    root@BSDbox:~ # dmesg|tail
    bwn0: the fw file(bwn_v4_lp_ucode15) not found
    bwn-open_v4_lp_ucode15: could not load firmware image, error 2
    bwn0: the fw file(bwn-open_v4_lp_ucode15) not found
    ubt0: <Broadcom Corp HP Integrated Module, class 224/1, rev 2.00/1.65, addr 2> on usbus0
    WARNING: attempt to domain_add(bluetooth) after domainfinalize()
    WARNING: attempt to domain_add(netgraph) after domainfinalize()
    bwn_v4_lp_ucode15: could not load firmware image, error 2
    bwn0: the fw file(bwn_v4_lp_ucode15) not found
    bwn-open_v4_lp_ucode15: could not load firmware image, error 2
    bwn0: the fw file(bwn-open_v4_lp_ucode15) not found

    ifconfig output:

    Code:
    root@BSDbox:~ # ifconfig
    bwn0: flags=8803<UP,BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
    	ether 00:26:5e:46:3e:ba
    	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    	status: no carrier
    re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    	options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
    	ether 00:23:5a:c6:da:5b
    	inet6 fe80::223:5aff:fec6:da5b%re0 prefixlen 64 scopeid 0x2 
    	inet 192.168.0.104 netmask 0xffffff00 broadcast 192.168.0.255 
    	nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
    	media: Ethernet autoselect (100baseTX <full-duplex>)
    	status: active
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
    	inet6 ::1 prefixlen 128 
    	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 
    	inet 127.0.0.1 netmask 0xff000000 
    	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
    	ether 00:26:5e:46:3e:ba
    	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    	status: no carrier
    	ssid HSD channel 1 (2412 MHz 11b)
    	country US authmode WPA1+WPA2/802.11i privacy OFF txpower 30 bmiss 7
    	scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7
    	roam:rate 1 wme bintval 0

I can see that the firmware file is not being loaded. How do I get it to load? I checked the /boot/firmware folder and it's empty. So I manually copied .fw files from the bwn ports directory, but that didn't work either. I tried renaming the module files (.ko) in /boot/modules to what the OS is looking for, but that failed too. I am almost at my wit's end now, and don't know how to go on from here. What do I need to do?
 
Broadcom cards can be a pain. Some have the same model numbers but are different enough to not be supported by the same driver. It looks like you've done the right things, but I would suggest posting in the freebsd-wireless mailing list. Sorry I can't say whether that card is supported or not, but I stopped keeping track of the Broadcom cards quite a while back.
 
I can’t help you, technically speaking, but I just noticed a double understrike here:
Code:
bwn_v4__lp_ucode_load="YES"
It would be nice if it was just that…
 
that's a great observation, Juanitou! Unfortunately fixing it didn't help :(

I have a feeling that the firmware files are not getting copied where they should. During installation, there is some warning like 'Warning: Work directory not changed from original..." or something similar.
Also, in the work directory in /usr/ports/net/bwn-firmware-kmod, I can see files with names like ucode15.fw and ucode15.fw.fwo.
I think these files should get copied somewhere in the system folders. I just don't know where. If I can figure that out maybe i can copy the files manually....
 
Code:
wpa_supplicant -Dbsd -iwlan0 -c /etc/wpa_supplicant.conf -dd 
... wait until on another tty ifconfig shows "associated"
... dhclient wlan0
.............................
rc.conf
Code:
wlans_bwi0="wlan0"
wlans_ndis0="wlan0
ifconfig wlan0="WPA SYNCDHCP"

loader.conf
Code:
if_bwi_load="YES"
bwi_v3_ucode_load="YES"
wlan_tkip_load="YES"
if_vlan_load="YES"
in /boot/modules you should see ndis files, port-generated files, etc.

Unfortunately I don't remember enough of the long involved process to supply more than the hints above [which may not be entirely accurate nor in context, and relate to more than one driver, and/or have extra unneeded lines which break it all... , ] i.e. (bwi, bwn, ndis etc confusion, ) as they replaced rum0 upon unexpectedly starting to work [ I had initial difficult success with an Edimax (bwn) dongle, then unexpected success with the other non-bwn-whatever one(s)...had several successes with ndis and an Edimax, but not enough documentation to duplicate it reliably in
a post without hours of retesting.

BTW there are long threads in this forum about one or more of the specific drivers I mentioned above. I had to tediously test each one of maybe forty or so wpa_supplicant.conf's that I had copied down... but it started working in each of the two wireless instances I can use now.
 
By inspecting the port Makefile and pkg-list files it looks like you have to end with two files in /boot/kernel/ directory:

pkg-list
Code:
@cwd %%KMODDIR%%
%%KMODNAME%%.ko
%%KMODNAME_LP%%.ko
Makefile
Code:
FWNAME=         bwn_v4
KMODNAME=       ${FWNAME}_ucode
FWNAME_LP=      bwn_v4_lp
KMODNAME_LP=    ${FWNAME_LP}_ucode

It seems to me, that you are looking for bwn_v4_ucode.ko and bwn_v4_lp_ucode.ko.
 
ondra_knezour said:
It seems to me, that you are looking for bwn_v4_ucode.ko and bwn_v4_lp_ucode.ko.

thanks ondra_knezour, both those files are getting created in /boot/modules
Should I try copying them to /boot/kernel?
 
It depends. The kldload() man page states, that modules are residing in /boot/kernel/ directory:
Code:
/boot/kernel  directory containing loadable modules.  Modules must have an extension of .ko.
but kldconfig() man page says, that default search path is
Code:
/boot/kernel, /boot/modules, /modules The default module search path used by the kernel.

On my unmodified old 9.0-STABLE I get
kldconfig -r
Code:
/boot/kernel;/boot/modules

So you can first check your configured path and then move the modules by output you get.
 
I just checked kldconfig -r

and i get the following:

Code:
/boot/kernel;/boot/modules

So no problem here...
 
The current status is as follows:

ifconfig wlan0 gives:

Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:26:5e:46:3e:ba
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
	ssid "" channel 1 (2412 MHz 11b)
	country US authmode OPEN privacy OFF txpower 30 bmiss 7 scanvalid 60
	bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 1 wme
	bintval 0

So it is UP.
However, ifconfig wlan0 scan still shows nothing

and dmesg|tail still shows

Code:
bwn_v4_lp_ucode15: could not load firmware image, error 2
bwn0: the fw file(bwn_v4_lp_ucode15) not found
bwn-open_v4_lp_ucode15: could not load firmware image, error 2

Now I don't understand why the interface is UP if modules haven't been loaded ...
 
Based on the file not found message in your dmesg output I would suspect that something has go wrong with installation/linking. In conf/kmod.mk is
Code:
.for _firmw in ${FIRMWS}
${_firmw:C/\:.*$/.fwo/}:        ${_firmw:C/\:.*$//}
        @${ECHO} ${_firmw:C/\:.*$//} ${.ALLSRC:M*${_firmw:C/\:.*$//}}
        @if [ -e ${_firmw:C/\:.*$//} ]; then                    \
                ${LD} -b binary --no-warn-mismatch ${LDFLAGS}   \
                    -r -d -o ${.TARGET} ${_firmw:C/\:.*$//};    \
        else                                                    \
                ln -s ${.ALLSRC:M*${_firmw:C/\:.*$//}} ${_firmw:C/\:.*$//}; \
                ${LD} -b binary --no-warn-mismatch ${LDFLAGS}   \
                    -r -d -o ${.TARGET} ${_firmw:C/\:.*$//};    \
                rm ${_firmw:C/\:.*$//};                         \
        fi
The FIRMWS variable is set in Makefile in working directory of the port, files are existent there, so as output of the if [ -e test they should be linked into binary, which I suppose is later linked into kernel module.

Based on what is written above, I would check if your system sources in /usr/src/ are in sync with your installed system and then try to examine installed modules with ldd(). There should be linked in objects of binary blobs which are put into card on module load. However someone more skilled with compilation/linking may give you more advices how to test given modules on required objects presence.
 
uberjoker said:
Now I don't understand why the interface is UP if modules haven't been loaded...

The modules have been probably loaded (check with kldstat()), but software required to drive internal logic of the card has not been loaded in, see my previous post. So the device probably "talks" with the module/driver, but is totally out of idea what it should do, because internal firmware is not loaded.
 
Thanks ondra_knezour for putting in all this effort. Much appreciated.

ondra_knezour said:
Based on what is written above, I would check if your system sources in /usr/src/ are in sync with your installed system

How do I do this? And good you brought this up. During installation, I did not install the sources. I downloaded the sources later through svn because the bwn-firmware-kmod port required the the sources to be in /usr/src. So might there be a chance of system and sources being out of sync?

and then try to examine installed modules with ldd(). There should be linked in objects of binary blobs which are put into card on module load. However someone more skilled with compilation/linking may give you more advices how to test given modules on required objects presence.


I actually am very new to FreeBSDso I am afraid I don't understand this much!
 
Can you post the output of
Code:
kldstat | grep bwn
and
Code:
pkg info -l bwn-firmware-kmod
You can also try to manually load the firmware with the following command
Code:
kldload /boot/modules/bwn_v4_lp_ucode15.ko
. You probably need to destroy the wlan0 interface prior to load the firmaware
 
Hi acheron,

Here's the output:
Code:
root@BSDbox:~ # kldstat | grep bwn
 2    1 0xc1677000 399d4    if_bwn.ko
 3    2 0xc16b1000 9eb0     siba_bwn.ko

Code:
root@BSDbox:~ # pkg info -l bwn-firmware-kmod
bwn-firmware-kmod-0.1.0:

I destroyed wlan0 and did this:

Code:
ifconfig wlan0 destroy
root@BSDbox:~ # kldload /boot/modules/bwn_v4_lp_ucode.ko
kldload: can't load /boot/modules/bwn_v4_lp_ucode.ko: File exists
 
uberjoker said:
Thanks ondra_knezour for putting in all this effort. Much appreciated.

ondra_knezour said:
Based on what is written above, I would check if your system sources in /usr/src/ are in sync with your installed system

I just realised that my /usr/src is synced with the STABLE tree, while I most probable have the RELEASE version of the OS installed...is this a problem?
 
Damn!
Ok, here's the output:

Code:
uname -a
FreeBSD BSDbox 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Fri Jan 17 01:46:25 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  i386

Code:
root@BSDbox:/usr/src # svn info
Path: .
Working Copy Root Path: /usr/src
URL: https://svn0.eu.freebsd.org/base/stable/10
Relative URL: ^/stable/10
Repository Root: https://svn0.eu.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 261131
Node Kind: directory
Schedule: normal
Last Changed Author: hselasky
Last Changed Rev: 261116
Last Changed Date: 2014-01-24 13:57:19 +0530 (Fri, 24 Jan 2014)
 
It confirms that your src tree is following the 10-stable branch and you're running 10.0-RELEASE. Grab the 10.0-RELEASE src tree and recompile all your modules.
 
Ok, thanks.How do I go about syncing with the proper tree now?
I tried svn checkout but I get:

Code:
svn: E155000: '/usr/src' is already a working copy for a different URL

Should I manually delete everything inside /usr/src?

I am really new here so I am not sure.
 
Ok I did svn switch

and now this is the output of svn info

Code:
root@BSDbox:/usr/src # svn info
Path: .
Working Copy Root Path: /usr/src
URL: https://svn0.eu.freebsd.org/base/release/10.0.0
Relative URL: ^/release/10.0.0
Repository Root: https://svn0.eu.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 261160
Node Kind: directory
Schedule: normal
Last Changed Author: gjb
Last Changed Rev: 260789
Last Changed Date: 2014-01-17 00:13:50 +0530 (Fri, 17 Jan 2014)

Is this ok?
 
Yes it's ok now, rebuild all your third party modules (ie, the ones from /boot/modules, pkg which /boot/modules/*.ko is your friend)
 
The preferred method is to delete /usr/src and do a fresh checkout, but switch should be okay. I'm not convinced that's the problem.

In the first post, a lot of stuff is added to /boot/loader.conf:
Code:
if_bwn_load="YES"
bwn_v4_lp_ucode_load="YES"

# if_bwi_load="YES"
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"

Remove all of that but the first two lines. Those modules are all part of the GENERIC kernel already. While debugging, commenting out the first two lines would also help, letting you load those modules manually with kldload.

When a module is not shown in kldstat, but can't be reloaded (File exists), that generally means it has been built into the kernel. Did you build a custom kernel?
 
Seems to be working now!

Here's what I did after svn switch

  • cd /usr/ports/net/bwn-firmware-kmod
  • make deinstall
    This command failed actually, so I manually deleted .ko files from /boot/modules
  • make install clean
  • Reboot

After rebooting, here's output of ifconfig

Code:
root@BSDbox:~ # ifconfig
bwn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
	ether 00:26:5e:46:3e:ba
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
	ether 00:23:5a:c6:da:5b
	inet6 fe80::223:5aff:fec6:da5b%re0 prefixlen 64 scopeid 0x2 
	inet 192.168.0.104 netmask 0xffffff00 broadcast 192.168.0.255 
	nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 
	inet 127.0.0.1 netmask 0xff000000 
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:26:5e:46:3e:ba
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
	ssid "" channel 1 (2412 MHz 11b)
	country US authmode OPEN privacy OFF txpower 30 bmiss 7 scanvalid 60
	bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 1 wme
	bintval 0

ifconfig wlan0 up scan
ifconfig wlan0 scan

Gave nothing

ifconfig again:

Code:
bwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
	ether 00:26:5e:46:3e:ba
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
	status: associated
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
	ether 00:23:5a:c6:da:5b
	inet6 fe80::223:5aff:fec6:da5b%re0 prefixlen 64 scopeid 0x2 
	inet 192.168.0.104 netmask 0xffffff00 broadcast 192.168.0.255 
	nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 
	inet 127.0.0.1 netmask 0xff000000 
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:26:5e:46:3e:ba
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
	ssid "" channel 12 (2467 MHz 11g)
	country US authmode OPEN privacy OFF txpower 30 bmiss 7 scanvalid 60
	bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5
	protmode CTS wme bintval 0

kldstat
Code:
Id Refs Address    Size     Name
 1   11 0xc0400000 1276c0c  kernel
 2    1 0xc1677000 399d4    if_bwn.ko
 3    2 0xc16b1000 9eb0     siba_bwn.ko
 4    1 0xc16bb000 2cbb8    bwn_v4_lp_ucode.ko

And somehow I thought of checking dmesg and here's what it showed:
Code:
wlan0: Ethernet address: 00:26:5e:46:3e:ba
bwn0: firmware version (rev 478 patch 104 date 0x8701 time 0x657)
wlan0: ieee80211_new_state_locked: pending INIT -> SCAN transition lost
bwn0: status of RF switch is changed to OFF
bwn0: please turn on the RF switch
bwn0: status of RF switch is changed to ON
ugen0.3: <Broadcom Corp> at usbus0

So I try ifconfig wlan0 scan
and voila!
Code:
SSID/MESH ID    BSSID              CHAN RATE   S:N     INT CAPS
D-link          cc:b2:55:df:96:b8   11   54M -135:-95  100 EP   RSN HTCAP WME
Naga            84:c9:b2:2a:ff:78   11   54M -137:-95  100 EP   RSN HTCAP WME
Connectify-...  1a:ed:b9:4e:5b:c6   11   54M -140:-95  100 EPS  RSN HTCAP WME ATH
HSD             c8:d3:a3:4e:b1:42    2   54M -113:-95  100 EPS  HTCAP WPA RSN WME WPS

Now I only need to figure out the connecting part!
Sorry for the long post, I think you guys might be able to throw some light on what changed, aside from the updating of the/usr/srctree to the proper version.

Thanks @wblock and @acheron for the help!!
 
Last edited by a moderator:
Back
Top