linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bob Copeland <me@bobcopeland.com>
To: Nick Kossifidis <mickflemm@gmail.com>
Cc: ath5k-devel@lists.ath5k.org, linux-wireless@vger.kernel.org,
	linville@tuxdriver.com, bruno@thinktube.com, jirislaby@gmail.com,
	mcgrof@gmail.com
Subject: Re: [ath5k-devel] [PATCH 6/8] ath5k: Fixes for PCI-E cards
Date: Sun, 24 Feb 2008 12:59:33 -0500	[thread overview]
Message-ID: <20080224175933.GA4360@hash.localnet> (raw)
In-Reply-To: <40f31dec0802232045v2902d76dg8ee1c4a4685862fe@mail.gmail.com>

On Sun, Feb 24, 2008 at 06:45:33AM +0200, Nick Kossifidis wrote:
> >  +       /* Identify PCI-E cards */
> >  +       if((srev >= AR5K_SREV_VER_AR2424 && srev <= AR5K_SREV_VER_AR5424) ||
> >  +       srev >= AR5K_SREV_VER_AR5416) {
> >  +               ah->ah_pcie = true;
> >  +       } else {
> >  +               ah->ah_pcie = false;
> >  +       }

This won't work, because reset is called before we ever set ah_pcie.
Moving the set before the first call to wakeup (patch below) does the
trick.  Then it works at least as well as I had it working (still with
random calibration failures, but I am again sending this mail using the
driver).

Thanks!

>From f59b2bc93059e7f1bd504714ca22654f4242d78d Mon Sep 17 00:00:00 2001
From: Bob Copeland <me@bobcopeland.com>
Date: Sun, 24 Feb 2008 10:30:50 -0500
Subject: [PATCH] Grab srev before resetting card.

Setting ah_pcie variable must be done before the first call to
ath5k_hw_nic_wakeup.
---
 drivers/net/wireless/ath5k/hw.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
index adcce6f..71cdbd9 100644
--- a/drivers/net/wireless/ath5k/hw.c
+++ b/drivers/net/wireless/ath5k/hw.c
@@ -178,13 +178,21 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
 	else if (ah->ah_version <= AR5K_AR5211)
 		ah->ah_proc_rx_desc = ath5k_hw_proc_old_rx_status;
 
+	/* Get MAC, PHY and RADIO revisions */
+	srev = ath5k_hw_reg_read(ah, AR5K_SREV);
+	/* Identify PCI-E cards */
+	if((srev >= AR5K_SREV_VER_AR2424 && srev <= AR5K_SREV_VER_AR5424) ||
+	srev >= AR5K_SREV_VER_AR5416) {
+		ah->ah_pcie = true;
+	} else {
+		ah->ah_pcie = false;
+	}
+
 	/* Bring device out of sleep and reset it's units */
 	ret = ath5k_hw_nic_wakeup(ah, AR5K_INIT_MODE, true);
 	if (ret)
 		goto err_free;
 
-	/* Get MAC, PHY and RADIO revisions */
-	srev = ath5k_hw_reg_read(ah, AR5K_SREV);
 	ah->ah_mac_srev = srev;
 	ah->ah_mac_version = AR5K_REG_MS(srev, AR5K_SREV_VER);
 	ah->ah_mac_revision = AR5K_REG_MS(srev, AR5K_SREV_REV);
@@ -214,14 +222,6 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
 		ah->ah_single_chip = false;
 	}
 
-	/* Identify PCI-E cards */
-	if((srev >= AR5K_SREV_VER_AR2424 && srev <= AR5K_SREV_VER_AR5424) ||
-	srev >= AR5K_SREV_VER_AR5416) {
-		ah->ah_pcie = true;
-	} else {
-		ah->ah_pcie = false;
-	}
-
 	/* Single chip radio */
 	if (ah->ah_radio_2ghz_revision == ah->ah_radio_5ghz_revision)
 		ah->ah_radio_2ghz_revision = 0;
-- 
1.5.4.2.182.gb3092

-- 
Bob Copeland %% www.bobcopeland.com 


  parent reply	other threads:[~2008-02-24 17:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-24  4:28 [PATCH 6/8] ath5k: Fixes for PCI-E cards Nick Kossifidis
2008-02-24  4:45 ` [ath5k-devel] " Nick Kossifidis
2008-02-24  4:47   ` Nick Kossifidis
2008-02-24 16:09   ` Bob Copeland
2008-02-24 17:59   ` Bob Copeland [this message]
2008-02-24 18:58     ` Nick Kossifidis
2008-02-24 20:21       ` Bob Copeland
2008-02-24 23:23         ` Nick Kossifidis
2008-02-27  3:23       ` Luis R. Rodriguez
2008-02-27  5:54         ` Nick Kossifidis
2008-02-27 13:30           ` Luis R. Rodriguez
2008-02-27 15:52             ` John W. Linville
2008-02-27 18:44               ` Nick Kossifidis
2008-02-28 22:20                 ` Luis R. Rodriguez
2008-02-24 23:48     ` Nick Kossifidis
2008-02-25  2:23       ` Bob Copeland
2008-02-25 14:20         ` Nick Kossifidis
2008-02-24 20:17   ` Christoph Hellwig
2008-02-24 23:27     ` Nick Kossifidis
2008-02-24 20:16 ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2008-02-25 15:43 [ath5k-devel] " Bob Copeland
2008-02-26  2:13 ` bruno randolf
2008-02-26  3:51   ` Bob Copeland
2008-02-26  3:57   ` Nick Kossifidis
2008-02-26  4:39     ` 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=20080224175933.GA4360@hash.localnet \
    --to=me@bobcopeland.com \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=bruno@thinktube.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@gmail.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).