From: "Luis R. Rodriguez" <mcgrof@gmail.com>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, Jiri Slaby <jirislaby@gmail.com>,
Nick Kossifidis <mickflemm@gmail.com>
Subject: Re: [PATCH 6/7] ath5k: Clear up settings of AR5K_RSSI_THR register settings
Date: Thu, 1 Nov 2007 17:55:53 -0400 [thread overview]
Message-ID: <20071101215553.GD4182@pogo> (raw)
In-Reply-To: <20071101043933.GG21987@pogo>
** Resending after checkpatch.pl
Clear up settings of AR5K_RSSI_THR register settings. These are split between
AR5K_TUNE_BMISS_THRES and AR5K_TUNE_RSSI_THRES.
Changes to ath5k.h, hw.c
Changes-licensed-under: ISC
Signed-off-by: Luis R. Rodriguez <mcgrof@gmail.com>
---
drivers/net/wireless/ath5k/ath5k.h | 10 +++++++++-
drivers/net/wireless/ath5k/hw.c | 11 ++++-------
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath5k/ath5k.h b/drivers/net/wireless/ath5k/ath5k.h
index 3354b37..c8ab09a 100644
--- a/drivers/net/wireless/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath5k/ath5k.h
@@ -86,8 +86,16 @@
#define AR5K_TUNE_RADAR_ALERT false
#define AR5K_TUNE_MIN_TX_FIFO_THRES 1
#define AR5K_TUNE_MAX_TX_FIFO_THRES ((IEEE80211_MAX_LEN / 64) + 1)
-#define AR5K_TUNE_RSSI_THRES 1792
#define AR5K_TUNE_REGISTER_TIMEOUT 20000
+/* Register for RSSI threshold has a mask of 0xff, so 255 seems to
+ * be the max value. */
+#define AR5K_TUNE_RSSI_THRES 129
+/* This must be set when setting the RSSI threshold otherwise it can
+ * prevent a reset. If AR5K_RSSI_THR is read after writing to it
+ * the BMISS_THRES will be seen as 0, seems harware doesn't keep
+ * track of it. Max value depends on harware. For AR5210 this is just 7.
+ * For AR5211+ this seems to be up to 255. */
+#define AR5K_TUNE_BMISS_THRES 7
#define AR5K_TUNE_REGISTER_DWELL_TIME 20000
#define AR5K_TUNE_BEACON_INTERVAL 100
#define AR5K_TUNE_AIFS 2
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
index 1b9c4f0..f1ba863 100644
--- a/drivers/net/wireless/ath5k/hw.c
+++ b/drivers/net/wireless/ath5k/hw.c
@@ -849,13 +849,10 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
/*PISR/SISR Not available on 5210*/
if (ah->ah_version != AR5K_AR5210) {
ath5k_hw_reg_write(ah, 0xffffffff, AR5K_PISR);
- /* XXX: AR5K_RSSI_THR has masks and shifts defined for it, so
- * direct write using ath5k_hw_reg_write seems wrong. Test with:
- * AR5K_REG_WRITE_BITS(ah, AR5K_RSSI_THR,
- * AR5K_RSSI_THR_BMISS, AR5K_TUNE_RSSI_THRES);
- * with different variables and check results compared
- * to ath5k_hw_reg_write(ah, ) */
- ath5k_hw_reg_write(ah, AR5K_TUNE_RSSI_THRES, AR5K_RSSI_THR);
+ /* If we later allow tuning for this, store into sc structure */
+ data = AR5K_TUNE_RSSI_THRES |
+ AR5K_TUNE_BMISS_THRES << AR5K_RSSI_THR_BMISS_S;
+ ath5k_hw_reg_write(ah, data, AR5K_RSSI_THR);
}
/*
--
1.5.2.5
next prev parent reply other threads:[~2007-11-01 21:56 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-01 4:35 [PATCH 2/7] ath5k: Remove opaque pointers from ath5k_hw_attach() Luis R. Rodriguez
2007-11-01 4:37 ` [PATCH 3/7] ath5k: Clean up ath5k rate duration settings Luis R. Rodriguez
2007-11-01 4:38 ` [PATCH 4/7] ath5k: Fix clock on OFDM timing computation Luis R. Rodriguez
2007-11-01 4:38 ` [PATCH 5/7] ath5k: Move OFDM timings into a helper routine Luis R. Rodriguez
2007-11-01 4:39 ` [PATCH 6/7] ath5k: Clear up settings of AR5K_RSSI_THR register settings Luis R. Rodriguez
2007-11-01 4:40 ` [PATCH 7/7] ath5k: Add documentation for struct ath5k_rate Luis R. Rodriguez
2007-11-01 13:16 ` Nick Kossifidis
2007-11-01 16:47 ` Luis R. Rodriguez
2007-11-01 21:56 ` Luis R. Rodriguez
2007-11-01 22:06 ` Randy Dunlap
2007-11-02 3:11 ` Luis R. Rodriguez
2007-11-01 13:27 ` [PATCH 6/7] ath5k: Clear up settings of AR5K_RSSI_THR register settings Nick Kossifidis
2007-11-01 21:55 ` Luis R. Rodriguez [this message]
2007-11-01 21:53 ` [PATCH 5/7] ath5k: Move OFDM timings into a helper routine Luis R. Rodriguez
2007-11-01 21:57 ` Jiri Slaby
2007-11-01 22:01 ` Luis R. Rodriguez
2007-11-01 22:02 ` Jiri Slaby
2007-11-01 22:21 ` Jiri Slaby
2007-11-01 22:27 ` Nick Kossifidis
2007-11-01 21:50 ` [PATCH 3/7] ath5k: Clean up ath5k rate duration settings Luis R. Rodriguez
2007-11-01 13:06 ` [PATCH 2/7] ath5k: Remove opaque pointers from ath5k_hw_attach() Nick Kossifidis
2007-11-01 17:27 ` Christoph Hellwig
2007-11-01 18:44 ` 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=20071101215553.GD4182@pogo \
--to=mcgrof@gmail.com \
--cc=jirislaby@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mickflemm@gmail.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).