public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: "Guy, Wey-Yi" <wey-yi.w.guy@intel.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "Chatre, Reinette" <reinette.chatre@intel.com>,
	"linville@tuxdriver.com" <linville@tuxdriver.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"ipw3945-devel@lists.sourceforge.net"
	<ipw3945-devel@lists.sourceforge.net>
Subject: Re: [PATCH 14/15] iwlwifi: add SM PS support for 6x50 series
Date: Sat, 31 Oct 2009 10:44:18 -0700	[thread overview]
Message-ID: <1257011058.8387.14.camel@wwguy-ubuntu> (raw)
In-Reply-To: <1256968411.3555.77.camel@johannes.local>

On Fri, 2009-10-30 at 22:53 -0700, Johannes Berg wrote:
> Hi,
> 
> > @@ -3012,6 +3012,10 @@ static int iwl_init_drv(struct iwl_priv *priv)
> >  	priv->band = IEEE80211_BAND_2GHZ;
> >  
> >  	priv->iw_mode = NL80211_IFTYPE_STATION;
> > +	if (priv->cfg->support_sm_ps)
> > +		priv->current_ht_config.sm_ps = WLAN_HT_CAP_SM_PS_DYNAMIC;
> > +	else
> > +		priv->current_ht_config.sm_ps = WLAN_HT_CAP_SM_PS_DISABLED;
> 
> Why bother with current_ht_config.sm_ps when ...

This is for keep the ht configuration in single place. 

> 
> >  	ht_info->cap |= IEEE80211_HT_CAP_SGI_20;
> > -	ht_info->cap |= (IEEE80211_HT_CAP_SM_PS &
> > -			     (WLAN_HT_CAP_SM_PS_DISABLED << 2));
> > +	if (priv->cfg->support_sm_ps)
> > +		ht_info->cap |= (IEEE80211_HT_CAP_SM_PS &
> > +				     (WLAN_HT_CAP_SM_PS_DYNAMIC << 2));
> > +	else
> > +		ht_info->cap |= (IEEE80211_HT_CAP_SM_PS &
> > +				     (WLAN_HT_CAP_SM_PS_DISABLED << 2));
> 
> here we always and unconditionally advertise dynamic SM-PS mode?

I am confuse, it is based on "priv->cfg->support_sm_ps", so it is not
always dynamic SM-PS mode.
  
>  
> > +	if (priv->cfg->support_sm_ps) {
> > +		/* # Rx chains when idling and maybe trying to save power */
> > +		switch (priv->current_ht_config.sm_ps) {
> > +		case WLAN_HT_CAP_SM_PS_STATIC:
> > +		case WLAN_HT_CAP_SM_PS_DYNAMIC:
> > +			idle_cnt = (is_cam) ? IWL_NUM_IDLE_CHAINS_DUAL :
> > +				IWL_NUM_IDLE_CHAINS_SINGLE;
> > +			break;
> > +		case WLAN_HT_CAP_SM_PS_DISABLED:
> > +			idle_cnt = (is_cam) ? active_cnt :
> > +				IWL_NUM_IDLE_CHAINS_SINGLE;
> > +			break;
> > +		case WLAN_HT_CAP_SM_PS_INVALID:
> > +		default:
> > +			IWL_ERR(priv, "invalid sm_ps mode %d\n",
> > +				priv->current_ht_config.sm_ps);
> > +			WARN_ON(1);
> > +			break;
> > +		}
> > +	}
> 
> This _should_ always hit the dynamic case since we've always advertised
> that, were it not for a bug below. And even when powersave is turned off
> the AP will have to do CTS/RTS handshake so we do not gain anything by
> turning on all chains in that case.
> 
We only hit the dynamic sm-ps mode if "priv->cfg->support_sm_ps == ture"
case. correct?

> I think the whole ht_config.sm_ps should be removed, and here we should
> always and unconditionally use _SINGLE as that matches what we've
> advertised to the AP via the HT capabilities.
> 
> >  /* up to 4 chains */
> > @@ -2258,6 +2280,12 @@ static void iwl_ht_conf(struct iwl_priv *priv,
> >  					>> IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT;
> >  			maxstreams += 1;
> >  
> > +			ht_conf->sm_ps =
> > +				(u8)((ht_cap->cap & IEEE80211_HT_CAP_SM_PS)
> > +				>> 2);
> > +			IWL_DEBUG_MAC80211(priv, "sm_ps: 0x%x\n",
> > +				ht_conf->sm_ps);
> > +
> 
> This is wrong; we cannot use the peer's SM_PS setting for our own SM_PS
> setting, we've advertised dynamic SM PS so we better stick with it. The
> peer's setting has no value for us, it means whether the peer will turn
> off _its_ chains or not.

I agree should not modify the SM_PS setting based on AP

I will submit another patch to remove using AP setting.

> 
> johannes


  reply	other threads:[~2009-10-31 17:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-30 21:36 [PATCH 00/15] iwlwifi updates 10/30/2009 Reinette Chatre
2009-10-30 21:36 ` [PATCH 01/15] iwlwifi: provide firmware version Reinette Chatre
2009-10-30 21:36 ` [PATCH 02/15] iwlwifi: remove unneeded locks from apm_stop() and stop_master() Reinette Chatre
2009-10-30 21:36 ` [PATCH 03/15] iwlwifi: remove power-wasting calls to apm_ops.init() Reinette Chatre
2009-10-30 21:36 ` [PATCH 04/15] iwlagn: invoke L0S workaround for 6000/1000 series Reinette Chatre
2009-10-30 21:36 ` [PATCH 05/15] iwlagn: Clarify FH_TX interrupt Reinette Chatre
2009-10-30 21:36 ` [PATCH 06/15] iwlagn: update write pointers for all tx queues after wakeup Reinette Chatre
2009-10-30 21:36 ` [PATCH 07/15] iwlwifi: unmap memory before use Reinette Chatre
2009-10-30 21:36 ` [PATCH 08/15] iwlwifi: move iwl_[un]init_drv to iwlagn Reinette Chatre
2009-10-31  5:56   ` Johannes Berg
2009-11-02 17:19     ` reinette chatre
2009-11-02 17:35       ` Johannes Berg
2009-11-02 17:42         ` reinette chatre
2009-10-30 21:36 ` [PATCH 09/15] iwlwifi: split adding broadcast station from others Reinette Chatre
2009-10-30 21:36 ` [PATCH 10/15] iwl3945: store station rate scale information in mac80211 station structure Reinette Chatre
2009-10-30 21:36 ` [PATCH 11/15] iwlagn: move rate scale initialization to init function Reinette Chatre
2009-10-30 21:36 ` [PATCH 12/15] iwlwifi: print warning when sending host command fails Reinette Chatre
2009-10-30 21:36 ` [PATCH 13/15] iwlwifi: coex API data structure Reinette Chatre
2009-10-30 21:36 ` [PATCH 14/15] iwlwifi: add SM PS support for 6x50 series Reinette Chatre
2009-10-31  5:53   ` Johannes Berg
2009-10-31 17:44     ` Guy, Wey-Yi [this message]
2009-10-31 19:23       ` Johannes Berg
2009-11-02 15:29         ` Guy, Wey-Yi
2009-10-30 21:36 ` [PATCH 15/15] iwlwifi: add wimax/wifi coexist " Reinette Chatre

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=1257011058.8387.14.camel@wwguy-ubuntu \
    --to=wey-yi.w.guy@intel.com \
    --cc=ipw3945-devel@lists.sourceforge.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=reinette.chatre@intel.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