Allow HE MCS rate selection for Beacon frames
Allow HE MCS rate to be used for beacon transmission when the driver advertises the support. The rate is specified with a new beacon_rate option "he:<HE MCS>" in hostapd configuration. Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
This commit is contained in:
parent
7f2f262e6d
commit
9f9d3d3625
6 changed files with 45 additions and 7 deletions
|
@ -3263,6 +3263,16 @@ static int hostapd_config_fill(struct hostapd_config *conf,
|
|||
}
|
||||
conf->rate_type = BEACON_RATE_VHT;
|
||||
conf->beacon_rate = val;
|
||||
} else if (os_strncmp(pos, "he:", 3) == 0) {
|
||||
val = atoi(pos + 3);
|
||||
if (val < 0 || val > 11) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"Line %d: invalid beacon_rate HE-MCS %d",
|
||||
line, val);
|
||||
return 1;
|
||||
}
|
||||
conf->rate_type = BEACON_RATE_HE;
|
||||
conf->beacon_rate = val;
|
||||
} else {
|
||||
val = atoi(pos);
|
||||
if (val < 10 || val > 10000) {
|
||||
|
|
|
@ -279,6 +279,8 @@ fragm_threshold=-1
|
|||
# beacon_rate=ht:<HT MCS>
|
||||
# VHT:
|
||||
# beacon_rate=vht:<VHT MCS>
|
||||
# HE:
|
||||
# beacon_rate=he:<HE MCS>
|
||||
#
|
||||
# For example, beacon_rate=10 for 1 Mbps or beacon_rate=60 for 6 Mbps (OFDM).
|
||||
#beacon_rate=10
|
||||
|
|
|
@ -405,7 +405,8 @@ enum wpa_radio_work_band {
|
|||
enum beacon_rate_type {
|
||||
BEACON_RATE_LEGACY,
|
||||
BEACON_RATE_HT,
|
||||
BEACON_RATE_VHT
|
||||
BEACON_RATE_VHT,
|
||||
BEACON_RATE_HE
|
||||
};
|
||||
|
||||
enum eap_proxy_sim_state {
|
||||
|
|
|
@ -1264,14 +1264,14 @@ struct wpa_driver_ap_params {
|
|||
*
|
||||
* This parameter can be used to set a specific Beacon frame data rate
|
||||
* for the BSS. The interpretation of this value depends on the
|
||||
* rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS). If
|
||||
* beacon_rate == 0 and rate_type == 0 (BEACON_RATE_LEGACY), the default
|
||||
* Beacon frame data rate is used.
|
||||
* rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS,
|
||||
* HE: HE-MCS). If beacon_rate == 0 and rate_type == 0
|
||||
* (BEACON_RATE_LEGACY), the default Beacon frame data rate is used.
|
||||
*/
|
||||
unsigned int beacon_rate;
|
||||
|
||||
/**
|
||||
* beacon_rate_type: Beacon data rate type (legacy/HT/VHT)
|
||||
* beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE)
|
||||
*/
|
||||
enum beacon_rate_type rate_type;
|
||||
|
||||
|
@ -1959,6 +1959,8 @@ struct wpa_driver_capa {
|
|||
* frames
|
||||
*/
|
||||
#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG 0x0000000000000010ULL
|
||||
/** Driver supports Beacon frame TX rate configuration (HE rates) */
|
||||
#define WPA_DRIVER_FLAGS2_BEACON_RATE_HE 0x0000000000000020ULL
|
||||
u64 flags2;
|
||||
|
||||
#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
|
||||
|
|
|
@ -4198,11 +4198,12 @@ static int nl80211_set_mesh_config(void *priv,
|
|||
#endif /* CONFIG_MESH */
|
||||
|
||||
|
||||
static int nl80211_put_beacon_rate(struct nl_msg *msg, const u64 flags,
|
||||
static int nl80211_put_beacon_rate(struct nl_msg *msg, u64 flags, u64 flags2,
|
||||
struct wpa_driver_ap_params *params)
|
||||
{
|
||||
struct nlattr *bands, *band;
|
||||
struct nl80211_txrate_vht vht_rate;
|
||||
struct nl80211_txrate_he he_rate;
|
||||
|
||||
if (!params->freq ||
|
||||
(params->beacon_rate == 0 &&
|
||||
|
@ -4235,6 +4236,7 @@ static int nl80211_put_beacon_rate(struct nl_msg *msg, const u64 flags,
|
|||
return -1;
|
||||
|
||||
os_memset(&vht_rate, 0, sizeof(vht_rate));
|
||||
os_memset(&he_rate, 0, sizeof(he_rate));
|
||||
|
||||
switch (params->rate_type) {
|
||||
case BEACON_RATE_LEGACY:
|
||||
|
@ -4287,6 +4289,22 @@ static int nl80211_put_beacon_rate(struct nl_msg *msg, const u64 flags,
|
|||
wpa_printf(MSG_DEBUG, " * beacon_rate = VHT-MCS %u",
|
||||
params->beacon_rate);
|
||||
break;
|
||||
case BEACON_RATE_HE:
|
||||
if (!(flags2 & WPA_DRIVER_FLAGS2_BEACON_RATE_HE)) {
|
||||
wpa_printf(MSG_INFO,
|
||||
"nl80211: Driver does not support setting Beacon frame rate (HE)");
|
||||
return -1;
|
||||
}
|
||||
he_rate.mcs[0] = BIT(params->beacon_rate);
|
||||
if (nla_put(msg, NL80211_TXRATE_LEGACY, 0, NULL) ||
|
||||
nla_put(msg, NL80211_TXRATE_HT, 0, NULL) ||
|
||||
nla_put(msg, NL80211_TXRATE_VHT, sizeof(vht_rate),
|
||||
&vht_rate) ||
|
||||
nla_put(msg, NL80211_TXRATE_HE, sizeof(he_rate), &he_rate))
|
||||
return -1;
|
||||
wpa_printf(MSG_DEBUG, " * beacon_rate = HE-MCS %u",
|
||||
params->beacon_rate);
|
||||
break;
|
||||
}
|
||||
|
||||
nla_nest_end(msg, band);
|
||||
|
@ -4409,7 +4427,8 @@ static int wpa_driver_nl80211_set_ap(void *priv,
|
|||
nla_put(msg, NL80211_ATTR_BEACON_TAIL, params->tail_len,
|
||||
params->tail) ||
|
||||
nl80211_put_beacon_int(msg, params->beacon_int) ||
|
||||
nl80211_put_beacon_rate(msg, drv->capa.flags, params) ||
|
||||
nl80211_put_beacon_rate(msg, drv->capa.flags, drv->capa.flags2,
|
||||
params) ||
|
||||
nl80211_put_dtim_period(msg, params->dtim_period) ||
|
||||
nla_put(msg, NL80211_ATTR_SSID, params->ssid_len, params->ssid))
|
||||
goto fail;
|
||||
|
|
|
@ -558,6 +558,10 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info,
|
|||
NL80211_EXT_FEATURE_BEACON_RATE_VHT))
|
||||
capa->flags |= WPA_DRIVER_FLAGS_BEACON_RATE_VHT;
|
||||
|
||||
if (ext_feature_isset(ext_features, len,
|
||||
NL80211_EXT_FEATURE_BEACON_RATE_HE))
|
||||
capa->flags2 |= WPA_DRIVER_FLAGS2_BEACON_RATE_HE;
|
||||
|
||||
if (ext_feature_isset(ext_features, len,
|
||||
NL80211_EXT_FEATURE_SET_SCAN_DWELL))
|
||||
capa->rrm_flags |= WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL;
|
||||
|
|
Loading…
Reference in a new issue