Date: Fri, 31 Jan 2025 23:53:42 GMT From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: c75a558d0729 - main - LinuxKPI: 802.11: implement ieee80211_get_{he,eht}_iftype_cap{,_vif} Message-ID: <202501312353.50VNrgTp016970@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c75a558d0729da87ee3c016b57cc8f5ac4fc65d0 commit c75a558d0729da87ee3c016b57cc8f5ac4fc65d0 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2025-01-25 11:46:58 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2025-01-31 23:53:30 +0000 LinuxKPI: 802.11: implement ieee80211_get_{he,eht}_iftype_cap{,_vif} Implement the combination of all four functions, the *_vif versions from mac80211.h as a wrapper to the non-*_vif ones in cfg80211.h. Put the function pairs next to each other and in the right files and harmonize argument naming, etc. Both of them have shown up too often in the todo-tracing to bother enough to implement them now for a time in the future when we will support HE/EHT. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 34 +++++++++++++++++++++-- sys/compat/linuxkpi/common/include/net/mac80211.h | 26 ++++++++--------- 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 7780b265cf6b..0b6a66033536 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -2073,12 +2073,40 @@ ieee80211_get_sband_iftype_data(const struct ieee80211_supported_band *band, return (NULL); } -static __inline const struct ieee80211_sta_eht_cap * +static inline const struct ieee80211_sta_he_cap * +ieee80211_get_he_iftype_cap(const struct ieee80211_supported_band *band, + enum nl80211_iftype iftype) +{ + const struct ieee80211_sband_iftype_data *iftype_data; + const struct ieee80211_sta_he_cap *he_cap; + + iftype_data = ieee80211_get_sband_iftype_data(band, iftype); + if (iftype_data == NULL) + return (NULL); + + he_cap = NULL; + if (iftype_data->he_cap.has_he) + he_cap = &iftype_data->he_cap; + + return (he_cap); +} + +static inline const struct ieee80211_sta_eht_cap * ieee80211_get_eht_iftype_cap(const struct ieee80211_supported_band *band, enum nl80211_iftype iftype) { - TODO(); - return (NULL); + const struct ieee80211_sband_iftype_data *iftype_data; + const struct ieee80211_sta_eht_cap *eht_cap; + + iftype_data = ieee80211_get_sband_iftype_data(band, iftype); + if (iftype_data == NULL) + return (NULL); + + eht_cap = NULL; + if (iftype_data->eht_cap.has_eht) + eht_cap = &iftype_data->eht_cap; + + return (eht_cap); } static inline bool diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index fe36f1adf28a..68d135a441c1 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1609,7 +1609,7 @@ ieee80211_csa_finish(struct ieee80211_vif *vif, uint32_t link_id) TODO(); } -static __inline enum nl80211_iftype +static inline enum nl80211_iftype ieee80211_vif_type_p2p(struct ieee80211_vif *vif) { @@ -2275,14 +2275,6 @@ ieee80211_channel_switch_disconnect(struct ieee80211_vif *vif, bool _x) TODO(); } -static __inline const struct ieee80211_sta_he_cap * -ieee80211_get_he_iftype_cap(const struct ieee80211_supported_band *band, - enum nl80211_iftype type) -{ - TODO(); - return (NULL); -} - static __inline void ieee80211_key_mic_failure(struct ieee80211_key_conf *key) { @@ -2431,20 +2423,24 @@ ieee80211_vif_is_mld(const struct ieee80211_vif *vif) return (vif->valid_links != 0); } -static __inline const struct ieee80211_sta_he_cap * +static inline const struct ieee80211_sta_he_cap * ieee80211_get_he_iftype_cap_vif(const struct ieee80211_supported_band *band, struct ieee80211_vif *vif) { - TODO(); - return (NULL); + enum nl80211_iftype iftype; + + iftype = ieee80211_vif_type_p2p(vif); + return (ieee80211_get_he_iftype_cap(band, iftype)); } -static __inline const struct ieee80211_sta_eht_cap * +static inline const struct ieee80211_sta_eht_cap * ieee80211_get_eht_iftype_cap_vif(const struct ieee80211_supported_band *band, struct ieee80211_vif *vif) { - TODO(); - return (NULL); + enum nl80211_iftype iftype; + + iftype = ieee80211_vif_type_p2p(vif); + return (ieee80211_get_eht_iftype_cap(band, iftype)); } static inline uint32_t
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202501312353.50VNrgTp016970>