# 8.0 Wireless problem with ath, wpa, vlan



## ikbendeman (Dec 4, 2009)

I'm having a really hard time getting wireless to work on my laptop on 8.0... I've run

```
ifconfig wlan0 create wlandev ath0
```
and

```
ifconfig wlan0 up scan
```
does nothing, sometimes displaying "ath0: device timeout" on terminal 1. I've tried running ifconfig ath0 up before ifconfig wlan0 scan, too, and every combination inbetween; the results are the same.

Other times running "ifconfig wlan0 scan" just sits there and reports no output and never finishes...

When manually running wpa_supplicant:


```
# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
ioctl[SIOCS80211, op 26, arg 0x0]: Operation not supported
Failed to disable WPA in the driver.
ELOOP: remaining socket: sock=4 eloop_data=0x28406140 user_data=0x2840d040 handler=0x8069f40
```

running dmesg only shows:

during boot

```
ath0: <Atheros 5424/2424> mem 0xd1100000-0xd110ffff irq 17 at device 0.0 on pci8
ath0: [ITHREAD]
ath0: AR2425 mac 14.2 RF5424 phy 7.0
```
after running ifconfig wlan0 create wlandev ath0:

```
wlan0: Ethernet address: 00:1f:e2:8c:c9:8f
```
after running ifconfig wlan0 scan or wpa_supplicant:

```
ath0: device timeout
ath0: device timeout
ath0: device timeout
ath0: device timeout
...
```

My /etc/rc.conf

```
# -- sysinstall generated deltas -- #

nfs_client_enable="YES"
nfs_server_enable="YES"
rpcbind_enable="YES"

# -- end sysinstall deltas -- #

# These are enabled when not trying manual ifconfig method {
#vaps_ath0="wlan0"
#wlans_ath0="wlan0"
#ifconfig_wlan0="WPA DHCP"
}


hald_enable="YES"
dbus_enable="YES"
devd_enable="YES"
```

and /boot/loader.conf (and I've tried with different combinations of the following):

```
ath_load="YES"
#wlan_scan_ap_load="YES" (from old loader.conf)
#wlan_scan_sta_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
if_vlan_load="YES"
```

and I'll post my whole pciconf -lv later when I get internet via ethernet but for now:

```
ath0@pci0:8:0:0:    class=0x020000 card=0x137a103c chip=0x001c168c rev=0x01 hdr=0x00
     vendor      = 'Atheros Communications Inc.'
     device      = 'HDAUDIOFUNC_01&VEN1095&DEV_1392&SUBSYS_10280242&REV_1000 (USBVID_147E&PID_20165&B71A446&0&1)'
     class       = network
     subclass    = ethernet
```

Somebody please help me...


----------



## ikbendeman (Dec 4, 2009)

Sorry DutchDaemon.... I guess I'll try the amd64 version and see how that goes. I was just trying the i386 version because I had so many compatability issues with the 64 bit versions of linux and all the 32 bit libs and 64 bit libs and so on and so forth. Could someone at least clear up whether I'm doing something wrong, or it's a software bug or possibly a hardware bug? (it was working in 7.2-RELEASE).


----------



## ikbendeman (Dec 4, 2009)

I guess it's a bug. It works in 8.0-RELEASE amd64. Is there somewhere I can submit this information to help the developers?


----------



## ikbendeman (Dec 4, 2009)

nevermind i lied. device works in both i386 and amd64... wpa_supplicant works in neither on my laptop... anyone else having this problem?


----------



## ikbendeman (Dec 4, 2009)

sorry I keep posting on here, but I know somebody can help me with this... it finally worked! I had to specify -Dbsd in wpa_supplicant... how can i setup rc.conf to do this automatically though?


----------



## bschmidt (Dec 4, 2009)

```
ifconfig_wlan0="WPA DHCP"
```
should add 
	
	



```
-Dbsd
```
 automatically.

You could fetch /etc/rc.d/wpa_supplicant and /etc/network.subr from svn to check whether it does work in stable.


----------



## Case (Dec 5, 2009)

Sorry for my english please...

I have this problem too. My device is <Atheros 5424/2424>.
In adhoc mode i've got kernel panic, but with option -bgscan in ifconfig system is fine. Although my connection is very unstable:

```
ath0: device timeout
ath0: device timeout
ath0: device timeout
```

I not use wpa, my rc.conf is:

```
wlans_ath0="wlan0"
create_args_wlan0="wlanmode adhoc"
ifconfig_wlan0="inet .... netmask .... ssid .... mode 11g -bgscan authmode shared wepmode on weptxkey 1 wepkey ...."
```


----------



## ikbendeman (Dec 5, 2009)

case... can you try running 

```
ifconfig wlan0 up scan
```

if that works post here and make sure your /etc/wpa_supplicant.conf file has:

```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
         ssid="[yourssid]]"
         psk="[yourpsk]"
}
```

Then run:

```
wpa_supplicant -D bsd -i wlan0 -c /etc/wpa_supplicant.conf
```

I had to run it with -D bsd once, and then the autosetup worked for me... weird bug...


----------



## Case (Dec 6, 2009)

scan works fine:

```
[case@sajuuk /usr/home/case]$ sudo ifconfig wlan0 scan
SSID/MESH ID    BSSID              CHAN RATE   S:N     INT CAPS
wolves          76:6c:13:82:be:0d   10   11M -66:-96  100 IPS  WME
default         00:0e:a6:f1:e4:00    1   54M -93:-96  100 EP   RSN WPA
vparsh          00:22:15:83:41:5b    6   54M -95:-96  100 EP   RSN WPA
Kraft           00:21:91:2e:8d:d7    6   54M -96:-98  100 EPS  WPA ATH WPS
```

I'm not sure that wpa_supplicant.conf like

```
network={
ssid="[yourssid]]"
psk="[yourpsk]"
}
```
... is correct for me.

I connect my computers in ad-hoc mode and use for it WPE (looks like it's only usable variant for my driver).

I tried wi-fi with wpa_supplicant:

```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
	ssid="wolves"
	mode=1
	auth_alg=SHARED
	key_mgmt=NONE
	wep_tx_keyidx=0
	wep_key0="<here was key>"
}
```
and with

```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
	ssid="mynet"
	psk="..."
}
```

In both cases i seen:

```
[case@sajuuk /etc]$ sudo wpa_supplicant -Dbsd -i wlan0 -c /etc/wpa_supplicant.conf 
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS
....
```


```
[case@sajuuk /usr/home/case]$ wpa_cli status
Selected interface 'wlan0'
wpa_state=SCANNING
ip_address=192.168.0.2
```

wlan0 don't get ssid from wpa_supplicant.conf, number of channel periodically changed and authmode is always WPA1+WPA2/802.11i, even if i choose in wpa_supplicant.conf auth_alg=SHARED :

```
[case@sajuuk /usr/home/case]$ ifconfig wlan0
wlan0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:15:af:82:90:99
        inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
        media: IEEE 802.11 Wireless Ethernet autoselect <adhoc> (autoselect <adhoc>)
        status: no carrier
        ssid "" channel 4 (2427 Mhz 11g)
        regdomain 96 indoor ecm authmode WPA1+WPA2/802.11i privacy ON
        deftxkey UNDEF txpower 20 scanvalid 450 protmode CTS wme burst
        roaming MANUAL
```

In my rc.conf:

```
wlans_ath="wlan0"
create_argc_wlan0="wlanmode adhoc"
ifconfig_wlan0="WPA inet 192.168.0.2"
```


----------



## Case (Dec 6, 2009)

I just was mistaken 
Really rc.conf is:

```
wlans_ath0="wlan0"
create_args_wlan0="wlanmode adhoc"
ifconfig_wlan0="WPA inet 192.168.0.2"
```


----------



## bschmidt (Dec 6, 2009)

Seems to be a known issue: bin/126822.


----------



## ikbendeman (Dec 8, 2009)

you could try

```
ifconfig wlan0 up && ifconfig wlan0 ssid [yourssid]
```
before running wpa_supplicant, wpasup should associate but if it doesn't this may help..


----------



## Case (Dec 8, 2009)

Already tried, no result 

May be I'll try connect my computers with hostap.


----------



## ikbendeman (Dec 18, 2009)

Did you try hostap mode yet?


----------



## Case (Dec 19, 2009)

Yes, but i don't remember a result 

This config is working for me:

```
wlans_ath0="wlan0"
create_args_wlan0="wlanmode adhoc beacons"
ifconfig_wlan0="inet 192.168.0.2 ssid wolves mode 11b mediaopt adhoc authmode shared wepmode on weptxkey 1 wepkey ..."
```

Some times net freezes, but after i do:

```
sudo ifconfig wlan0 scan
```
all is going well.


----------



## donallen (Feb 12, 2010)

I also tried to get a card with an Atheros chip to work with WPA on 8.0 RELEASE. I worked on this for hours and at one point, just once, I got it working, but couldn't replicate it. In the course of this, the machine froze twice. It was the system crashes that prompted me to give up. Unfortunately, this has been the story with multiple attempts to use several releases of FreeBSD. I get tempted by the enthusiasts and always run into a show-stopping bug (to be fair, most have been in the USB layers, old and new). In this case, the machine is an old Thinkpad G41 that I keep around as a spare because it still works (I've used it to experiment with a few Linux distributions and the BSDs). It has 2 Gb RAM and a 60 Gb 7200 rpm disk devoted completely to Unix/Linux. The wireless card was made by 3com. Pretty vanilla stuff and it just doesn't work.

Both Arch Linux and OpenBSD run fine on that machine with the same wireless card (I got nowhere with NetBSD -- long story, which I'll spare you). OpenBSD was much easier to set up (wireless and generally), but Arch is a noticeably more responsive system, is more up-to-date technically (real SMP support, big-mem support on amd64, unified buffer cache), has Flash, and broader user support. I've gone this route with all my systems now.


----------

