mac80211_hwsim: Register support for HE meshpoint
RFC PATCH 1/2 mac80211_hwsim: Register support for HE meshpoint
From: Sven Eckelmann <[email protected]>
Some features of 802.11ax without central organizing (AP) STA can also be used in mesh mode. hwsim can be used to assist initial development of these features without having access to HW.
Signed-off-by Sven Eckelmann <[email protected]>
--- drivers/net/wireless/mac80211_hwsim.c | 283 +++++++++++++++++--------- 1 file changed, 189 insertions(+), 94 deletions(-)
drivers/net/wireless/mac80211_hwsim.c +189 -94
@@ -2501,116 +2501,211 @@ static void hwsim_mcast_new_radio(int id, struct genl_info *info,nlmsg_free (mcast_skb); } -static const struct ieee80211_sband_iftype_data he_capa_2ghz = { -/* TODO: should we support other types, e.g., P2P?*/ - .types_mask =BIT (NL80211_IFTYPE_STATION ) |BIT (NL80211_IFTYPE_AP ), - .he_cap = { - .has_he = true, - .he_cap_elem = { - .mac_cap_info[0 ] = -IEEE80211_HE_MAC_CAP0_HTC_HE , - .mac_cap_info[1 ] = -IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US | -IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8 , - .mac_cap_info[2 ] = -IEEE80211_HE_MAC_CAP2_BSR | -IEEE80211_HE_MAC_CAP2_MU_CASCADING | -IEEE80211_HE_MAC_CAP2_ACK_EN , - .mac_cap_info[3 ] = -IEEE80211_HE_MAC_CAP3_OMI_CONTROL | -IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2 , - .mac_cap_info[4 ] =IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU , - .phy_cap_info[1 ] = -IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | -IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | -IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | -IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS , - .phy_cap_info[2 ] = - IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US | -IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ | -IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ | -IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO | -IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO , - -/* Leave all the other PHY capability bytes unset, as -* DCM, beam forming, RU and PPE threshold information -* are not supported -*/ +static const struct ieee80211_sband_iftype_data he_capa_2ghz[] = { + { +/* TODO: should we support other types, e.g., P2P?*/ + .types_mask =BIT (NL80211_IFTYPE_STATION ) | +BIT (NL80211_IFTYPE_AP ), + .he_cap = { + .has_he = true, + .he_cap_elem = { + .mac_cap_info[0 ] = +IEEE80211_HE_MAC_CAP0_HTC_HE , + .mac_cap_info[1 ] = +IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US | +IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8 , + .mac_cap_info[2 ] = +IEEE80211_HE_MAC_CAP2_BSR | +IEEE80211_HE_MAC_CAP2_MU_CASCADING | +IEEE80211_HE_MAC_CAP2_ACK_EN , + .mac_cap_info[3 ] = +IEEE80211_HE_MAC_CAP3_OMI_CONTROL | +IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2 , + .mac_cap_info[4 ] =IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU , + .phy_cap_info[1 ] = +IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | +IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | +IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | +IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS , + .phy_cap_info[2 ] = + IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US | +IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ | +IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ | +IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO | +IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO , + +/* Leave all the other PHY capability bytes +* unset, as DCM, beam forming, RU and PPE +* threshold information are not supported +*/ + }, + .he_mcs_nss_supp = { + .rx_mcs_80 =cpu_to_le16 (0xfffa ), + .tx_mcs_80 =cpu_to_le16 (0xfffa ), + .rx_mcs_160 =cpu_to_le16 (0xffff ), + .tx_mcs_160 =cpu_to_le16 (0xffff ), + .rx_mcs_80p80 =cpu_to_le16 (0xffff ), + .tx_mcs_80p80 =cpu_to_le16 (0xffff ), + }, }, - .he_mcs_nss_supp = { - .rx_mcs_80 =cpu_to_le16 (0xfffa ), - .tx_mcs_80 =cpu_to_le16 (0xfffa ), - .rx_mcs_160 =cpu_to_le16 (0xffff ), - .tx_mcs_160 =cpu_to_le16 (0xffff ), - .rx_mcs_80p80 =cpu_to_le16 (0xffff ), - .tx_mcs_80p80 =cpu_to_le16 (0xffff ), + }, +#ifdef CONFIG_MAC80211_MESH + { +/* TODO: should we support other types, e.g., IBSS?*/ + .types_mask =BIT (NL80211_IFTYPE_MESH_POINT ), + .he_cap = { + .has_he = true, + .he_cap_elem = { + .mac_cap_info[0 ] = +IEEE80211_HE_MAC_CAP0_HTC_HE , + .mac_cap_info[1 ] = +IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8 , + .mac_cap_info[2 ] = +IEEE80211_HE_MAC_CAP2_ACK_EN , + .mac_cap_info[3 ] = +IEEE80211_HE_MAC_CAP3_OMI_CONTROL | +IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2 , + .mac_cap_info[4 ] =IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU , + .phy_cap_info[1 ] = +IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | +IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | +IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | +IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS , + .phy_cap_info[2 ] =0 , + +/* Leave all the other PHY capability bytes +* unset, as DCM, beam forming, RU and PPE +* threshold information are not supported +*/ + }, + .he_mcs_nss_supp = { + .rx_mcs_80 =cpu_to_le16 (0xfffa ), + .tx_mcs_80 =cpu_to_le16 (0xfffa ), + .rx_mcs_160 =cpu_to_le16 (0xffff ), + .tx_mcs_160 =cpu_to_le16 (0xffff ), + .rx_mcs_80p80 =cpu_to_le16 (0xffff ), + .tx_mcs_80p80 =cpu_to_le16 (0xffff ), + }, }, }, +#endif }; -static const struct ieee80211_sband_iftype_data he_capa_5ghz = { -/* TODO: should we support other types, e.g., P2P?*/ - .types_mask =BIT (NL80211_IFTYPE_STATION ) |BIT (NL80211_IFTYPE_AP ), - .he_cap = { - .has_he = true, - .he_cap_elem = { - .mac_cap_info[0 ] = -IEEE80211_HE_MAC_CAP0_HTC_HE , - .mac_cap_info[1 ] = -IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US | -IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8 , - .mac_cap_info[2 ] = -IEEE80211_HE_MAC_CAP2_BSR | -IEEE80211_HE_MAC_CAP2_MU_CASCADING | -IEEE80211_HE_MAC_CAP2_ACK_EN , - .mac_cap_info[3 ] = -IEEE80211_HE_MAC_CAP3_OMI_CONTROL | -IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2 , - .mac_cap_info[4 ] =IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU , - .phy_cap_info[0 ] = -IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | -IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G | -IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G , - .phy_cap_info[1 ] = -IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | -IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | -IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | -IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS , - .phy_cap_info[2 ] = - IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US | -IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ | -IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ | -IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO | -IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO , - -/* Leave all the other PHY capability bytes unset, as -* DCM, beam forming, RU and PPE threshold information -* are not supported -*/ +static const struct ieee80211_sband_iftype_data he_capa_5ghz[] = { + { +/* TODO: should we support other types, e.g., P2P?*/ + .types_mask =BIT (NL80211_IFTYPE_STATION ) | +BIT (NL80211_IFTYPE_AP ), + .he_cap = { + .has_he = true, + .he_cap_elem = { + .mac_cap_info[0 ] = +IEEE80211_HE_MAC_CAP0_HTC_HE , + .mac_cap_info[1 ] = +IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US | +IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8 , + .mac_cap_info[2 ] = +IEEE80211_HE_MAC_CAP2_BSR | +IEEE80211_HE_MAC_CAP2_MU_CASCADING | +IEEE80211_HE_MAC_CAP2_ACK_EN , + .mac_cap_info[3 ] = +IEEE80211_HE_MAC_CAP3_OMI_CONTROL | +IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2 , + .mac_cap_info[4 ] =IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU , + .phy_cap_info[0 ] = +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G | +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G , + .phy_cap_info[1 ] = +IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | +IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | +IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | +IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS , + .phy_cap_info[2 ] = + IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US | +IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ | +IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ | +IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO | +IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO , + +/* Leave all the other PHY capability bytes +* unset, as DCM, beam forming, RU and PPE +* threshold information are not supported +*/ + }, + .he_mcs_nss_supp = { + .rx_mcs_80 =cpu_to_le16 (0xfffa ), + .tx_mcs_80 =cpu_to_le16 (0xfffa ), + .rx_mcs_160 =cpu_to_le16 (0xfffa ), + .tx_mcs_160 =cpu_to_le16 (0xfffa ), + .rx_mcs_80p80 =cpu_to_le16 (0xfffa ), + .tx_mcs_80p80 =cpu_to_le16 (0xfffa ), + }, }, - .he_mcs_nss_supp = { - .rx_mcs_80 =cpu_to_le16 (0xfffa ), - .tx_mcs_80 =cpu_to_le16 (0xfffa ), - .rx_mcs_160 =cpu_to_le16 (0xfffa ), - .tx_mcs_160 =cpu_to_le16 (0xfffa ), - .rx_mcs_80p80 =cpu_to_le16 (0xfffa ), - .tx_mcs_80p80 =cpu_to_le16 (0xfffa ), + }, +#ifdef CONFIG_MAC80211_MESH + { +/* TODO: should we support other types, e.g., IBSS?*/ + .types_mask =BIT (NL80211_IFTYPE_MESH_POINT ), + .he_cap = { + .has_he = true, + .he_cap_elem = { + .mac_cap_info[0 ] = +IEEE80211_HE_MAC_CAP0_HTC_HE , + .mac_cap_info[1 ] = +IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8 , + .mac_cap_info[2 ] = +IEEE80211_HE_MAC_CAP2_ACK_EN , + .mac_cap_info[3 ] = +IEEE80211_HE_MAC_CAP3_OMI_CONTROL | +IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2 , + .mac_cap_info[4 ] =IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU , + .phy_cap_info[0 ] = +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G | +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G , + .phy_cap_info[1 ] = +IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | +IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | +IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | +IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS , + .phy_cap_info[2 ] =0 , + +/* Leave all the other PHY capability bytes +* unset, as DCM, beam forming, RU and PPE +* threshold information are not supported +*/ + }, + .he_mcs_nss_supp = { + .rx_mcs_80 =cpu_to_le16 (0xfffa ), + .tx_mcs_80 =cpu_to_le16 (0xfffa ), + .rx_mcs_160 =cpu_to_le16 (0xfffa ), + .tx_mcs_160 =cpu_to_le16 (0xfffa ), + .rx_mcs_80p80 =cpu_to_le16 (0xfffa ), + .tx_mcs_80p80 =cpu_to_le16 (0xfffa ), + }, }, }, +#endif };static void mac80211_hswim_he_capab (struct ieee80211_supported_band *sband) { -if (sband->band ==NL80211_BAND_2GHZ ) +u16 n_iftype_data; + +if (sband->band ==NL80211_BAND_2GHZ ) { + n_iftype_data =ARRAY_SIZE (he_capa_2ghz); sband->iftype_data = - (struct ieee80211_sband_iftype_data *)&he_capa_2ghz; -else if (sband->band ==NL80211_BAND_5GHZ ) + (struct ieee80211_sband_iftype_data *)he_capa_2ghz; + }else if (sband->band ==NL80211_BAND_5GHZ ) { + n_iftype_data =ARRAY_SIZE (he_capa_5ghz); sband->iftype_data = - (struct ieee80211_sband_iftype_data *)&he_capa_5ghz; -else + (struct ieee80211_sband_iftype_data *)he_capa_5ghz; + }else {return ; + } - sband->n_iftype_data =1 ; + sband->n_iftype_data = n_iftype_data; }#ifdef CONFIG_MAC80211_MESH
Signature · 1 line
2.20.1
RFC PATCH 2/2 mac80211: implement HE support for mesh
From: Sven Eckelmann <[email protected]>
Implement the basics required for supporting high efficiency with mesh:
include HE information elements in beacons, probe responses, and peering action frames, and check for compatible HE configurations when peering.
Signed-off-by Sven Eckelmann <[email protected]>
--- include/net/cfg80211.h | 19 ++++++++++++ net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/mesh.c | 61 ++++++++++++++++++++++++++++++++++++++ net/mac80211/mesh.h | 4 +++ net/mac80211/mesh_plink.c | 11 ++++++- net/mac80211/util.c | 52 ++++++++++++++++++++++++++++++++ 6 files changed, 148 insertions(+), 1 deletion(-)
include/net/cfg80211.h +19 -0
@@ -399,6 +399,25 @@ ieee80211_get_he_sta_cap(const struct ieee80211_supported_band *sband)return NULL ; } +/** +* ieee80211_get_he_mesh_cap - return HE capabilities for an sband's mesh STA +* @sband: the sband to search for the mesh STA on +* +* Return: pointer to the struct ieee80211_sta_he_cap, or NULL is none found +*/ +static inline const struct ieee80211_sta_he_cap * +ieee80211_get_he_mesh_cap (const struct ieee80211_supported_band *sband) +{ +const struct ieee80211_sband_iftype_data *data = +ieee80211_get_sband_iftype_data (sband, +NL80211_IFTYPE_MESH_POINT ); + +if (data && data->he_cap.has_he) +return &data->he_cap; + +return NULL ; +} +/** * wiphy_read_of_freq_limits - read frequency limits from device tree *
net/mac80211/ieee80211_i.h +2 -0
@@ -2126,9 +2126,11 @@ u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap, u32 cap);u8 *ieee80211_ie_build_vht_oper (u8 *pos,struct ieee80211_sta_vht_cap *vht_cap,const struct cfg80211_chan_def *chandef); +u8 ieee80211_ie_len_he_cap (struct ieee80211_sub_if_data *sdata);u8 *ieee80211_ie_build_he_cap (u8 *pos,const struct ieee80211_sta_he_cap *he_cap,u8 *end); +u8 *ieee80211_ie_build_he_oper (u8 *pos);int ieee80211_parse_bitrates (struct cfg80211_chan_def *chandef,const struct ieee80211_supported_band *sband,const u8 *srates,int srates_len,u32 *rates);
net/mac80211/mesh.c +61 -0
91 lines not on this page · raw message
net/mac80211/mesh.h +4 -0
@@ -221,6 +221,10 @@ int mesh_add_vht_cap_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb);int mesh_add_vht_oper_ie (struct ieee80211_sub_if_data *sdata,struct sk_buff *skb); +int mesh_add_he_cap_ie (struct ieee80211_sub_if_data *sdata, +struct sk_buff *skb,u8 ie_len); +int mesh_add_he_oper_ie (struct ieee80211_sub_if_data *sdata, +struct sk_buff *skb);void mesh_rmc_free (struct ieee80211_sub_if_data *sdata);int mesh_rmc_init (struct ieee80211_sub_if_data *sdata);void ieee80211s_init (void );
net/mac80211/mesh_plink.c +10 -1
@@ -221,9 +221,11 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,bool include_plid = false;u16 peering_proto =0 ;u8 *pos, ie_len =4 ; +u8 ie_len_he_cap; int hdr_len = offsetofend(struct ieee80211_mgmt, u.action.u.self_prot);int err = -ENOMEM ; + ie_len_he_cap =ieee80211_ie_len_he_cap (sdata); skb = dev_alloc_skb(local->tx_headroom + hdr_len + 2 + /* capability info */
@@ -236,6 +238,8 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,2 +sizeof (struct ieee80211_ht_operation ) +2 +sizeof (struct ieee80211_vht_cap ) +2 +sizeof (struct ieee80211_vht_operation ) + + ie_len_he_cap + +2 +1 +sizeof (struct ieee80211_he_operation ) +2 +8 +/* peering IE */ sdata->u.mesh.ie_len);if (!skb)
@@ -324,7 +328,9 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,if (mesh_add_ht_cap_ie (sdata, skb) ||mesh_add_ht_oper_ie (sdata, skb) ||mesh_add_vht_cap_ie (sdata, skb) || -mesh_add_vht_oper_ie (sdata, skb)) +mesh_add_vht_oper_ie (sdata, skb) || +mesh_add_he_cap_ie (sdata, skb, ie_len_he_cap) || +mesh_add_he_oper_ie (sdata, skb)) goto free; }
@@ -436,6 +442,9 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,ieee80211_vht_cap_ie_to_sta_vht_cap (sdata, sband, elems->vht_cap_elem, sta); +ieee80211_he_cap_ie_to_sta_he_cap (sdata, sband, elems->he_cap, + elems->he_cap_len, sta); +if (bw != sta->sta.bandwidth) changed |=IEEE80211_RC_BW_CHANGED ;
net/mac80211/util.c +52 -0
64 lines not on this page · raw message
Signature · 1 line
2.20.1