2008-11-12 21:59:29

by RUMI Szabolcs

[permalink] [raw]
Subject: ath5k master (AP) mode

Hello!

I've been trying to set an Atheros NIC to AP mode using the ath5k
driver but it fails:

# iwconfig wlan0 mode master
Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan0 ; Invalid argument.

lspci:

03:03.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

dmesg (with compat-wireless-2008-11-12):

ath5k_pci 0000:03:03.0: PCI INT A disabled
cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: EU
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2402000 KHz - 2482000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
(5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
(5490000 KHz - 5710000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
ath5k_pci 0000:03:03.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
ath5k_pci 0000:03:03.0: registered as 'phy0'
phy0: Selected rate control algorithm 'pid'
ath5k phy0: Atheros AR2414 chip found (MAC: 0x79, PHY: 0x45)
__ratelimit: 6 callbacks suppressed
ath5k phy0: gain calibration timeout (2412MHz)
ath5k phy0: can't reset hardware (-11)
ath5k phy0: gain calibration timeout (2412MHz)
ath5k phy0: can't reset hardware (-11)
ath5k phy0: gain calibration timeout (2412MHz)
ath5k phy0: can't reset hardware (-11)
ath5k phy0: gain calibration timeout (2452MHz)
ath5k phy0: can't reset hardware (-11)
ath5k phy0: gain calibration timeout (2452MHz)
ath5k phy0: can't reset hardware (-11)
__ratelimit: 6 callbacks suppressed
ath5k phy0: gain calibration timeout (2452MHz)
ath5k phy0: can't reset hardware (-11)

First I've tried this with the driver version that is included with 2.6.27
but when I saw that it doesn't work I have installed the compat-wireless
tarball from today (2008-11-12) but it still doesn't work.

Is this how it supposed to be (eg. not supported yet) or am I just doing
something wrong?

Thanks,

Sab


2008-11-13 23:07:06

by Nick Kossifidis

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

2008/11/14 RUMI Szabolcs <[email protected]>:
> On Thu, 13 Nov 2008 18:49:10 +0100
> Johannes Berg <[email protected]> wrote:
>
>> > I have compiled a kernel from wireless-testing git of today (2.6.28-rc4-wl)
>> > then recompiled and tested hostapd-0.6.5 against that,
>>
>> look, you need hostapd from git
>
> If you look a bit further down in that email, I've also tried
> exactly that afterwards but unfortunately it made no difference.
>
> BTW I've made a diff -rduN between hostapd-0.6.5 and todays -git
> but haven't spotted anything relevant to my problem anyway.
>
> To summarize:
>
> 2.6.27 + hostapd-0.6.5 = NO
> 2.6.27 + OpenWRT hack + hostapd-0.6.5 = NO
> compat-wireless-2008-11-12 + hostapd-0.6.5 = NO
> wireless-testing-git + hostapd-0.6.5 = NO
> wireless-testing-git + hostapd-git = NO
>
> In fact I've also tried hostapd-0.6.4 and 0.5.10 at some point
> but they didn't make anything better.
>
> Thanks,
>
> Sab

Have you enabled AP mode on the driver ?

diff --git a/drivers/net/wireless/ath5k/base.c
b/drivers/net/wireless/ath5k/base.c
index e09ed2c..69aad6e 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -488,6 +488,7 @@ ath5k_pci_probe(struct pci_dev *pdev,

hw->wiphy->interface_modes =
BIT(NL80211_IFTYPE_STATION) |
+ BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_ADHOC) |
BIT(NL80211_IFTYPE_MESH_POINT);

Code for AP mode is there but it's not enabled yet until we do further
tests (it didn't work on some 5413 hw etc, now after PCU updates it
should work but we still need to test it)


--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

2008-11-14 10:16:03

by RUMI Szabolcs

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Fri, 14 Nov 2008 01:07:04 +0200
"Nick Kossifidis" <[email protected]> wrote:

> Have you enabled AP mode on the driver ?
>
> diff --git a/drivers/net/wireless/ath5k/base.c
> b/drivers/net/wireless/ath5k/base.c
> index e09ed2c..69aad6e 100644
> --- a/drivers/net/wireless/ath5k/base.c
> +++ b/drivers/net/wireless/ath5k/base.c
> @@ -488,6 +488,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
>
> hw->wiphy->interface_modes =
> BIT(NL80211_IFTYPE_STATION) |
> + BIT(NL80211_IFTYPE_AP) |
> BIT(NL80211_IFTYPE_ADHOC) |
> BIT(NL80211_IFTYPE_MESH_POINT);
>
> Code for AP mode is there but it's not enabled yet until we do further
> tests (it didn't work on some 5413 hw etc, now after PCU updates it
> should work but we still need to test it)

YES, that did the trick! :)
With partial success. To summarize:

- Open System worked (only basic IPv4 tested, eg. ICMP ping)
- MAC filtering from hostapd didn't work
- WEP didn't work
- WPA and WPA2 weren't tested

I have attached a hostapd log (concatenated, commented, and gzipped)
of my testing runs.

In the end I need this to work properly as an AP with WPA2
so I'm willing to test further if somebody is willing to try to
fix the whole thing...

Thanks,

Sab


Attachments:
ath5k_hostapd_081114.txt.gz (3.75 kB)

2008-11-13 17:12:01

by RUMI Szabolcs

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Thu, 13 Nov 2008 00:46:32 +0100
RUMI Szabolcs <[email protected]> wrote:

> On Wed, 12 Nov 2008 17:46:50 -0500
> Pavel Roskin <[email protected]> wrote:
>
> > On Wed, 2008-11-12 at 22:48 +0100, RUMI Szabolcs wrote:
> > > Hello!
> > >
> > > I've been trying to set an Atheros NIC to AP mode using the ath5k
> > > driver but it fails:
> > >
> > > # iwconfig wlan0 mode master
> > > Error for wireless request "Set Mode" (8B06) :
> > > SET failed on device wlan0 ; Invalid argument.
> >
> > You need to use hostapd for master mode.
>
> Well, I have installed hostapd-0.6.5 with the nl80211 driver and it says:
>
> # hostapd -dd /etc/hostapd/hostapd.conf
> Configuration file: /etc/hostapd/hostapd.conf
> ctrl_interface_group=0
> Failed to set interface wlan0 to master mode.
> nl80211 driver initialization failed.
> wlan0: Unable to setup interface.
> Flushing old station entries
> Deauthenticate all stations
> rmdir[ctrl_interface]: No such file or directory
> ELOOP: remaining socket: sock=8 eloop_data=0x9f4ea98 user_data=(nil) handler=0x8082920

Some news about what I have tried since yesterday:

I have compiled a kernel from wireless-testing git of today (2.6.28-rc4-wl)
then recompiled and tested hostapd-0.6.5 against that, but it exhibited the
same behavior as above. Then I've compiled libnl git of today which did
compile but any version of hostapd failed to compile against it so I gave
up on that. Then I have compiled the hostapd git of today against libnl-1.1
and the wireless-testing kernel which did compile but runtime it exhibited
the same error as above. So basically whatever I do it fails to set master
mode on ath5k...

I have also tried to patch 2.6.27 with a patch that the OpenWRT people
seemed to be using and has this in net/mac80211/cfg.c:

@@ -33,6 +33,10 @@ nl80211_type_to_mac80211_type(enum nl802
case NL80211_IFTYPE_MESH_POINT:
return IEEE80211_IF_TYPE_MESH_POINT;
#endif
+ case NL80211_IFTYPE_AP:
+ return IEEE80211_IF_TYPE_AP;
+ case NL80211_IFTYPE_AP_VLAN:
+ return IEEE80211_IF_TYPE_VLAN;

But this also ended up with the same error like anything else.

Thanks,

Sab

2008-11-13 17:50:05

by Johannes Berg

[permalink] [raw]
Subject: Re: ath5k master (AP) mode


> I have compiled a kernel from wireless-testing git of today (2.6.28-rc4-wl)
> then recompiled and tested hostapd-0.6.5 against that,

look, you need hostapd from git

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2008-11-12 23:46:33

by RUMI Szabolcs

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Wed, 12 Nov 2008 17:46:50 -0500
Pavel Roskin <[email protected]> wrote:

> On Wed, 2008-11-12 at 22:48 +0100, RUMI Szabolcs wrote:
> > Hello!
> >
> > I've been trying to set an Atheros NIC to AP mode using the ath5k
> > driver but it fails:
> >
> > # iwconfig wlan0 mode master
> > Error for wireless request "Set Mode" (8B06) :
> > SET failed on device wlan0 ; Invalid argument.
>
> You need to use hostapd for master mode.

Well, I have installed hostapd-0.6.5 with the nl80211 driver and it says:

# hostapd -dd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
ctrl_interface_group=0
Failed to set interface wlan0 to master mode.
nl80211 driver initialization failed.
wlan0: Unable to setup interface.
Flushing old station entries
Deauthenticate all stations
rmdir[ctrl_interface]: No such file or directory
ELOOP: remaining socket: sock=8 eloop_data=0x9f4ea98 user_data=(nil) handler=0x8082920

Thanks,

Sab

2008-11-13 22:59:30

by RUMI Szabolcs

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Thu, 13 Nov 2008 18:49:10 +0100
Johannes Berg <[email protected]> wrote:

> > I have compiled a kernel from wireless-testing git of today (2.6.28-rc4-wl)
> > then recompiled and tested hostapd-0.6.5 against that,
>
> look, you need hostapd from git

If you look a bit further down in that email, I've also tried
exactly that afterwards but unfortunately it made no difference.

BTW I've made a diff -rduN between hostapd-0.6.5 and todays -git
but haven't spotted anything relevant to my problem anyway.

To summarize:

2.6.27 + hostapd-0.6.5 = NO
2.6.27 + OpenWRT hack + hostapd-0.6.5 = NO
compat-wireless-2008-11-12 + hostapd-0.6.5 = NO
wireless-testing-git + hostapd-0.6.5 = NO
wireless-testing-git + hostapd-git = NO

In fact I've also tried hostapd-0.6.4 and 0.5.10 at some point
but they didn't make anything better.

Thanks,

Sab

2008-11-13 23:03:51

by Johannes Berg

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Thu, 2008-11-13 at 23:59 +0100, RUMI Szabolcs wrote:
> On Thu, 13 Nov 2008 18:49:10 +0100
> Johannes Berg <[email protected]> wrote:
>
> > > I have compiled a kernel from wireless-testing git of today (2.6.28-rc4-wl)
> > > then recompiled and tested hostapd-0.6.5 against that,
> >
> > look, you need hostapd from git
>
> If you look a bit further down in that email, I've also tried
> exactly that afterwards but unfortunately it made no difference.
>
> BTW I've made a diff -rduN between hostapd-0.6.5 and todays -git
> but haven't spotted anything relevant to my problem anyway.

ath5k is at fault; I think there were patches but I know nothing about
ath5k

hw->wiphy->interface_modes =
BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC) |
BIT(NL80211_IFTYPE_MESH_POINT);


johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2008-11-12 22:46:53

by Pavel Roskin

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Wed, 2008-11-12 at 22:48 +0100, RUMI Szabolcs wrote:
> Hello!
>
> I've been trying to set an Atheros NIC to AP mode using the ath5k
> driver but it fails:
>
> # iwconfig wlan0 mode master
> Error for wireless request "Set Mode" (8B06) :
> SET failed on device wlan0 ; Invalid argument.

You need to use hostapd for master mode.

--
Regards,
Pavel Roskin

2009-02-11 22:34:43

by Pat Erley

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

Bob Copeland wrote:
> On Wed, Feb 11, 2009 at 1:47 PM, Norman Rie=DF <[email protected]>=
wrote:
>> Hello,
>>
>> i pulled wireless-testing kernel today and installed hostapd-0.6.7, =
but
>> it still does not work.
>>
>>
>> iwconfig wlan0 mode master
>> Error for wireless request "Set Mode" (8B06) :
>> SET failed on device wlan0 ; Invalid argument.
>=20
> Did you apply this patch from upthread?
>=20

I can confirm Norman's wireless card's behavior (and have an associate =
with
the same problem). This is with the upthread patch applied to compat-w=
ireless
pulled from git.

ath5k 0000:0a:05.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
ath5k 0000:0a:05.0: registered as 'phy5'
phy5: Selected rate control algorithm 'pid'
ath5k phy5: Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43)
ath5k phy5: RF5112B multiband radio found (0x36)

If I remove the entry from hostapd.conf to set the channel, and force a=
channel
with iwconfig, hostapd will start, but nothing can associate, and netst=
umbler
on an XP machine with an atheros card in it does not detect the SSID as=
being=20
an access point.

Pat Erley

2009-02-11 21:49:04

by Nick Kossifidis

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

2009/2/10 RUMI Szabolcs <[email protected]>:
> Hello Everyone!
>
> To put it simple: IT WORKS! :)
>
> The recipe:
>
> wireless-testing-git pull from earlier today with the only
> modification being this:
>
> -----8<----------------------------------------
>
> --- wireless-testing/drivers/net/wireless/ath5k/base.c 2009-02-10 06:11:43.186470883 +0100
> +++ wireless-testing/drivers/net/wireless/ath5k/base.c.old 2008-11-14 09:36:40.000000000 +0100
> @@ -522,6 +501,7 @@
> hw->wiphy->interface_modes =
> BIT(NL80211_IFTYPE_STATION) |
> BIT(NL80211_IFTYPE_ADHOC) |
> + BIT(NL80211_IFTYPE_AP) |
> BIT(NL80211_IFTYPE_MESH_POINT);
>
> hw->extra_tx_headroom = 2;
>
> -----8<----------------------------------------
>
> Otherwise hostapd-0.6.7, nothing special on the userland.
>
> In detail:
>
> - Open System mode works with Tx fluctuating between 4-6 Mbps
> and Rx between 10-14 Mbps regardless of the distance or signal
> strength. It was tested standing 1m away from the AP antenna
> (signal 100/100) up to 15m away with several thick walls in
> between (signal 60/100) but throughput figures remained the
> same.
>
> - MAC address filtering does work. It probably always did,
> I think I've just messed up the configuration the last time
> and that was the reason back then, sorry.
>
> - WEP mode does not work, apparently the driver does not allow
> setting it and hostapd is exiting on that error.
>
> - WPA and WPA2 have been tested and they seem to be working!
>
> A small hint is that the WPA pre-shared key should be given
> in hex both for hostapd and on the clients, otherwise there can
> be differences in translation from ASCII to hex which in turn
> may lead to an authentication failure.
>
> I've tried to push some 100 MBs through the link in both directions
> both with WPA/WPA2 turned off and then on and it seems to be rock
> solid so far. CPU usage both on the AP host and the client is
> negligible in any case, the throughput isn't affected by turning
> on WPA/WPA2 either.
>
> Thank you all!
>
> Best regards,
> Sab
>

The only reason we haven't enabled AP support yet is that it didn't
work on some devices and we need to make more tests to be sure that
it's ok.


--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

2009-02-13 21:28:50

by Jeff Tchang

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

> On Wed, Feb 11, 2009 at 1:47 PM, Norman Rie <[email protected]> wrote:
>
>> Hello,
>>
>> i pulled wireless-testing kernel today and installed hostapd-0.6.7, but
>> it still does not work.
>>
>>
>> iwconfig wlan0 mode master
>> Error for wireless request "Set Mode" (8B06) :
>> SET failed on device wlan0 ; Invalid argument.

I am also trying to get ath5k Master/AP mode working with my wireless card.

I am using a GIGABYTE GN-WS50G 802.11 b/g Atheros AR5007 chipset
minicard mPCI express.

It gets detected as PCI ID: 168c:001c. I am using Ubuntu 8.10.

I downloaded the latest tarball from
http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2
and then patched the single file adding in the option for AP mode. I
unloaded the ath5k module and then reloaded it using modprobe. However
I am still getting the "SET failed on device wlan0 ; Invalid
argument."

Using hostapd 0.6.7 I see the errors:

Failed to set interface wlan0 to master mode.
nl80211 driver initialization failed

Trying to figure out what I am missing.

2009-02-12 02:12:35

by Ben Greear

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

Nick Kossifidis wrote:

> The only reason we haven't enabled AP support yet is that it didn't
> work on some devices and we need to make more tests to be sure that
> it's ok.

I found a blog entry from Jiri saying he had it working on the AR5212,
but I'm unable to reproduce his luck. I only added the patch to enable
AP mode, assuming the rest are already in the wireless-testing tree.

My NIC:
16:00.0 Ethernet controller: Atheros Communications, Inc. AR5212/AR5213 Multiprotocol MAC/baseband processor (rev 01)

As long as I leave channel=0, I don't see any obvious errors when I start hostapd,
but I don't see any APs show up on a friend's Vista system (or my G1). If I try
to set a channel (channel=1, for instance), then it fails to set the channel and aborts.

I haven't used hostapd before, so I could be messing that up somehow. I'm trying
the latest git snapshot as of today, and the libnl-1.1


Here is my hostapd startup, in case it helps:

[root@ibmt60w-1 hostapd]# ./hostapd -d hostapd_ath5k.conf
Configuration file: hostapd_ath5k.conf
ctrl_interface_group=0
Opening raw packet socket for ifindex 10596688
BSS count 1, BSSID mask ff:ff:ff:ff:ff:ff (0 bits)
SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
wlan1: IEEE 802.11 Fetching hardware channel/rate support not supported.
Flushing old station entries
Deauthenticate all stations
Using interface wlan1 with hwaddr 00:0b:6b:20:88:75 and ssid 'ben-ath5k'
wlan1: Setup of interface done.
MGMT (TX callback) ACK
MGMT (TX callback) ACK
mgmt::proberesp cb
MGMT (TX callback) ACK
mgmt::proberesp cb

I see these in the kernel logs, as well:
Feb 11 17:55:23 ibmt60w-1 kernel: ath5k phy1: beacon queue 7 didn't stop?
Feb 11 17:56:27 ibmt60w-1 kernel:last message repeated 74 times
[root@ibmt60w-1 ~]#


Thanks,
Ben


--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com


2009-02-11 18:57:38

by Norman Rieß

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

Hello,

i pulled wireless-testing kernel today and installed hostapd-0.6.7, but
it still does not work.


iwconfig wlan0 mode master
Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan0 ; Invalid argument.

hostapd v0.6.7
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2009, Jouni Malinen <[email protected]> and contributors


hostapd -dd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
ctrl_interface_group=0
Failed to set interface wlan0 to master mode.
nl80211 driver initialization failed.
wlan0: Unable to setup interface.
rmdir[ctrl_interface]: No such file or directory
ELOOP: remaining socket: sock=5 eloop_data=0x95f39e8 user_data=(nil)
handler=0x8075908


The card is Atheros Communications Inc. AR2413 802.11bg NIC (rev 01).

Regards,

Norman

2009-02-10 12:24:10

by RUMI Szabolcs

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

Hello Everyone!

To put it simple: IT WORKS! :)

The recipe:

wireless-testing-git pull from earlier today with the only
modification being this:

-----8<----------------------------------------

--- wireless-testing/drivers/net/wireless/ath5k/base.c 2009-02-10 06:11:43.186470883 +0100
+++ wireless-testing/drivers/net/wireless/ath5k/base.c.old 2008-11-14 09:36:40.000000000 +0100
@@ -522,6 +501,7 @@
hw->wiphy->interface_modes =
BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC) |
+ BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_MESH_POINT);

hw->extra_tx_headroom = 2;

-----8<----------------------------------------

Otherwise hostapd-0.6.7, nothing special on the userland.

In detail:

- Open System mode works with Tx fluctuating between 4-6 Mbps
and Rx between 10-14 Mbps regardless of the distance or signal
strength. It was tested standing 1m away from the AP antenna
(signal 100/100) up to 15m away with several thick walls in
between (signal 60/100) but throughput figures remained the
same.

- MAC address filtering does work. It probably always did,
I think I've just messed up the configuration the last time
and that was the reason back then, sorry.

- WEP mode does not work, apparently the driver does not allow
setting it and hostapd is exiting on that error.

- WPA and WPA2 have been tested and they seem to be working!

A small hint is that the WPA pre-shared key should be given
in hex both for hostapd and on the clients, otherwise there can
be differences in translation from ASCII to hex which in turn
may lead to an authentication failure.

I've tried to push some 100 MBs through the link in both directions
both with WPA/WPA2 turned off and then on and it seems to be rock
solid so far. CPU usage both on the AP host and the client is
negligible in any case, the throughput isn't affected by turning
on WPA/WPA2 either.

Thank you all!

Best regards,
Sab

2009-02-12 09:12:52

by Norman Rieß

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

Bob Copeland schrieb:
> On Wed, Feb 11, 2009 at 1:47 PM, Norman Rie=DF <[email protected]>=
wrote:
> =20
>> Hello,
>>
>> i pulled wireless-testing kernel today and installed hostapd-0.6.7, =
but
>> it still does not work.
>>
>>
>> iwconfig wlan0 mode master
>> Error for wireless request "Set Mode" (8B06) :
>> SET failed on device wlan0 ; Invalid argument.
>> =20
>
> Did you apply this patch from upthread?
>
> --- wireless-testing/drivers/net/wireless/ath5k/base.c 2009-02-1=
0
> 06:11:43.186470883 +0100
> +++ wireless-testing/drivers/net/wireless/ath5k/base.c.old
> 2008-11-14 09:36:40.000000000 +0100
> @@ -522,6 +501,7 @@
> hw->wiphy->interface_modes =3D
> BIT(NL80211_IFTYPE_STATION) |
> BIT(NL80211_IFTYPE_ADHOC) |
> + BIT(NL80211_IFTYPE_AP) |
> BIT(NL80211_IFTYPE_MESH_POINT);
>
> hw->extra_tx_headroom =3D 2;
>
> =20
Arrrrg,
as i understood it, the newest pull did change that line, so i did not.
With that line added hostapd starts, and at first look, a bg2200 sees
the accesspoint with wpa2 capability.

Sorry for that.
Thanks
Norman

2009-02-11 21:04:11

by Bob Copeland

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Wed, Feb 11, 2009 at 1:47 PM, Norman Rie=DF <[email protected]> w=
rote:
> Hello,
>
> i pulled wireless-testing kernel today and installed hostapd-0.6.7, =
but
> it still does not work.
>
>
> iwconfig wlan0 mode master
> Error for wireless request "Set Mode" (8B06) :
> SET failed on device wlan0 ; Invalid argument.

Did you apply this patch from upthread?

--- wireless-testing/drivers/net/wireless/ath5k/base.c 2009-02-10
06:11:43.186470883 +0100
+++ wireless-testing/drivers/net/wireless/ath5k/base.c.old
2008-11-14 09:36:40.000000000 +0100
@@ -522,6 +501,7 @@
hw->wiphy->interface_modes =3D
BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC) |
+ BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_MESH_POINT);

hw->extra_tx_headroom =3D 2;

--=20
Bob Copeland %% http://www.bobcopeland.com

2009-03-06 08:19:56

by Christoph .J Thompson

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Thu, 5 Mar 2009 22:49:16 +0000
Alexey Yudichev <[email protected]> wrote:
> Thanks Christoph, looks like ubuntu is currently at 2.6.28 and I do
> not want to attempt installing non-ubuntu-patched kernel. Also, what
> is the driver option value in your hostapd config? Is it nl80211? And
> last question, do you know anything about that "another" patch for pre
> 2.6.29 kernels?

Hi,

Yes, the driver option value is nl80211. This is the patch you are looking for I think:

http://johannes.sipsolutions.net/patches/kernel/all/LATEST/030-allow-ap-vlan-modes.patch


--
Christoph J. Thompson <[email protected]>

2009-03-05 22:21:17

by Gábor Stefanik

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Thu, Mar 5, 2009 at 8:12 PM, Ben Greear <[email protected]> wr=
ote:
> [email protected] wrote:
>
>>>> I don't know if it's intended, or just not implemented, but iwconf=
ig
>>>> <iface> mode master
>>>> won't work with mac80211 drivers. =A0Hostapd knows how to set mast=
er mode
>>>> on it's own.
>>>
>>> Hostapd needs to be used for master mode in *any* case. =A0So yes, =
its
>>> intended that you need hostapd for master mode with mac80211 driver=
s.
>>> Just switching the card to master mode simply won't work, because
>>> there's oh-so-much-more setup required in addition to that, which
>>> hostapd knows how to do.
>>>
>>> Dan
>>
>> Thanks for confirming this. =A0It was what I understood to be the ca=
se, and
>> what experimentation had shown, but I was not sure if it was by desi=
gn, or
>> just not implemented yet.
>
> Seems like iwconfig should have a more useful error message,
> telling users to use hostapd for this particular driver,
> instead of just a generic error...
>
> Ben
>

I think that would need a new Wireless Extensions feature, and WExt is
closed for new features, as we are transitioning to cfg80211.

--=20
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)

2009-03-05 22:49:19

by Alexey Yudichev

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

> On Wed, 4 Mar 2009 22:51:01 +0000
> Alexey Yudichev <[email protected]> wrote:
>> Hi, I use 2.6.27-11-generic (from ubuntu's
>> linux-backports-modules-intrepid-generic), hostapd v0.5.10.
>
> I use 2.6.29-rc6 and hostapd 0.6.8. I know that on kernels < 2.6.29 you need another patch to enable AP support, not just the one that enables AP support in ath5k. If you upgrade to 2.6.29 the old regulatory rules will be disabled by default. So unless you re-enable them (but I haven't tested with that) you'll have to install crda and the wireless regulatory database. In hostapd.conf you will have to change channel=0 to something else. That's how I got it working.
>
> --
> Christoph J. Thompson <[email protected]>

Thanks Christoph, looks like ubuntu is currently at 2.6.28 and I do
not want to attempt installing non-ubuntu-patched kernel. Also, what
is the driver option value in your hostapd config? Is it nl80211? And
last question, do you know anything about that "another" patch for pre
2.6.29 kernels?

2009-03-04 22:58:12

by Pat Erley

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

Alexey Yudichev wrote:
>> On Wed, 4 Mar 2009 21:33:21 +0000
>> Alexey Yudichev <[email protected]> wrote:
>>> Hello,
>>>
>>> I've just joined the list so don't know how to join the same thread so
>>> to indicate that it's the same matter I use the same subject. I am
>>> trying to make my "04:01.0 Ethernet controller: Atheros Communications
>>> Inc. Atheros AR5001X+ Wireless Network Adapter (rev 01)" which is
>>> identified by ath5k as
>>> [ 10.356742] ath5k phy0: Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43)
>>> [ 10.356748] ath5k phy0: RF5112B multiband radio found (0x36)
>> I have the exact same card (AR5001X+) working in master mode with hostapd. What kernel version and hostapd version do you use?
>
> Hi, I use 2.6.27-11-generic (from ubuntu's
> linux-backports-modules-intrepid-generic), hostapd v0.5.10.

I don't know if it's intended, or just not implemented, but iwconfig <iface> mode master
won't work with mac80211 drivers. Hostapd knows how to set master mode on it's own.

Pat Erley

2009-03-05 19:09:09

by Pat Erley

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Thu, 05 Mar 2009 06:43:22 -0500, Dan Williams <[email protected]> wrote:
> On Wed, 2009-03-04 at 17:58 -0500, pat-lkml wrote:
>> Alexey Yudichev wrote:
>> >> On Wed, 4 Mar 2009 21:33:21 +0000
>> >> Alexey Yudichev <[email protected]> wrote:
>> >>> Hello,
>> >>>
>> >>> I've just joined the list so don't know how to join the same thread
>> >>> so
>> >>> to indicate that it's the same matter I use the same subject. I am
>> >>> trying to make my "04:01.0 Ethernet controller: Atheros
>> >>> Communications
>> >>> Inc. Atheros AR5001X+ Wireless Network Adapter (rev 01)" which is
>> >>> identified by ath5k as
>> >>> [ 10.356742] ath5k phy0: Atheros AR5213A chip found (MAC: 0x59,
>> >>> PHY: 0x43)
>> >>> [ 10.356748] ath5k phy0: RF5112B multiband radio found (0x36)
>> >> I have the exact same card (AR5001X+) working in master mode with
>> >> hostapd. What kernel version and hostapd version do you use?
>> >
>> > Hi, I use 2.6.27-11-generic (from ubuntu's
>> > linux-backports-modules-intrepid-generic), hostapd v0.5.10.
>>
>> I don't know if it's intended, or just not implemented, but iwconfig
>> <iface> mode master
>> won't work with mac80211 drivers. Hostapd knows how to set master mode
>> on it's own.
>
> Hostapd needs to be used for master mode in *any* case. So yes, its
> intended that you need hostapd for master mode with mac80211 drivers.
> Just switching the card to master mode simply won't work, because
> there's oh-so-much-more setup required in addition to that, which
> hostapd knows how to do.
>
> Dan

Thanks for confirming this. It was what I understood to be the case,
and what experimentation had shown, but I was not sure if it was by
design, or just not implemented yet.

Pat Erley

2009-03-04 22:51:04

by Alexey Yudichev

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

> On Wed, 4 Mar 2009 21:33:21 +0000
> Alexey Yudichev <[email protected]> wrote:
>> Hello,
>>
>> I've just joined the list so don't know how to join the same thread =
so
>> to indicate that it's the same matter I use the same subject. I am
>> trying to make my "04:01.0 Ethernet controller: Atheros Communicatio=
ns
>> Inc. Atheros AR5001X+ Wireless Network Adapter (rev 01)" which is
>> identified by ath5k as
>> [=C2=A0=C2=A0 10.356742] ath5k phy0: Atheros AR5213A chip found (MAC=
: 0x59, PHY: 0x43)
>> [=C2=A0=C2=A0 10.356748] ath5k phy0: RF5112B multiband radio found (=
0x36)
>
> I have the exact same card (AR5001X+) working in master mode with hos=
tapd. What kernel version and hostapd version do you use?

Hi, I use 2.6.27-11-generic (from ubuntu's
linux-backports-modules-intrepid-generic), hostapd v0.5.10.

2009-03-10 21:41:33

by Christoph .J Thompson

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Tue, 10 Mar 2009 21:04:17 +0000
Alexey Yudichev <[email protected]> wrote:
> Thanks. This link is broken however simple search brings me here:
> http://wireless.erley.org/
> where the author says that Atheros AR5213A does not work: "Lets me set
> master mode, and activate hostapd, but not found on other machines
> while scanning". Well what I tried is I left the kernel on 2.6.27-13,
> compiled latest compat-wireless, upgraded to hostapd 0.6.8 and I got
> hostapd starting successfully. I configured it for open system and got
> my Windows Mobile 5 PDA connecting to it successfully and even
> interenet was working! WM6 Smartphone connects from 2nd or 3rd attempt
> but has no access to internet for some reason. With WPA2-PSK WM6
> connects but still no internet and WM5 does not connect even though
> the config is pretty standard:
> wpa=3
> wpa_passphrase=abcdefgh
> wpa_key_mgmt=WPA-PSK
> wpa_pairwise=TKIP CCMP
>
> Does this resemble your wpa configuration?

I didn't try WPA yet but I will shortly.

> Do you know, if I got this far, can unstable connection and not
> working WPA be related to older kernel?

I can't be sure. I don't have the unstable connection problem but I didn't
use WPA yet. So maybe the unstable connection problem only happens with WPA.

> What clients did you try? I can't understand why internet access works
> on WM5 but not on WM6. Both devices worked great with hardware
> wireless router.

The client was Linux 2.6.29-rc6 with a USB WiFi key with the rtl8187L chipset.

--
Christoph .J Thompson <[email protected]>

2009-03-05 19:13:06

by Ben Greear

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

[email protected] wrote:

>>> I don't know if it's intended, or just not implemented, but iwconfig
>>> <iface> mode master
>>> won't work with mac80211 drivers. Hostapd knows how to set master mode
>>> on it's own.
>> Hostapd needs to be used for master mode in *any* case. So yes, its
>> intended that you need hostapd for master mode with mac80211 drivers.
>> Just switching the card to master mode simply won't work, because
>> there's oh-so-much-more setup required in addition to that, which
>> hostapd knows how to do.
>>
>> Dan
>
> Thanks for confirming this. It was what I understood to be the case,
> and what experimentation had shown, but I was not sure if it was by
> design, or just not implemented yet.

Seems like iwconfig should have a more useful error message,
telling users to use hostapd for this particular driver,
instead of just a generic error...

Ben

--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com


2009-03-10 21:04:22

by Alexey Yudichev

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

>
> On Thu, 5 Mar 2009 22:49:16 +0000
> Alexey Yudichev <[email protected]> wrote:
> > Thanks Christoph, looks like ubuntu is currently at 2.6.28 and I do
> > not want to attempt installing non-ubuntu-patched kernel. Also, what
> > is the driver option value in your hostapd config? Is it nl80211? And
> > last question, do you know anything about that "another" patch for pre
> > 2.6.29 kernels?
>
> Hi,
>
> Yes, the driver option value is nl80211. This is the patch you are looking for I think:
>
> http://johannes.sipsolutions.net/patches/kernel/all/LATEST/030-allow-ap-vlan-modes.patch
>
>
> --
> Christoph J. Thompson <[email protected]>

Thanks. This link is broken however simple search brings me here:
http://wireless.erley.org/
where the author says that Atheros AR5213A does not work: "Lets me set
master mode, and activate hostapd, but not found on other machines
while scanning". Well what I tried is I left the kernel on 2.6.27-13,
compiled latest compat-wireless, upgraded to hostapd 0.6.8 and I got
hostapd starting successfully. I configured it for open system and got
my Windows Mobile 5 PDA connecting to it successfully and even
interenet was working! WM6 Smartphone connects from 2nd or 3rd attempt
but has no access to internet for some reason. With WPA2-PSK WM6
connects but still no internet and WM5 does not connect even though
the config is pretty standard:
wpa=3
wpa_passphrase=abcdefgh
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP

Does this resemble your wpa configuration?

Do you know, if I got this far, can unstable connection and not
working WPA be related to older kernel?
What clients did you try? I can't understand why internet access works
on WM5 but not on WM6. Both devices worked great with hardware
wireless router.

2009-03-10 21:58:43

by Bob Copeland

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Tue, Mar 10, 2009 at 5:37 PM, Christoph .J Thompson
<[email protected]> wrote:
> On Tue, 10 Mar 2009 21:04:17 +0000
> Alexey Yudichev <[email protected]> wrote:
>> Do you know, if I got this far, can unstable connection and not
>> working WPA be related to older kernel?
>
> I can't be sure. I don't have the unstable connection problem but I didn't
> use WPA yet. So maybe the unstable connection problem only happens with WPA.

It's possible ath5k has bugs in the crypto for AP mode like the ones fixed
in ath9k recently - you can always try the nohwcrypt=1 modparam.

--
Bob Copeland %% http://www.bobcopeland.com

2009-03-04 22:59:56

by Christoph .J Thompson

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Wed, 4 Mar 2009 22:51:01 +0000
Alexey Yudichev <[email protected]> wrote:
> Hi, I use 2.6.27-11-generic (from ubuntu's
> linux-backports-modules-intrepid-generic), hostapd v0.5.10.

I use 2.6.29-rc6 and hostapd 0.6.8. I know that on kernels < 2.6.29 you need another patch to enable AP support, not just the one that enables AP support in ath5k. If you upgrade to 2.6.29 the old regulatory rules will be disabled by default. So unless you re-enable them (but I haven't tested with that) you'll have to install crda and the wireless regulatory database. In hostapd.conf you will have to change channel=0 to something else. That's how I got it working.

--
Christoph J. Thompson <[email protected]>

2009-03-05 11:45:22

by Dan Williams

[permalink] [raw]
Subject: Re: ath5k master (AP) mode

On Wed, 2009-03-04 at 17:58 -0500, pat-lkml wrote:
> Alexey Yudichev wrote:
> >> On Wed, 4 Mar 2009 21:33:21 +0000
> >> Alexey Yudichev <[email protected]> wrote:
> >>> Hello,
> >>>
> >>> I've just joined the list so don't know how to join the same thread so
> >>> to indicate that it's the same matter I use the same subject. I am
> >>> trying to make my "04:01.0 Ethernet controller: Atheros Communications
> >>> Inc. Atheros AR5001X+ Wireless Network Adapter (rev 01)" which is
> >>> identified by ath5k as
> >>> [ 10.356742] ath5k phy0: Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43)
> >>> [ 10.356748] ath5k phy0: RF5112B multiband radio found (0x36)
> >> I have the exact same card (AR5001X+) working in master mode with hostapd. What kernel version and hostapd version do you use?
> >
> > Hi, I use 2.6.27-11-generic (from ubuntu's
> > linux-backports-modules-intrepid-generic), hostapd v0.5.10.
>
> I don't know if it's intended, or just not implemented, but iwconfig <iface> mode master
> won't work with mac80211 drivers. Hostapd knows how to set master mode on it's own.

Hostapd needs to be used for master mode in *any* case. So yes, its
intended that you need hostapd for master mode with mac80211 drivers.
Just switching the card to master mode simply won't work, because
there's oh-so-much-more setup required in addition to that, which
hostapd knows how to do.

Dan