LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/1] WDEV: ath5k, test single chip before reset
@ 2008-02-15 20:37 Jiri Slaby
  2008-02-15 21:53 ` Nick Kossifidis
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Slaby @ 2008-02-15 20:37 UTC (permalink / raw)
  To: linville
  Cc: linux-kernel, linux-wireless, ath5k-devel, Jiri Slaby,
	Nick Kossifidis, Luis R. Rodriguez

Move ath5k_hw_nic_wakeup after ah_single_chip being set, because we
test the value in there and decides whether reset or not.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Nick Kossifidis <mickflemm@gmail.com>
Cc: Luis R. Rodriguez <mcgrof@gmail.com>
---
 drivers/net/wireless/ath5k/hw.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
index 3a4bf40..9cdd27f 100644
--- a/drivers/net/wireless/ath5k/hw.c
+++ b/drivers/net/wireless/ath5k/hw.c
@@ -181,11 +181,6 @@ 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;
 
-	/* 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;
@@ -210,12 +205,13 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
 	}
 
 	/* Identify single chip solutions */
-	if((srev <= AR5K_SREV_VER_AR5414) &&
-	(srev >= AR5K_SREV_VER_AR2424)) {
-		ah->ah_single_chip = true;
-	} else {
-		ah->ah_single_chip = false;
-	}
+	ah->ah_single_chip = srev >= AR5K_SREV_VER_AR2424 &&
+			srev <= AR5K_SREV_VER_AR5414;
+
+	/* 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;
 
 	/* Single chip radio */
 	if (ah->ah_radio_2ghz_revision == ah->ah_radio_5ghz_revision)
-- 
1.5.3.8


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] WDEV: ath5k, test single chip before reset
  2008-02-15 20:37 [PATCH 1/1] WDEV: ath5k, test single chip before reset Jiri Slaby
@ 2008-02-15 21:53 ` Nick Kossifidis
  2008-02-15 22:40   ` Jiri Slaby
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Kossifidis @ 2008-02-15 21:53 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: linville, linux-kernel, linux-wireless, ath5k-devel, Luis R. Rodriguez

2008/2/15, Jiri Slaby <jirislaby@gmail.com>:
> Move ath5k_hw_nic_wakeup after ah_single_chip being set, because we
>  test the value in there and decides whether reset or not.
>
>  Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
>  Cc: Nick Kossifidis <mickflemm@gmail.com>
>  Cc: Luis R. Rodriguez <mcgrof@gmail.com>
>  ---
>   drivers/net/wireless/ath5k/hw.c |   21 ++++++++++-----------
>   1 files changed, 10 insertions(+), 11 deletions(-)
>
>  diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
>  index 3a4bf40..9cdd27f 100644
>  --- a/drivers/net/wireless/ath5k/hw.c
>  +++ b/drivers/net/wireless/ath5k/hw.c
>  @@ -181,11 +181,6 @@ 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;
>
>  -       /* 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;
>  @@ -210,12 +205,13 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
>         }
>
>         /* Identify single chip solutions */
>  -       if((srev <= AR5K_SREV_VER_AR5414) &&
>  -       (srev >= AR5K_SREV_VER_AR2424)) {
>  -               ah->ah_single_chip = true;
>  -       } else {
>  -               ah->ah_single_chip = false;
>  -       }
>  +       ah->ah_single_chip = srev >= AR5K_SREV_VER_AR2424 &&
>  +                       srev <= AR5K_SREV_VER_AR5414;
>  +
>  +       /* 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;
>
>         /* Single chip radio */
>         if (ah->ah_radio_2ghz_revision == ah->ah_radio_5ghz_revision)
>

NACK, single chip flag is going out since only needed check is for
5424/2424 during nic_wakeup, 5413/2413 behave like the rest
5211/5212-combatible cards.

Sorry for delaying the relevant patches, i'm working with the 2413
card i got from Mike to make it work and it'll take some time (not as
easy as i thought, i probably miss something)...


-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] WDEV: ath5k, test single chip before reset
  2008-02-15 21:53 ` Nick Kossifidis
@ 2008-02-15 22:40   ` Jiri Slaby
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2008-02-15 22:40 UTC (permalink / raw)
  To: Nick Kossifidis
  Cc: linville, linux-kernel, linux-wireless, ath5k-devel, Luis R. Rodriguez

On 02/15/2008 10:53 PM, Nick Kossifidis wrote:
> 2008/2/15, Jiri Slaby <jirislaby@gmail.com>:
>> Move ath5k_hw_nic_wakeup after ah_single_chip being set, because we
>>  test the value in there and decides whether reset or not.
>>
>>  Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
>>  Cc: Nick Kossifidis <mickflemm@gmail.com>
>>  Cc: Luis R. Rodriguez <mcgrof@gmail.com>
>>  ---
>>   drivers/net/wireless/ath5k/hw.c |   21 ++++++++++-----------
>>   1 files changed, 10 insertions(+), 11 deletions(-)
>>
>>  diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
>>  index 3a4bf40..9cdd27f 100644
>>  --- a/drivers/net/wireless/ath5k/hw.c
>>  +++ b/drivers/net/wireless/ath5k/hw.c
[...]
>>  @@ -210,12 +205,13 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
>>         }
>>
>>         /* Identify single chip solutions */
>>  -       if((srev <= AR5K_SREV_VER_AR5414) &&
>>  -       (srev >= AR5K_SREV_VER_AR2424)) {
>>  -               ah->ah_single_chip = true;
>>  -       } else {
>>  -               ah->ah_single_chip = false;
>>  -       }
>>  +       ah->ah_single_chip = srev >= AR5K_SREV_VER_AR2424 &&
>>  +                       srev <= AR5K_SREV_VER_AR5414;
>>  +
>>  +       /* 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;
>>
>>         /* Single chip radio */
>>         if (ah->ah_radio_2ghz_revision == ah->ah_radio_5ghz_revision)
>>
> 
> NACK, single chip flag is going out since only needed check is for
> 5424/2424 during nic_wakeup, 5413/2413 behave like the rest
> 5211/5212-combatible cards.

Ok, thanks.

> Sorry for delaying the relevant patches, i'm working with the 2413
> card i got from Mike to make it work and it'll take some time (not as
> easy as i thought, i probably miss something)...

No problem, if I could do anything for you in this area, don't hesitate to drop 
a message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-15 22:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-15 20:37 [PATCH 1/1] WDEV: ath5k, test single chip before reset Jiri Slaby
2008-02-15 21:53 ` Nick Kossifidis
2008-02-15 22:40   ` Jiri Slaby

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).