Date: Tue, 29 Apr 2025 11:41:39 GMT From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: a638734e4a5c - stable/14 - net80211: add driver / crypto methods to set the hardware / software cipher suites Message-ID: <202504291141.53TBfd0u045805@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a638734e4a5c1bb22b30760f9fa9d3f2ac037780 commit a638734e4a5c1bb22b30760f9fa9d3f2ac037780 Author: Adrian Chadd <adrian@FreeBSD.org> AuthorDate: 2024-04-18 01:47:07 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2025-04-29 10:49:28 +0000 net80211: add driver / crypto methods to set the hardware / software cipher suites Drivers currently announce hardware crypto cipher support by setting up ic_cryptocaps. This adds two public function calls: * ieee80211_set_software_ciphers() - set the software cipher set; * ieee80211_set_hardware_ciphers() - set the hardware cipher set. For now these just call into the newly crypto routines to set the ciphers. This then adds the two crypto routines, similarly named, to set the hardware/software cipher suite. This is a no-op right now - wep/tkip/ccmp are already set by default so drivers aren't required to call these routines for software encryption, and drivers already set ic_cryptocaps for hardware encryption. Differential Revision: https://reviews.freebsd.org/D44827 (cherry picked from commit e9961ea164968bf2bdab210eab69201b4bf2cb37) --- sys/net80211/ieee80211.c | 22 ++++++++++++++++++++++ sys/net80211/ieee80211_crypto.c | 21 +++++++++++++++++++++ sys/net80211/ieee80211_crypto.h | 4 ++++ sys/net80211/ieee80211_var.h | 4 ++++ 4 files changed, 51 insertions(+) diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 0aaded2bdbcd..cdfb7654ee40 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -434,6 +434,28 @@ ieee80211_ifdetach(struct ieee80211com *ic) IEEE80211_LOCK_DESTROY(ic); } +/* + * Called by drivers during attach to set the supported + * cipher set for software encryption. + */ +void +ieee80211_set_software_ciphers(struct ieee80211com *ic, + uint32_t cipher_suite) +{ + ieee80211_crypto_set_supported_software_ciphers(ic, cipher_suite); +} + +/* + * Called by drivers during attach to set the supported + * cipher set for hardware encryption. + */ +void +ieee80211_set_hardware_ciphers(struct ieee80211com *ic, + uint32_t cipher_suite) +{ + ieee80211_crypto_set_supported_hardware_ciphers(ic, cipher_suite); +} + struct ieee80211com * ieee80211_find_com(const char *name) { diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c index fef63390c27b..16803fa59141 100644 --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -164,6 +164,27 @@ ieee80211_crypto_detach(struct ieee80211com *ic) { } +/* + * Set the supported ciphers for software encryption. + */ +void +ieee80211_crypto_set_supported_software_ciphers(struct ieee80211com *ic, + uint32_t cipher_set) +{ + ic->ic_sw_cryptocaps = cipher_set; +} + +/* + * Set the supported ciphers for hardware encryption. + */ +void +ieee80211_crypto_set_supported_hardware_ciphers(struct ieee80211com *ic, + uint32_t cipher_set) +{ + ic->ic_cryptocaps = cipher_set; +} + + /* * Setup crypto support for a vap. */ diff --git a/sys/net80211/ieee80211_crypto.h b/sys/net80211/ieee80211_crypto.h index fcc6973dd62e..68143f66aaf5 100644 --- a/sys/net80211/ieee80211_crypto.h +++ b/sys/net80211/ieee80211_crypto.h @@ -180,6 +180,10 @@ MALLOC_DECLARE(M_80211_CRYPTO); void ieee80211_crypto_attach(struct ieee80211com *); void ieee80211_crypto_detach(struct ieee80211com *); +void ieee80211_crypto_set_supported_software_ciphers(struct ieee80211com *, + uint32_t cipher_set); +void ieee80211_crypto_set_supported_hardware_ciphers(struct ieee80211com *, + uint32_t cipher_set); void ieee80211_crypto_vattach(struct ieee80211vap *); void ieee80211_crypto_vdetach(struct ieee80211vap *); int ieee80211_crypto_newkey(struct ieee80211vap *, diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index dd6737aedb66..552c45e5ddb2 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -765,6 +765,10 @@ MALLOC_DECLARE(M_80211_VAP); int ic_printf(struct ieee80211com *, const char *, ...) __printflike(2, 3); void ieee80211_ifattach(struct ieee80211com *); void ieee80211_ifdetach(struct ieee80211com *); +void ieee80211_set_software_ciphers(struct ieee80211com *, + uint32_t cipher_suite); +void ieee80211_set_hardware_ciphers(struct ieee80211com *, + uint32_t cipher_suite); int ieee80211_vap_setup(struct ieee80211com *, struct ieee80211vap *, const char name[IFNAMSIZ], int unit, enum ieee80211_opmode opmode, int flags,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202504291141.53TBfd0u045805>