git: c8a6676eb652 - main - LinuxKPI: 802.11: crypto pn lengths

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Tue, 18 Mar 2025 09:22:15 UTC
The branch main has been updated by bz:

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

commit c8a6676eb652b59fee545dc3e24ffec21bd0cd8d
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-03-15 00:01:11 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-03-18 09:22:00 +0000

    LinuxKPI: 802.11: crypto pn lengths
    
    Define the last missing PN length and for consistency use them
    in struct ieee80211_key_seq (even though a 6 is a 6 is a 6).
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 sys/compat/linuxkpi/common/include/linux/ieee80211.h | 3 ++-
 sys/compat/linuxkpi/common/include/net/mac80211.h    | 7 +++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h
index ca1493e666c6..964fd970ecf0 100644
--- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h
+++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2020-2024 The FreeBSD Foundation
+ * Copyright (c) 2020-2025 The FreeBSD Foundation
  *
  * This software was developed by Björn Zeeb under sponsorship from
  * the FreeBSD Foundation.
@@ -64,6 +64,7 @@ struct ieee80211_mmie_16 {
 #define	IEEE80211_GCMP_MIC_LEN			16
 #define	IEEE80211_GCMP_PN_LEN			6
 #define	IEEE80211_GMAC_PN_LEN			6
+#define	IEEE80211_CMAC_PN_LEN			6
 
 #define	IEEE80211_MAX_PN_LEN			16
 
diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h
index 9faf58ed6ee5..4dc1aaccb886 100644
--- a/sys/compat/linuxkpi/common/include/net/mac80211.h
+++ b/sys/compat/linuxkpi/common/include/net/mac80211.h
@@ -581,10 +581,13 @@ struct ieee80211_key_seq {
 			uint8_t		pn[IEEE80211_CCMP_PN_LEN];
 		} ccmp;
 		struct {
-			uint8_t		pn[IEEE80211_CCMP_PN_LEN];
+			uint8_t		pn[IEEE80211_GCMP_PN_LEN];
+		} gcmp;
+		struct {
+			uint8_t		pn[IEEE80211_CMAC_PN_LEN];
 		} aes_cmac;
 		struct {
-			uint8_t		pn[IEEE80211_CCMP_PN_LEN];
+			uint8_t		pn[IEEE80211_GMAC_PN_LEN];
 		} aes_gmac;
 		struct {
 			uint32_t	iv32;