diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -434,6 +434,30 @@ IEEE80211_LOCK_DESTROY(ic); } +/* + * Called by drivers during setup to set the supported + * cipher set for software encryption. + */ +void +ieee80211_set_software_cipher_set(struct ieee80211com *ic, + uint32_t cipher_suite) +{ + ieee80211_crypto_set_supported_software_ciphers(ic, + cipher_suite); +} + +/* + * Called by drivers during setup to set the supported + * cipher set for hardware encryption. + */ +void +ieee80211_set_hardware_cipher_set(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.h b/sys/net80211/ieee80211_crypto.h --- a/sys/net80211/ieee80211_crypto.h +++ b/sys/net80211/ieee80211_crypto.h @@ -162,6 +162,10 @@ 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_crypto.c b/sys/net80211/ieee80211_crypto.c --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -164,6 +164,27 @@ { } +/* + * Set the supported ciphers for software encryption. + */ +void +ieee80211_crypto_set_supported_software_ciphers(struct ieee80211com *ic, + uint32_t cipher_set) +{ + ic->ic_supp_cryptocaps = cipher_set; +} + +/* + * Set the supporter 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_var.h b/sys/net80211/ieee80211_var.h --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -751,6 +751,10 @@ int ic_printf(struct ieee80211com *, const char *, ...) __printflike(2, 3); void ieee80211_ifattach(struct ieee80211com *); void ieee80211_ifdetach(struct ieee80211com *); +void ieee80211_set_software_cipher_set(struct ieee80211com *, + uint32_t cipher_suite); +void ieee80211_set_hardware_cipher_set(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,