# wifi setup



## MrRossi (Sep 12, 2010)

Hi
1st time poster and freeBSD so pleas be gentle 

I've recently installed freebsd 8 on an old laptop with a linksys wifi card which I'm struggling to set up using the guide http://www.freebsd.org/doc/handbook/network-wireless.html. My network is configured to WPA encryption.

From searching around it looks like I need to use the included broadcom drivers, following the guide I've set up my loader.conf file as : 


```
if_bwi_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```

I'm unsure I'll need the 2nd line but have added it in a wild attempt to resolve the issue.

So, I'm now at the section titled "How to find access points", using the guide and manual page I've tryed - 


```
ifconfig wlan create wlandev bwi0

and

ifconfig wlan0 create wlandev bwi0
```

Leading to the error - 

SIOCIFCREATE2: device not configured.

Seems fairly obvious the device hasn't loaded for some reason although I don't see what could have been missed out.

Sticking to the guide I've initially left out the lines below as it claims they are included automatically with the wireless driver : 


```
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
```

Figuring it can't hurt any I have now changed the loader.conf to - 


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

On booting I see the message dc0: linkstate changed to down.  I'm reasnably sure this wasn't present before the above change, although I'm unsure what it refers to.

The guide does say that loading should give something along the lines of - 


```
ath0: <Atheros 5212> mem 0x88000000-0x8800ffff irq 11 at device 0.0 on cardbus1
ath0: [ITHREAD]
ath0: AR2413 mac 7.9 RF2413 phy 4.5
```

In my case, I expect ath0 would be replaced with bwi0 or something similar, although the text flys by too quick to really inspect this.

Spent a few days googling like mad on this issue, if anyone has any tips or pointers I'd really appreciate it.

thanks.


----------



## gordon@ (Sep 13, 2010)

Read through the bwi(4) man page. It says you need the net/bwi-firmware-kmod port installed before it will function correctly. If you have already installed that, can you verify using the ifconfig(8) command that you see a bwi0 device?

Edit: Additionally, output of pciconf -l would also be helpful.


----------



## wblock@ (Sep 13, 2010)

MrRossi said:
			
		

> Hi
> 1st time poster and freeBSD so pleas be gentle
> 
> I've recently installed freebsd 8 on an old laptop with a linksys wifi card which I'm struggling to set up using the guide http://www.freebsd.org/doc/handbook/network-wireless.html. My network is configured to WPA encryption.



WPA is good, and we appreciate that you're following the Handbook.  It might be useful to give the model number of the Linksys card.



> From searching around it looks like I need to use the included broadcom drivers, following the guide I've set up my loader.conf file as :
> 
> 
> ```
> ...



Only the first line should be needed, the rest are part of the GENERIC kernel or autoloaded.

As Gordon said, you also need to install the firmware port and load that module.  Note that there are two Broadcom drivers, bwi and bwn.  bwi is for older and bwn newer cards, and each has its own firmware port.  Also as Gordon said, a pciconf -lv is useful, and you can narrow it down to just the wireless device for posting.

Note: I would suggest making sure your access point does not allow TKIP, which has had some security alerts not too long ago.  AES (CCMP) is okay AFAIK.

After you get the right driver loaded, the device should show in ifconfig.



> On booting I see the message dc0: linkstate changed to down.  I'm reasnably sure this wasn't present before the above change, although I'm unsure what it refers to.



It's your wired Ethernet card.


----------



## MrRossi (Sep 13, 2010)

Hi
Thanks for the help so far.
It's a WPC54G ver 1.2.
Just editing the loader.conf file and googling whether its bwi or bwn I need for this.


----------



## MrRossi (Sep 13, 2010)

Well. I've changed the loader.conf file and installed the ports.  Attempting to install the firmware port though gives the an error - 


```
wl_apsta-3.130.20.0.o doesnt seem to exist in /usr/ports/distfiles.

Attempting to fetch from [url]http://downloads.openwrt.org/sources/[/url]
```

Obviously it's unable to download them as the wifi isn't set up yet, although I don't see why its unable to find it in the 1st place.


----------



## gordon@ (Sep 14, 2010)

We don't distribute every ports source with the ports collection; there are just way too many distfiles. Download the cited file and get it onto your laptop either via usb key or using a wired ethernet that works.


----------



## MrRossi (Sep 15, 2010)

Hi
Thanks again for the help.  Have been working on this since then and seem to have hit another wall.
The CD drive doesnt appear to list any of the files on the disk so copying over that way is out (re-install from CD works though). It looks like plugging straight into the router and setting up the ethernet card might be the simplest way to get ahead.
From following the guide (http://docs.freebsd.org/doc/4.6.2-R.../books/ppp-primer/verify-ether-if-config.html)
I've added the following to the rc.conf file - 


```
network_interfaces="lo0 ed0"
ifconfig_lo0="inet 127.0.0.1"
ifconfig_ed0="inet 192.168.1.1 netmask 255.255.255.0"
```

lo0 wasnt present before but I added it anyway, 192.168.1.1 is definitely the ip for my router and I can ping this no problem, pinging out gives an unreachable message though and I was under the impression that plugging into a router removed the need for any passwords to get into it.

From ifcofig it looks like this has been set up (copied manually so formatting will be off sorry) - 


```
dc0: <UP, BROADCAST, RUNNING, SIMPLEX, MULTICAST> metric 0 mti 1500
options = 80008<VLAN_MTU, LINKSTATE>
ether (address here, not sure if this is needed) netmask 0xffffff00
broadcast 122.168.1.255
media: ethernet autoselect (100baseTX <full duplex>)
status active
```

there are also listings for fwe0, fwip0, plip0, and lo0 which i assume arent relevant.  would be good if someone could give me another nudge in the correct direction please


----------



## gordon@ (Sep 16, 2010)

You should probably be using DHCP if you have some sort of router provided by your ISP.


```
ifconfig_dc0="DHCP"
```

Using 192.168.1.1 will cause IP conflicts because your router and host would have the same IP address at that point.


----------



## MrRossi (Sep 19, 2010)

Hi
Thats got me to the point where I can access the net through an ethernet cable which is a massive step for me.  I've installed the bwi firmware port (and the kernal source tree, I got an error saying I needed that too).  I'm now at the network scanning stage, the command - 


```
ifconfig wlan0 create wlandev dc0
```

Gives an error like - 


```
dc0: wlan_clone_create: reject, not an 802.11 device
```

ifconfig shows -


```
dc0: <UP, BROADCAST, RUNNING, SIMPLEX, MULTICAST>
```

pciconf though shows - 


```
none2@pci0
```

Where I would have assumed it should be dc0ci0 or something similar.

I'm guessing now I either need to try something else I don't know about yet, or, worst case, chuck the card for a different one.


----------



## wblock@ (Sep 19, 2010)

MrRossi said:
			
		

> ```
> ifconfig wlan0 create wlandev dc0
> ```



Repeat: dc0 is your wired Ethernet.

The bwi driver creates a bwi device.  Use bwi0.


----------



## MrRossi (Sep 19, 2010)

wblock said:
			
		

> Repeat: dc0 is your wired Ethernet.
> 
> The bwi driver creates a bwi device.  Use bwi0.



Arg!
Sorry.  Spent a lot of time on this and my head is spinning.
Hopefully get it working soon.

Thank you for helping.


----------



## MrRossi (Sep 20, 2010)

Hi
Still having issues with this card.
Today I've 

a. done a reinstall for a fresh start
b. added if_bwi_load="YES" to the loader.conf file in boot
c. installed the firmware port by running make install clean in /usr/ports/net/bwi-firmware-kmod/

Still appears that its not configured for some reason, ifconfig bwi0 down/up gives a not configured error, and pciconf shows a broadcom device listed as - 


```
none2@pci0:4:0:0
```

Also the chipset is listed as: Chipset BCM4309


----------



## wblock@ (Sep 20, 2010)

MrRossi said:
			
		

> Hi
> Still having issues with this card.
> Today I've
> 
> ...



I think you also need to load the firmware module in /boot/loader.conf.  I have one system with a Broadcom card in it, which I can drag out to check configuration.  Later...

There probably are cards which the Broadcom drivers don't yet detect.  Please show the output of
`# pciconf -lv | grep -B3 network`


----------



## MrRossi (Sep 21, 2010)

wblock said:
			
		

> I think you also need to load the firmware module in /boot/loader.conf.



Thanks.
From searching google is that just 
	
	



```
firmware_load="YES"
```
 in loader.conf?

pciconf output is below, I assume dc0 isn't relevant but have copied it anyway.


```
dc0:pci0:0:17:0:
class = 0x02000000
card = 0x22421113
chip = 0x12161113
rev = 0x11
hdr = 0x00

vendor = accton technology corporation
device = EN-5251 based fast ethernet adapter

none2@pci0:4:0:0:
class = 0x028000
card = 0x43201737
chip = 0x432014e4
rev = 0x03
hdr = 0x00
vendor = Broadcom corporation
device = 802.11b/g wireless LAN controller (BCM4309)
class = network
```


----------



## gordon@ (Sep 22, 2010)

Can you post the output of kldstat(8)?

I believe the kernel module is named /boot/modules/bwi_v3_ucode.ko. Can you confirm the file is there? Can you confirm that it is loaded (which is what kldstat(8) will tell you)?

If it isn't loaded try adding 

```
bwi_v3_ucode_load="YES"
```
to /boot/loader.conf


----------



## MrRossi (Sep 23, 2010)

I had to amend load.conf, kld stat now says - 


```
1  4  0xc0400000 bb5504  kernel
2  1  0xc0fb6000 1a2dc   bwi_v3_ucode.ko
```



```
ifconfig wlan0 create wlandev bwi0
```


Gives the error

```
ifconfig: SIOCIFCREATE2: Device not configured
```

And pciconf still lists the card as - 


```
none2@pci0:4:0:0:
class = 0x028000
card = 0x43201737
chip = 0x432014e4
rev = 0x03
hdr = 0x00
vendor = Broadcom corporation
device = 802.11b/g wireless LAN controller (BCM4309)
class = network
```

I'm guessing my card is one of the unlucky ones, or something still needs poked somewhere.


----------



## wblock@ (Sep 23, 2010)

MrRossi said:
			
		

> I had to amend load.conf, kld stat now says -



That should be /boot/load*er*.conf:

```
if_bwi_load="YES"
bwi_v3_ucode_load="YES"
```

Based on your pciconf output, it looks like the bwi driver should support this card.  At that point, ifconfig should show a bwi0 device, and pciconf should show bwi0 attached to the device.


----------



## MrRossi (Sep 23, 2010)

Hi
Thanks for the reply.
It was loader.conf I edited sorry.  I've gone back in just to check it and it matches up the one on your last post.
Not sure why the device still shows up as none2@pci0.

ifconfig still shows devices listed for fwe0, fwip0, dc0, plip0, lo0. Nothing for bwi0 though.


----------

