public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Chien Wong <m@xv97.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH v3 2/5] wifi: mac80211: add generic MMIE struct defines
Date: Tue, 11 Nov 2025 22:57:56 +0800	[thread overview]
Message-ID: <20251111145759.111691-3-m@xv97.com> (raw)
In-Reply-To: <20251111145759.111691-1-m@xv97.com>

The added struct is needed when writing generic handler for both CMAC-128
and CMAC-256.

Signed-off-by: Chien Wong <m@xv97.com>
---
 include/linux/ieee80211.h | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index ddff9102f633..9392fc11d4fb 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1633,7 +1633,7 @@ struct ieee80211_mgmt {
 #define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u)
 
 
-/* Management MIC information element (IEEE 802.11w) */
+/* Management MIC information element (IEEE 802.11w) for CMAC */
 struct ieee80211_mmie {
 	u8 element_id;
 	u8 length;
@@ -1651,6 +1651,15 @@ struct ieee80211_mmie_16 {
 	u8 mic[16];
 } __packed;
 
+/* Management MIC information element (IEEE 802.11w) for all variants */
+struct ieee80211_mmie_var {
+	u8 element_id;
+	u8 length;
+	__le16 key_id;
+	u8 sequence_number[6];
+	u8 mic[]; /* 8 or 16 bytes */
+} __packed;
+
 struct ieee80211_vendor_ie {
 	u8 element_id;
 	u8 len;
@@ -4064,6 +4073,9 @@ enum ieee80211_radio_measurement_actioncode {
 #define IEEE80211_GCMP_HDR_LEN		8
 #define IEEE80211_GCMP_MIC_LEN		16
 #define IEEE80211_GCMP_PN_LEN		6
+#define IEEE80211_CMAC_128_MIC_LEN	8
+#define IEEE80211_CMAC_256_MIC_LEN	16
+#define IEEE80211_GMAC_MIC_LEN		16
 
 #define FILS_NONCE_LEN			16
 #define FILS_MAX_KEK_LEN		64
-- 
2.51.2


  parent reply	other threads:[~2025-11-11 14:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11 14:57 [PATCH v3 0/5] wifi: mac80211: refactor CMAC implementation Chien Wong
2025-11-11 14:57 ` [PATCH v3 1/5] wifi: mac80211: fix CMAC functions not handling errors Chien Wong
2025-11-12 13:11   ` Johannes Berg
2025-11-13 13:15     ` Chien Wong
2025-11-11 14:57 ` Chien Wong [this message]
2025-11-11 14:57 ` [PATCH v3 3/5] wifi: mac80211: utilize the newly defined CMAC constants Chien Wong
2025-11-12 13:12   ` Johannes Berg
2025-11-13 13:16     ` Chien Wong
2025-11-11 14:57 ` [PATCH v3 4/5] wifi: mac80211: refactor CMAC crypt functions Chien Wong
2025-11-12 13:19   ` Johannes Berg
2025-11-13 13:24     ` Chien Wong
2025-11-11 14:57 ` [PATCH v3 5/5] wifi: mac80211: refactor CMAC packet handlers Chien Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251111145759.111691-3-m@xv97.com \
    --to=m@xv97.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox