提交 c4a30446 编写于 作者: R Rajkumar Manoharan 提交者: Johannes Berg

cfg80211: add support to configure HE MCS for beacon rate

This allows an option to configure a single HE MCS beacon tx rate.
Signed-off-by: NRajkumar Manoharan <rmanohar@codeaurora.org>
Link: https://lore.kernel.org/r/1602879327-29488-2-git-send-email-rmanohar@codeaurora.orgSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 857b34c4
...@@ -1750,8 +1750,9 @@ enum nl80211_commands { ...@@ -1750,8 +1750,9 @@ enum nl80211_commands {
* specify just a single bitrate, which is to be used for the beacon. * specify just a single bitrate, which is to be used for the beacon.
* The driver must also specify support for this with the extended * The driver must also specify support for this with the extended
* features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, * features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY,
* NL80211_EXT_FEATURE_BEACON_RATE_HT and * NL80211_EXT_FEATURE_BEACON_RATE_HT,
* NL80211_EXT_FEATURE_BEACON_RATE_VHT. * NL80211_EXT_FEATURE_BEACON_RATE_VHT and
* NL80211_EXT_FEATURE_BEACON_RATE_HE.
* *
* @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
* at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME. * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
...@@ -5903,6 +5904,9 @@ enum nl80211_feature_flags { ...@@ -5903,6 +5904,9 @@ enum nl80211_feature_flags {
* @NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP: Driver/device supports * @NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP: Driver/device supports
* unsolicited broadcast probe response transmission * unsolicited broadcast probe response transmission
* *
* @NL80211_EXT_FEATURE_BEACON_RATE_HE: Driver supports beacon rate
* configuration (AP/mesh) with HE rates.
*
* @NUM_NL80211_EXT_FEATURES: number of extended features. * @NUM_NL80211_EXT_FEATURES: number of extended features.
* @MAX_NL80211_EXT_FEATURES: highest extended feature index. * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
*/ */
...@@ -5963,6 +5967,7 @@ enum nl80211_ext_feature_index { ...@@ -5963,6 +5967,7 @@ enum nl80211_ext_feature_index {
NL80211_EXT_FEATURE_SAE_OFFLOAD_AP, NL80211_EXT_FEATURE_SAE_OFFLOAD_AP,
NL80211_EXT_FEATURE_FILS_DISCOVERY, NL80211_EXT_FEATURE_FILS_DISCOVERY,
NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP, NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP,
NL80211_EXT_FEATURE_BEACON_RATE_HE,
/* add new features before the definition below */ /* add new features before the definition below */
NUM_NL80211_EXT_FEATURES, NUM_NL80211_EXT_FEATURES,
......
...@@ -4683,6 +4683,7 @@ static int nl80211_parse_tx_bitrate_mask(struct genl_info *info, ...@@ -4683,6 +4683,7 @@ static int nl80211_parse_tx_bitrate_mask(struct genl_info *info,
mask->control[band].ht_mcs)) mask->control[band].ht_mcs))
return -EINVAL; return -EINVAL;
} }
if (tb[NL80211_TXRATE_VHT]) { if (tb[NL80211_TXRATE_VHT]) {
if (!vht_set_mcs_mask( if (!vht_set_mcs_mask(
sband, sband,
...@@ -4690,6 +4691,7 @@ static int nl80211_parse_tx_bitrate_mask(struct genl_info *info, ...@@ -4690,6 +4691,7 @@ static int nl80211_parse_tx_bitrate_mask(struct genl_info *info,
mask->control[band].vht_mcs)) mask->control[band].vht_mcs))
return -EINVAL; return -EINVAL;
} }
if (tb[NL80211_TXRATE_GI]) { if (tb[NL80211_TXRATE_GI]) {
mask->control[band].gi = mask->control[band].gi =
nla_get_u8(tb[NL80211_TXRATE_GI]); nla_get_u8(tb[NL80211_TXRATE_GI]);
...@@ -4701,6 +4703,7 @@ static int nl80211_parse_tx_bitrate_mask(struct genl_info *info, ...@@ -4701,6 +4703,7 @@ static int nl80211_parse_tx_bitrate_mask(struct genl_info *info,
nla_data(tb[NL80211_TXRATE_HE]), nla_data(tb[NL80211_TXRATE_HE]),
mask->control[band].he_mcs)) mask->control[band].he_mcs))
return -EINVAL; return -EINVAL;
if (tb[NL80211_TXRATE_HE_GI]) if (tb[NL80211_TXRATE_HE_GI])
mask->control[band].he_gi = mask->control[band].he_gi =
nla_get_u8(tb[NL80211_TXRATE_HE_GI]); nla_get_u8(tb[NL80211_TXRATE_HE_GI]);
...@@ -4742,7 +4745,7 @@ static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev, ...@@ -4742,7 +4745,7 @@ static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev,
enum nl80211_band band, enum nl80211_band band,
struct cfg80211_bitrate_mask *beacon_rate) struct cfg80211_bitrate_mask *beacon_rate)
{ {
u32 count_ht, count_vht, i; u32 count_ht, count_vht, count_he, i;
u32 rate = beacon_rate->control[band].legacy; u32 rate = beacon_rate->control[band].legacy;
/* Allow only one rate */ /* Allow only one rate */
...@@ -4775,7 +4778,21 @@ static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev, ...@@ -4775,7 +4778,21 @@ static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev,
return -EINVAL; return -EINVAL;
} }
if ((count_ht && count_vht) || (!rate && !count_ht && !count_vht)) count_he = 0;
for (i = 0; i < NL80211_HE_NSS_MAX; i++) {
if (hweight16(beacon_rate->control[band].he_mcs[i]) > 1) {
return -EINVAL;
} else if (beacon_rate->control[band].he_mcs[i]) {
count_he++;
if (count_he > 1)
return -EINVAL;
}
if (count_he && rate)
return -EINVAL;
}
if ((count_ht && count_vht && count_he) ||
(!rate && !count_ht && !count_vht && !count_he))
return -EINVAL; return -EINVAL;
if (rate && if (rate &&
...@@ -4790,6 +4807,10 @@ static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev, ...@@ -4790,6 +4807,10 @@ static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev,
!wiphy_ext_feature_isset(&rdev->wiphy, !wiphy_ext_feature_isset(&rdev->wiphy,
NL80211_EXT_FEATURE_BEACON_RATE_VHT)) NL80211_EXT_FEATURE_BEACON_RATE_VHT))
return -EINVAL; return -EINVAL;
if (count_he &&
!wiphy_ext_feature_isset(&rdev->wiphy,
NL80211_EXT_FEATURE_BEACON_RATE_HE))
return -EINVAL;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册