Short version: the official driver fixed it.
Basically I'm just trying to get a working access point using hardware I
already have. I knew my Dlink DWL-G520 worked for that in 2009 under FreeBSD,
so I was surprised to have trouble under OpenBSD.
This machine triple-boots into OpenBSD, Debian, and Windows XP so I had
gotten the latest official driver package from Dlink and was playing around
in Windows with their utilities and Netstumbler looking at another machine's
access point through the DWL-G520. All was fine.
By the way, I had installed 2 versions of their drivers, an original and a
Rev. B. When I plugged in the card and booted up it had configured itself
to use the Rev. B driver. I don't know if that's hardware revision B or
software revision B. There's nothing about Rev. B marked on the card.
So the next day back in OpenBSD I looked at a general ifconfig listing for
something else and was quite surprised to see ath0 working:
ath0: flags=8822<BROADCAST,NOTRAILERS,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:0d:88:c8:80:21
priority: 4
groups: wlan
media: IEEE802.11 autoselect (DS1 mode 11b)
status: no network
ieee80211: nwid ""
inet6 fe80::20d:88ff:fec8:8021%ath0 prefixlen 64 scopeid 0x1
Sure enough, dmesg shows it as being perfectly normal (notice 2 different
numbers: 5212 and 5213):
ath0 at pci2 dev 9 function 0 "Atheros AR5212" rev 0x01: apic 2 int 18
ath0: AR5213 5.6 phy 4.1 rf2112a 4.6, FCC1A, address 00:0d:88:c8:80:21
2 days ago it said:
ath0 at pci2 dev 9 function 0 "Atheros AR5311" rev 0x01: apic 2 int 18
ath_hal_attach: unable to init EEPROM
ath0: unable to attach hardware; HAL status 22
The day before I was looking for clues as to the chip's identity using pcidump
and had done pcidump -x 2:9:0 > ath1.dat, all the way through pcidump -xxx.
I was hoping to find a string in there that had the model number in it.
With the chip working I did:
pcidump -xxx 2:9:0 > /tmp/working3.dat
freebie# cmp ath3.dat working3.dat
ath3.dat working3.dat differ: char 20, line 1
cmp stops at the first difference.
ath3.dat: (old, not working)
2:9:0: Atheros AR5311
0x0000: 0011168c 82900116 02000001 00004010
0x0010: fcfd0000 00000000 00000000 00000000
0x0020: 00000000 00000000 00005001 3a111186
0x0030: 00000000 00000044 00000000 1c080109
0x0040: 00000000 00000001 c6004000 00000000
0x0050: 00000000 00000000 00000000 00000000
0x0060: 00000000 00000000 00000000 00000000
0x0070: 00000000 00000000 00000000 00000000
0x0080: 00000000 00000000 00000000 00000000
0x0090: 00000000 00000000 00000000 00000000
0x00a0: 00000000 00000000 00000000 00000000
0x00b0: 00000000 00000000 00000000 00000000
0x00c0: 00000000 00000000 00000000 00000000
0x00d0: 00000000 00000000 00000000 00000000
0x00e0: 00000000 00000000 00000000 00000000
0x00f0: 00000000 00000000 00000000 00000000
working3.dat:
2:9:0: Atheros AR5212
0x0000: 0013168c 02900116 02000001 00004010
0x0010: fcfd0000 00000000 00000000 00000000
0x0020: 00000000 00000000 00005001 3a131186
0x0030: 00000000 00000044 00000000 1c0a0109
0x0040: 00000000 00020001 c6004000 00000000
0x0050: 00000000 00000000 00000000 00000000
0x0060: 00000000 00000000 00000000 00000000
0x0070: 00000000 00000000 00000000 00000000
0x0080: 00000000 00000000 00000000 00000000
0x0090: 00000000 00000000 00000000 00000000
0x00a0: 00000000 00000000 00000000 00000000
0x00b0: 00000000 00000000 00000000 00000000
0x00c0: 00000000 00000000 00000000 00000000
0x00d0: 00000000 00000000 00000000 00000000
0x00e0: 00000000 00000000 00000000 00000000
0x00f0: 00000000 00000000 00000000 00000000
I noticed that aside from something obscure in the binary data maybe being
different, in the non-working version pcidump identifies it as an AR5311, in
the working version it's called an AR5212. Could the number itself be in
the eeprom? In these listings it looks like pcidump is putting in the
number because it's on a line by itself.
Running the official Dlink driver under Windows changed something in the
eeprom so now it works under OpenBSD.
Even Linux is happy with it now:
[ 16.314543] ath5k_pci 0000:02:09.0: registered as 'phy0'
[ 16.615344] ath5k phy0: Atheros AR5213 chip found (MAC: 0x56, PHY: 0x41)
[ 16.615353] ath5k phy0: RF2112A 2GHz radio found (0x46)
This was giving an error that it wouldn't POST.
The Atheros containment/numbering scheme (from the advertising "datasheet"
pdf):
The AR5002AP-2X contains
AR5112 2.4/5 GHz dual band radio-on-a-chip
AR2112 2.4 GHz radio-on-a-chip
AR5312 Wireless System-on-a-chip
The AR 5002AP-X contains
AR5112 2.4/5 GHz dual band radio-on-a-chip
AR2312 Wireless System-on-a-chip
The AR5002AP-G contains
AR2112 2.4 GHz radio-on-a-chip
AR2312 Wireless System-on-a-chip
The AR5002AP-A contains
AR5102 Radio-on-a-chip
AR2312 Wireless System-on-a-chip
The AR5002X contains
AR5112 2.4/5 GHz dual band Radio-on-a-chip
AR5212 Multiprotocol MAC/baseband processor
The AR5002G contains
AR2112 2.4 GHz Radio-on-a-chip
AR5212 Multiprotocol MAC/baseband processor
The AR5002A contains
AR5102 5 GHz Radio-on-a-chip
AR5212 Multiprotocol MAC/baseband processor
There's no copyright date in the PDF, but there's probably at least 1 newer
generation of chips.
The 5311 number seems bogus, but maybe it's from a different generation.
Alan
On Wed, 28 Mar 2012, Alan Corey wrote:
I'm just Googling, but see
https://bitbucket.org/freebsd/freebsd-head/src/3ce34df9366f/sys/dev/ath/ath_hal/ar5212/
They look closely related. I started by Googling "AR5212 datasheet" and
ended up with 2 copies of a 1-page advertising PDF. The 5112 and 5212 seem
to be parts of the AR5002x. The Atheros stuff seems to have one number like
AR5002* referrring to a package of a "radio on a chip" plus a processor. The
radios are different, the processors are different, and the different AR5002*
packages are different as a result. 3 numbers for each combination.
Nothing like an official API yet though.
Alan
On Tue, 27 Mar 2012, Mihai Popescu wrote:
The odd thing is that this card works in a machine with FreeBSD 7.1 and
that
identifies the chip as "Atheros 5212". So which chip number is right?
Could the problem have to do with misidentifying the chip? dmesg, pcidump
and the driver think it's an AR5311.
I've got 4.7 running on my laptop with an internal mini-pci card which has
either a 5212 or 5213A depending on where in the dmesg output you look,
and
that works fine. pcidump calls that a 5212. So much for accuracy.
Back to the PCI-mounted one: A FreeBSD 7.0 live CD I've got calls it an
AR5211 with a HAL status of 13. OpenBSD installs 4.7 & 4.4 call it an
AR5311 with a HAL status 22. OpenBSD 4.1 install calls it a 5211, 4.0 &
4.2
don't find it (floppy install image). Debian Linux 5.03 calls it an ath5k
and says it fails the POST.
It's good you've mentioned it. I tried to work with a laptop using
Atheros chipset for wireless. OpenBSD dmesg shows Atheros AR5424 and
another number like AR5xxx I can't remember, but I can't find this
model on Qualcomm Atheros site. Windows XP shows Atheros AR5700
series. Which is what ? Maybe someone who got it right can give us a
clue.
Thanks