# ar9285 wireless windows driver



## venoom27 (Nov 9, 2010)

So I can't get my wireless card ar9285 to work with FreeBSD 8.1 it sees it but after following the wireless how to and reading some forums I think the driver is buggy. With that being said do you think using the windows drivers for this card and making my own kernel module is the way to go or should I just give up?


----------



## kpedersen (Nov 9, 2010)

As buggy as the native driver is, the ndis drivers are usually worse 

Post what command you use from a clean reboot.
I do...


```
# ifconfig wlan create wlandev ath0
# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B
# dhclient wlan0
```

for the open wireless at uni. I just do


```
# ifconfig wlan create wlandev ath0
# ifconfig wlan0 up
# dhclient wlan0
```

Best regards


----------



## richardpl (Nov 9, 2010)

kpedersen said:
			
		

> As buggy as the native driver is, the ndis drivers are usually worse



Please refrain from spreading FUD. Thanks.


----------



## kpedersen (Nov 9, 2010)

@richardpl

Correct, I should have prefixed "IMO" to my post.

I will also add that I experienced endless kernel panics when I used ndis drivers with a certain broadcom wifi card (however some worked fine, perhaps you will have more luck with an atheros).
I even had to modify the .inf file to get ndisgen to successfully parse it.
I like to stick to native drivers and proud of it 

Personally I prefer to try my luck with the native drivers before going onto ndisgen etc..., especially if it is recognized, you are half-way there lol.


----------



## venoom27 (Nov 10, 2010)

After some work last night I loaded the windows driver and rebooted. I noticed that I was connected to my network, so I was able to download the binaries for KDE3 and KDE4 (I didn't realize that "pkg_add -r kde" was kde3) and installed away. 

Then after that the wireless signal dropped and now the wireless signal will not stay connected. 

I have rebooted and tried a number of commands and am about to give up because I cannot figure out why it would work for 2 to 3 hours and then stop all together staying connected.

 Anyway it was fun messing around and would love to learn more about Freebsd and use it but I have to be able to use the wireless card on the computer to use it.


----------



## richardpl (Nov 10, 2010)

You do not need to reboot, just bring interface down/up.

Anyway if you are not able to write in few simple steps what you did and what you expect to happen and did not happen, I can not fix such bug.

It is not fun to fix bugs which never got reported.


----------



## venoom27 (Nov 10, 2010)

Your right and I am sorry. I have a Atheros AR9285 wireless card. The install freebsd 8.1 sees the card. I set the card up as follows


```
my /boot/loader.conf 
if_ath_load="YES" 
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```

I then made the file /etc/wpa_supplicant.conf and put the information from http://www.freebsd.org/doc/handbook/network-wireless.html

```
network={
  ssid="freebsdap"
  psk="freebsdmall"
}
```

I then edited my /etc/rc.conf like the http://www.freebsd.org/doc/handbook/network-wireless.html says

```
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
```
So then when I reboot with this config the wpa information does not get picked up in ifconfig under ssid it says ""

So then I tried `wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf` (sorry I don't remember the output and then I try 
`dhclient wlan0`
and it sometimes says no link or it says DHCPREQUEST on wlan0 to 255.255.255.255 port 67 over and over until it timesout.

So that was before I made the windows driver. Below is how and after I made the Windows driver
When I made the driver I used ndisgen and it created the mydriver_sys.ko I then k`ldload ./mydriver_sys.ko` (I downloaded the windows driver from dell support site)

Then I added it to my /boot/loader.conf

```
mydriver_sys_load="YES"
```
and commented out the 

```
if_ath_load="YES"
```
and rebooted.

after reboot (which I know I don't have to do but I am new to freebsd I don't know the commands) I ifconfig and the ssid had my id in it so I then pinged the gateway and it worked so then I did the download of the binaries. 

I installed xorg then rebooted kde3 then rebooted and I ran 
echo "echo "exec startkde" > ~/.xinitrc" to start up in kde3 , 
and then I installed kde4 I rebooted and then I ran
echo "exec /usr/local/kde4/bin/startkde" > ~/.xinitrc  to start up in kde4 once I typed startx.

After I started in kde4 I then tried to open konsole but it kept on crashing so then I opened up another tty and tried to install firefox35 that is when the network went down which I cannot get it back up for more then a few seconds. 

It is acting like it did before I loaded the windows driver like it went back to the native bsd driver. I went back and double checked the above conf files and nothing had changed. 

If you want more information I am at work right now and can get more information when I am at home at the computer.


----------



## richardpl (Nov 10, 2010)

Instead of DHCP try SYNCDHCP.

Windows driver was not used at all after boot because you did not set:
*wlans_ndis0="wlan3"*
ifconfig_wlan3="WPA SYNCDHCP"

And FreeBSD have feature to autoload *native* drivers for you, so you don't need to put them in loader.conf

For example, command:
`# ifconfig ath0`
will automatically load ath(4) for you.


----------



## venoom27 (Nov 10, 2010)

Thanks I will give this a try when I get home and let you know how it works.


----------



## venoom27 (Nov 10, 2010)

Ok I gave it a try I didn't work or at least it didn't work with the way I set it up below is what I did.



```
/boot/loader.conf
#if_ath_load="YES"

wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
athr_sys_load="YES"
```



```
/etc/rc.conf
hostname="john"
moused_enable="YES"
dbus_enable="YES"
hald_enable="YES"
#wlans_athr="YES"
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
wlans_ndis0="wlan3"
ifconfig_wlan3="WPA SYNCDHCP"
devfs_system_ruleset="localrules"
```

which produced this for ifconfig

```
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:1b:b1:45:76:84
        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>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
        inet6 ::1 prefixlen 128 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:1b:b1:45:76:84
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid "" channel 1 (2412 MHz 11g)
        regdomain 101 indoor ecm authmode WPA2/802.11i privacy ON
        deftxkey UNDEF txpower 20 bmiss 7 scanvalid 450 bgscan bgscanintvl 300
        bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme burst
        roaming MANUAL
```


*Now I went back and commented out  *



```
/etc/rc.conf
hostname="john"
moused_enable="YES"
dbus_enable="YES"
hald_enable="YES"
#wlans_athr="YES"
[B]#wlans_ath0="wlan0"
#ifconfig_wlan0="WPA DHCP"
[/B]wlans_ndis0="wlan3"
ifconfig_wlan3="WPA SYNCDHCP"
devfs_system_ruleset="localrules"
```

and I got this for ifconfig


```
ath0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:1b:b1:45:76:84
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
        inet6 ::1 prefixlen 128 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
```



Also shout wlans_ndis0="wlan3" in /etc/rc.conf be that or should it be like your post wlan_ndis0="wlan3"?

I am pretty sure I am doing something wrong but anyway if you could shed any light into this my thanks. If you need anymore info please let me know.


----------



## richardpl (Nov 10, 2010)

If this is GENERIC kernel windows driver will never attach as ndis0.
You need custom kernel without lines *device ath** for windows driver to be able to attach at all.

Are you really sure that you properly configured your AP and your client? What is signal strength between AP and client?
(ifconfig wlan0 list scan will show you this)


----------



## venoom27 (Nov 10, 2010)

As of right when I booted back into FreeBSD it is working and I am able to post this from it but here is some info.


```
ifconfig wlan0 scan
SSID/MESH ID    BSSID              CHAN RATE   S:N     INT CAPS
HDAVIS          00:24:b2:c9:be:0c    1   54M -78:-96  100 EP   RSN WPS WME
```


```
/etc/wpa_supplicant.conf
network={
	ssid="HDAVIS"
	#scan_ssid=1
	#key_mgmt=WPA-PSK
	psk="*********"
}
```


```
john# ifconfig
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:1b:b1:45:76:84
        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>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
        inet6 ::1 prefixlen 128 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:1b:b1:45:76:84
        inet 192.168.1.4 netmask 0xffffff00 broadcast 192.168.1.255
        media: IEEE 802.11 Wireless Ethernet DS/5.5Mbps mode 11g
        status: associated
        ssid HDAVIS channel 1 (2412 MHz 11g) bssid 00:24:b2:c9:be:0c
        regdomain 101 indoor ecm authmode WPA2/802.11i privacy ON
        deftxkey UNDEF AES-CCM 2:128-bit txpower 20 bmiss 7 scanvalid 450
        bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5
        protmode CTS wme burst roaming MANUAL
```


----------



## venoom27 (Nov 10, 2010)

So after I unplugged my laptop and moved 7 feet to the table the wireless connection dropped. I then went back to where I was and plugged it back in and I got some info from the terminal but never got it to working again.



```
[B]john# ifconfig[/B]
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:1b:b1:45:76:84
        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>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
        inet6 ::1 prefixlen 128 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:1b:b1:45:76:84
        inet 192.168.1.4 netmask 0xffffff00 broadcast 192.168.1.255
        media: IEEE 802.11 Wireless Ethernet DS/5.5Mbps mode 11g
        status: associated
        ssid HDAVIS channel 1 (2412 MHz 11g) bssid 00:24:b2:c9:be:0c
        regdomain 101 indoor ecm authmode WPA2/802.11i privacy ON
        deftxkey UNDEF AES-CCM 2:128-bit txpower 20 bmiss 7 scanvalid 450
        bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5
        protmode CTS wme burst roaming MANUAL
```


```
[B]#john ifconfig wlan0 scan[/B]
	SSID/MESH ID    BSSID              CHAN RATE   S:N     INT CAPS
HDAVIS          00:24:b2:c9:be:0c    1   54M -77:-96  100 EP   RSN WPS WME
```


```
[B]john# /etc/rc.d/netif start[/B]
Starting wpa_supplicant.
Starting Network: lo0 ath0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
        inet6 ::1 prefixlen 128 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
ath0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:1b:b1:45:76:84
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
```


```
[B]john# ifconfig ath0[/B]
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:1b:b1:45:76:84
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
        status: associated
```


```
[B]john# ifconfig wlan0[/B]
wlan0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:1b:b1:45:76:84
        inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid "" channel 1 (2412 MHz 11g)
        regdomain 101 indoor ecm authmode WPA2/802.11i privacy ON
        deftxkey UNDEF txpower 20 bmiss 7 scanvalid 450 bgscan bgscanintvl 300
        bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme burst
        roaming MANUAL

ifconfig: interface wlan0 does not exist
```


```
[B]john# /etc/rc.d/netif start[/B]
Starting wpa_supplicant.
Starting Network: lo0 ath0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
        inet6 ::1 prefixlen 128 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
ath0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:1b:b1:45:76:84
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
```


```
[B]john# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf[/B]
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
CTRL-EVENT-SCAN-RESULTS 
Associated with 00:24:b2:c9:be:0c
WPA: Key negotiation completed with 00:24:b2:c9:be:0c [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to 00:24:b2:c9:be:0c completed (auth) [id=0 id_str=]
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
Authentication with 00:24:b2:c9:be:0c timed out.
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
Authentication with 00:24:b2:c9:be:0c timed out.
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
Authentication with 00:24:b2:c9:be:0c timed out.
john# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
CTRL-EVENT-SCAN-RESULTS 
Associated with 00:24:b2:c9:be:0c
WPA: Key negotiation completed with 00:24:b2:c9:be:0c [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to 00:24:b2:c9:be:0c completed (auth) [id=0 id_str=]
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
Authentication with 00:24:b2:c9:be:0c timed out.
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
Authentication with 00:24:b2:c9:be:0c timed out.
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
Authentication with 00:24:b2:c9:be:0c timed out.
  Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
Authentication with 00:24:b2:c9:be:0c timed out.
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
CTRL-EVENT-SCAN-RESULTS 
CTRL-EVENT-SCAN-RESULTS 
Associated with 00:24:b2:c9:be:0c
WPA: Key negotiation completed with 00:24:b2:c9:be:0c [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to 00:24:b2:c9:be:0c completed (reauth) [id=0 id_str=]
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
CTRL-EVENT-SCAN-RESULTS 
Associated with 00:24:b2:c9:be:0c
WPA: 4-Way Handshake failed - pre-shared key may be incorrect
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
Authentication with 00:24:b2:c9:be:0c timed out.
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:24:b2:c9:be:0c (SSID='HDAVIS' freq=2412 MHz)
CTRL-EVENT-SCAN-RESULTS 
Associated with 00:24:b2:c9:be:0c
WPA: Key negotiation completed with 00:24:b2:c9:be:0c [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to 00:24:b2:c9:be:0c completed (reauth) [id=0 id_str=]
^CCTRL-EVENT-TERMINATING - signal 2 received
ioctl[SIOCS80211, op 26, arg 0x0]: Operation not supported
Failed to disable WPA in the driver.
ELOOP: remaining socket: sock=4 eloop_data=0x800e0b1c0 user_data=0x800e070f0 handler=0x421840
```


----------



## DutchDaemon (Nov 11, 2010)

venoom27, read the rules in your signup email, and start formatting your posts, so I don't have to keep doing it.


----------



## venoom27 (Nov 11, 2010)

I am sorry for the poor formatting and my thanks for correcting my poor work. 

I have found a bug reports for this issue it is located http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/148112 and http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/149307

Thanks again to the supportive Freebsd community for your help


----------

