# WPA_supplicant problems...



## raxterz (Jan 24, 2009)

Hey, I've got an Atheros chipset based wireless network card, the card is a Netgear WPN311. I'm running FreeBSD 8.0-CURRENT and I'm trying to configure my wireless network.  i had it working on linux before but not that i've installed freebsd on my new computer it doesnt work.  my network uses wpa2 psk authentication, and i believe my wpa_supplicant.conf is configured correctly.

when i do "/etc/rc.d/netif start"  i get the following problems..
Starting wpa_supplicant.
ioct1[SIOCG80211, op 98, len 3076]: Invalid argument
wpa_supplicant[1455]: Failed to initialize driver interface
WARNING: Failed to start wpa_supplicant

 same thing happens wen i try to start it manually.  does anybody know whats wrong?  i was following the FreeBSD handbook instructions on setting up my wireless network and added the appropriate lines to my /boot/loader.conf and /etc/rc.conf.  

my rc.conf...
ifconfig_ath0="ssid my_ssid inet 192.168.2.4 netmask 255.255.255.0"
ifconfig_ath0="WPA"
defaultrouter="192.168.2.1"
hostname"jesus.Belkin"

and my /boot/loader.conf...
if_ath_load="YES"
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"

and my /etc/wpa_supplicant.conf....
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="my_ssid"
scan_ssid=1
proto=RSN
pairwise=CCMP TKIP
key_mgmt=WPA-PSK
psk="my_psk"
}
any help would be much appreciated!


----------



## raxterz (Jan 24, 2009)

UPDATE: i was searching through my dmesg and found this....
ath0: <Atheros 5212> mem 0xc0100000-0xc010ffff irq 17 at device 1.0 on pci2
ath0: [ITHREAD]
ath0: WARNING: using obsoleted if_watchdog interface
ath0: mac 7.9 phy 4.5 radio 5.6
dunno if this means anything?  hopefully it helps...


----------



## kamikaze (Jan 24, 2009)

Just reduce your wpa_supplicant.conf to the minimum. Get rid of the lines scan_ssid=1, proto=RSN, pairwise=CCMP TKIP, key_mgmt=WPA-PSK. That might work, or not. With wpa_supplicant you can never be sure.

Also, I recommend you the 
	
	



```
-Block.
```


----------



## richardpl (Jan 24, 2009)

raxterz said:
			
		

> Hey, I've got an Atheros chipset based wireless network card, the card is a Netgear WPN311. I'm running FreeBSD 8.0-CURRENT and I'm trying to configure my wireless network.  i had it working on linux before but not that i've installed freebsd on my new computer it doesnt work.  my network uses wpa2 psk authentication, and i believe my wpa_supplicant.conf is configured correctly.



Whan 8.0 CURRENT?, it appears you are using very old one.

How do you start wpa_supplicant?


----------



## raxterz (Jan 25, 2009)

*Still no luck...*



			
				kamikaze said:
			
		

> Just reduce your wpa_supplicant.conf to the minimum. Get rid of the lines scan_ssid=1, proto=RSN, pairwise=CCMP TKIP, key_mgmt=WPA-PSK. That might work, or not. With wpa_supplicant you can never be sure.
> 
> Also, I recommend you the
> 
> ...


----------



## richardpl (Jan 25, 2009)

```
> wpa_supplicant 
wpa_supplicant v0.5.10
Copyright (c) 2003-2008, Jouni Malinen <j@w1.fi> and contributors

This program is free software. You can distribute it and/or modify it
under the terms of the GNU General Public License version 2.

Alternatively, this software may be distributed under the terms of the
BSD license. See README and COPYING for more details.

This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/)

usage:
  wpa_supplicant [-BddhKLqqstuvwW] [-P<pid file>] [-g<global ctrl>] \
        -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \
        [-b<br_ifname>] [-f<debug file>] \
        [-N -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \
        [-p<driver_param>] [-b<br_ifname>] ...]

drivers:
  bsd = BSD 802.11 support (Atheros, etc.)
  ndis = Windows NDIS driver
  wired = BSD wired Ethernet driver
options:
  -b = optional bridge interface name
  -B = run daemon in the background
  -c = Configuration file
  -C = ctrl_interface parameter (only used if -c is not)
  -i = interface name
  -d = increase debugging verbosity (-dd even more)
  -D = driver name
  -g = global ctrl_interface
  -K = include keys (passwords, etc.) in debug output
  -t = include timestamp in debug messages
  -h = show this help text
  -L = show license (GPL and BSD)
  -p = driver parameters
  -P = PID file
  -q = decrease debugging verbosity (-qq even less)
  -s = log output to syslog instead of stdout
  -v = show version
  -w = wait for interface to be added, if needed
  -W = wait for a control interface monitor before starting
  -N = start describing new interface
example:
  wpa_supplicant -Dbsd -iwlan0 -c/etc/wpa_supplicant.conf
```


----------



## raxterz (Jan 25, 2009)

*wtf....*

Ok, i tried using the "-D bsd" option but it still gives me the same message...

jesus# wpa_supplicant -i ath0 -D bsd -c /etc/wpa_supplicant.conf
ioctl[SIOCG80211, op 98, len 3076]: Invalid argument
Failed to initialize drive interface


wtf?  does anybody know whats causing this?


----------



## raxterz (Jan 25, 2009)

*Solved!*

Ok i fixed the problem. After reading this link:
http://unix.derkeiler.com/Mailing-Lists/FreeBSD/current/2008-04/msg00460.html
and this one:
http://kerneltrap.org/mailarchive/freebsd-current/2008/4/27/1616124/thread
I removed the "wlan_scan_*" references in my loader.conf
I added the following lines to my rc.conf:
vaps_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"

I guess i needed to create a new ifconfig device, so i did:
ifconfig wlan0 create wlandev ath0

then i setup the wlan0 device with an IP address.
then i did wpa_supplicant, but put wlan0 instead of ath0.
and viola!, authentication completed successfully and i can now browse the net.


----------



## os (Oct 21, 2009)

thanks..

I'm running 8.0 RC1 and it seems like
vaps_ath0="wlan0"
is now
wlans_ath0="wlan0"


----------

