ath9k: fix TSF after reset on AR913x
commita1972d6d42c0c1763c0b95093fae805636125b47
authorFelix Fietkau <nbd@openwrt.org>
Wed, 30 Jun 2010 00:07:48 +0000 (30 02:07 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Aug 2010 17:54:10 +0000 (10 10:54 -0700)
treeda9da5a5123d661ff94ad7cb0359bff9c2ea7453
parent8e0e0465a8bb89e31cc5c3b8e68b65639ba84221
ath9k: fix TSF after reset on AR913x

commit f860d526eb2939a1c37128900b5af2b6f3ff7f20 upstream.

When issuing a reset, the TSF value is lost in the hardware because of
the 913x specific cold reset. As with some AR9280 cards, the TSF needs
to be preserved in software here.

Additionally, there's an issue that frequently prevents a successful
TSF write directly after the chip reset. In this case, repeating the
TSF write after the initval-writes usually works.

This patch detects failed TSF writes and recovers from them, taking
into account the delay caused by the initval writes.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Reported-by: Björn Smedman <bjorn.smedman@venatech.se>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/ath/ath9k/hw.c