Atheroswifi + WPA2

Hi to everybody,
I recently decided to try haiku and I really like it, albeit a bit unfinished and a bit unstable. I am good at C++ and maybe contribute a bit to development, I’d like to program a bit on haiku.
But there is a big problem at the moment, my only internet connection right now is through a WPA2 wireless link and I cannot reconfigure it to use WEP.
I tried hard to make haiku connect but no way at the moment; I tried the alpha first, than a nightly and now I am running a self compiled master (hrev43804) (all gcc2 hybrids) but still no connection.
The first time I recompiled it I had added ‘AddOptionalHaikuImagePackages wpa_supplicant ;’ to UserBuildConfig but even if wpa_supplicant was installed in the system it did’t worked, instead installing it using installoptionalpackages once the system was installed it did work, don’t know why …
Anyway, I have two wifi card available an intel ipw2200 and an atheros AR922X, both are recognized (after installing the firmware for the ipw2200) but I cannot connect. I’d prefer to use the atheros since it works better, it is correctly recognized by haiku:
in the log:
KERN: atheroswifi: init_driver(0x813fdfa4)
KERN: [atheroswifi] (ath_pci) bus_alloc_resource(3, [16], 0x0, 0xffffffff, 0x1,0x2)
KERN: add_memory_type_range(2621, 0xdfdf0000, 0x20000, 0)
KERN: set MTRRs to:
KERN: mtrr: 0: base: 0xf0000, size: 0x1000, type: 0
KERN: mtrr: 1: base: 0x7f7d2000, size: 0x2000, type: 0
KERN: mtrr: 2: base: 0x7f7e0000, size: 0x20000, type: 0
KERN: mtrr: 3: base: 0xd0000000, size: 0x10000000, type: 0
KERN: mtrr: 4: base: 0xe0000000, size: 0x20000000, type: 0
KERN: mtrr: 5: base: 0x80000000, size: 0x80000000, type: 1
KERN: [atheroswifi] (ath_pci) bus_alloc_resource(1, [0], 0x0, 0xffffffff, 0x1,0x6)
KERN: if_initname(0x8227f300, ath_pci, 3)
KERN: [atheroswifi] atheroswifi: /dev/net/atheroswifi/0
KERN: ifmedia_add: Adding Entry…
KERN: Type: IEEE 802.11 Wireless Ethernet
KERN: Mode: autoselect
KERN: SubType: autoselect
KERN: ifmedia_add: Adding Entry…
KERN: Type: IEEE 802.11 Wireless Ethernet
KERN: Mode: autoselect
KERN: SubType: autoselect
KERN: SubType Option[0]: adhoc
KERN: ifmedia_add: Adding Entry…
KERN: Type: IEEE 802.11 Wireless Ethernet
KERN: Mode: autoselect
KERN: SubType: autoselect
KERN: SubType Option[0]: hostap
lots of messages like the last one …

later:
KERN: ieee80211_sysctl_attach not implemented, yet.
KERN: [net/atheroswifi/0] 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
KERN: [net/atheroswifi/0] 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
KERN: [net/atheroswifi/0] 2T2R
KERN: [net/atheroswifi/0] 11ng MCS 20MHz
KERN: [net/atheroswifi/0] MCS 0-7: 6.5Mbps - 65Mbps
KERN: [net/atheroswifi/0] MCS 8-15: 13Mbps - 130Mbps
KERN: [net/atheroswifi/0] AR9280 mac 128.2 RF5133 phy 13.0
KERN: [net/atheroswifi/0] Use hw queue 1 for WME_AC_BE traffic
KERN: [net/atheroswifi/0] Use hw queue 0 for WME_AC_BK traffic
KERN: [net/atheroswifi/0] Use hw queue 2 for WME_AC_VI traffic
KERN: [netKERN: /atheroswifi/0] Use hw queue 3 for WME_AC_VO traffic
KERN: [net/atheroswifi/0] Use hw queue 8 for CAB traffic
KERN: [net/atheroswifi/0] Use hw queue 9 for beacons
KERN: [net/atheroswifi/0] using multicast key search
KERN: if_initname(0x8227f600, wlan, 3)
KERN: [atheroswifi] atheroswifi: /dev/net/atheroswifi/0
KERN: [net/atheroswifi/0] ieee80211_node_vattach: init 2 auth 12 run 20 probe 2
KERN: [net/atheroswifi/0] ieee80211_vap_attach: STA parent ath_pci flags 0x400c2008 flags_ext 0x2
KERN: [net/atheroswifi/0] ieee80211_alloc_node 0xcdd45000f4:ec:38:ff:f9:3c in station table
KERN: [net/atheroswifi/0] [f4:ec:38:ff:f9:3c] ieee80211_alloc_node: inact_reload 2
KERN: ifmedia_add: Adding Entry…
KERN: Type: IEEE 802.11 Wireless Ethernet

There is one message about ieee80211_sysctl_attach not being implemented but I don’t know if it is related to the problem, anyway using the ipw2200 drives gives the same results.
listdev:
device Network controller [2|80|0]
vendor 168c: Atheros Communications Inc.
device 0029: AR922X Wireless Network Adapter

listimage:
994 /boot/system/add-ons/kernel/drivers/dev/net/atheroswifi 0x8133a000 0x813fd000 0 0
ifconfig:
/dev/net/atheroswifi/0
Hardware type: Ethernet, Address: none
Media type: Auto-select
inet addr: , Bcast: , Mask:
MTU: 1500, Metric: 0, broadcast link
Receive: 0 packets, 0 errors, 0 bytes, 0 mcasts, 0 dropped
Transmit: 0 packets, 0 errors, 0 bytes, 0 mcasts, 0 dropped
Collisions: 0

ifconfig /dev/net/atheroswifi/0 scan recognizes that a WPA2 link is available

name address signal auth
casa 06:25:56:69:f5:c6 28 WPA2

When I try to activate the network the popup asking the password appears, I guess it is from wpa_supplicant since it didn’t worked when wpa_supplicant was not correctly installed, but after a few second in ‘configuring’ the network doesn’t work.
The log shows that DHCP is trying to configure the network but it gets no answer:
DAEMON ‘DHCP’: /dev/net/atheroswifi/0: Send DHCP_DISCOVER to 255.255.255.255:67
KERN: [net/atheroswifi/0] compat_open(0x2)
KERN: [net/atheroswifi/0] ieee80211_init
KERN: [net/atheroswifi/0] start running, 0 vaps running
KERN: [net/atheroswifi/0] ieee80211_start_locked: up parent ath_pci
KERN: ifmedia_ioctl: no media found for 0x20
KERN: [net/atheroswifi/0] start running, 1 vaps running
KERN: /dev/net/atheroswifi/0: media change, media 0x200a0 quality 1000 speed 1000000000
KERN: [net/atheroswifi/0] start running, 1 vaps running
KERN: [net/atheroswifi/0] ieee80211_new_state_locked: INIT -> SCAN (nrunning 0 nscanning 0)
KERN: [net/atheroswifi/0] ieee80211_newstate_cb: INIT -> SCAN arg 0
KERN: [net/atheroswifi/0] sta_newstate: INIT -> SCAN (0)
KERN: [net/atheroswifi/0] ieee80211_check_scan: active scan, append
KERN: [net/atheroswifi/0] scan_update_locked: current scanner is none:none, switch to wlan:STA
KERN: [net/atheroswifi/0] start_scan_locked: active scan, duration 2147483647 mindwell 0 maxdwell 0, desired mode auto, flush
KERN: [net/atheroswifi/0] scan set 1g, 6g, 11g, 7g, 13g, 2g, 3g, 4g, 5g, 8g, 9g, 10g, 12g dwell min 20ms max 0ms
KERN: [net/atheroswifi/0] scan_task: chan 1b -> 1g [active, dwell min 20ms max 0ms]
KERN: wlan_control: 9235, 78
KERN: wlan_control: 9235, 76
KERN: [net/atheroswifi/0] ieee80211_ref_node (ieee80211_send_probereq:1748) 0xcdd45000f4:ec:38:ff:f9:3c refcnt 3
KERN: NDP entry 0xce130460 Marked as VALID
KERN: register_domain(9, unix)
KERN: [net/atheroswifi/0] scan_task: chan 1g -> 6g [active, dwell min 20ms max 0ms]
KERN: [net/atheroswifi/0] ieee80211_ref_node (ieee80211_send_probereq:1748) 0xcdd45000f4:ec:38:ff:f9:3c refcnt 3
KERN: [net/atheroswifi/0] scan_task: chan 6g -> 11g [active, dwell min 20ms max 0ms]
KERN: [net/atheroswifi/0] ieee80211_ref_node (ieee80211_send_probereq:1748) 0xcdd45000f4:ec:38:ff:f9:3c refcnt 3
KERN: [06:25:56:69:f5:c6] new probe_resp on chan 11 (bss chan 11) “casa” rssi 48
KERN: [06:25:56:69:f5:c6] caps 0x531 bintval 100 erp 0x100
KERN: [06:25:56:69:f5:c6] new beacon on chan 11 (bss chan 11) “casa” rssi 49
KERN: [06:25:56:69:f5:c6] caps 0x531 bintval 100 erp 0x100
KERN: [06:25:56:69:f5:c6] new beacon on chan 11 (bss chan 11) “casa” rssi 48
KERN: [06:25:56:69:f5:c6] caps 0x531 bintval 100 erp 0x100
KERN: [net/atheroswifi/0] scan_task: chan 11g -> 7g [active, dwell min 20ms max 0ms]
KERN: [net/atheroswifi/0] ieee80211_ref_node (ieee80211_send_probereq:1748) 0xcdd45000f4:ec:38:ff:f9:3c refcnt 3
KERN: [net/atheroswifi/0] scan_task: chan 7g -> 13g [active, dwell min 20ms max 0ms]
KERN: [net/atheroswifi/0] ieee80211_ref_node (ieee80211_send_probereq:1748) 0xcdd45000f4:ec:38:ff:f9:3c refcnt 3
KERN: /dev/net/atheroswifi/0: media change, media 0x300a0 quality 1000 speed 1000000000
KERN: [net/atheroswifi/0] scan_task: chan 13g -> 2g [active, dwell min 20ms max 0ms]
KERN: [net/atheroswifi/0] ieee80211_ref_node (ieee80211_send_probereq:1748) 0xcdd45000f4:ec:38:ff:f9:3c refcnt 3
KERN: [net/atheroswifi/0] scan_task: chan 2g -> 3g [active, dwell min 20ms max 0ms]
KERN: [net/atheroswifi/0] ieee80211_ref_node (ieee80211_send_probereq:1748) 0xcdd45000f4:ec:38:ff:f9:3c refcnt 3
KERN: [net/atheroswifi/0] scan_task: chan 3g -> 4g [active, dwell min 20ms max 0ms]
KERN: [net/atheroswifi/0] ieee80211_ref_node (ieee80211_send_probereq:1748) 0xcdd45000f4:ec:38:ff:f9:3c refcnt 3
KERN: [net/atheroswifi/0] scan_task: chan 4g -> 5g [active, dwell min 20ms max 0ms]
KERN: [net/atheroswifi/0] ieee80211_ref_node (ieee80211_send_probereq:1748) 0xcdd45000f4:ec:38:ff:f9:3c refcnt 3
KERN: [net/atheroswifi/0] scan_task: chan 5g -> 8g [active, dwell min 20ms max 0ms]
KERN: [net/atheroswifi/0] ieee80211_ref_node (ieee80211_send_probereq:1748) 0xcdd45000f4:ec:38:ff:f9:3c refcnt 3

Even if I don’t try to connect the log keeps being filled with messages like this:
KERN: [net/atheroswifi/0] ieee80211_check_scan: active scan, append, nojoin, once
KERN: [net/atheroswifi/0] macaddr bssid chan rssi rate flag wep essid
KERN: + 06:25:56:69:f5:c6 06:25:56:69:f5:c6 11 +56 54M ess wep "casa"
KERN: ieee80211_notify_scan_done
KERN: wlan_control: 9235, 76
KERN: ifmedia_ioctl: switching wlan to Type: IEEE 802.11 Wireless Ethernet
KERN: Mode: autoselect
KERN: SubType: autoselect
KERN: wlan_control: 9234, 16
KERN: wlan_control: 9234, 17
KERN: wlan_control: 9234, 26
KERN: wlan_control: 9234, 103
KERN: [net/atheroswifi/0] ieee80211_scanreq: flags 0x20052 duration 0x7fffffff mindwell 0 maxdwell 0 nssid 1
KERN: [net/atheroswifi/0] ieee80211_check_scan: active scan, append, nojoin, once
KERN: [net/atheroswifi/0] macaddr bssid chan rssi rate flag wep essid
KERN: + 06:25:56:69:f5:c6 06:25:56:69:f5:c6 11 +56 54M ess wep "casa"
KERN: ieee80211_notify_scan_done

I installed wpa_supplicant last night - which, when wpa works for everyone I hope will get distributed with Haiku as standard - but I failed to connect to my wpa2 network at home. At least that was the case using the GUI network tool as whenever I entered my network key and pushed OK or next or whatever, my password would just disappear and I’d be prompted to input it again without any sign of it trying to actually connect me. I didn’t bother trying connecting via the terminal. With this same build of Haiku on the same netbook I can connect to an open wifi network via DHCP using the GUI.

After my previous post I had a bit of a search and saw it was almost 6 months ago when wpa was announced as being available under Haiku but I’m guessing that this was if you connect via the terminal only at the time?

Has anyone successfully connected to a wpa(2) network using the Haiku GUI yet or is this WIP?

Could you please file a bug for this at http://dev.haiku-os.org? I’ve been experiencing the same thing as you with my AR5212-based card, so it’s apparently affecting some of us, but not all. I know things worked for me back when the wpa_supplicant was first added, but something broke between now and then. I need to go do some builds to see where along the line things broke, but hope to get around to that within the next couple of days. Your information will be a good starting point towards this getting fixed, so if you could please post your information into an official bug report, that would be great.

done

WPA2 is supported in Haiku now, or at least some have it working?? Since when? Last I heard Haiku only supported connecting to wep encrypted networks.

So apparently tonight I may get my netbook connecting to my wpa2 AP then I can browse with qupzilla? (If I get it to compile)

Wow!

:slight_smile:

I was curious so I compiled a gcc4 hybrid, recompiled wpa_supplicant from haiku ports since the gcc4 version from optional packages doesn’t work, and still no WPA connection. With this setup there is a new error in the log, I think related to wpa_supplicant.

KERN: [net/atheroswifi/0] ath_reset: unable to reset hardware; hal status 14
KERN: wlan_control: 9234, 103
KERN: ifmedia_ioctl: switching wlan to   Type: IEEE 802.11 Wireless Ethernet
KERN:   Mode: autoselect
KERN:   SubType: autoselect
KERN: wlan_control: 9234, 16
KERN: wlan_control: 9234, 17
KERN: wlan_control: 9234, 26
KERN: [net/atheroswifi/0] ath_reset: unable to reset hardware; hal status 14
KERN: wlan_control: 9234, 103
DAEMON 'DHCP': /dev/net/atheroswifi/0: Timeout shift: 4 secs (try 2)
DAEMON 'DHCP': /dev/net/atheroswifi/0: Send DHCP_DISCOVER to 255.255.255.255:67
KERN: ifmedia_ioctl: switching wlan to   Type: IEEE 802.11 Wireless Ethernet
KERN:   Mode: autoselect
KERN:   SubType: autoselect
KERN: wlan_control: 9234, 16
KERN: wlan_control: 9234, 17
KERN: wlan_control: 9234, 26
KERN: [net/atheroswifi/0] ath_reset: unable to reset hardware; hal status 14

I didn’t try the wireless_networks config file method, what is the syntax exactly?

If WPA is working (at least for some) under Haiku now we need to update this page:

https://www.haiku-os.org/guides/daily-tasks/wireless

and I’m sure OS News will be interested if this is the case!

Yep, was able to connect to a WPA protected network from a laptop with an Intel Pro Wireless adapter.

That result was not very repeatable though. From your and my own syslogs I would say that the adapter goes on scanning networks even though a specific network has been found and a connect command has been issued. DHCP will start sending broadcasts.

A connect attempt occurs

  • via the Network Preferences GUI
  • via command line
  • when saving an altered version of the wireless_networks config file, preferrably including encryption method and password

The latter currently seems to be the method yielding best results. So, the answer to your question is “either” - it works sometimes (for me) but way to go.

Yesss, it works, I am posting from haiku!!!

OK setup is GCC4 hybrid + latest wpa_supplicant recompiled from haiku ports, I used the wireless_networks file with the password and encryption and DHCP as method. It did connect but every few seconds it would disconnect and reconnect again, so I opened again the network preferences and choose static address using the values previously obtained with dhcp, the connection stabilized and dhcp also stopped filling the log with scan and updates. it looks like it is working good :slight_smile:
syntax is:

/boot/common/settings/network/wireless_networks
network SSID-name-of-the-network {
authentication wep|wpa|wpa2
password Your-password-string
}

Later I will try again if the same method works with the gcc2 hybrid on the hard disk, I am running gcc4 off an usb stick now.

Hello erm67!

I have the same problem, can You please upload your wpa_supplicant binary somewhere for me?
Thanks!

Z.

[quote=miqlas]Hello erm67!

I have the same problem, can You please upload your wpa_supplicant binary somewhere for me?
Thanks!

Z.[/quote]

I switched back to a gcc2 hybrid but I can no longer connect, don’t know why … I also tried to recompile wpa_supplicant with gcc2 but no luck … And I formatted the partition in the process so I no longer have the gcc4 executable, later I will boot haiku, compile it again, reboot and upload it :frowning: Hope it will be fixed.
It worked well on a gcc4 hybryd, after a couple of hours it stopped working and I had to reconnect manually (I guess some wifi keys expired) but it was acceptable

Hello!

Thanks for the reply. On gcc2h Haiku You can select the gcc4 compiler wit the “setgcc” command in terminal. Maybe it helps.

Doesn’t work, I did not investigate but on a gcc2 haiku

setgcc gcc4
make clean
make

doesn’t work, fails linking with libcrypto.a while

setgcc gcc2
make clean
make

does. I guess it has to be compiled on a gcc4 image.
If you have a gcc4 haiku, you only need the wpa_supplicant sources, the patches from haikuports and the haiku sources. Patch the wpa_supplicant sources, edit the .config file inside the wpa_supplicant subdir to fix the path to the haiku sources, run make.

Can You please post your binaries? I don’t want to download the whole source tree :frowning: