Driver implementation to collect the EHT capabilities of the Device and register it to the wiphy capabilities in the cfg80211 driver. Signed-off-by: Gokul Sivakumar --- drivers/net/wireless/infineon/inffmac/eht.c | 86 +++++++++++++++++++++ drivers/net/wireless/infineon/inffmac/eht.h | 42 ++++++++++ 2 files changed, 128 insertions(+) create mode 100644 drivers/net/wireless/infineon/inffmac/eht.c create mode 100644 drivers/net/wireless/infineon/inffmac/eht.h diff --git a/drivers/net/wireless/infineon/inffmac/eht.c b/drivers/net/wireless/infineon/inffmac/eht.c new file mode 100644 index 000000000000..78434c10713b --- /dev/null +++ b/drivers/net/wireless/infineon/inffmac/eht.c @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: ISC +/* + * Copyright (c) 2025, Infineon Technologies AG, or an affiliate of Infineon Technologies AG. + * All rights reserved. + */ + +#include +#include "bus.h" +#include "chip.h" +#include "eht.h" +#include "feature.h" +#include "fwil.h" +#include "cfg80211.h" +#include "debug.h" +#include "xtlv.h" + +int +inff_eht_mlo_get_enable(struct inff_if *ifp, u8 *param, int param_len) +{ + s32 ret = 0; + + ret = inff_fil_xtlv_data_get(ifp, "mlo", INFF_EHT_MLO_CMD_ENAB, param, param_len); + if (unlikely(ret)) + iphy_err(ifp->drvr, "failed to check if EHT MLO is enabled"); + + return ret; +} + +void +inff_eht_update_wiphy_cap(struct inff_if *ifp) +{ + struct inff_pub *drvr = ifp->drvr; + struct wiphy *wiphy = drvr->wiphy; + struct ieee80211_supported_band *band; + struct ieee80211_sband_iftype_data *data; + struct inff_bus *bus_if; + struct inff_chip *ci; + struct inff_chip_mlo_priv *chip_mlo_priv; + u8 eht_mlo_mode; + u8 i; + s32 ret = 0; + + /* EHT MLO mode */ + if (!inff_feat_is_enabled(ifp, INFF_FEAT_MLO)) + return; + ret = inff_eht_mlo_get_enable(ifp, &eht_mlo_mode, sizeof(eht_mlo_mode)); + if (ret || !eht_mlo_mode) + return; + bus_if = drvr->bus_if; + ci = bus_if->chip_pub; + chip_mlo_priv = &ci->chip_mlo_priv; + + if (!chip_mlo_priv->get_eht_cap) + return; + + inff_dbg(INFO, "EHT MLO Enabled\n"); + + /* Update HE Capab for each Band */ + for (i = 0; i < ARRAY_SIZE(wiphy->bands); i++) { + band = wiphy->bands[i]; + if (!band) + continue; + + data = (struct ieee80211_sband_iftype_data *)band->iftype_data; + + switch (band->band) { + case NL80211_BAND_6GHZ: + if (!inff_feat_is_6ghz_enabled(ifp)) + break; + /* Band 6GHz supports EHT, so */ + fallthrough; + + case NL80211_BAND_5GHZ: + /* Band 5GHz supports EHT, so */ + fallthrough; + + case NL80211_BAND_2GHZ: + /* Band 2.4GHz supports EHT, so */ + chip_mlo_priv->get_eht_cap(band, data); + break; + + default: + break; + } + } +} diff --git a/drivers/net/wireless/infineon/inffmac/eht.h b/drivers/net/wireless/infineon/inffmac/eht.h new file mode 100644 index 000000000000..a2850f1a8bfc --- /dev/null +++ b/drivers/net/wireless/infineon/inffmac/eht.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: ISC */ +/* + * Copyright (c) 2025, Infineon Technologies AG, or an affiliate of Infineon Technologies AG. + * All rights reserved. + */ + +#ifndef INFF_EHT_H +#define INFF_EHT_H + +#include "core.h" + +#define EHT_MAC_CAP_INFO_SIZE 2 +#define EHT_PHY_CAP_INFO_SIZE 9 + +/** + * enum inff_eht_mlo_cmd - EHT iovar subcmds handled by firmware EHT module + */ +/* EHT MLO sub command IDs */ +enum inff_eht_mlo_cmd { + INFF_EHT_MLO_CMD_ENAB = 0, /* enable/disable MLO feature as a whole */ + INFF_EHT_MLO_CMD_CONFIG, /* configure MLO feature - bsscfg specific */ + INFF_EHT_MLO_CMD_STATUS, /* status on MLO feature - interface specific */ + INFF_EHT_MLO_CMD_EMLSR_CTRL, /* emlsr control - interface specific */ + INFF_EHT_MLO_CMD_TID_MAP, /* configure TID-To-Link Mapping */ + INFF_EHT_MLO_CMD_CAP, /* capability of MLO feature as a whole */ + INFF_EHT_MLO_CMD_ACT_LINK_BMAP, /* Set active link for MLO TX and RX */ + INFF_EHT_MLO_CMD_MULTILINK_ACTIVE, /* Set use of multi links in MLO mode */ + INFF_EHT_MLO_CMD_LINK_PS_BMAP, /* Modify PS state of a particular link in MLO. */ + INFF_EHT_MLO_CMD_LINK_DORMANT_BMAP, /* Bitmap to configure dormant state for links */ + INFF_EHT_MLO_CMD_REC_LINK_BMAP, /* Bitmap to configure recommended links */ + INFF_EHT_MLO_CMD_CONFIG_PREF, /* Configure mlo mode and band preferences */ + INFF_EHT_MLO_CMD_MAX_MLO_LINKS, /* set/get max MLO links supported */ + INFF_EHT_MLO_CMD_FEATURE_EN, /* Enable/Disable a given feature */ + INFF_EHT_MLO_CMD_NPLINK_CONFIG, /* configure nplink op upon offchannel of plink */ + INFF_EHT_MLO_CMD_STATS, /* stats on MLO feature */ + /* Add new sub command IDs here... */ +}; + +int inff_eht_mlo_get_enable(struct inff_if *ifp, u8 *param, int param_len); +void inff_eht_update_wiphy_cap(struct inff_if *ifp); + +#endif /* INFF_EHT_H */ -- 2.25.1