linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Raja Mani <rmani@qca.qualcomm.com>
Cc: <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 5/7] ath6kl: Invoke wow suspend/resume calls during PM operations
Date: Mon, 31 Oct 2011 15:16:13 +0200	[thread overview]
Message-ID: <4EAE9F9D.2000209@qca.qualcomm.com> (raw)
In-Reply-To: <4EAE7038.7010306@qca.qualcomm.com>

On 10/31/2011 11:54 AM, Raja Mani wrote:
> On Friday 28 October 2011 06:45 PM, Kalle Valo wrote:
>> On 10/25/2011 01:37 PM, rmani@qca.qualcomm.com wrote:
>>> From: Raja Mani<rmani@qca.qualcomm.com>
>>>
>>> --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
>>> +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
>>> @@ -1606,6 +1606,19 @@ static int ar6k_cfg80211_suspend(struct wiphy *wiphy,
>>>   				 struct cfg80211_wowlan *wow)
>>>   {
>>>   	struct ath6kl *ar = wiphy_priv(wiphy);
>>> +	int ret;
>>> +
>>> +	if (wow&&  ath6kl_cfg80211_ready(ar)&&
>>> +	    test_bit(CONNECTED,&ar->flag)&&
>>> +	    ath6kl_hif_keep_pwr_caps(ar)) {
>>> +
>>> +		/* Flush all non control pkts in Tx path */
>>> +		ath6kl_tx_data_cleanup(ar);
>>> +
>>> +		ret = ath6kl_pm_wow_suspend(ar, wow);
>>> +		if (ret)
>>> +			return ret;
>>> +	}
>>
>> This is now confusing. Some of the suspend logic is now in sdio.c and
>> some here. It's better to have everything in one place, that is in
>> sdio.c. We just need to add an interface so that sdio.c can request the
>> correct suspend mode.
> 
> Do you want me to keep ath6kl_pm_wow_suspend() implementation in 
> cfg80211.c file and move only above code to ath6kl_sdio_suspend() ?

I gave this more thought and in my suspend patches earlier today I added
this function:

int ath6kl_cfg80211_suspend(struct ath6kl *ar,
			    enum ath6kl_cfg_suspend_mode mode)
{
	int ret;

	ath6kl_cfg80211_stop(ar);

	switch (mode) {
	case ATH6KL_CFG_SUSPEND_DEEPSLEEP:
		/* save the current power mode before enabling power save */
		ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;

		ret = ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER);
		if (ret) {
			ath6kl_warn("wmi powermode command failed during suspend: %d\n",
				    ret);
		}

		ar->state = ATH6KL_STATE_DEEPSLEEP;

		break;

You can add a new mode for WOW and call your wow functions from that
function. And you need to make changes to ath6kl_sdio_suspend() so that
it will enable WOW in correct cases. Also I added a state variable
ar->state and hopefully we don't need a separate wow state anymore.

Kalle

  reply	other threads:[~2011-10-31 13:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-25 10:37 [PATCH 0/7] ath6kl: Add WOW support rmani
2011-10-25 10:37 ` [PATCH 1/7] ath6kl: Add wmi functions to add/delete wow patterns rmani
2011-10-28 12:11   ` Kalle Valo
2011-10-31  9:52     ` Raja Mani
2011-10-25 10:37 ` [PATCH 2/7] ath6kl: Add wmi functions to configure wow mode and host sleep mode rmani
2011-10-28 12:19   ` Kalle Valo
2011-10-31  9:53     ` Raja Mani
2011-10-31 13:10       ` Kalle Valo
2011-10-25 10:37 ` [PATCH 3/7] ath6kl: Introduce new variable to track wow state machine rmani
2011-10-25 10:37 ` [PATCH 4/7] ath6kl: Add new functions to handle wow suspend/resume operations rmani
2011-10-28 12:31   ` Kalle Valo
2011-10-31  9:53     ` Raja Mani
2011-10-25 10:37 ` [PATCH 5/7] ath6kl: Invoke wow suspend/resume calls during PM operations rmani
2011-10-28 13:15   ` Kalle Valo
2011-10-31  9:54     ` Raja Mani
2011-10-31 13:16       ` Kalle Valo [this message]
2011-10-28 13:21   ` Kalle Valo
2011-10-31  9:54     ` Raja Mani
2011-10-31 13:29       ` Kalle Valo
2011-10-25 10:37 ` [PATCH 6/7] ath6kl: Perform WOW resume in RX path in case of SDIO IRQ wakeup rmani
2011-10-28 13:18   ` Kalle Valo
2011-10-31  9:55     ` Raja Mani
2011-10-31 13:03       ` Kalle Valo
2011-10-25 10:37 ` [PATCH 7/7] ath6kl: Expose ath6kl wow capabilities to cfg layer rmani
2011-10-28 11:58 ` [PATCH 0/7] ath6kl: Add WOW support Kalle Valo
2011-10-31  9:55   ` Raja Mani

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=4EAE9F9D.2000209@qca.qualcomm.com \
    --to=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rmani@qca.qualcomm.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).