All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: "Andrés García Saavedra" <andres.garcia.saavedra@gmail.com>
Cc: linux-wireless@vger.kernel.org, ath5k-devel@lists.ath5k.org
Subject: Re: [ath5k-devel] force AR5212 to sleep
Date: Mon, 14 Nov 2011 17:23:24 -0500	[thread overview]
Message-ID: <20111114172324.511d676a@mj> (raw)
In-Reply-To: <CADxqDgFoO63RG67McnxUJSmxZ9ZPPnE7obKkn+MZAsoJ4UMQtg@mail.gmail.com>

On Mon, 14 Nov 2011 11:42:24 +0100
Andrés García Saavedra <andres.garcia.saavedra@gmail.com> wrote:

> Hi all,
> 
> I am testing some custom algorithms for powersaving using
> mac80211/ath5k. I am using  Dlink DWL-AG660 PCMCIA cards for my
> experiments. For these algorithms I am notifying sleep/awake events
> from mac80211 down to the driver whenever I want to. For the case of
> ath5k I followed that code madwifi was using to force the chipset to
> sleep (full sleep mode), find the piece of code below:
> 
> The problem is, the card (and the laptop) totally freezes whenever
> this is done. According to
> http://madwifi-project.org/wiki/Compatibility/D-Link this card uses a
> AR5212, and madwifi driver does use this piece of code to force the
> chip to sleep (in that case when resetting or stopping an interface).
> 
> Undoubtedly, I am missing something I should take care of. I'd
> appreciate any "clue" you could give me.
> 
> 
> /**** CODE *****/
> 
>     struct ath5k_softc *sc = hw->priv;
>     struct ath5k_hw *ah = sc->ah;

You must be using an outdated kernel if you have to do this.

>     unsigned int i;
>     u32 staid, data;
> 
>     staid = ath5k_hw_reg_read(ah, AR5K_STA_ID1);
> 
>     ath5k_hw_reg_write(ah, AR5K_SLEEP_CTL_SLE_ALLOW, AR5K_SLEEP_CTL);
> 
>     staid |= AR5K_STA_ID1_PWR_SV;
> 
>     ath5k_hw_reg_write(ah, staid, AR5K_STA_ID1);

Just try one or two of those statements to see which is causing
trouble.  Obviously, you'll need to print staid first so that you write
the same value as ath5k_hw_reg_read() returned.  It's also important
when you read the registers.  Try adding your code to the code that
already accesses those registers.

-- 
Regards,
Pavel Roskin

  parent reply	other threads:[~2011-11-14 22:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-14 10:42 force AR5212 to sleep Andrés García Saavedra
2011-11-14 16:01 ` Adrian Chadd
2011-11-14 22:23 ` Pavel Roskin [this message]
2011-11-14 23:13   ` [ath5k-devel] " Nick Kossifidis

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=20111114172324.511d676a@mj \
    --to=proski@gnu.org \
    --cc=andres.garcia.saavedra@gmail.com \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=linux-wireless@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.