# Setup Wireless Networking on PowerBook G4



## alehed (Sep 25, 2016)

Hi, 

I got a PowerBook G4 12' from 2005 running FreeBSD 10.3 for PowerPC and I'm currently struggling to set up wireless networking on it. Using Ethernet everything works fine.

The wireless card is the Broadcom BCM4306 revision 3. According to the manpages bwi(4) should be the driver I need. But when use bwi (either loaded or compiled into the kernel) it crashes and creates a boot loop. 
After that I tried the newer driver bwn(4) which loads without crashes and bwn0 is listed by `ifconfig`

Following the section from the handbook on wireless networking has not worked for me.
More specifically:

I created /etc/wpa_supplicant.conf and put the network credentials into it: 


```
network={
        ssid="myssid" # this is not the actual ssid
        psk="my_psk" # again not the actual psk
}
```


The relevant entries in the /etc/rc.conf are:


```
wlans_bwi0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP" # I also tried "WPA DHCP"
```


restarting the network interface with `service netif restart` run as root does not yield a working wireless connection.

The output of the command is:

```
fw_tl_free: the xfer is not in the queue (tlabel=0, flag=0x0)
send: dst=0x00 tl=0x00 rt=0 tcode=0x0 pri=0x0 src=0x000
recv: dst=0x00 tl=0x00 rt=0 tcode=0x0 pri=0x0 src=0x000
KDB: stack backtrace:
#0 0x1a76e0 at fw_tl_free+0x174
#1 0x1a79b4 at fw_xfer_unload+0x16c
#2 0x1a7a38 at fw_xfer_free+0x40
#3 0x1b5f54 at fwe_stop+0xd8
#4 0x1b7008 at fwe_ioctl+0xb4
#5 0x55bb0c at ifioctl+0xf94
#6 0x4daa3c at soo_ioctl+0x6b8
#7 0x4d2c04 at kern_ioctl+0x354
#8 0x4d2e90 at sys_ioctl+0x128
#9 0x7882d0 at trap+0x6cc
#10 0x779028 at powerpc_interrupt+0x170
<this is repeated about 20 times>
gem0: cannot reset RX MAC
<repeated three times>
dhclient not running? (check /var/run/dhclient.fwe0.pid)
dhclient not running? (check /var/run/dhclient.fwe0.pid)
Stopping Network: lo0 bwn0 fwe0 gem0 pflog0.
<output of ifconfig with all down>
Starting Network: lo0 bwn0 fwe0 gem0
<output of ifconfig with bwn0 down with status: no carrier and others up>
```

pinging google results in 

```
ping: cannot resolve google.com: Host name lookup failure
```

Simply running `service netif start` doesn't print any errors but also does not result in a working network connection.

Now being new to FreeBSD and networking on FreeBSD I hope someone can point me to the source of the issue.

Best,
Alexander


----------



## ASX (Sep 25, 2016)

alehed said:


> The wireless card is the Broadcom BCM4306 *revision 3*. According to the manpages bwi(4) should be the driver I need.



To me it seems you should really use the bwn (firmware v4), not the bwi (firmware v3).

bwi(4)
"You must use the bwi driver if you are using older Broadcom chipsets (BCM4301, BCM4303 and BCM4306 *rev 2*).

bwn(4)
"Users of older Broadcom chipsets (BCM4301, BCM4303 and BCM4306 *rev 2*) must use bwi(4) because the v4 version of the firmware does not support these chips.  The newer firmware is too big to fit into these old chips."

Additionally, you should install the firmware from the ports tree, like instructed from bwn(4)
"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.  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."


----------



## alehed (Sep 25, 2016)

Like described in the man pages I installed bwi-firmware-kmod. 
I then changed the content of /boot/loader.conf to

```
if_bwi_load="YES"
```

Unfortunately when I let it reboot with that module, it gets stuck in a reboot loop.


----------



## kpa (Sep 25, 2016)

You have a bwn0 device according to kernel message but you're trying to configure a bwi0 device in /etc/rc.conf, that's not going to work.


----------



## alehed (Sep 25, 2016)

I changed the line to bwn0. Now I get a slew of warning about failing to start dhclient and that it could not load the firmware image.
So I guess I do need the bwi(4) driver. Only problem is it crashes the kernel at startup. Is there any way I can debug it and get some sort of crash log?


----------



## alehed (Sep 30, 2016)

ASX said:


> To me it seems you should really use the bwn (firmware v4), not the bwi (firmware v3).



Sorry I misread your comment from above. bwn(4) was indeed the right driver. What I needed to do was load bwn_v4_ucode before if_bwn. I also set 
	
	



```
ifconfig_wlan0="WPA DHCP"
```
. 

I still get a few error messages related to rx decryption at startup but overall it works now. Thanks for the help.


----------



## ASX (Sep 30, 2016)

alehed said:


> I still get a few error messages related to rx decryption at startup but overall it works now.



Glad it works ... hopefully the messages are harmless ... good luck!


----------

