On 5/18/2024 11:23 AM, Karthikeyan Periyasamy wrote:
Currently, the interface combination input parameter num_different_channels and iftype_num are directly filled in by the caller under the assumption that all channels and interfaces belong to a single hardware device. This assumption is incorrect for multi-device interface combinations because each device supports a different set of channels and interfaces. As discussed in [1], need to refactor the input parameters to encode enough data to handle both single and multiple device interface combinations. This can be achieved by encoding the frequency parameter under the link entity and interface type parameter under the interface entity, which can hold an array of link entities. This is because, in the MLO scenario, a single interface can support multiple links. With this new input parameter structure, the cfg80211 can classify and construct the device parameters, then verify them against the device specific interface combinations. [1]: https://lore.kernel.org/linux-wireless/ca70eeb3cdee1e8c3caee69db595bc8160eb4115.camel@xxxxxxxxxxxxxxxx/ Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@xxxxxxxxxxx> --- v2: - changed the argument of ieee80211_check_combinations() - changed the iface_combination_interface::num_link into iface_combination_interface::valid_links - Moved the new_beacon_int, radar_detect under the iface link param - Moved the ieee80211_link_or_deflink() helper under the util - Moved the ieee80211_link_get_chanctx() helper under the ieee80211_i.h - Removed ieee80211_chanctx_radar_detect() drivers/net/wireless/ath/wil6210/cfg80211.c | 44 ++- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 60 +++- .../net/wireless/quantenna/qtnfmac/cfg80211.c | 32 +- include/net/cfg80211.h | 51 +++- net/mac80211/cfg.c | 40 +-- net/mac80211/chan.c | 16 +- net/mac80211/ibss.c | 7 +- net/mac80211/ieee80211_i.h | 20 +- net/mac80211/iface.c | 7 +- net/mac80211/util.c | 280 +++++++++++++----- net/wireless/util.c | 90 ++++-- 11 files changed, 464 insertions(+), 183 deletions(-)
...
+/** + * struct iface_combination_interface - Interface parameter for iface combination + * + * Used to pass interface specific parameter for iface combination + * + * @iftype: interface type as specified in &enum nl80211_iftype. + * @links: array with the number of link parameter used for verification + * @valid_links: bitmap of valid links, or 0 for non-MLO.
Will correct the comments for valid_links in the next version. It should be like below
@valid_links: bitmap of valid links.
+ */ +struct iface_combination_interface { + enum nl80211_iftype iftype; + struct iface_combination_iface_link links[IEEE80211_MLD_MAX_NUM_LINKS]; + u16 valid_links; +};
-- Karthikeyan Periyasamy -- கார்த்திகேயன் பெரியசாமி