Replace the way HE Operation elements are defined Replace the way HE Capab is configured in hostapd.conf and add more configuration paramters. Signed-off-by: Siva Mullati <siva.mullati@xxxxxxxxx> --- hostapd/config_file.c | 63 +++++++++++++++++++++++++++++++++----- hostapd/hostapd.conf | 35 ++++++++++++++++----- src/ap/ap_config.h | 12 +------- src/ap/ieee802_11_he.c | 73 ++++++++++++++++++++++++++++++++------------ src/common/ieee802_11_defs.h | 52 +++++++++++++++++++------------ 5 files changed, 169 insertions(+), 66 deletions(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 75bd4915a..d6e51eecd 100755 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -3733,14 +3733,61 @@ static int hostapd_config_fill(struct hostapd_config *conf, } else if (os_strcmp(buf, "he_ppe_th_ppet8_for_nss4_for_ru3") == 0) { conf->he_capab.he_ppe_thresholds[HE_PPE_CAP12_IDX] |= set_he_cap(atoi(pos), HE_PPE_CAP12_PPET8_FOR_NSS4_FOR_RU3); - } else if (os_strcmp(buf, "he_bss_color") == 0) { - conf->he_op.he_bss_color = atoi(pos); - } else if (os_strcmp(buf, "he_default_pe_duration") == 0) { - conf->he_op.he_default_pe_duration = atoi(pos); - } else if (os_strcmp(buf, "he_twt_required") == 0) { - conf->he_op.he_twt_required = atoi(pos); - } else if (os_strcmp(buf, "he_rts_threshold") == 0) { - conf->he_op.he_rts_threshold = atoi(pos); + } else if (os_strcmp(buf, "he_operation_bss_color") == 0) { + conf->he_oper.bss_color_info = atoi(pos); + } else if (os_strcmp(buf, "he_operation_default_pe_duration") == 0) { + conf->he_oper.he_oper_params[HE_OPERATION_CAP0_IDX] |= + set_he_cap(atoi(pos), HE_OPERATION_CAP0_DEFAULT_PE_DURATION); + } else if (os_strcmp(buf, "he_operation_twt_required") == 0) { + conf->he_oper.he_oper_params[HE_OPERATION_CAP0_IDX] |= + set_he_cap(atoi(pos), HE_OPERATION_CAP0_TWT_REQUIRED); + } else if (os_strcmp(buf, "he_operation_txop_dur_rts_th") == 0) { + conf->he_oper.he_oper_params[HE_OPERATION_CAP0_IDX] |= + set_he_cap(atoi(pos), HE_OPERATION_CAP0_TXOP_DUR_RTS_TH); + conf->he_oper.he_oper_params[HE_OPERATION_CAP1_IDX] |= + set_he_cap(atoi(pos) >> 4, HE_OPERATION_CAP1_TXOP_DUR_RTS_TH); + } else if (os_strcmp(buf, "he_operation_er_su_disable") == 0) { + conf->he_oper.he_oper_params[HE_OPERATION_CAP2_IDX] |= + set_he_cap(atoi(pos), HE_OPERATION_CAP2_ER_SU_DISABLE); + } else if (os_strcmp(buf, "he_operation_partial_bss_color") == 0) { + conf->he_oper.bss_color_info |= + set_he_cap(atoi(pos), HE_OPERATION_PARTIAL_BSS_COLOR); + } else if (os_strcmp(buf, "he_operation_vht_oper_info_present") == 0) { + conf->he_oper.he_oper_params[HE_OPERATION_CAP1_IDX] |= + set_he_cap(atoi(pos), HE_OPERATION_CAP1_VHT_OPER_INFO_PRESENT); + } else if (os_strcmp(buf, "he_operation_bss_color_disabled") == 0) { + conf->he_oper.bss_color_info |= + set_he_cap(atoi(pos), HE_OPERATION_BSS_COLOR_DISABLED); + } else if (os_strcmp(buf, "he_operation_max_mcs_for_1ss") == 0) { + conf->he_oper.he_mcs_nss_set[0] |= + set_he_cap(atoi(pos), HE_MCS_NSS_FOR_1SS); + } else if (os_strcmp(buf, "he_operation_max_mcs_for_2ss") == 0) { + conf->he_oper.he_mcs_nss_set[0] |= + set_he_cap(atoi(pos), HE_MCS_NSS_FOR_2SS); + } else if (os_strcmp(buf, "he_operation_max_mcs_for_3ss") == 0) { + conf->he_oper.he_mcs_nss_set[0] |= + set_he_cap(atoi(pos), HE_MCS_NSS_FOR_3SS); + } else if (os_strcmp(buf, "he_operation_max_mcs_for_4ss") == 0) { + conf->he_oper.he_mcs_nss_set[0] |= + set_he_cap(atoi(pos), HE_MCS_NSS_FOR_4SS); + } else if (os_strcmp(buf, "he_operation_max_mcs_for_5ss") == 0) { + conf->he_oper.he_mcs_nss_set[1] |= + set_he_cap(atoi(pos), HE_MCS_NSS_FOR_5SS); + } else if (os_strcmp(buf, "he_operation_max_mcs_for_6ss") == 0) { + conf->he_oper.he_mcs_nss_set[1] |= + set_he_cap(atoi(pos), HE_MCS_NSS_FOR_6SS); + } else if (os_strcmp(buf, "he_operation_max_mcs_for_7ss") == 0) { + conf->he_oper.he_mcs_nss_set[1] |= + set_he_cap(atoi(pos), HE_MCS_NSS_FOR_7SS); + } else if (os_strcmp(buf, "he_operation_max_mcs_for_8ss") == 0) { + conf->he_oper.he_mcs_nss_set[1] |= + set_he_cap(atoi(pos), HE_MCS_NSS_FOR_8SS); + } else if (os_strcmp(buf, "he_operation_vht_channel_width") == 0) { + conf->he_oper.vht_op_info_chwidth = atoi(pos); + } else if (os_strcmp(buf, "he_operation_vht_channel_center_seg0") == 0) { + conf->he_oper.vht_op_info_chan_center_freq_seg0_idx = atoi(pos); + } else if (os_strcmp(buf, "he_operation_vht_channel_center_seg1") == 0) { + conf->he_oper.vht_op_info_chan_center_freq_seg1_idx = atoi(pos); } else if (os_strcmp(buf, "he_mu_edca_qos_info_param_count") == 0) { conf->he_mu_edca.he_qos_info |= set_he_cap(atoi(pos), HE_QOS_INFO_EDCA_PARAM_SET_COUNT); diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index f94671ca9..e5fa77c48 100755 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -884,24 +884,43 @@ wmm_ac_vo_acm=0 #he_ppe_th_ppet8_for_nss4_for_ru2=7 #he_ppe_th_ppet8_for_nss4_for_ru3=7 -# he_bss_color: BSS color +#he_operation_bss_color: BSS color # 0 = no BSS color (default) # unsigned integer = BSS color -#he_bss_color=0 +#he_operation_bss_color=0 -#he_default_pe_duration: The duration of PE field in an HE PPDU in us +#he_operation_default_pe_duration: The duration of PE field in an HE PPDU in us # Possible values are 0 us (default), 4 us, 8 us, 12 us, and 16 us -#he_default_pe_duration=0 +#he_operation_default_pe_duration=0 -#he_twt_required: Whether TWT is required +#he_operation_twt_required: Whether TWT is required # 0 = not required (default) # 1 = required -#he_twt_required=0 +#he_operation_twt_required=0 -#he_rts_threshold: Duration of STA transmission +#he_operation_txop_dur_rts_th: Duration of STA transmission # 0 = not set (default) # unsigned integer = duration in units of 16 us -#he_rts_threshold=0 +#he_operation_txop_dur_rts_th=0 + +# The Max HE-MCS For n SS subfield (where n = 1, ..., 8) is encoded as follows: +# 0 indicates support for HE-MCS 0-7 for n spatial streams +# 1 indicates support for HE-MCS 0-9 for n spatial streams +# 2 indicates support for HE-MCS 0-11 for n spatial streams +# 3 indicates that n spatial streams is not supported for HE PPDUs +#he_operation_max_mcs_for_2ss=0 +#he_operation_max_mcs_for_3ss=0 +#he_operation_max_mcs_for_4ss=0 +#he_operation_max_mcs_for_5ss=0 +#he_operation_max_mcs_for_6ss=0 +#he_operation_max_mcs_for_7ss=0 +#he_operation_max_mcs_for_8ss=0 + +# VHT Operation Information +#he_operation_vht_oper_info_present=1 +#he_operation_vht_channel_width=1 +#he_operation_vht_channel_center_seg0=42 +#he_operation_vht_channel_center_seg1=50 #he_mu_edca_qos_info_param_count #he_mu_edca_qos_info_q_ack diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index 84082e37e..fd1bb8491 100755 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -704,16 +704,6 @@ struct hostapd_bss_config { }; /** - * struct he_operation - HE operation - */ -struct he_operation { - u8 he_bss_color; - u8 he_default_pe_duration; - u8 he_twt_required; - u8 he_rts_threshold; -}; - -/** * struct hostapd_config - Per-radio interface configuration */ struct hostapd_config { @@ -833,7 +823,7 @@ struct hostapd_config { int ieee80211ax; #ifdef CONFIG_IEEE80211AX struct ieee80211_he_capabilities he_capab; - struct he_operation he_op; + struct ieee80211_he_operation he_oper; struct ieee80211_he_mu_edca_parameter_set he_mu_edca; #endif /* CONFIG_IEEE80211AX */ diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c index 68ce77e03..a03c23be4 100755 --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c @@ -82,41 +82,74 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) { struct ieee80211_he_operation *oper; u8 *pos = eid; + u8 *he_oper; if (!hapd->iface->current_mode) return eid; - *pos++ = WLAN_EID_EXTENSION; - *pos++ = 1 + sizeof(struct ieee80211_he_operation); - *pos++ = WLAN_EID_EXT_HE_OPERATION; - - oper = (struct ieee80211_he_operation *) pos; - os_memset(oper, 0, sizeof(*oper)); + u8 size = sizeof(oper->he_oper_params) + + sizeof(oper->bss_color_info) + + sizeof(oper->he_mcs_nss_set); + + if(hapd->iface->conf->he_oper.he_oper_params[HE_OPERATION_CAP1_IDX] & + HE_OPERATION_CAP1_VHT_OPER_INFO_PRESENT) { + size += sizeof(oper->vht_op_info_chwidth) + + sizeof(oper->vht_op_info_chan_center_freq_seg0_idx) + + sizeof(oper->vht_op_info_chan_center_freq_seg1_idx); + + hapd->iface->conf->he_oper.vht_op_info_chwidth = + hapd->iface->conf->vht_oper_chwidth; + hapd->iface->conf->he_oper.vht_op_info_chan_center_freq_seg0_idx = + hapd->iface->conf->vht_oper_centr_freq_seg0_idx; + hapd->iface->conf->he_oper.vht_op_info_chan_center_freq_seg1_idx = + hapd->iface->conf->vht_oper_centr_freq_seg1_idx; + } - if (hapd->iface->conf->he_op.he_bss_color) - oper->he_oper_params |= hapd->iface->conf->he_op.he_bss_color; + if(hapd->iface->conf->he_oper.he_oper_params[HE_OPERATION_CAP1_IDX] & + HE_OPERATION_CAP1_CO_LOCATED_BSS) + size += sizeof(oper->max_co_located_bssid_ind); - if (hapd->iface->conf->he_op.he_default_pe_duration) - oper->he_oper_params |= - (hapd->iface->conf->he_op.he_default_pe_duration << - HE_OPERATION_DFLT_PE_DURATION_OFFSET); + *pos++ = WLAN_EID_EXTENSION; + *pos++ = 1 + size; + *pos++ = WLAN_EID_EXT_HE_OPERATION; - if (hapd->iface->conf->he_op.he_twt_required) - oper->he_oper_params |= HE_OPERATION_TWT_REQUIRED; + he_oper = pos; + os_memset(he_oper, 0, size); + os_memcpy(he_oper, + &hapd->iface->conf->he_oper.he_oper_params, + sizeof(oper->he_oper_params)); + + he_oper = (u8 *) (he_oper + sizeof(oper->he_oper_params)); + *he_oper = hapd->iface->conf->he_oper.bss_color_info; + + he_oper = (u8 *) (he_oper + sizeof(oper->bss_color_info)); + os_memcpy(he_oper, + &hapd->iface->conf->he_oper.he_mcs_nss_set, + sizeof(oper->he_mcs_nss_set)); + + if(hapd->iface->conf->he_oper.he_oper_params[HE_OPERATION_CAP1_IDX] & + HE_OPERATION_CAP1_VHT_OPER_INFO_PRESENT) { + he_oper = (u8 *) (he_oper + sizeof(oper->he_mcs_nss_set)); + *he_oper++ = hapd->iface->conf->he_oper.vht_op_info_chwidth; + *he_oper++ = + hapd->iface->conf->he_oper.vht_op_info_chan_center_freq_seg0_idx; + *he_oper++ = + hapd->iface->conf->he_oper.vht_op_info_chan_center_freq_seg1_idx; + } - if (hapd->iface->conf->he_op.he_rts_threshold) - oper->he_oper_params |= - (hapd->iface->conf->he_op.he_rts_threshold << - HE_OPERATION_RTS_THRESHOLD_OFFSET); + if(hapd->iface->conf->he_oper.he_oper_params[HE_OPERATION_CAP1_IDX] & + HE_OPERATION_CAP1_CO_LOCATED_BSS) + *he_oper = hapd->iface->conf->he_oper.max_co_located_bssid_ind; - /* TODO: conditional MaxBSSID Indicator subfield */ + wpa_hexdump(MSG_DEBUG, "hostapd_eid_he_operation:", pos, size); - pos += sizeof(*oper); + pos += size; return pos; } + u8 * hostapd_eid_he_mu_edca_parameter_set(struct hostapd_data *hapd, u8 *eid) { struct ieee80211_he_mu_edca_parameter_set *edca; diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 809564dad..2d432a433 100755 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -2114,13 +2114,13 @@ struct ieee80211_he_capabilities { } STRUCT_PACKED; struct ieee80211_he_operation { - u32 he_oper_params; /* HE Operation Parameters[3] and - * BSS Color Information[1] */ + u8 he_oper_params[3]; + u8 bss_color_info; u8 he_mcs_nss_set[2]; u8 vht_op_info_chwidth; u8 vht_op_info_chan_center_freq_seg0_idx; u8 vht_op_info_chan_center_freq_seg1_idx; - /* Followed by conditional MaxBSSID Indicator subfield (u8) */ + u8 max_co_located_bssid_ind; } STRUCT_PACKED; /* IEEE 802.11AX DRAFT VER 3.0 */ @@ -2334,22 +2334,36 @@ struct ieee80211_he_operation { /* B7: PPE PAD */ /* HE Operation defines */ -/* HE Operation Parameters and BSS Color Information fields */ -#define HE_OPERATION_BSS_COLOR_MASK ((u32) (BIT(0) | BIT(1) | \ - BIT(2) | BIT(3) | \ - BIT(4) | BIT(5))) -#define HE_OPERATION_PARTIAL_BSS_COLOR ((u32) BIT(6)) -#define HE_OPERATION_BSS_COLOR_DISABLED ((u32) BIT(7)) -#define HE_OPERATION_DFLT_PE_DURATION_MASK ((u32) (BIT(8) | BIT(9) | \ - BIT(10))) -#define HE_OPERATION_DFLT_PE_DURATION_OFFSET 8 -#define HE_OPERATION_TWT_REQUIRED ((u32) BIT(11)) -#define HE_OPERATION_RTS_THRESHOLD_MASK ((u32) (BIT(12) | BIT(13) | \ - BIT(14) | BIT(15) | \ - BIT(16) | BIT(17) | \ - BIT(18) | BIT(19) | \ - BIT(20) | BIT(21))) -#define HE_OPERATION_RTS_THRESHOLD_OFFSET 12 +/* HE Operation Parameters */ +#define HE_OPERATION_CAP0_IDX 0 +#define HE_OPERATION_CAP0_DEFAULT_PE_DURATION ((u8) (BIT(0) | BIT(1) | BIT(2))) +#define HE_OPERATION_CAP0_TWT_REQUIRED ((u8) (BIT(3))) +#define HE_OPERATION_CAP0_TXOP_DUR_RTS_TH ((u8) (BIT(4) | BIT(5) | \ + BIT(6) | BIT(7))) +#define HE_OPERATION_CAP1_IDX 1 +#define HE_OPERATION_CAP1_TXOP_DUR_RTS_TH ((u8) (BIT(0) | BIT(1) | \ + BIT(2) | BIT(3) | BIT(4) | BIT(5))) +#define HE_OPERATION_CAP1_VHT_OPER_INFO_PRESENT ((u8) BIT(6)) +#define HE_OPERATION_CAP1_CO_LOCATED_BSS ((u8) BIT(7)) +#define HE_OPERATION_CAP2_IDX 2 +#define HE_OPERATION_CAP2_ER_SU_DISABLE ((u8) BIT(0)) /* B16 */ +/* B17 ...B23 Reserved */ + +/* HE BSS Color Information field defines */ +#define HE_OPERATION_BSS_COLOR ((u8) (BIT(0) | BIT(1) | \ + BIT(2) | BIT(3) | BIT(4) | BIT(5))) +#define HE_OPERATION_PARTIAL_BSS_COLOR ((u8) BIT(6)) +#define HE_OPERATION_BSS_COLOR_DISABLED ((u8) BIT(7)) + +/* HE MCS and NSS set defines */ +#define HE_MCS_NSS_FOR_1SS ((u8) (BIT(0) | BIT(1))) +#define HE_MCS_NSS_FOR_2SS ((u8) (BIT(2) | BIT(3))) +#define HE_MCS_NSS_FOR_3SS ((u8) (BIT(4) | BIT(5))) +#define HE_MCS_NSS_FOR_4SS ((u8) (BIT(6) | BIT(7))) +#define HE_MCS_NSS_FOR_5SS ((u8) (BIT(0) | BIT(1))) +#define HE_MCS_NSS_FOR_6SS ((u8) (BIT(2) | BIT(3))) +#define HE_MCS_NSS_FOR_7SS ((u8) (BIT(4) | BIT(5))) +#define HE_MCS_NSS_FOR_8SS ((u8) (BIT(6) | BIT(7))) struct ieee80211_he_mu_edca_parameter_set { u8 he_qos_info; -- 2.11.0 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap