linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Rajkumar Manoharan <rmanohar@codeaurora.org>, kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org
Subject: Re: [PATCH v3 10/11] mac80211: determine chantype from HE operation in 6 GHz
Date: Wed, 27 May 2020 16:41:50 +0200	[thread overview]
Message-ID: <74232fe9a140a15306c04f0509e6c615b8e329de.camel@sipsolutions.net> (raw)
In-Reply-To: <1589399105-25472-10-git-send-email-rmanohar@codeaurora.org>

On Wed, 2020-05-13 at 12:45 -0700, Rajkumar Manoharan wrote:
> In 6 GHz band, determine chandef from 6 GHz operation information
> of HE operation element.

So here we get to real differences ...

> Reported-by: kernel test robot <rong.a.chen@intel.com>

Huh?

> +bool ieee80211_chandef_he_oper(struct ieee80211_sub_if_data *sdata,
> +			       const struct ieee80211_he_operation *heop,
> +			       struct cfg80211_chan_def *chandef)
> +{
> +	struct ieee80211_he_oper_6ghz_op_info info;
> +	const struct ieee80211_sta_he_cap *he_cap;
> +	struct ieee80211_supported_band *sband;
> +	struct cfg80211_chan_def new = *chandef;
> +	int cf0, cf1;
> +	int ccf0, ccf1;
> +	bool support_80_80;
> +	bool support_160;
> +	u8 he_phy_cap;
> +	u8 pos = 0;
> +
> +	/* Below HE Operation check is required only for 6 GHz band */
> +	if (chandef->chan->band != NL80211_BAND_6GHZ)
> +		return true;
> +
> +	if (!heop)
> +		return false;
> +
> +	sband = sdata->local->hw.wiphy->bands[chandef->chan->band];
> +	if (!sband)
> +		return false;
> +
> +	he_cap = ieee80211_get_he_iftype_cap(sband, sdata->vif.type);
> +	if (!he_cap)
> +		return false;
> +
> +	if (!(le32_to_cpu(heop->he_oper_params) &
> +				IEEE80211_HE_OPERATION_6GHZ_OP_INFO))
> +		return false;
> +
> +	he_phy_cap = he_cap->he_cap_elem.phy_cap_info[0];
> +	support_160 =
> +		!!(he_phy_cap &
> +		   IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G);
> +	support_80_80 =
> +		!!(he_phy_cap &
> +		   IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G);
> +
> +	if (le32_to_cpu(heop->he_oper_params) &
> +	    IEEE80211_HE_OPERATION_VHT_OPER_INFO)
> +		pos += 3;
> +	if (le32_to_cpu(heop->he_oper_params) &
> +	    IEEE80211_HE_OPERATION_CO_HOSTED_BSS)
> +		pos += 1;

This really gets better with the ieee80211_he_6ghz_oper() inline I wrote
and posted in the other reply.

> +	case IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ:
> +		new.center_freq1 = cf0;
> +		new.width = NL80211_CHAN_WIDTH_80;
> +		if (ccf1) {
> +			unsigned int diff;
> +
> +			diff = abs(ccf1 - ccf0);
> +			if (diff == 8 && support_160) {
> +				new.width = NL80211_CHAN_WIDTH_160;
> +				new.center_freq1 = cf1;
> +			} else if ((diff > 8) && support_80_80) {
> +				new.width = NL80211_CHAN_WIDTH_80P80;
> +				new.center_freq2 = cf1;
> +			}
> +		}

Hmm. Yes, we just had

+       case IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_160MHZ:
+               if (abs(he_6ghz_oper->ccfs1 - he_6ghz_oper->ccfs0) == 8)
+                       he_chandef.width = NL80211_CHAN_WIDTH_160;
+               else
+                       he_chandef.width = NL80211_CHAN_WIDTH_80P80;
+               break;


but that breaks if you don't support 80+80 or 160.

OTOH, we check this later again, I think, and downgrade if we don't
support it, so no harm done?

I think I'd prefer the parsing to be exact, and then downgrade as
necessary. That makes things a bit simpler.

That may mean the place where you call this should be different though.

johannes


  reply	other threads:[~2020-05-27 14:41 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 19:44 [PATCH v3 01/11] cfg80211: use only HE capability to set prohibited flags in 6 GHz Rajkumar Manoharan
2020-05-13 19:44 ` [PATCH v3 02/11] cfg80211: handle 6 GHz capability of new station Rajkumar Manoharan
2020-05-27 14:00   ` Johannes Berg
2020-05-27 23:24     ` Rajkumar Manoharan
2020-05-28  7:40       ` Johannes Berg
2020-05-13 19:44 ` [PATCH v3 03/11] nl80211: add HE 6 GHz Band Capability support Rajkumar Manoharan
2020-05-27 14:27   ` Johannes Berg
2020-05-27 17:39     ` Rajkumar Manoharan
2020-05-13 19:44 ` [PATCH v3 04/11] mac80211: add HE 6 GHz Band Capabilities into parse extension Rajkumar Manoharan
2020-05-27 14:28   ` Johannes Berg
2020-05-13 19:44 ` [PATCH v3 05/11] mac80211: fix memory overlap due to variable length param Rajkumar Manoharan
2020-05-27 14:28   ` Johannes Berg
2020-05-13 19:45 ` [PATCH v3 06/11] mac80211: handle HE 6 GHz Capability in HE STA processing Rajkumar Manoharan
2020-05-27 14:43   ` Johannes Berg
2020-05-28  8:55   ` Johannes Berg
2020-05-28  9:43   ` Johannes Berg
2020-05-28 13:15     ` Johannes Berg
2020-05-13 19:45 ` [PATCH v3 07/11] mac80211: add HE 6 GHz Band Capability IE in Assoc. Request Rajkumar Manoharan
2020-05-27 14:37   ` Johannes Berg
2020-05-28 12:20   ` Johannes Berg
2020-05-13 19:45 ` [PATCH v3 08/11] mac80211: build HE operation with 6 GHz oper information Rajkumar Manoharan
2020-05-27 14:30   ` Johannes Berg
2020-05-13 19:45 ` [PATCH v3 09/11] mac80211: do not allow HT/VHT IEs in 6 GHz mesh mode Rajkumar Manoharan
2020-05-13 19:45 ` [PATCH v3 10/11] mac80211: determine chantype from HE operation in 6 GHz Rajkumar Manoharan
2020-05-27 14:41   ` Johannes Berg [this message]
2020-05-27 14:44     ` Johannes Berg
2020-05-27 18:34       ` Rajkumar Manoharan
2020-05-27 18:41         ` Johannes Berg
2020-05-28  9:41     ` Johannes Berg
2020-05-28 11:46       ` Johannes Berg
2020-05-13 19:45 ` [PATCH v3 11/11] ath11k: build HE 6 GHz capability Rajkumar Manoharan
2020-06-01 22:42   ` Rajkumar Manoharan
2020-05-27 13:43 ` [PATCH v3 01/11] cfg80211: use only HE capability to set prohibited flags in 6 GHz Johannes Berg
2020-05-27 23:32   ` Rajkumar Manoharan
2020-05-28  7:41     ` Johannes Berg
2020-05-28  7:42       ` Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2020-05-09  0:12 Rajkumar Manoharan
2020-05-09  0:13 ` [PATCH v3 10/11] mac80211: determine chantype from HE operation " Rajkumar Manoharan

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=74232fe9a140a15306c04f0509e6c615b8e329de.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=ath11k@lists.infradead.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rmanohar@codeaurora.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;
as well as URLs for NNTP newsgroup(s).