Solved Broadcom BCM4313

Hello: the laptop I am working on for our local American Legion post, an Acer "Aspire One", includes a Broadcom BCM4313 WLAN chip on the motherboard. I am trying to get it in operation. I searched the threads on this forum and found an old one from 2012 which had some very useful info, but I figured that there must have been some progress made since then. So, I went to Broadcom's website and found two Linux drivers for this adapter, one 64 bit and one 32 bit version. I downloaded the 64 bit version and extracted it. There are a ton of files in two main directories, src and lib. At this point, I can't figure out which to use where.

Anyone?

Ken Gordon
 
Isn't it described here?
They used ndisgen(), which is
The ndisgen script uses the ndiscvt(8) utility and other tools to
generate a FreeBSD loadable driver module and a static ELF object module
from a Windows® NDIS driver, for use with the ndis(4) compatibility module.
 
OK. I went through that entire exercise, but, apparently, I have several issues.

1) After doing all of that, and after doing wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -dd the output is as follows;
Code:
wpa_supplicant v2.6
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'default' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant.conf'
Line: 1 - start of a new network block
ssid - hexdump_ascii(len=8):
     53 48 41 4d 52 4f 43 4b                           SHAMROCK        
PSK (ASCII passphrase) - hexdump_ascii(len=11): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
Priority group 0
   id=0 ssid='SHAMROCK'
wpa_driver_bsd_init: interface wlan0 does not exist
wlan0: Failed to initialize driver interface
Failed to add interface wlan0
wlan0: Cancelling scan request
wlan0: Cancelling authentication timeout
2) When I run pciconf -lv, I am presented with this info;
Code:
none1@pci0:2:0:0:    class=0x028000 card=0x051014e4 chip=0x472714e4 rev=0x01 hdr=0x00
    vendor     = 'Broadcom Inc. and subsidiaries'
    device     = 'BCM4313 802.11bgn Wireless Network Adapter'
    class      = network
(Notice the "none1" ?
3)Checking in /dev, I find no entry for wlan0, which may not be of importance.

4) dmesg -a | more does not show a wireless LAN adapter at all.

5) Although there is a .INF file associated with all the other Windows drivers, it is never used here.

6) I had thought to replace "wlan0" in all appropriate files with "none1". but that seemed to me to be less than helpful, so I didn't do it.

Suggestions? Helpful hints?

Ken Gordon
 
I think you have to create wlan0 from ndis0 ― do you see the latter?
Code:
ifconfig wlan0 create wlandev ndis0
There is Broadcom NDIS HOWTO thread (from 2012).
Also, there is even older NDIS related HOWTO.

I used to use NDIS long time ago, unfortunately do not remember details...
 
Thank you again. Obviously, I still have work to do. I will say that so far, this is the biggest PITA I have run into while working with this Acer laptop.

The only thing I have left after I get this sorted out is to activate the I2C-based touch pad.....and I am not looking forward to doing that.

And, I don't see how the folks I am doing this for can even remotely appreciate all the work that has been and still is necessary. Many hours.

Oh, well....

And they have 5 more of these I have to work on, but at least after this one, the rest should be....easier...

Ken Gordon
 
You can still try building that driver, it's easy, you'll need to get the kernel src code in /usr/src though.
I guess, in my case the 12.* doesn't recognize the I2C bus in my computer (it's too new!).
 
OK. Getting back, for the moment, to my NDIS issue, I have been reviewing the files concerned.

1) First of all, I may have an error in my rc.conf. Here is the code:
Code:
hostname="pharc2"          
zfs_enable="YES"
kld_list="sysctlinfo"
moused_enable="YES"
ifconfig_alc0="DHCP"
wlans_ndis0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
wpa_supplicant_enable="YES"
linux_enable="YES"
dbus_enable="YES"
dsbdriverd_enable="YES"
lightdm_enable="YES"
cupsd_enable="YES"
samba_server_enable="YES"
I am suspicious of the line
Code:
wlans_ndis0="wlan0"
. That doesn't look correct to me, but I don't yet know enough to tell.

2) Here is my wpa_supplicant.conf
Code:
network={
   ssid="SHAMROCK"
   psk="Ab2thW3Aohc"
}
ifconfig wlan0 create wlandev ndis0
ifconfig wlan0 up
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D ndis0
dhclient wlan0
As one can see, the ifconf "create" command is contained there. However, when I then do wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -dd, the output is as follows:
Code:
wpa_supplicant v2.6
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'default' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant.conf'
Line: 1 - start of a new network block
ssid - hexdump_ascii(len=8):
     53 48 41 4d 52 4f 43 4b                           SHAMROCK       
PSK (ASCII passphrase) - hexdump_ascii(len=11): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
Line 5: unknown global field 'ifconfig wlan0 create wlandev ndis0'.
Line 5: Invalid configuration line 'ifconfig wlan0 create wlandev ndis0'.
Line 6: unknown global field 'ifconfig wlan0 up'.
Line 6: Invalid configuration line 'ifconfig wlan0 up'.
Line 7: unknown global field 'wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D ndis0'.
Line 7: Invalid configuration line 'wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D ndis0'.
Line 8: unknown global field 'dhclient wlan0'.
Line 8: Invalid configuration line 'dhclient wlan0'.
Priority group 0
   id=0 ssid='SHAMROCK'
Failed to read or parse configuration '/etc/wpa_supplicant.conf'.
Failed to add interface wlan0
: Cancelling scan request
: Cancelling authentication timeout

It seems obvious to me (perhaps I am wrong) that ndis0 does not exist.

3) Lastly, here is my bcm4313 executable in /etc/rc.d which does show up in the boot process as loading the drivers.
Code:
#!/bin/sh

# PROVIDE: bcm4313
# REQUIRE: NETWORKING
# BEFORE: LOGIN
# KEYWORD: nojail

. /etc/rc.subr

name="bcm4313"
start_cmd="${name}_start"
stop_cmd=":"

bcm4313_start()
{
   echo "Loading Broadcom BCM4313 NDIS kernel modules."
   kldload bcm43xx64.cat.ko
   kldload bcmihvui64.dll.ko
   kldload bcmihvsrv64.dll.ko
   kldload bcmwl63a.sys.ko
}

load_rc_config $name
run_rc_command "$1"
This appears to be working correctly.

At this point, I am kinda stuck.
Ken Gordon
 
It seems obvious to me that given the errors from the wpa_supplicant.conf that, most likely, wlan0 is missing, therefore ndis0 cannot be made....or vice-versa.

Ken Gordon
 
Just a side note (for now):
Code:
wlans_ndis0="wlan0"
is the same as
Code:
ifconfig wlan0 create wlandev ndis0
and used at boot-up.
Code:
kldload bcm43xx64.cat.ko
kldload bcmihvui64.dll.ko
kldload bcmihvsrv64.dll.ko
kldload bcmwl63a.sys.ko
What do you see in dmesg() when you load those drivers?
 
Just a side note (for now):
Code:
wlans_ndis0="wlan0"
is the same as
Code:
ifconfig wlan0 create wlandev ndis0
and used at boot-up.
OK. The first is in rc.conf, and I believe that is read first, so I suppose I could comment out that line in wpa_supplicant.conf since it is redundant. I'll do that.

What do you see in dmesg() when you load those drivers?
Well, first of all I find this:
Code:
ifconfig: SIOCUFCIFCREATE2: Device not configured
This tells me that ifconfig did not make wlan0, and this means to me that the line in rc.conf
Code:
wlans_ndis0="wlan0"
fails because ndis0 does not exist. So, why not, or where is it?

Secondly, when loading the drivers, there is simply this message: "Loading Broadcom BCM4313 NDIS kernel modules.", and nothing is mentioned any further about them. From this I am assuming that they are being loaded correctly.

I also find that there is a vesa-driver loaded in the kernel, which is no longer needed. That means that in order to make everything right, I am going to have to compile another kernel, but that is a job for another time.

Ken Gordon
 
I am wondering if these commands in rc.conf,
Code:
wlans_ndis0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
wpa_supplicant_enable="YES"
are simply out of order: maybe they should be like this:
Code:
wpa_supplicant_enable="YES"
wlans_ndis0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"

Ken Gordon
 
What is all this in your wpa_supplicant.conf file?
Code:
ifconfig wlan0 create wlandev ndis0
ifconfig wlan0 up
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D ndis0
dhclient wlan0

Get rid of it ... the errors shown when you tried to run wpa_supplicant clearly indicate lines 5-8 are something it doesn't understand.
All of that are commands that will be run when the system boots up because of what you have in rc,conf
 
I had wondered about those. Thanks.

With those gone, the important message from wpa_supplicant is "wlan0 does not exist"....but we knew that.

Ken
 
Well, I am down to knowing that ndis0 does not exist, period, and despite all the reading I have done, I have no idea where it should come from or how to make it.

Ken
 
From further reading, it appears that the drivers that ndisgen made are not the correct ones, since if they were the correct ones, ndis, which is in the kernel, would have then built ndis0 and would have attached it to the Broadcom NIC.

OK. I will revisit this.

Ken
 
Well, that didn't help.

So, where the heck is ndis0 ???? :confused:

Ken

It is useless what you are trying with Broadcom BCM4313 wireless card, in Linux this driver works very well, but in BSD it is a waste of time with this driver since many people have complained about the lack of interest of FreeBSD to make it compatible with this driver and the alternatives given in the handbook as ndis are useless, when rebooting the system it becomes a panic kernel.
 
Back
Top