git: 906521f8176b - main - LinuxKPI: 802.11: return proper value for IEEE80211_CRYPTO_AES_CCM

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Tue, 12 Mar 2024 23:00:36 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=906521f8176b13533556d742db4ab28e847b85c0

commit 906521f8176b13533556d742db4ab28e847b85c0
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-03-04 23:03:58 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-03-12 22:59:11 +0000

    LinuxKPI: 802.11: return proper value for IEEE80211_CRYPTO_AES_CCM
    
    In case of LKPI_80211_HW_CRYPTO we convert from LinuxKPI cipher_suites
    to net80211 ic_cryptocaps fields. For WLAN_CIPHER_SUITE_CCMP we
    accidentally returned the bit number instead of the shifted value
    which leads to ieee80211_crypto_newkey() setting IEEE80211_KEY_SWCRYPT,
    which in turned lead to us trying to decode the frame again despite
    HW had already done it.  This was found out of a discussion in D43634.
    
    MFC after:      3 days
    Reviewed by:    cc, adrian
    Differential Revision: https://reviews.freebsd.org/D44208
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index ced2f2dc8cca..df3b0bc467f2 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -546,7 +546,7 @@ lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite)
 	case WLAN_CIPHER_SUITE_TKIP:
 		return (IEEE80211_CRYPTO_TKIP);
 	case WLAN_CIPHER_SUITE_CCMP:
-		return (IEEE80211_CIPHER_AES_CCM);
+		return (IEEE80211_CRYPTO_AES_CCM);
 	case WLAN_CIPHER_SUITE_WEP104:
 		return (IEEE80211_CRYPTO_WEP);
 	case WLAN_CIPHER_SUITE_AES_CMAC: