Modify

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#7044 closed defect (worksforme)

Ath9k driver's problem with sta mode.

Reported by: tournet <yjdofc@…> Owned by: nbd
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

board is Atheros PB44, with two AR9160 wifi minipci cards. with newest trunk version, Ath9k's driver have some problem with sta mode. and give this log:
...
ioctl[SIOCSIWENCODEEXT]: Invalid argument
...

before the trunk version about r201xx, the sta mode works fine.

Attachments (0)

Change History (15)

comment:1 Changed 8 years ago by thepeople

  • Owner changed from developers to nbd
  • Status changed from new to assigned

comment:2 follow-up: Changed 8 years ago by nbd

please provide some details on the configuration that you're using

comment:3 Changed 8 years ago by anonymous

Hi,

I seem to have a similar problem: STA modes works fine, if there are NO AP-mode entries for the same interface.

I use the following config (on a DIR-825 with BackFire 10.3-rc2)

config 'wifi-device' 'radio0'

option 'type' 'mac80211'
option 'macaddr' '00:26:5a:c6:1d:b4'
option 'hwmode' '11ng'
list 'ht_capab' 'SHORT-GI-40'
list 'ht_capab' 'DSSS_CCK-40'
option 'disabled' '0'
option 'channel' '5'
option 'htmode' 'HT20'

config 'wifi-iface'

option 'device' 'radio0'
option 'ssid' 'some AP'
option 'network' 'wan'
option 'mode' 'sta'
option 'encryption' 'psk2'
option 'key' 'secret'

#config 'wifi-iface'
# option 'device' 'radio0'
# option 'network' 'lan'
# option 'mode' 'ap'
# option 'ssid' 'my AP'
# option 'encryption' 'psk-mixed'
# option 'key' 'my secret'

When I activate the second entry with mode ap, the sta mode does no longer work. I still get associate messages in dmesg, but no throughput to the other ap.

Regardless of the second configuration I always get

ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument

when I run wifi, so that seems to come from the sta-configuration (as the creator of the issue already mentioned).

comment:4 Changed 8 years ago by anonymous

Sorry, again with better formatting:

config 'wifi-device' 'radio0'
        option 'type' 'mac80211'
        option 'macaddr' '00:26:5a:c6:1d:b4'
        option 'hwmode' '11ng'
        list 'ht_capab' 'SHORT-GI-40'
        list 'ht_capab' 'DSSS_CCK-40'
        option 'disabled' '0'
        option 'channel' '1'
        option 'htmode' 'HT20'

config 'wifi-iface'
        option 'device' 'radio0'
        option 'ssid' 'some AP'
        option 'network' 'wan'
        option 'mode' 'sta'
        option 'encryption' 'psk2'
        option 'key' 'secret'

#config 'wifi-iface'
#       option 'device' 'radio0'
#       option 'network' 'lan'
#       option 'mode' 'ap'
#       option 'ssid' 'my AP'
#       option 'encryption' 'psk-mixed'
#       option 'key' 'my secret'

comment:5 in reply to: ↑ 2 Changed 8 years ago by anonymous

Replying to nbd:

please provide some details on the configuration that you're using

yes, sorry for my late. this is my wireless config.

config wifi-device  radio0
        option type     mac80211
        option channel  11
        option macaddr  00:03:7f:0c:e3:27
        option hwmode   11ng
        option htmode   HT20
        list ht_capab   SHORT-GI-40
        list ht_capab   DSSS_CCK-40
        option disabled 0
        option country  US

config wifi-iface
        option device   radio0
        option network  wan
        option mode     sta
        option ssid     wireless
        option encryption none

config wifi-device  radio1
        option type     mac80211
        option channel  153
        option macaddr  00:03:7f:0c:e3:1f
        option hwmode   11na
        option htmode   HT40-
        list ht_capab   SHORT-GI-40
        list ht_capab   DSSS_CCK-40
        option disabled 0
        option country  US

config wifi-iface
        option device   radio1
        option network  lan
        option mode     ap
        option ssid     OpenWrt_5G
        option encryption psk2
        option key      thisisatest

comment:6 Changed 8 years ago by tournet <yjdofc@…>

I confirmed the "ioctl[SIOCSIWENCODEEXT]: Invalid argument" is caused by sta mode,because if I made all the two wifi cards works as AP mode(2.4G or 5G), no "ioctl[SIOCSIWENCODEEXT]: Invalid argument" information.

BTW: the sta mode works fine even with the "ioctl[SIOCSIWENCODEEXT]: Invalid argument"

comment:7 Changed 8 years ago by Pat Erley <pat@…>

you can't bridge station interfaces. This might be the first problem. Here's a working dual vif example from my dir-615 rev c1:

config 'wifi-device' 'radio0'
        option 'type' 'mac80211'
        option 'channel' '7'
        option 'macaddr' '00:24:01:75:d1:f5'
        option 'hwmode' '11ng'
        list 'ht_capab' 'SHORT-GI-40'
        list 'ht_capab' 'DSSS_CCK-40'
        option 'htmode' 'HT40+'

config 'wifi-iface'
        option 'device' 'radio0'
        option 'network' 'lan'
        option 'mode' 'ap'
        option 'ssid' 'FooBarCafeWrt'
        option 'key' 'deadbeefcafe'
        option 'encryption' 'psk-mixed'

config 'wifi-iface'
        option 'device' 'radio0'
        option 'mode' 'sta'
        option 'ssid' 'FooBarCafeWPA'
        option 'key' 'deadbeefcafe'
        option 'encryption' 'psk2'

I needed to:

  • Have APs Before Stations
  • No Stations in Bridges
  • Disable HW Crypto

For this to work

comment:8 Changed 8 years ago by anonymous

Hi,

I used to have station interfaces bridges with Kamikaze 7.x and 8.x without problems. I also have this working with dd-wrt. So this seems to be a rather new limitation... If I want to use a WLAN connection as WAN, this would make quite some configuration hassle, if bridging is no longer allowed.

What about the disabled HW crypto?

comment:9 Changed 8 years ago by Pat Erley <pat@…>

Why is wlan as wan a configuration hastle? My example above is used exactly as that, and works fine. You just can't bridge a station interface. if you want wireless AND wired WAN connections, you need to load balance them, not bridge them. Here's the /etc/config/network that goes with that /etc/config/wireless:

config 'interface' 'loopback'
        option 'ifname' 'lo'
        option 'proto' 'static'
        option 'ipaddr' '127.0.0.1'
        option 'netmask' '255.0.0.0'

config 'interface' 'lan'
        option 'ifname' 'eth0'
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.1'
        option 'netmask' '255.255.255.0'

config 'interface' 'wan'
        option 'proto' 'dhcp'
        option 'ifname' 'wlan1'

comment:10 Changed 8 years ago by Pat Erley <pat@…>

Note on those configuration files: This is a dir-615-C1 that automatically associates with an encrypted network, then creates another, different encrypted network and broadcasts it, natting it through. If you want to do the bridged station/client approach, you either need to use a relatively old kernel(2.6.26ish) and the Gargoyle Project's arp-nat module, or forward port that to a recent kernel. I've been working on the later, but have not had any success (ebtables -> xtables issues in my brain).

As far as the disabling hwcrypto goes, just add/edit /etc/modules.d/NN-ath9k and make it look like:

ath9k_hw
ath9k_common
ath9k nohwcrypt=1

There has been recent discussion of fixing hwcrypto in ath9k for multiple ssids. The problem is the Group Key, as far as I understand it.

comment:11 Changed 8 years ago by Pat Erley <pat@…>

As a final follow up, a set of links...

This one explains why mac80211 (not ath9k) does not allow a station interface to be bridged (unless 4ADDR is enabled): https://patchwork.kernel.org/patch/60631/

This one is a link to 'Project GUS' which uses openwrt/gargoyle along with Arp-NAT to do 'sorta' bridged client mode: http://projectgus.com/2010/03/wireless-client-bridging-with-openwrt/

The patches for Arpnat do not currently work with 2.6.32 or 2.6.33, and really need to be ported to xtables. I've been working on doing this, but need to make money, which doing this does not do.

comment:12 Changed 8 years ago by uia

I have a question, is 4ADDR=WDS? So if I put the main AP in WDS mode, will the openwrt ath9k work as wireless bridge(without arp-nat approach)?

comment:13 Changed 8 years ago by Pat Erley <pat@…>

4ADDR is used in WDS, but in this particular case, 4ADDR is a special extension to the normal framing, to allow wireless client bridges. If you control the AP (running hostapd on linux) and the bridged-client (also running linux), they can negotiate 4ADDR support, enabling a functioning bridge. This is a use case where the AP doesn't support WDS... WDS is a better approach, as it's not a hack to emulate essentially the same thing. I've never tried/used 4ADDR/WDS as my main AP supports neither, and I can't put OpenWRT on it.

comment:14 Changed 8 years ago by nbd

  • Resolution set to worksforme
  • Status changed from assigned to closed

sta+ap crypto key handling was reworked in r21568. it should work even with hw crypto now

comment:15 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.