From: Bob Copeland <me@bobcopeland.com>
To: Nick Kossifidis <mickflemm@gmail.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: ath5k: reset for 5424-based card
Date: Mon, 11 Feb 2008 10:00:12 -0500 [thread overview]
Message-ID: <20080211150012.GA15956@hash.localnet> (raw)
In-Reply-To: <40f31dec0802101105o61442683ia6b56c264a9af556@mail.gmail.com>
On Sun, Feb 10, 2008 at 09:05:38PM +0200, Nick Kossifidis wrote:
> 2008/2/10, Bob Copeland <me@bobcopeland.com>:
> > I'll post a patch later tonight.
Well I spoke too soon :) I was unable to repeatedly get this to work
so I guess maybe I was lucky the times it did. Here's what I have so
far.
- in my traces the hal always set DMA == 128B. So I did not bump it up,
and that seemed to cure rx overrun. Obviously should be done on a
per-card basis.
- turned off reset of PCI to avoid host interface unit hang as discussed
previously
- noticed this card has a different sleep pending value, not sure what
the rf5413 uses compared to this
- added various registers that I have no idea what they do.
> Did you forced b mode via iwpriv while tracing (even if ap is b-only
> card will use g settings) ? You should at least see different IFS etc
> settings (check out initvals).
Not sure, I'll try them again. Are the other traces for other cards
online somewhere?
> Good work ;-)
Heh I really don't know a phy from a sta so feel free to pick this
apart...
>From 53d584dd188a131632e09353d1dd674f02a15b3c Mon Sep 17 00:00:00 2001
From: Bob Copeland <me@bobcopeland.com>
Date: Sat, 9 Feb 2008 00:16:12 -0500
Subject: [PATCH] ath5k: changes for 5424/2424 cards
This adds some register writes and updates some values used by
the Atheros 5424 chipset. This is just an experimental patch that
should not be applied.
---
drivers/net/wireless/ath5k/hw.c | 29 ++++++++++++++++++++++-------
1 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
index 3a4bf40..ba832b0 100644
--- a/drivers/net/wireless/ath5k/hw.c
+++ b/drivers/net/wireless/ath5k/hw.c
@@ -358,8 +358,8 @@ static int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial)
}
/* ...reset chipset and PCI device */
- if (ah->ah_single_chip == false && ath5k_hw_nic_reset(ah,
- AR5K_RESET_CTL_CHIP | AR5K_RESET_CTL_PCI)) {
+ if (ah->ah_single_chip == false && ath5k_hw_nic_reset(ah,
+ AR5K_RESET_CTL_CHIP)) {
ATH5K_ERR(ah->ah_sc, "failed to reset the MAC Chip + PCI\n");
return -EIO;
}
@@ -887,9 +887,9 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
*/
if (ah->ah_version != AR5K_AR5210) {
AR5K_REG_WRITE_BITS(ah, AR5K_TXCFG, AR5K_TXCFG_SDMAMR,
- AR5K_DMASIZE_512B | AR5K_TXCFG_DMASIZE);
+ AR5K_DMASIZE_128B | AR5K_TXCFG_DMASIZE);
AR5K_REG_WRITE_BITS(ah, AR5K_RXCFG, AR5K_RXCFG_SDMAMW,
- AR5K_DMASIZE_512B);
+ AR5K_DMASIZE_128B);
}
/*
@@ -981,14 +981,22 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
* Set the 32MHz reference clock on 5212 phy clock sleep register
*/
if (ah->ah_version == AR5K_AR5212) {
+ int spending;
+
ath5k_hw_reg_write(ah, AR5K_PHY_SCR_32MHZ, AR5K_PHY_SCR);
ath5k_hw_reg_write(ah, AR5K_PHY_SLMT_32MHZ, AR5K_PHY_SLMT);
ath5k_hw_reg_write(ah, AR5K_PHY_SCAL_32MHZ, AR5K_PHY_SCAL);
ath5k_hw_reg_write(ah, AR5K_PHY_SCLOCK_32MHZ, AR5K_PHY_SCLOCK);
ath5k_hw_reg_write(ah, AR5K_PHY_SDELAY_32MHZ, AR5K_PHY_SDELAY);
- ath5k_hw_reg_write(ah, ah->ah_radio == AR5K_RF5111 ?
- AR5K_PHY_SPENDING_RF5111 : AR5K_PHY_SPENDING_RF5112,
- AR5K_PHY_SPENDING);
+
+ if (ah->ah_radio <= AR5K_RF5111)
+ spending = AR5K_PHY_SPENDING_RF5111;
+ else if (ah->ah_radio <= AR5K_RF5112)
+ spending = AR5K_PHY_SPENDING_RF5112;
+ else
+ spending = 0x12;
+
+ ath5k_hw_reg_write(ah, spending, AR5K_PHY_SPENDING);
}
/*
@@ -997,6 +1005,13 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
AR5K_REG_DISABLE_BITS(ah, AR5K_BEACON, AR5K_BEACON_ENABLE |
AR5K_BEACON_RESET_TSF);
+ if (ah->ah_mac_srev >= AR5K_SREV_VER_AR2424) {
+ ath5k_hw_reg_write(ah, 0x000100aa, 0x8118);
+ ath5k_hw_reg_write(ah, 0x00003210, 0x811c);
+ ath5k_hw_reg_write(ah, 0x00000052, 0x8108);
+ ath5k_hw_reg_write(ah, 0x001e1e1e, AR5K_TXPC);
+ ath5k_hw_reg_write(ah, 0x00000004, 0x8120);
+ }
return 0;
}
--
1.5.4
--
Bob Copeland %% www.bobcopeland.com
next prev parent reply other threads:[~2008-02-11 15:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-31 15:59 ath5k: reset for 5424-based card Bob Copeland
2008-01-31 16:56 ` Nick Kossifidis
2008-02-01 4:03 ` Bob Copeland
2008-02-01 12:09 ` Nick Kossifidis
2008-02-01 22:53 ` Bob Copeland
2008-02-02 1:48 ` Nick Kossifidis
2008-02-03 1:45 ` Bob Copeland
2008-02-05 9:13 ` Nick Kossifidis
2008-02-10 16:21 ` Bob Copeland
2008-02-10 19:05 ` Nick Kossifidis
2008-02-11 15:00 ` Bob Copeland [this message]
2008-02-12 7:18 ` Nick Kossifidis
2008-02-12 7:48 ` Holger Schurig
2008-02-12 7:55 ` Nick Kossifidis
2008-02-14 4:20 ` Bob Copeland
2008-02-18 23:59 ` Bob Copeland
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=20080211150012.GA15956@hash.localnet \
--to=me@bobcopeland.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).