# Problem with iwn driver and wpa_supplicant.



## synack (Mar 13, 2010)

Hi,

I am having some problems' getting my laptop to join my wireless access point. I am running FreeBSD stable 8 on an asus N50VN.

In my MYKERNEL config file I have the following;


```
device iwn
device iwnfw
```

In my /boot/loader.conf I have;


```
legal.intel_iwn.license_ack=1
```

in my /etc/rc.conf I have;


```
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA DHCP"
```

and finally in my /etc/wpa_supplicant.conf I have;


```
network{
  ssid="myssid"
  scan_ssid=1
  mode=0
  key_mgmt=WPA-PSK
  psk="mykey"
}
```

When the laptop boots I get;


```
Starting wpa_supplicant
/etc/rc.d/wpa_supplicant: WARNING: failed to start wpa_supplicant
```

and then it brings up wlan0 :x

The wireless light is on so I know the hardware switch is on..

I have also tried (from the handbook);


```
/etc/rc.d/netif start
```

which brings up this stuff;


```
ifconfig: create: bad value
starting wpa_supplicant
```

Then I try


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

and I get something about;


```
Failed to disable WPA in the driver.
ELOOP: remaining socket: sock=4 eloop_data-0x800e0b1c0 user_data=0x800e070f0 handler=0x421840
```

any help would be great.


----------



## thuglife (Mar 13, 2010)

```
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA_DHCP"
```

Remove the underscore from WPA_DHCP.


```
wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
```

ath0? You should use wlan0.


----------



## synack (Mar 13, 2010)

hey,

those are both typos'.

Sorry

Now when I run


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

CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS
CTRL-EVENT-SCAN-RESULTS
CTRL-EVENT-SCAN-RESULTS

when I ^c I get;

ioctl[SIOCS80211, op 26 arg 0x0]: Operation not permitted
Failed to disable WPA in the driver
```


----------



## vermaden (Mar 13, 2010)

@synack

Check this howto: http://daemonforums.org/showthread.php?t=3651


----------



## synack (Mar 13, 2010)

thankyou for the help and link. but when I change my wpa_supplicant.conf to 


```
network={
 ssid="myssid"
 proto=WPA
 psk="MYpsk"
}
```

I still get


```
CTRL-EVENT-SCAN-RESULTS
CTRL-EVENT-SCAN-RESULTS
until I ^c
```

when I disable WPA on the access point and just try dhclient I get;


```
wlan0: no link ......
```


----------



## synack (Mar 13, 2010)

now when I run


```
/etc/rc.d/netif start  I get;
ifconfig: create: bad value
```


----------



## outsid3r (Apr 7, 2010)

Is your psk correct? check it by using [CMD=""]$wpa_passphrase[/CMD] which receives 2 parameters, the ssid and the key.


----------



## bschmidt (Apr 7, 2010)

Post the output of `# wpa_supplicant -Dbsd -iwlan0 -c/etc/wpa_supplicant.conf -ddt` please.


----------



## datastream (Apr 7, 2010)

synack said:
			
		

> now when I run
> 
> 
> ```
> ...




```
#wpa_passphrase your-ssid  your-passphrase >>/etc/wpa_supplicant.conf
```
get your wireless card

```
#ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=399b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
	ether 00:1c:25:1c:fc:d3
	media: Ethernet autoselect
	status: no carrier
iwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
	ether 00:1d:e0:48:1d:1f
	media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
	status: associated
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=3<RXCSUM,TXCSUM>
	inet 127.0.0.1 netmask 0xff000000 
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
```
well you find your wireless card is iwn0.
so in /etc/rc.conf,you should add

```
wlans_iwn0=wlan0
ifconfig_wlan0="WPA DHCP"
wpa_supplicant_enable="YES"
```


----------



## fronclynne (Apr 11, 2010)

Maybe related to this bug which doesn't seem to have had any attention paid since mid January.  Check to see if you also are getting the "need multicast update callback" line in your dmesg.


----------

