From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail2.candelatech.com ([208.74.158.173]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XWnmr-00069o-Qq for ath10k@lists.infradead.org; Wed, 24 Sep 2014 14:43:22 +0000 Message-ID: <5422D874.1030007@candelatech.com> Date: Wed, 24 Sep 2014 07:43:00 -0700 From: Ben Greear MIME-Version: 1.0 Subject: Re: [RFC 2/2] ath10k: re-config ht_caps when chainmask is modified. References: <1411518383-32634-1-git-send-email-greearb@candelatech.com> <1411518383-32634-2-git-send-email-greearb@candelatech.com> In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="utf-8"; Format="flowed" Sender: "ath10k" Errors-To: ath10k-bounces+kvalo=adurom.com@lists.infradead.org To: Michal Kazior Cc: linux-wireless , "ath10k@lists.infradead.org" CgpPbiAwOS8yNC8yMDE0IDEyOjUxIEFNLCBNaWNoYWwgS2F6aW9yIHdyb3RlOgo+IE9uIDI0IFNl cHRlbWJlciAyMDE0IDAyOjI2LCAgPGdyZWVhcmJAY2FuZGVsYXRlY2guY29tPiB3cm90ZToKPiBb Li4uXQo+PiArc3RhdGljIHN0cnVjdCBpZWVlODAyMTFfc3RhX3ZodF9jYXAgYXRoMTBrX2NyZWF0 ZV92aHRfY2FwKHN0cnVjdCBhdGgxMGsgKmFyLAo+PiArICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCB1c2VfY2ZnX2NoYWlucykKPj4g ICB7Cj4+ICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfc3RhX3ZodF9jYXAgdmh0X2NhcCA9IHsw fTsKPj4gICAgICAgICAgdTE2IG1jc19tYXA7Cj4+ICAgICAgICAgIGludCBpOwo+PiArICAgICAg IGludCBucmYgPSBhci0+bnVtX3JmX2NoYWluczsKPj4gKwo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YXVsdHMuCgpUaGFua3MsCkJlbgoKPgo+Cj4gTWljaGHFggo+IC0t Cj4gVG8gdW5zdWJzY3JpYmUgZnJvbSB0aGlzIGxpc3Q6IHNlbmQgdGhlIGxpbmUgInVuc3Vic2Ny aWJlIGxpbnV4LXdpcmVsZXNzIiBpbgo+IHRoZSBib2R5IG9mIGEgbWVzc2FnZSB0byBtYWpvcmRv bW9Admdlci5rZXJuZWwub3JnCj4gTW9yZSBtYWpvcmRvbW8gaW5mbyBhdCAgaHR0cDovL3ZnZXIu a2VybmVsLm9yZy9tYWpvcmRvbW8taW5mby5odG1sCj4KCi0tIApCZW4gR3JlZWFyIDxncmVlYXJi QGNhbmRlbGF0ZWNoLmNvbT4KQ2FuZGVsYSBUZWNobm9sb2dpZXMgSW5jICBodHRwOi8vd3d3LmNh bmRlbGF0ZWNoLmNvbQoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX18KYXRoMTBrIG1haWxpbmcgbGlzdAphdGgxMGtAbGlzdHMuaW5mcmFkZWFkLm9yZwpodHRw Oi8vbGlzdHMuaW5mcmFkZWFkLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2F0aDEwawo= From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail2.candelatech.com ([208.74.158.173]:58256 "EHLO mail2.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750772AbaIXOnB (ORCPT ); Wed, 24 Sep 2014 10:43:01 -0400 Message-ID: <5422D874.1030007@candelatech.com> (sfid-20140924_164305_667908_9419F73D) Date: Wed, 24 Sep 2014 07:43:00 -0700 From: Ben Greear MIME-Version: 1.0 To: Michal Kazior CC: linux-wireless , "ath10k@lists.infradead.org" Subject: Re: [RFC 2/2] ath10k: re-config ht_caps when chainmask is modified. References: <1411518383-32634-1-git-send-email-greearb@candelatech.com> <1411518383-32634-2-git-send-email-greearb@candelatech.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Sender: linux-wireless-owner@vger.kernel.org List-ID: On 09/24/2014 12:51 AM, Michal Kazior wrote: > On 24 September 2014 02:26, wrote: > [...] >> +static struct ieee80211_sta_vht_cap ath10k_create_vht_cap(struct ath10k *ar, >> + bool use_cfg_chains) >> { >> struct ieee80211_sta_vht_cap vht_cap = {0}; >> u16 mcs_map; >> int i; >> + int nrf = ar->num_rf_chains; >> + >> + if (use_cfg_chains && ar->cfg_tx_chainmask) >> + nrf = get_nss_from_chainmask(ar->cfg_tx_chainmask); > > Is use_cfg_chains really necessary here? Is setting tx/rx chainmask to > 0x0 make any sense at all? Shouldn't we deny it or make it fallback to > the supported tx/rx chainmask values? I was thinking we should register with supported values, instead of configured values. That is the intention of the code. In case we ever re-register after user has configured the system, this should retain that functionality. If it is impossible to re-register the wiphy, then this extra use_cfg_chains logic could go away. On startup, before user ever configures anything (and most users never will), the cfg-tx-chainmask is 0, so it would stay with chip's defaults. Thanks, Ben > > > MichaƂ > -- > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Ben Greear Candela Technologies Inc http://www.candelatech.com