From: "Lukáš Turek" <8an@praha12.net>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
Johannes Berg <johannes@sipsolutions.net>,
ath5k-devel@lists.ath5k.org
Subject: [PATCH 3/4] ath5k: Fix functions for getting/setting slot time
Date: Sun, 6 Dec 2009 18:24:58 +0100 [thread overview]
Message-ID: <200912061824.58557.8an@praha12.net> (raw)
In-Reply-To: <200912061820.26320.8an@praha12.net>
Functions ath5k_hw_get_slot_time and ath5k_hw_set_slot_time were
converting microseconds to clocks only for AR5210, although it's needed
for all supported devices. The conversion was moved outside the
hardware-specific branches.
These functions are not called from anywhere yet, but they are needed
for an implementation of mac80211 callback set_coverage.
Signed-off-by: Lukas Turek <8an@praha12.net>
---
drivers/net/wireless/ath/ath5k/qcu.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/qcu.c
b/drivers/net/wireless/ath/ath5k/qcu.c
index eeebb9a..248878a 100644
--- a/drivers/net/wireless/ath/ath5k/qcu.c
+++ b/drivers/net/wireless/ath/ath5k/qcu.c
@@ -520,12 +520,16 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah,
unsigned int queue)
*/
unsigned int ath5k_hw_get_slot_time(struct ath5k_hw *ah)
{
+ unsigned int slot_time_clock;
+
ATH5K_TRACE(ah->ah_sc);
+
if (ah->ah_version == AR5K_AR5210)
- return ath5k_hw_clocktoh(ath5k_hw_reg_read(ah,
- AR5K_SLOT_TIME) & 0xffff, ah->ah_turbo);
+ slot_time_clock = ath5k_hw_reg_read(ah, AR5K_SLOT_TIME);
else
- return ath5k_hw_reg_read(ah, AR5K_DCU_GBL_IFS_SLOT) & 0xffff;
+ slot_time_clock = ath5k_hw_reg_read(ah, AR5K_DCU_GBL_IFS_SLOT);
+
+ return ath5k_hw_clocktoh(slot_time_clock & 0xffff, ah->ah_turbo);
}
/*
@@ -533,15 +537,18 @@ unsigned int ath5k_hw_get_slot_time(struct ath5k_hw *ah)
*/
int ath5k_hw_set_slot_time(struct ath5k_hw *ah, unsigned int slot_time)
{
+ u32 slot_time_clock = ath5k_hw_htoclock(slot_time, ah->ah_turbo);
+
ATH5K_TRACE(ah->ah_sc);
- if (slot_time < AR5K_SLOT_TIME_9 || slot_time > AR5K_SLOT_TIME_MAX)
+
+ if (slot_time_clock < AR5K_SLOT_TIME_9 ||
+ slot_time_clock > AR5K_SLOT_TIME_MAX)
return -EINVAL;
if (ah->ah_version == AR5K_AR5210)
- ath5k_hw_reg_write(ah, ath5k_hw_htoclock(slot_time,
- ah->ah_turbo), AR5K_SLOT_TIME);
+ ath5k_hw_reg_write(ah, slot_time_clock, AR5K_SLOT_TIME);
else
- ath5k_hw_reg_write(ah, slot_time, AR5K_DCU_GBL_IFS_SLOT);
+ ath5k_hw_reg_write(ah, slot_time_clock, AR5K_DCU_GBL_IFS_SLOT);
return 0;
}
--
1.6.4.4
next prev parent reply other threads:[~2009-12-06 17:24 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-06 17:20 [PATCH 0/4] Setting coverage class (and ACK timeout and slot time) Lukáš Turek
2009-12-06 17:22 ` [PATCH 1/4] nl80211: Add new WIPHY attribute COVERAGE_CLASS Lukáš Turek
2009-12-06 18:01 ` Johannes Berg
2009-12-06 18:45 ` Lukáš Turek
2009-12-06 18:49 ` Johannes Berg
2009-12-06 19:28 ` Lukáš Turek
2009-12-06 19:32 ` Lukáš Turek
2009-12-06 21:59 ` Lukáš Turek
2009-12-07 6:57 ` Johannes Berg
2009-12-06 17:23 ` [PATCH 2/4] mac80211: Add new callback set_coverage Lukáš Turek
2009-12-07 10:59 ` Kalle Valo
2009-12-07 11:04 ` Johannes Berg
2009-12-06 17:24 ` Lukáš Turek [this message]
2009-12-06 17:26 ` [PATCH 4/4] ath5k: Implement mac80211 " Lukáš Turek
2009-12-06 18:34 ` Felix Fietkau
2009-12-06 19:00 ` Lukáš Turek
2009-12-06 19:20 ` Felix Fietkau
2009-12-06 20:23 ` Lukáš Turek
2009-12-07 9:48 ` Felix Fietkau
2009-12-09 1:15 ` Lukáš Turek
2009-12-09 1:48 ` Felix Fietkau
2009-12-09 13:12 ` Lukáš Turek
2009-12-09 13:30 ` Felix Fietkau
2009-12-09 23:51 ` Lukáš Turek
2009-12-06 17:29 ` [PATCH] iw: Add support for NL80211_ATTR_WIPHY_COVERAGE_CLASS Lukáš Turek
2009-12-06 21:49 ` Luis R. Rodriguez
2009-12-06 21:52 ` Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200912061824.58557.8an@praha12.net \
--to=8an@praha12.net \
--cc=ath5k-devel@lists.ath5k.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).