2012-10-22 20:20:09

by Ben Greear

[permalink] [raw]
Subject: Cannot bring up second VAP on recent kernels?

Anyone successfully using more than one virtual AP on
3.3 or higher kernels? It works fine for me on 3.0.32,
but my 3.3.8 and 3.5.7 kernels (and a few similar ones)
all fail with errors like this below:

Hardware is ath9k 3x3 9380 NIC.

[root@lec2010-ath9k-1 wifi]# cat hostapd_log_vap1.txt
1350936424.890962: random: Trying to read entropy from /dev/random
1350936424.891172: Configuration file: wifi/hostapd_vap1.conf
1350936424.892827: ctrl_interface_group=0
1350936424.895084: nl80211: interface vap1 in phy wiphy0
1350936424.895175: rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
1350936424.895456: nl80211: Using driver-based off-channel TX
1350936424.895483: nl80211: TDLS supported
1350936424.895500: nl80211: TDLS external setup
1350936424.895612: nl80211: Add own interface ifindex 26
1350936424.896560: nl80211: Set mode ifindex 26 iftype 3 (AP)
1350936424.896919: nl80211: Setup AP - device_ap_sme=0 use_monitor=0
1350936424.896992: nl80211: Subscribe to mgmt frames with AP handle 0x81e8910
1350936424.897018: nl80211: Register frame type=0xb0 nl_handle=0x81e8910
1350936424.897036: nl80211: Register frame match - hexdump(len=0): [NULL]
1350936424.897107: nl80211: Register frame type=0x0 nl_handle=0x81e8910
1350936424.897127: nl80211: Register frame match - hexdump(len=0): [NULL]
1350936424.897174: nl80211: Register frame type=0x20 nl_handle=0x81e8910
1350936424.897195: nl80211: Register frame match - hexdump(len=0): [NULL]
1350936424.897240: nl80211: Register frame type=0xa0 nl_handle=0x81e8910
1350936424.897261: nl80211: Register frame match - hexdump(len=0): [NULL]
1350936424.897306: nl80211: Register frame type=0xc0 nl_handle=0x81e8910
1350936424.897326: nl80211: Register frame match - hexdump(len=0): [NULL]
1350936424.897372: nl80211: Register frame type=0xd0 nl_handle=0x81e8910
1350936424.897392: nl80211: Register frame match - hexdump(len=0): [NULL]
1350936424.897438: nl80211: Register frame type=0x40 nl_handle=0x81e8910
1350936424.897458: nl80211: Register frame match - hexdump(len=0): [NULL]
1350936424.897681: nl80211: Register beacons command failed: ret=-16 (Device or resource busy)
1350936424.897830: nl80211: Failed to set interface vap1 into AP mode
1350936424.901888: netlink: Operstate: linkmode=0, operstate=6
1350936424.901996: nl80211: Set mode ifindex 26 iftype 2 (STATION)
1350936424.902197: nl80211 driver initialization failed.


Thanks,
Ben


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



2012-10-22 22:52:13

by Ben Greear

[permalink] [raw]
Subject: Re: Cannot bring up second VAP on recent kernels?

On 10/22/2012 02:45 PM, Felix Fietkau wrote:
> On 2012-10-22 11:26 PM, Ben Greear wrote:
>> On 10/22/2012 02:19 PM, Felix Fietkau wrote:
>>> On 2012-10-22 10:20 PM, Ben Greear wrote:
>>>> Anyone successfully using more than one virtual AP on
>>>> 3.3 or higher kernels? It works fine for me on 3.0.32,
>>>> but my 3.3.8 and 3.5.7 kernels (and a few similar ones)
>>>> all fail with errors like this below:
>>>>
>>>> Hardware is ath9k 3x3 9380 NIC.
>>> Are you using one hostapd instance per vap, or one hostapd instance for
>>> all of them?
>>
>> One hostapd per VAP.
> I had issues with that a long time ago. Use one hostapd instance for all
> vaps on the same wiphy, that'll work better.

Well, that would be a lot of user-space churn for me, so I think
I'll try to figure out why it's failing and see if I can fix it.

Thanks,
Ben

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


2012-10-22 21:45:09

by Felix Fietkau

[permalink] [raw]
Subject: Re: Cannot bring up second VAP on recent kernels?

On 2012-10-22 11:26 PM, Ben Greear wrote:
> On 10/22/2012 02:19 PM, Felix Fietkau wrote:
>> On 2012-10-22 10:20 PM, Ben Greear wrote:
>>> Anyone successfully using more than one virtual AP on
>>> 3.3 or higher kernels? It works fine for me on 3.0.32,
>>> but my 3.3.8 and 3.5.7 kernels (and a few similar ones)
>>> all fail with errors like this below:
>>>
>>> Hardware is ath9k 3x3 9380 NIC.
>> Are you using one hostapd instance per vap, or one hostapd instance for
>> all of them?
>
> One hostapd per VAP.
I had issues with that a long time ago. Use one hostapd instance for all
vaps on the same wiphy, that'll work better.

- Felix


2012-10-22 23:27:43

by Ben Greear

[permalink] [raw]
Subject: Re: Cannot bring up second VAP on recent kernels?

On 10/22/2012 03:52 PM, Ben Greear wrote:
> On 10/22/2012 02:45 PM, Felix Fietkau wrote:
>> On 2012-10-22 11:26 PM, Ben Greear wrote:
>>> On 10/22/2012 02:19 PM, Felix Fietkau wrote:
>>>> On 2012-10-22 10:20 PM, Ben Greear wrote:
>>>>> Anyone successfully using more than one virtual AP on
>>>>> 3.3 or higher kernels? It works fine for me on 3.0.32,
>>>>> but my 3.3.8 and 3.5.7 kernels (and a few similar ones)
>>>>> all fail with errors like this below:
>>>>>
>>>>> Hardware is ath9k 3x3 9380 NIC.
>>>> Are you using one hostapd instance per vap, or one hostapd instance for
>>>> all of them?
>>>
>>> One hostapd per VAP.
>> I had issues with that a long time ago. Use one hostapd instance for all
>> vaps on the same wiphy, that'll work better.
>
> Well, that would be a lot of user-space churn for me, so I think
> I'll try to figure out why it's failing and see if I can fix it.
>
> Thanks,
> Ben
>


Well, crap, it looks like it is this commit. No one considered wanting
to run two hostapd processes on one wiphy :(

commit 5e760230e42cf759bd923457ca2753aacf2e656e
Author: Johannes Berg <[email protected]>
Date: Fri Nov 4 11:18:17 2011 +0100

cfg80211: allow registering to beacons

Add the ability to register to received beacon frames
to allow implementing OLBC logic in userspace. The
registration is per wiphy since there's no point in
receiving the same frame multiple times.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: John W. Linville <[email protected]>


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


2012-10-22 21:26:42

by Ben Greear

[permalink] [raw]
Subject: Re: Cannot bring up second VAP on recent kernels?

On 10/22/2012 02:19 PM, Felix Fietkau wrote:
> On 2012-10-22 10:20 PM, Ben Greear wrote:
>> Anyone successfully using more than one virtual AP on
>> 3.3 or higher kernels? It works fine for me on 3.0.32,
>> but my 3.3.8 and 3.5.7 kernels (and a few similar ones)
>> all fail with errors like this below:
>>
>> Hardware is ath9k 3x3 9380 NIC.
> Are you using one hostapd instance per vap, or one hostapd instance for
> all of them?

One hostapd per VAP.

Thanks,
Ben

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


2012-10-23 07:20:56

by Johannes Berg

[permalink] [raw]
Subject: Re: Cannot bring up second VAP on recent kernels?

On Mon, 2012-10-22 at 16:27 -0700, Ben Greear wrote:

> Well, crap, it looks like it is this commit. No one considered wanting
> to run two hostapd processes on one wiphy :(

I'm not sure why you'd want to? It'll work just as well with a single
process, and *you* were the one who was so concerned about userspace
overhead first ;-)

You could fall back to monitor mode AP implementation?

johannes


2012-10-22 21:19:37

by Felix Fietkau

[permalink] [raw]
Subject: Re: Cannot bring up second VAP on recent kernels?

On 2012-10-22 10:20 PM, Ben Greear wrote:
> Anyone successfully using more than one virtual AP on
> 3.3 or higher kernels? It works fine for me on 3.0.32,
> but my 3.3.8 and 3.5.7 kernels (and a few similar ones)
> all fail with errors like this below:
>
> Hardware is ath9k 3x3 9380 NIC.
Are you using one hostapd instance per vap, or one hostapd instance for
all of them?

- Felix