2018-06-30 11:49:39

by Luca Coelho

[permalink] [raw]
Subject: [PATCH] mac80211_hwsim: Add support for HE

From: Ilan Peer <[email protected]>

Add support for HE in mac8011_hwsim, conforming with P802.11ax_D2.0.

Signed-off-by: Liad Kaufman <[email protected]>
Signed-off-by: Ilan Peer <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/mac80211_hwsim.c | 123 ++++++++++++++++++++++++++
1 file changed, 123 insertions(+)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 9825bfd42abc..026a9c209545 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2,6 +2,7 @@
* mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211
* Copyright (c) 2008, Jouni Malinen <[email protected]>
* Copyright (c) 2011, Javier Lopez <[email protected]>
+ * Copyright (c) 2016 - 2017 Intel Deutschland GmbH
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -2517,6 +2518,123 @@ 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 = 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_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_GRP_ADDR_MULTI_STA_BA_DL_MU |
+ IEEE80211_HE_MAC_CAP3_OMI_CONTROL |
+ IEEE80211_HE_MAC_CAP3_MAX_A_AMPDU_LEN_EXP_VHT_2,
+ .mac_cap_info[4] = IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU,
+ .phy_cap_info[0] =
+ IEEE80211_HE_PHY_CAP0_DUAL_BAND,
+ .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_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_msc_80 = cpu_to_le16(0xfffa),
+ .tx_msc_80 = cpu_to_le16(0xfffa),
+ .rx_msc_160 = cpu_to_le16(0xffff),
+ .tx_msc_160 = cpu_to_le16(0xffff),
+ .rx_msc_80p80 = cpu_to_le16(0xffff),
+ .tx_msc_80p80 = cpu_to_le16(0xffff),
+ },
+ },
+};
+
+static const struct ieee80211_sband_iftype_data he_capa_5ghz = {
+ /* TODO: should we support other types, e.g., P2P?*/
+ .types = 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_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_GRP_ADDR_MULTI_STA_BA_DL_MU |
+ IEEE80211_HE_MAC_CAP3_OMI_CONTROL |
+ IEEE80211_HE_MAC_CAP3_MAX_A_AMPDU_LEN_EXP_VHT_2,
+ .mac_cap_info[4] = IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU,
+ .phy_cap_info[0] =
+ IEEE80211_HE_PHY_CAP0_DUAL_BAND |
+ 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_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_msc_80 = cpu_to_le16(0xfffa),
+ .tx_msc_80 = cpu_to_le16(0xfffa),
+ .rx_msc_160 = cpu_to_le16(0xfffa),
+ .tx_msc_160 = cpu_to_le16(0xfffa),
+ .rx_msc_80p80 = cpu_to_le16(0xfffa),
+ .tx_msc_80p80 = cpu_to_le16(0xfffa),
+ },
+ },
+};
+
+static void mac80211_hswim_he_capab(struct ieee80211_supported_band *sband)
+{
+ if (sband->band == NL80211_BAND_2GHZ)
+ sband->iftype_data =
+ (struct ieee80211_sband_iftype_data *)&he_capa_2ghz;
+ else if (sband->band == NL80211_BAND_5GHZ)
+ sband->iftype_data =
+ (struct ieee80211_sband_iftype_data *)&he_capa_5ghz;
+ else
+ return;
+
+ sband->n_iftype_data = 1;
+}
+
static int mac80211_hwsim_new_radio(struct genl_info *info,
struct hwsim_new_radio_params *param)
{
@@ -2678,6 +2796,9 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,

for (band = NL80211_BAND_2GHZ; band < NUM_NL80211_BANDS; band++) {
struct ieee80211_supported_band *sband = &data->bands[band];
+
+ sband->band = band;
+
switch (band) {
case NL80211_BAND_2GHZ:
sband->channels = data->channels_2ghz;
@@ -2734,6 +2855,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
sband->ht_cap.mcs.rx_mask[1] = 0xff;
sband->ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED;

+ mac80211_hswim_he_capab(sband);
+
hw->wiphy->bands[band] = sband;
}

--
2.18.0


2018-06-30 18:56:09

by Arend Van Spriel

[permalink] [raw]
Subject: Re: [PATCH] mac80211_hwsim: Add support for HE

On 6/30/2018 5:42 PM, kbuild test robot wrote:
> 2560 .he_mcs_nss_supp = {
>> >2561 .rx_msc_80 = cpu_to_le16(0xfffa),
>> >2562 .tx_msc_80 = cpu_to_le16(0xfffa),
>> >2563 .rx_msc_160 = cpu_to_le16(0xffff),
>> >2564 .tx_msc_160 = cpu_to_le16(0xffff),
>> >2565 .rx_msc_80p80 = cpu_to_le16(0xffff),
>> >2566 .tx_msc_80p80 = cpu_to_le16(0xffff),
> 2567 },

I believe I commented in earlier version that those fields in the type
defintion should be mcs iso msc and this initializer did not get fixed?

Regards,
Arend

2018-06-30 15:42:47

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] mac80211_hwsim: Add support for HE

Hi Ilan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on mac80211-next/master]
[also build test ERROR on v4.18-rc2 next-20180629]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Luca-Coelho/mac80211_hwsim-Add-support-for-HE/20180630-195038
base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: openrisc-allyesconfig (attached as .config)
compiler: or1k-linux-gcc (GCC) 6.0.0 20160327 (experimental)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=openrisc

All errors (new ones prefixed by >>):

>> drivers/net//wireless/mac80211_hwsim.c:2523:2: error: unknown field 'types' specified in initializer
.types = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP),
^
>> drivers/net//wireless/mac80211_hwsim.c:2561:4: error: unknown field 'rx_msc_80' specified in initializer
.rx_msc_80 = cpu_to_le16(0xfffa),
^
>> drivers/net//wireless/mac80211_hwsim.c:2562:4: error: unknown field 'tx_msc_80' specified in initializer
.tx_msc_80 = cpu_to_le16(0xfffa),
^
>> drivers/net//wireless/mac80211_hwsim.c:2563:4: error: unknown field 'rx_msc_160' specified in initializer
.rx_msc_160 = cpu_to_le16(0xffff),
^
>> drivers/net//wireless/mac80211_hwsim.c:2564:4: error: unknown field 'tx_msc_160' specified in initializer
.tx_msc_160 = cpu_to_le16(0xffff),
^
>> drivers/net//wireless/mac80211_hwsim.c:2565:4: error: unknown field 'rx_msc_80p80' specified in initializer
.rx_msc_80p80 = cpu_to_le16(0xffff),
^
>> drivers/net//wireless/mac80211_hwsim.c:2566:4: error: unknown field 'tx_msc_80p80' specified in initializer
.tx_msc_80p80 = cpu_to_le16(0xffff),
^
drivers/net//wireless/mac80211_hwsim.c:2573:2: error: unknown field 'types' specified in initializer
.types = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP),
^
drivers/net//wireless/mac80211_hwsim.c:2614:4: error: unknown field 'rx_msc_80' specified in initializer
.rx_msc_80 = cpu_to_le16(0xfffa),
^
drivers/net//wireless/mac80211_hwsim.c:2615:4: error: unknown field 'tx_msc_80' specified in initializer
.tx_msc_80 = cpu_to_le16(0xfffa),
^
drivers/net//wireless/mac80211_hwsim.c:2616:4: error: unknown field 'rx_msc_160' specified in initializer
.rx_msc_160 = cpu_to_le16(0xfffa),
^
drivers/net//wireless/mac80211_hwsim.c:2617:4: error: unknown field 'tx_msc_160' specified in initializer
.tx_msc_160 = cpu_to_le16(0xfffa),
^
drivers/net//wireless/mac80211_hwsim.c:2618:4: error: unknown field 'rx_msc_80p80' specified in initializer
.rx_msc_80p80 = cpu_to_le16(0xfffa),
^
drivers/net//wireless/mac80211_hwsim.c:2619:4: error: unknown field 'tx_msc_80p80' specified in initializer
.tx_msc_80p80 = cpu_to_le16(0xfffa),
^

vim +/rx_msc_80 +2561 drivers/net//wireless/mac80211_hwsim.c

2520
2521 static const struct ieee80211_sband_iftype_data he_capa_2ghz = {
2522 /* TODO: should we support other types, e.g., P2P?*/
> 2523 .types = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP),
2524 .he_cap = {
2525 .has_he = true,
2526 .he_cap_elem = {
2527 .mac_cap_info[0] =
2528 IEEE80211_HE_MAC_CAP0_HTC_HE,
2529 .mac_cap_info[1] =
2530 IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US |
2531 IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_QOS_8,
2532 .mac_cap_info[2] =
2533 IEEE80211_HE_MAC_CAP2_BSR |
2534 IEEE80211_HE_MAC_CAP2_MU_CASCADING |
2535 IEEE80211_HE_MAC_CAP2_ACK_EN,
2536 .mac_cap_info[3] =
2537 IEEE80211_HE_MAC_CAP3_GRP_ADDR_MULTI_STA_BA_DL_MU |
2538 IEEE80211_HE_MAC_CAP3_OMI_CONTROL |
2539 IEEE80211_HE_MAC_CAP3_MAX_A_AMPDU_LEN_EXP_VHT_2,
2540 .mac_cap_info[4] = IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU,
2541 .phy_cap_info[0] =
2542 IEEE80211_HE_PHY_CAP0_DUAL_BAND,
2543 .phy_cap_info[1] =
2544 IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK |
2545 IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A |
2546 IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD |
2547 IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_MAX_NSTS,
2548 .phy_cap_info[2] =
2549 IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US |
2550 IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ |
2551 IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ |
2552 IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO |
2553 IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO,
2554
2555 /* Leave all the other PHY capability bytes unset, as
2556 * DCM, beam forming, RU and PPE threshold information
2557 * are not supported
2558 */
2559 },
2560 .he_mcs_nss_supp = {
> 2561 .rx_msc_80 = cpu_to_le16(0xfffa),
> 2562 .tx_msc_80 = cpu_to_le16(0xfffa),
> 2563 .rx_msc_160 = cpu_to_le16(0xffff),
> 2564 .tx_msc_160 = cpu_to_le16(0xffff),
> 2565 .rx_msc_80p80 = cpu_to_le16(0xffff),
> 2566 .tx_msc_80p80 = cpu_to_le16(0xffff),
2567 },
2568 },
2569 };
2570

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (5.31 kB)
.config.gz (44.39 kB)
Download all attachments

2018-07-01 05:46:45

by Luca Coelho

[permalink] [raw]
Subject: Re: [PATCH] mac80211_hwsim: Add support for HE

On Sat, 2018-06-30 at 20:56 +0200, Arend van Spriel wrote:
> On 6/30/2018 5:42 PM, kbuild test robot wrote:
> > 2560 .he_mcs_nss_supp = {
> > > > 2561 .rx_msc_80 =
> > > > cpu_to_le16(0xfffa),
> > > > 2562 .tx_msc_80 =
> > > > cpu_to_le16(0xfffa),
> > > > 2563 .rx_msc_160 =
> > > > cpu_to_le16(0xffff),
> > > > 2564 .tx_msc_160 =
> > > > cpu_to_le16(0xffff),
> > > > 2565 .rx_msc_80p80 =
> > > > cpu_to_le16(0xffff),
> > > > 2566 .tx_msc_80p80 =
> > > > cpu_to_le16(0xffff),
> >
> > 2567 },
>
> I believe I commented in earlier version that those fields in the
> type
> defintion should be mcs iso msc and this initializer did not get
> fixed?

Ugh, yes, this doesn't even compile with the code Johannes merged. I
applied the patches on top of the old version of the cfg/mac changes...

I'll resend.

--
Cheers,
Luca.