Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 519988fe authored by Johannes Berg's avatar Johannes Berg Committed by Gerrit - the friendly Code Review server
Browse files

cfg80211: add and expose HE 6 GHz band capabilities

These capabilities cover what would otherwise be transported
in HT/VHT capabilities, but only a subset thereof that is
actually needed on 6 GHz with HE already present. Expose the
capabilities to userspace, drivers are expected to set them
as using the 6 GHz band (currently) requires HE capability.

Link: https://lore.kernel.org/r/20200528213443.244cd5cb9db8.Icd8c773277a88c837e7e3af1d4d1013cc3b66543@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Git-commit: 223952177296c34d9c8de9cde33204caffe55725
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git


CRs-Fixed: 2743684
Change-Id: I38356f750b93cd7964b38e9d0983137b0db665c7
Signed-off-by: default avatarVinita S. Maloo <vmaloo@codeaurora.org>
parent b383779d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -346,10 +346,13 @@ struct ieee80211_sta_he_cap {
 *
 * @types_mask: interface types mask
 * @he_cap: holds the HE capabilities
 * @he_6ghz_capa: HE 6 GHz capabilities, must be filled in for a
 *	6 GHz band channel (and 0 may be valid value).
 */
struct ieee80211_sband_iftype_data {
	u16 types_mask;
	struct ieee80211_sta_he_cap he_cap;
	struct ieee80211_he_6ghz_capa he_6ghz_capa;
};

/**
+3 −0
Original line number Diff line number Diff line
@@ -3382,6 +3382,8 @@ enum nl80211_mpath_info {
 *     defined in HE capabilities IE
 * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band HE capability attribute currently
 *     defined
 * @NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA: HE 6GHz band capabilities (__le16),
 *	given for all 6 GHz band channels
 * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use
 */
enum nl80211_band_iftype_attr {
@@ -3392,6 +3394,7 @@ enum nl80211_band_iftype_attr {
	NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY,
	NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET,
	NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE,
	NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA,

	/* keep last */
	__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST,
+8 −1
Original line number Diff line number Diff line
@@ -1384,6 +1384,7 @@ static int nl80211_send_coalesce(struct sk_buff *msg,

static int
nl80211_send_iftype_data(struct sk_buff *msg,
			 const struct ieee80211_supported_band *sband,
			 const struct ieee80211_sband_iftype_data *iftdata)
{
	const struct ieee80211_sta_he_cap *he_cap = &iftdata->he_cap;
@@ -1407,6 +1408,12 @@ nl80211_send_iftype_data(struct sk_buff *msg,
			return -ENOBUFS;
	}

	if (sband->band == NL80211_BAND_6GHZ &&
	    nla_put(msg, NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA,
		    sizeof(iftdata->he_6ghz_capa),
		    &iftdata->he_6ghz_capa))
		return -ENOBUFS;

	return 0;
}

@@ -1454,7 +1461,7 @@ static int nl80211_send_band_rateinfo(struct sk_buff *msg,
			if (!iftdata)
				return -ENOBUFS;

			err = nl80211_send_iftype_data(msg,
			err = nl80211_send_iftype_data(msg, sband,
						       &sband->iftype_data[i]);
			if (err)
				return err;