Re: [ath9k-devel] DWA-556 not working as AP

2011-08-08 Thread sami ahokas
2011/8/6 Pavel Roskin :
> On Fri, 5 Aug 2011 09:48:42 +0300
> sami ahokas  wrote:
>
>> I don't know if my issue is related to ath9k driver or hostapd so I'm
>> sending this to both lists.
> ...
>> If I reboot my board after this, AP role works right from the start.
>> But if I toggle the power of my board, AP mode gets broken again. What
>> could cause this kind of behavior? Is there something in AR5418
>> registers that is left uninitialized in AP mode in the driver or
>> hostapd?
>
> That's clearly something in the hardware, so hostapd is irrelevant here.
>
>> I'm using Linux kernel version 2.6.33 on powerpc platform. Hostapd
>> version is 0.7.3 and wpa_supplicant is 0.7.3 too.
>
> The first thing should be to test the card with the latest kernel or
> with compat-wireless.  For Linux wireless drivers, 2.6.33 is stone
> age :)
>
> You can also check the card with MadWifi trunk snapshot.  If that works
> fine, chances are that ath9k does something wrong, otherwise I would
> suspect the hardware.
>
> --
> Regards,
> Pavel Roskin
>

Hi,

Thanks for your reply. I chose to try the MadWifi driver, but now I'm
not able to set interface to master mode. Here is what hostapd gives
me when I try start it:

root@samia:~# hostapd -B -P /var/run/hostapd.pid /var/run/wlan_ap.conf
Configuration file: /var/run/wlan_ap.conf
ioctl[SIOCSIWMODE]: Invalid argument
Could not set interface to master mode!
madwifi driver initialization failed.
rmdir[ctrl_interface]: No such file or directory
ELOOP: remaining socket: sock=6 eloop_data=0x106677a0 user_data=(nil)
handler=0x100338a4

Some ioctl command seems to be the problem. Could there be something
missing from my environment? I attach my hostapd config file here too:

cat /var/run/wlan_ap.conf
interface=ath0
bridge=br0
driver=madwifi
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
country_code=FI
beacon_int=100
dtim_period=2
max_num_sta=255
wmm_enabled=0
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
hw_mode=g
channel=4
eapol_version=2
ssid=test_wlan
ignore_broadcast_ssid=0
auth_algs=1
wpa=1
wpa_passphrase=xyxyxyxyxyxyxy
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP

I haven't been using MadWifi driver before so this might be some
stupid newbie configuration mistake. But if someone could steer me to
right direction I would appreciate that.

Sami
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] Atheros 5416 on a D-Link DWA-552 in host mode bug

2011-08-08 Thread Mohammed Shafi
On Tue, Aug 9, 2011 at 9:55 AM, Bugs  wrote:
> Hi,
>
> I am trying to run a Atheros 5416 on a D-Link DWA-552 in host mode for
> 802.11n
>
> I seem to be having a problem that looks like the one patched in
> https://patchwork.kernel.org/patch/694461/ however I am running the current
> driver, and at least mac.c seems to match that patch, and still have this
> issue when starting host mode.
>
> I am new to HostAP and have spent a considerable amount of time working on
> this issue, and I hope I am not wasting your time, but I think this is a
> legitimate bug I am experiencing.

hi,

we will try to recreate it here, also its a bit of old card.

>
> Here are some details:
> Linux kernel 3.0.1
>
> Full Kernel config at:
> http://pastebin.com/f3BZpVVd
>
> Likely relevant kernel config:
> http://pastebin.com/RHHguFvF
>
> dmesg right after starting hostapd:
> http://pastebin.com/XL5shUxZ
>
> hostapd config:
> http://pastebin.com/6au0qajF
>
> I am willing to test code if anyone has patches to try.
>
> If this is not a bug, I apologize for taking up your time and would
> appreciate any suggestions on what to read / google to get this working.
>
> Thank you for your time.
>
> Fred Dinkler IV
>
>
> ___
> ath9k-devel mailing list
> ath9k-devel@lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>
>



-- 
shafi
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] Atheros 5416 on a D-Link DWA-552 in host mode bug

2011-08-08 Thread Bugs
Hi,

I am trying to run a Atheros 5416 on a D-Link DWA-552 in host mode for
802.11n

I seem to be having a problem that looks like the one patched in
https://*patch*work.*kernel*.org/*patch*/*694461*/however I am running
the current driver, and at least mac.c seems to match that patch, and
still have this issue when starting host mode.

I am new to HostAP and have spent a considerable amount of time working
on this issue, and I hope I am not wasting your time, but I think this
is a legitimate bug I am experiencing.

Here are some details:
Linux kernel 3.0.1

Full Kernel config at:
http://pastebin.com/f3BZpVVd

Likely relevant kernel config:
http://pastebin.com/RHHguFvF

dmesg right after starting hostapd:
http://pastebin.com/XL5shUxZ

hostapd config:
http://pastebin.com/6au0qajF

I am willing to test code if anyone has patches to try.

If this is not a bug, I apologize for taking up your time and would
appreciate any suggestions on what to read / google to get this working.

Thank you for your time.

Fred Dinkler IV

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] ath9k: Network stalls every 30 seconds

2011-08-08 Thread Galen
I haven't reviewed the full thread here - but have you made 100% sure that 
there is not some kind of WiFi connection manager running in the background on 
the Linux system? Just something to double check... those connection managers 
frequently probe and cause network stalls, particularly at specific, likely 
human-programmed intervals (e.g. 30 seconds) like you're describing...

Sure, it's stupidly simple, but Linux distros have deeply embedded WiFi 
connection managers and people sometimes miss them...

-Galen

On Aug 8, 2011, at 6:13 PM, Adrian Chadd wrote:

> .. sorry, he isn't having issues with the AR5416 on FreeBSD but is under 
> ath9k.
> 
> (Wow, is this the second time FreeBSD works where ath9k doesn't? I may
> have to throw a little private party :-)
> 
> Would someone like to take up the challenge? I'll help you wade
> through the HAL if you'd like.
> 
> 
> Adrian
> 
> On 9 August 2011 09:12, Adrian Chadd  wrote:
>> Hi all,
>> 
>> I'm just forwarding what Robert said. FreeBSD doesn't have the same
>> interruptions as ath9k does on the AR5416.
>> 
>> I don't have the time to go digging myself just now.
>> 
>> On 3 August 2011 05:37, Robert Högberg  wrote:
>>> An update to previous mail..
>>> 
>>> I tried the i386 version of FreeBSD 9.0 beta (instead of amd64) and
>>> that one worked much, much better. No network interruptions every 30
>>> seconds in FreeBSD 9.0 beta 1, but I only ran the test for a few
>>> minutes. Would you expect the noise floor calibrations to happen every
>>> 30 seconds in FreeBSD also or is the interval different there?
>>> 
>>> I'll continue investigating.
>>> 
>>> (You may want to look into why the ath driver doesn't work on amd64..)
>>> 
>>> Robert
>>> 
>>> 2011/8/2 Robert Högberg :
 I tried FreeBSD and the computer crashed when I tried to enable the WLAN.
 
 I'm no FreeBSD user so I'm not sure I got things right, but here's what I 
 did:
 * Boot FreeBSD from USB stick (WLAN device was detected correctly and
 ath0 created)
 * ifconfig wlan0 create wlandev ath0
 * ifconfig wlan0 up (This caused the computer to freeze. No output,
 and no input possible. I waited minutes but nothing happened.)
 
 I attach dmesg output after boot.
 
 /Robert
 
 2011/8/2 Adrian Chadd :
> Ah, that it works well in Windows is a good sign.
> 
> Would you mind doing me a favour? Could you spin up FreeBSD-9.0-BETA1
> on a temporary disk (eg a USB thumb drive) and see if it exhibits the
> same behaviour?
> 
> 
> Adrian
> 
> On 2 August 2011 04:19, Robert Högberg  wrote:
>> 2011/7/30 Adrian Chadd :
>>> Have you tried another ath9k NIC? Another AR5416 NIC?
>> 
>> I've tried an AR9271 NIC (USB ID 0cf3:9271) and it works very well. I
>> only have one AR5416 NIC to test I'm afraid.
>> 
>> 
>>> Is it possible this NIC is slightly weirdly damaged?
>> 
>> Maybe, but the card works well with the Windows 7 drivers. But I guess
>> it's possible that the noise floor calibration functionality is
>> broken/problematic on this card and the Windows driver knows this and
>> avoids or adapts to the problem. After all, I don't see any problems
>> with the calibration disabled so maybe the Windows driver doesn't use
>> the calibration either. But I don't know..
>> 
>> TP-Link has released a v2 version of this TL-WN851N NIC (I'm using v1)
>> which suggests the first version may not have been perfect. Maybe v1
>> was "weirdly damaged" and they fixed it in the second version. I don't
>> know what the differences are between the two versions, but I think
>> they used AR5416 in both versions.
>> 
>> Robert
>> 
> 
 
>>> 
>> 
> ___
> ath9k-devel mailing list
> ath9k-devel@lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH] ath: Fix hardware decryption of WEP

2011-08-08 Thread Felix Fietkau
On 2011-08-08 1:19 PM, Bill Jordan wrote:
> The first 4 hardware key indexes are reserved for WEP, but
> never programmed. The result was that WEP always used
> software decryption.
>
> Signed-off-by: Bill Jordan
> ---
>   drivers/net/wireless/ath/key.c |8 +---
>   1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c
> index 17b0efd..73177f1 100644
> --- a/drivers/net/wireless/ath/key.c
> +++ b/drivers/net/wireless/ath/key.c
> @@ -501,7 +501,11 @@ int ath_key_config(struct ath_common *common,
>   if (key->keylen)
>   memcpy(hk.kv_val, key->key, key->keylen);
>
> - if (!(key->flags&  IEEE80211_KEY_FLAG_PAIRWISE)) {
> + if (hk.kv_type == ATH_CIPHER_WEP) {
> + if (key->keyidx>= IEEE80211_WEP_NKID)
> + return -EOPNOTSUPP;
> + idx = key->keyidx;
> + } else if (!(key->flags&  IEEE80211_KEY_FLAG_PAIRWISE)) {
I'm not sure this is a good idea, this would break adding pairwise WEP 
keys. Also, maybe WEP keys could use the BSSID in the lookup to avoid 
the first 4 keycache slots, that way it'd work properly in multi-BSSID 
AP setups.

- Felix
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] ath9k: Network stalls every 30 seconds

2011-08-08 Thread Adrian Chadd
.. sorry, he isn't having issues with the AR5416 on FreeBSD but is under ath9k.

(Wow, is this the second time FreeBSD works where ath9k doesn't? I may
have to throw a little private party :-)

Would someone like to take up the challenge? I'll help you wade
through the HAL if you'd like.


Adrian

On 9 August 2011 09:12, Adrian Chadd  wrote:
> Hi all,
>
> I'm just forwarding what Robert said. FreeBSD doesn't have the same
> interruptions as ath9k does on the AR5416.
>
> I don't have the time to go digging myself just now.
>
> On 3 August 2011 05:37, Robert Högberg  wrote:
>> An update to previous mail..
>>
>> I tried the i386 version of FreeBSD 9.0 beta (instead of amd64) and
>> that one worked much, much better. No network interruptions every 30
>> seconds in FreeBSD 9.0 beta 1, but I only ran the test for a few
>> minutes. Would you expect the noise floor calibrations to happen every
>> 30 seconds in FreeBSD also or is the interval different there?
>>
>> I'll continue investigating.
>>
>> (You may want to look into why the ath driver doesn't work on amd64..)
>>
>> Robert
>>
>> 2011/8/2 Robert Högberg :
>>> I tried FreeBSD and the computer crashed when I tried to enable the WLAN.
>>>
>>> I'm no FreeBSD user so I'm not sure I got things right, but here's what I 
>>> did:
>>> * Boot FreeBSD from USB stick (WLAN device was detected correctly and
>>> ath0 created)
>>> * ifconfig wlan0 create wlandev ath0
>>> * ifconfig wlan0 up (This caused the computer to freeze. No output,
>>> and no input possible. I waited minutes but nothing happened.)
>>>
>>> I attach dmesg output after boot.
>>>
>>> /Robert
>>>
>>> 2011/8/2 Adrian Chadd :
 Ah, that it works well in Windows is a good sign.

 Would you mind doing me a favour? Could you spin up FreeBSD-9.0-BETA1
 on a temporary disk (eg a USB thumb drive) and see if it exhibits the
 same behaviour?


 Adrian

 On 2 August 2011 04:19, Robert Högberg  wrote:
> 2011/7/30 Adrian Chadd :
>> Have you tried another ath9k NIC? Another AR5416 NIC?
>
> I've tried an AR9271 NIC (USB ID 0cf3:9271) and it works very well. I
> only have one AR5416 NIC to test I'm afraid.
>
>
>> Is it possible this NIC is slightly weirdly damaged?
>
> Maybe, but the card works well with the Windows 7 drivers. But I guess
> it's possible that the noise floor calibration functionality is
> broken/problematic on this card and the Windows driver knows this and
> avoids or adapts to the problem. After all, I don't see any problems
> with the calibration disabled so maybe the Windows driver doesn't use
> the calibration either. But I don't know..
>
> TP-Link has released a v2 version of this TL-WN851N NIC (I'm using v1)
> which suggests the first version may not have been perfect. Maybe v1
> was "weirdly damaged" and they fixed it in the second version. I don't
> know what the differences are between the two versions, but I think
> they used AR5416 in both versions.
>
> Robert
>

>>>
>>
>
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] ath9k: Network stalls every 30 seconds

2011-08-08 Thread Adrian Chadd
Hi all,

I'm just forwarding what Robert said. FreeBSD doesn't have the same
interruptions as ath9k does on the AR5416.

I don't have the time to go digging myself just now.

On 3 August 2011 05:37, Robert Högberg  wrote:
> An update to previous mail..
>
> I tried the i386 version of FreeBSD 9.0 beta (instead of amd64) and
> that one worked much, much better. No network interruptions every 30
> seconds in FreeBSD 9.0 beta 1, but I only ran the test for a few
> minutes. Would you expect the noise floor calibrations to happen every
> 30 seconds in FreeBSD also or is the interval different there?
>
> I'll continue investigating.
>
> (You may want to look into why the ath driver doesn't work on amd64..)
>
> Robert
>
> 2011/8/2 Robert Högberg :
>> I tried FreeBSD and the computer crashed when I tried to enable the WLAN.
>>
>> I'm no FreeBSD user so I'm not sure I got things right, but here's what I 
>> did:
>> * Boot FreeBSD from USB stick (WLAN device was detected correctly and
>> ath0 created)
>> * ifconfig wlan0 create wlandev ath0
>> * ifconfig wlan0 up (This caused the computer to freeze. No output,
>> and no input possible. I waited minutes but nothing happened.)
>>
>> I attach dmesg output after boot.
>>
>> /Robert
>>
>> 2011/8/2 Adrian Chadd :
>>> Ah, that it works well in Windows is a good sign.
>>>
>>> Would you mind doing me a favour? Could you spin up FreeBSD-9.0-BETA1
>>> on a temporary disk (eg a USB thumb drive) and see if it exhibits the
>>> same behaviour?
>>>
>>>
>>> Adrian
>>>
>>> On 2 August 2011 04:19, Robert Högberg  wrote:
 2011/7/30 Adrian Chadd :
> Have you tried another ath9k NIC? Another AR5416 NIC?

 I've tried an AR9271 NIC (USB ID 0cf3:9271) and it works very well. I
 only have one AR5416 NIC to test I'm afraid.


> Is it possible this NIC is slightly weirdly damaged?

 Maybe, but the card works well with the Windows 7 drivers. But I guess
 it's possible that the noise floor calibration functionality is
 broken/problematic on this card and the Windows driver knows this and
 avoids or adapts to the problem. After all, I don't see any problems
 with the calibration disabled so maybe the Windows driver doesn't use
 the calibration either. But I don't know..

 TP-Link has released a v2 version of this TL-WN851N NIC (I'm using v1)
 which suggests the first version may not have been perfect. Maybe v1
 was "weirdly damaged" and they fixed it in the second version. I don't
 know what the differences are between the two versions, but I think
 they used AR5416 in both versions.

 Robert

>>>
>>
>
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] [PATCH] ath: Fix hardware decryption of WEP

2011-08-08 Thread Bill Jordan
The first 4 hardware key indexes are reserved for WEP, but
never programmed. The result was that WEP always used
software decryption.

Signed-off-by: Bill Jordan 
---
 drivers/net/wireless/ath/key.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c
index 17b0efd..73177f1 100644
--- a/drivers/net/wireless/ath/key.c
+++ b/drivers/net/wireless/ath/key.c
@@ -501,7 +501,11 @@ int ath_key_config(struct ath_common *common,
if (key->keylen)
memcpy(hk.kv_val, key->key, key->keylen);
 
-   if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
+   if (hk.kv_type == ATH_CIPHER_WEP) {
+   if (key->keyidx >= IEEE80211_WEP_NKID)
+   return -EOPNOTSUPP;
+   idx = key->keyidx;
+   } else if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
switch (vif->type) {
case NL80211_IFTYPE_AP:
memcpy(gmac, vif->addr, ETH_ALEN);
@@ -577,8 +581,6 @@ EXPORT_SYMBOL(ath_key_config);
 void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key)
 {
ath_hw_keyreset(common, key->hw_key_idx);
-   if (key->hw_key_idx < IEEE80211_WEP_NKID)
-   return;
 
clear_bit(key->hw_key_idx, common->keymap);
if (key->cipher != WLAN_CIPHER_SUITE_TKIP)
-- 
1.7.4.4

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel