Skip to contentSkip to conversation

ath5k: Set TSF fix

PATCH In review Alina Friedrichsen 4 participants 6 messages Jan 24, 2009 – Jan 27, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath5k: Set TSF fix

It seems that some Atheros hardware more like this code for setting the=
TSF.

---
diff -urN wireless-testing.orig/drivers/net/wireless/ath5k/pcu.c wirele= ss-testing/drivers/net/wireless/ath5k/pcu.c
--- wireless-testing.orig/drivers/net/wireless/ath5k/pcu.c 2009-01-23 2=
2:54:07.000000000 +0100
+++ wireless-testing/drivers/net/wireless/ath5k/pcu.c 2009-01-24 08:47:=
16.000000000 +0100
@@ -657,9 +657,8 @@
{
ATH5K_TRACE(ah->ah_sc);
=20
- ath5k_hw_reg_write(ah, 0x00000000, AR5K_TSF_L32);
- ath5k_hw_reg_write(ah, (tsf64 >> 32) & 0xffffffff, AR5K_TSF_U32);
ath5k_hw_reg_write(ah, tsf64 & 0xffffffff, AR5K_TSF_L32);
+ ath5k_hw_reg_write(ah, (tsf64 >> 32) & 0xffffffff, AR5K_TSF_U32);
}
=20
/**

--=20
NUR NOCH BIS 31.01.! GMX FreeDSL - Telefonanschluss + DSL=20 f=FCr nur 16,37 EURO/mtl.!* http://dsl.gmx.de/?ac=3DOM.AD.PD003K11308T4=
569a
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw

Review

Quoted 8 lines · Alina Friedrichsen
 {
       ATH5K_TRACE(ah->ah_sc);
(quoted diff) +1 -2
-       ath5k_hw_reg_write(ah, 0x00000000, AR5K_TSF_L32);
-       ath5k_hw_reg_write(ah, (tsf64 >> 32) & 0xffffffff, AR5K_TSF_U32);
       ath5k_hw_reg_write(ah, tsf64 & 0xffffffff, AR5K_TSF_L32);
+       ath5k_hw_reg_write(ah, (tsf64 >> 32) & 0xffffffff, AR5K_TSF_U32);
 }

Perhaps there is an internal latch on this pair; that may explain why you need to write low->high order.

However, you don't need to write (tsf64 >> 32) & 0xffffffff; it's unsigned so the mask is unnecessary.

Signature · 1 line
Bob Copeland %% www.bobcopeland.com
#2 lore raw
Quoted 4 lines · Bob Copeland
Quoted 3 lines · Alina Friedrichsen
 {
       ATH5K_TRACE(ah->ah_sc);
Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +1 -2
-       ath5k_hw_reg_write(ah, 0x00000000, AR5K_TSF_L32);
-       ath5k_hw_reg_write(ah, (tsf64 >> 32) & 0xffffffff, AR5K_TSF_U32);
       ath5k_hw_reg_write(ah, tsf64 & 0xffffffff, AR5K_TSF_L32);
+       ath5k_hw_reg_write(ah, (tsf64 >> 32) & 0xffffffff, AR5K_TSF_U32);
 }

Perhaps there is an internal latch on this pair; that may explain why you need to write low->high order.

Either way, I think the changelog should back up the claim by _something_. Even if it's just "tested on device XXX, old way doesn't work, new way does" or "looked at legacy HAL code" or ...

johannes

#3 lore raw
Quoted 6 lines · Johannes Berg
Quoted 2 lines

Perhaps there is an internal latch on this pair; that may explain why you need to write low->high order.

Either way, I think the changelog should back up the claim by _something_. Even if it's just "tested on device XXX, old way doesn't work, new way does" or "looked at legacy HAL code" or ...

Agreed, "tested on..." would be good. I looked at the HAL and it doesn't have a set tsf function, only reset.

Signature · 1 line
Bob Copeland %% www.bobcopeland.com
#4 lore raw

Hello!

Quoted 2 lines
Quoted 2 lines

Either way, I think the changelog should back up the claim by _something_. Even if it's just "tested on device XXX, old way doesn=

't

Quoted 4 lines
Quoted 1 line

work, new way does" or "looked at legacy HAL code" or ...

=20
Agreed, "tested on..." would be good. I looked at the HAL and it doesn't have a set tsf function, only reset.

The old code does not work on:
AR5418+AR2122 (ath9k)
AR5416+AR2133 (ath9k)

The new code is tested on:
AR5418+AR2122 (ath9k)
AR5416+AR2133 (ath9k)
AR5001X+ (ath5k)
AR5007EG (ath5k)

The old code was taken from:
https://dev.openwrt.org/browser/trunk/package/madwifi/patches/383-ibss_=
hostap.patch
(by Sven-Ola Tuecke)

Regards
Alina

--=20
NUR NOCH BIS 31.01.! GMX FreeDSL - Telefonanschluss + DSL=20 f=FCr nur 16,37 EURO/mtl.!* http://dsl.gmx.de/?ac=3DOM.AD.PD003K11308T4=
569a
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 19 lines · Alina Friedrichsen

Hello!

Quoted 6 lines
Quoted 3 lines

Either way, I think the changelog should back up the claim by _something_. Even if it's just "tested on device XXX, old way doesn't work, new way does" or "looked at legacy HAL code" or ...

Agreed, "tested on..." would be good. I looked at the HAL and it doesn't have a set tsf function, only reset.

The old code does not work on:
AR5418+AR2122 (ath9k)
AR5416+AR2133 (ath9k)

The new code is tested on:
AR5418+AR2122 (ath9k)
AR5416+AR2133 (ath9k)
AR5001X+ (ath5k)
AR5007EG (ath5k)

Quoted 3 lines

The old code was taken from:
https://dev.openwrt.org/browser/trunk/package/madwifi/patches/383-ibss_hostap.patch
(by Sven-Ola Tuecke)

Could you resubmit this patch with some/all of the above information incorporated into the changelog? I'm dropping the current version (with limited changelog) just to avoid my own confusion.

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.