LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-17-2021, 01:56 PM   #1
madyogi
LQ Newbie
 
Registered: Feb 2009
Location: Poland
Distribution: My own, Fedora, OpenSuse
Posts: 21

Rep: Reputation: 2
Question Atheros 5005gs setup with wpa_supplicant


HELLO!

I attempt to resurrect an old laptop from ~2004/5 era (sort of typewriter). I put gentoo on it and it all would be great except the wireless adapter. Initially, there was Inprocom 2220 miniPCI installed and it didn't glue at all. Tried with ndiswrapper and dedicated windows driver (it installed fine), but iwconfig didn't even see wireless extensions available (CONFIG{WEXT_CORE=y, WEXT_PROC=Y, CFG80211_WEXT=y}). Tried with 3.18.139 and 5.10.61 kernels.

I disassembled some other notebook from the past, and it had Atheros 5005gs on board. Verified the kernel over menuconfig and it lists ath5k module and says it supports:
MAC: AR5211, AR5212
PHY: RF5111/2111, RF5112/2112, RF5412/2413

So, I put that card into the target machine and here is what lspci lists:

$ lspci
Code:
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD/ATI] RS300 Host Bridge (rev 02)
00:01.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RS300 AGP Bridge
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB200 OHCI USB Controller #1 (rev 01)
00:13.1 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB200 OHCI USB Controller #2 (rev 01)
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB200 EHCI USB Controller (rev 01)
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD/ATI] SB200 SMBus Controller (rev 1a)
00:14.1 IDE interface: Advanced Micro Devices, Inc. [AMD/ATI] SB200 IDE Controller
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB200 PCI to LPC Bridge
00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB200 PCI to PCI Bridge
00:14.5 Multimedia audio controller: Advanced Micro Devices, Inc. [AMD/ATI] SB200 AC97 Audio Controller (rev 01)
00:14.6 Modem: Advanced Micro Devices, Inc. [AMD/ATI] SB200 AC97 Modem Controller (rev 01)
01:05.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RS300M [Mobility Radeon 9100 IGP]
>> 02:02.0 Ethernet controller: Qualcomm Atheros AR2413/AR2414 Wireless Network Adapter [AR5005G(S) 802.11bg] (rev 01)
02:03.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter (rev 10)
02:04.0 CardBus bridge: ENE Technology Inc CB1410 Cardbus Controller (rev 01)
$ lspci -nn | grep "^02:02"

Code:
02:02.0 0200: 168c:001a (rev 01)
$ grep "ath" dmesg

Code:
[    0.864235] ath5k 0000:02:02.0: PCI INT A: no GSI
[    0.864375] ath5k 0000:02:02.0: registered as 'phy0'
[    1.769664] ath: EEPROM regdomain: 0x64
[    1.769666] ath: EEPROM indicates we should expect a direct regpair map
[    1.769670] ath: Country alpha2 being used: 00
[    1.769672] ath: Regpair used: 0x64
[    1.770174] ath5k: phy0: Atheros AR2413 chip found (MAC: 0x78, PHY: 0x45)
I have no idea what the "no GSI" means, but it also lists for the wired ethernet controller (and that one works fine).

I've installed wpa_supplicant-2.9-r5 and yay, it's giving me head ache... Here is the setup

Code:
#ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
# Above looks like not working, in log it lists it would stuck with group id 0 (zero).
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
#update_config=1
ap_scan=1
network={
	bssid=00:30:cd:0d:53:eb
	ssid="seawolf"
	psk="********"
	#psk=1bc711**********21edfc
	scan_ssid=1
	key_mgmt=WPA-PSK
	proto=RSN
	group=TKIP
	pairwise=CCMP TKIP
	priority=5
}
network={
	ssid=""
	key_mgmt=NONE
	priority=-999
}
and the logged output:

Code:
wpa_supplicant v2.9
random: getrandom() support available
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'
ctrl_interface='/var/run/wpa_supplicant'
ctrl_interface_group='wheel'
ap_scan=1
Line: 22 - start of a new network block
ssid - hexdump_ascii(len=7):
     73 65 61 77 6f 6c 66                              seawolf         
PSK (ASCII passphrase) - hexdump_ascii(len=8): [REMOVED]
scan_ssid=1 (0x1)
proto: 0x2
key_mgmt: 0x2
group: 0x8
priority=5 (0x5)
PSK (from passphrase) - hexdump(len=32): [REMOVED]
Line: 36 - start of a new network block
key_mgmt: 0x4
priority=-999 (0xfffffc19)
Priority group 5
   id=0 ssid='seawolf'
Priority group -999
   id=1 ssid=''
WEXT: cfg80211-based driver detected
wext: interface wlan0 phy: phy0
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
  capabilities: key_mgmt 0xf enc 0x1f flags 0x0
WEXT: Driver: ath5k
netlink: Operstate: ifindex=2 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT)
Add interface wlan0 to a new radio phy0
wlan0: Own MAC address: 00:11:f5:da:d2:3e
wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=4 set_tx=0 seq_len=0 key_len=0
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Driver did not support SIOCSIWENCODEEXT
wpa_driver_wext_set_key: alg=0 key_idx=5 set_tx=0 seq_len=0 key_len=0
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Driver did not support SIOCSIWENCODEEXT
wpa_driver_wext_set_countermeasures
wlan0: RSN: flushing PMKID list in the driver
wlan0: Setting scan request: 0.100000 sec
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
ctrl_interface_group=10 (from group name 'wheel')
MBO: Update non-preferred channels, non_pref_chan=N/A
wlan0: Added interface wlan0
wlan0: State: DISCONNECTED -> DISCONNECTED
wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=2 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
Daemonize..
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
Wireless event: cmd=0x8b06 len=8
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
Wireless event: cmd=0x8b1a len=8
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
wlan0: State: DISCONNECTED -> SCANNING
Scan SSID - hexdump_ascii(len=7):
     73 65 61 77 6f 6c 66                              seawolf         
wlan0: Starting AP scan for wildcard SSID (Interleave with specific)
wlan0: Add radio work 'scan'@0x79f9e0
wlan0: First radio work item in the queue - schedule start immediately
wlan0: Starting radio work 'scan'@0x79f9e0 after 0.000023 second wait
Scan requested (ret=0) - scan timeout 10 seconds
nl80211: Event message available
nl80211: Event message available
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
Wireless event: cmd=0x8b19 len=8
wlan0: Event SCAN_RESULTS (3) received
Received 0 bytes of scan results (0 BSSes)
wlan0: BSS: Start scan result update 1
BSS: last_scan_res_used=0/0
wlan0: New scan results available (own=0 ext=0)
wlan0: Radio work 'scan'@0x79f9e0 done in 0.726609 seconds
wlan0: radio_work_free('scan'@0x79f9e0): num_active_works --> 0
wlan0: No suitable network found
wlan0: Setting scan request: 5.000000 sec
RTM_NEWLINK: ifi_index=2 ifname=wlan0 wext ifi_family=0 ifi_flags=0x1003 ([UP])
EAPOL: disable timer tick
Scan SSID - hexdump_ascii(len=7):
     73 65 61 77 6f 6c 66                              seawolf         
wlan0: Starting AP scan for specific SSID: seawolf
wlan0: Add radio work 'scan'@0x79a680
wlan0: First radio work item in the queue - schedule start immediately
wlan0: Starting radio work 'scan'@0x79a680 after 0.000021 second wait
Scan requested (ret=0) - scan timeout 30 seconds
nl80211: Event message available
nl80211: Event message available
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
Wireless event: cmd=0x8b19 len=8
wlan0: Event SCAN_RESULTS (3) received
Received 0 bytes of scan results (0 BSSes)
wlan0: BSS: Start scan result update 2
# amd so on.

It don't even list other BSSes from the neighbourhood...

Interesting points.
1. Where it says it got SCAN_RESULTS (3), but it "Received 0 bytes of scan results (0 BSSes)".
2. 'WEXT: cfg80211-based driver detected' but there are still 'nl80211: Event message available".

I assume WEXT driver should be used as compatible(?) with all that old stuff, since found quite few post here on LQ (like: here) and on gentoo forum, related to ath5k and was used with madwifi toolchain (which is now stated to be obsolete and ported as part of WEXT). Is it?

I tried the nl80211 driver as well, but the result is pretty much similar..

Already turned on debugging on the drivers and MAC80211 but have completely no idea what/where to look for. There's a lot of things at /sys/kernel/debug to look at...

I do code a little myself and tried building ancient version of wpa_supplicant (2.0), to match it with one of 3.16 or 3.18 kernels. After configuring, I stuck at compile error in:

../src/crypto/tls_openssl.c: In function ‘tls_load_ca_der’:
../src/crypto/tls_openssl.c:1298:40: error: dereferencing pointer to incomplete type ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
1298 | lookup = X509_STORE_add_lookup(ssl_ctx->cert_store,

I see the code and it looks like there's nothing wrong in it. Rather, it's the fact that headers of openssl do not provide(?) the definition of 'struct ssl_ctx_st', just the typedefs to alias them with some other names.

Or am I missing the fact that this card will never ever work with the ath5k driver? AR5005 IS NOT AR521{12}, even though this page clearly states that 168c:001a device should work like a charm...

Pls, help since I really, really wish not to reinvent the world. Emerging it would be a pleasure...

P.S.
I did a fast install of WindowsXP ;D and confirmed the card works perfectly fine. It lists like ~20 APs from the area, including mine... Connects with WPA2-PSK. But except working WiFi, it is great to have a working web browser and a decent OS! ...

Last edited by madyogi; 10-17-2021 at 05:53 PM.
 
Old 10-19-2021, 08:32 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,518

Rep: Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604
That laptop is seriously ancient, and from AMD's worst period. They cleared out all the old crappy firmware from the kernel in 2015(?), so you need firmware from before that. You have USB-1.0, and one novelty - a single usb-2.0 controller. The internal wifi uses the ath5k module

If you're having issues with devices (e.g. the network) not working, it could be that the interrupts (one or two) that it could use are gone. I had that back in the day. The trick is to advance the nonfunctional device in the boot sequence, so it is initiated first.

EDIT:… so it is initialized first.

Last edited by business_kid; 10-20-2021 at 05:38 AM.
 
Old 10-20-2021, 02:52 PM   #3
madyogi
LQ Newbie
 
Registered: Feb 2009
Location: Poland
Distribution: My own, Fedora, OpenSuse
Posts: 21

Original Poster
Rep: Reputation: 2
Firmware

Thank you for the reply.

Quote:
Originally Posted by business_kid View Post
so you need firmware from before that
Hmmm... Do you mean something commonly known as binary blobs for linux kernel?

In case of gentoo there's a package known as "sys-kernel/linux-firmware". I tried that too. Must admit, I could do it but only for 5.x kernel. Result - there was nothing dedicated for ath5x inside. Already checked kernel.org but the firmware repository starts in 2019. Oldest archive holds ar5523.bin. Will see...

Last edited by madyogi; 10-20-2021 at 07:25 PM.
 
Old 10-21-2021, 06:14 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,518

Rep: Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604
Binary blobs aren't named as exactly as drivers. I'm finding a blob for ath3k and some ath6k options, and either of those might run your wifi if you have them. Inside is some industrial cpu with read/write routines. There's 802.11b, g, or n which are all speed options. But if your router is offering faster than your card can accept, it throttles down. Likewise there's WEP, WPA, & WPA2 encryption. Suck it and see. Alkso try 'ifconfig' and 'iwconfig' as root or with sudo and see if any wifi shows

Also, grep the big log files in /var/log for firmware. As a last resort, you can buy some usb wifi adapter, and shove it in the usb-2.0 socket. That would give you a few Mbit/S, perhaps up to 10Mbit/S. We're not looking for performance from a 'typewriter,' are we?

Anyhow, if you force load the wrong firmware, it will ignoire it, it won't fall on it's sword.
 
  


Reply

Tags
ath5k, wireless adapter


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure wpa_supplicant configuration to handle multiple USB WIiFi devices with single wpa_supplicant configuration file with system chetuneve Linux - Wireless Networking 1 11-18-2020 04:07 PM
Newbie Trying to Set Up Atheros 5005gs Network in Debian 8.04 jackdaws Linux - Wireless Networking 2 08-30-2008 03:27 AM
wpa_supplicant, atheros a5212, fedora core 6. Alias_NeO Linux - Hardware 0 11-05-2006 10:18 AM
wpa-psk, wpa_supplicant/madwifi/atheros association woes stardotstar Linux - Wireless Networking 7 10-18-2006 10:22 PM
atheros madwifi wpa_supplicant troubles jb2006 Slackware 3 03-27-2006 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration