Linux wireless drivers development
 help / color / mirror / Atom feed
From: Luciano Coelho <coelho@ti.com>
To: Eliad Peller <eliad@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 08/29] wl12xx: configure sleep_policy according to active roles
Date: Mon, 10 Oct 2011 21:51:52 +0300	[thread overview]
Message-ID: <1318272712.9690.384.camel@cumari> (raw)
In-Reply-To: <1318234397-21081-9-git-send-email-eliad@wizery.com>

On Mon, 2011-10-10 at 10:12 +0200, Eliad Peller wrote: 
> If there is an active AP role, stay always on.
> Otherwise, allow chip to enter elp.
> 
> (Note that this is a global configuration, so if the
> device is already configured according to our policy,
> we don't have to configure it again)
> 
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> ---

[...]

> @@ -573,13 +563,38 @@ static int wl12xx_init_ap_role(struct wl1271 *wl, struct wl12xx_vif *wlvif)
>  
>  int wl1271_init_vif_specific(struct wl1271 *wl, struct ieee80211_vif *vif)
>  {
> -	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
> +	struct wl12xx_vif *iter, *wlvif = wl12xx_vif_to_data(vif);
>  	struct conf_tx_ac_category *conf_ac;
>  	struct conf_tx_tid *conf_tid;
>  	bool is_ap = (wlvif->bss_type == BSS_TYPE_AP_BSS);
> -
> +	u8 sta_roles_cnt = 0, ap_roles_cnt = 0;
>  	int ret, i;
>  
> +	wl12xx_for_each_wlvif(wl, iter) {
> +		if (iter->bss_type == BSS_TYPE_AP_BSS)
> +			ap_roles_cnt++;
> +		else
> +			sta_roles_cnt++;
> +	}
> +
> +	/*
> +	 * consider all existing roles before configuring psm.
> +	 * TODO: reconfigure on interface removal.
> +	 */
> +	if (!ap_roles_cnt) {
> +		if (is_ap) {
> +			/* Configure for power always on */
> +			ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_CAM);
> +			if (ret < 0)
> +				return ret;
> +		} else if (!sta_roles_cnt) {
> +			/* Configure for ELP power saving */
> +			ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_ELP);
> +			if (ret < 0)
> +				return ret;
> +		}
> +	}
> +

Wouldn't it be much simpler to have a "have_ap" element in the wl
struct?


-- 
Cheers,
Luca.


  reply	other threads:[~2011-10-10 18:51 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10  8:12 [PATCH 00/29] make the driver ready for multi-vif support Eliad Peller
2011-10-10  8:12 ` [PATCH 01/29] wl12xx: refactor fw init into a new function Eliad Peller
2011-10-10  8:12 ` [PATCH 02/29] wl12xx: move last_tx_hlid into wlvif Eliad Peller
2011-10-10 17:52   ` Luciano Coelho
2011-10-10 19:16     ` Eliad Peller
2011-10-10  8:12 ` [PATCH 03/29] wl12xx: unify STA and AP tx_queue mechanism Eliad Peller
2011-10-10  8:12 ` [PATCH 04/29] wl12xx: move some functions from remove_interface() to stop() Eliad Peller
2011-10-10  8:12 ` [PATCH 05/29] wl12xx: move bitrate_masks into wlvif Eliad Peller
2011-10-10 18:20   ` Luciano Coelho
2011-10-10 19:21     ` Eliad Peller
2011-10-10 19:25       ` Luciano Coelho
2011-10-10  8:12 ` [PATCH 06/29] wl12xx: add vifs list Eliad Peller
2011-10-10 18:28   ` Luciano Coelho
2011-10-10 19:29     ` Eliad Peller
2011-10-10 19:40       ` Luciano Coelho
2011-10-10 20:04   ` Johannes Berg
2011-10-10 20:07     ` Eliad Peller
2011-10-10  8:12 ` [PATCH 07/29] wl12xx: support multiple vifs in the tx path Eliad Peller
2011-10-10  8:12 ` [PATCH 08/29] wl12xx: configure sleep_policy according to active roles Eliad Peller
2011-10-10 18:51   ` Luciano Coelho [this message]
2011-10-10 19:32     ` Eliad Peller
2011-10-10 19:54       ` Luciano Coelho
2011-10-10  8:12 ` [PATCH 09/29] wl12xx: make event handling support multirole Eliad Peller
2011-10-10 18:58   ` Luciano Coelho
2011-10-10 19:36     ` Eliad Peller
2011-10-10 19:47       ` Luciano Coelho
2011-10-10  8:12 ` [PATCH 10/29] wl12xx: move tx_security_seq into wlvif Eliad Peller
2011-10-10 19:25   ` Luciano Coelho
2011-10-10  8:12 ` [PATCH 11/29] wl12xx: rearm rx streaming per vif Eliad Peller
2011-10-10  8:13 ` [PATCH 12/29] wl12xx: make WL1271_FLAG_STA_ASSOCIATED flag per-vif Eliad Peller
2011-10-10  8:13 ` [PATCH 13/29] wl12xx: make WL1271_FLAG_IBSS_JOINED " Eliad Peller
2011-10-10  8:13 ` [PATCH 14/29] wl12xx: make WL1271_FLAG_AP_STARTED " Eliad Peller
2011-10-10  8:13 ` [PATCH 15/29] wl12xx: make WL1271_FLAG_PSM " Eliad Peller
2011-10-10  8:13 ` [PATCH 16/29] wl12xx: make WL1271_FLAG_STA_STATE_SENT " Eliad Peller
2011-10-10  8:13 ` [PATCH 17/29] wl12xx: make WL1271_FLAG_RX_STREAMING_STARTED " Eliad Peller
2011-10-10  8:13 ` [PATCH 18/29] wl12xx: make WL1271_FLAG_IF_INITIALIZED per-vif Eliad Peller
2011-10-10  8:13 ` [PATCH 19/29] wl12xx: make WL1271_FLAG_PSPOLL_FAILURE flag per-vif Eliad Peller
2011-10-10  8:13 ` [PATCH 20/29] wl12xx: make WL1271_FLAG_CS_PROGRESS " Eliad Peller
2011-10-10  8:13 ` [PATCH 21/29] wl12xx: add band field to wlvif Eliad Peller
2011-10-10 20:38   ` Luciano Coelho
2011-10-10 20:47     ` Eliad Peller
2011-10-11  9:48       ` Victor Goldenshtein
2011-10-10  8:13 ` [PATCH 22/29] wl12xx: add channel " Eliad Peller
2011-10-10  8:13 ` [PATCH 23/29] wl12xx: add power_level " Eliad Peller
2011-10-10  8:13 ` [PATCH 24/29] wl12xx: make op_config configure all vifs Eliad Peller
2011-10-10  8:13 ` [PATCH 25/29] wl12xx: replace all remaining wl->vif references Eliad Peller
2011-10-10  8:13 ` [PATCH 26/29] wl12xx: call stop() on recovery Eliad Peller
2011-10-10  8:13 ` [PATCH 27/29] wl12xx: use dynamic rate policies Eliad Peller
2011-10-10  8:13 ` [PATCH 28/29] wl12xx: add elp wakeup/sleep calls to add_interface Eliad Peller
2011-10-10  8:13 ` [PATCH 29/29] wl12xx: use round-robin policy for tx Eliad Peller
2011-10-11 12:52 ` [PATCH 00/29] make the driver ready for multi-vif support Luciano Coelho

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=1318272712.9690.384.camel@cumari \
    --to=coelho@ti.com \
    --cc=eliad@wizery.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox