Skip to content

Commit 639401f

Browse files
rotemkeremMiriam-Rachel
authored andcommitted
wifi: iwlwifi: implement wowlan status notification API update
Add per key status indication in the WOWLAN status notification. This update is required for fips. Each key entry now includes a status field. Keys are now processed as follows: 0: no key, ignore entry 1: old, use only metadata 2: new, use key material and metadata While at it, fix tid_offloaded_tx error message to print the actual variable being validated in iwl_mld_handle_wowlan_info_notif. Signed-off-by: Rotem Kerem <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250909061931.0a2e7a62504c.Id195c9c83f9f767d1e3e458468af2d933774daa1@changeid
1 parent c5318e6 commit 639401f

File tree

4 files changed

+306
-49
lines changed

4 files changed

+306
-49
lines changed

drivers/net/wireless/intel/iwlwifi/fw/api/d3.h

Lines changed: 105 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,64 @@ struct iwl_wowlan_gtk_status_v3 {
632632
struct iwl_wowlan_all_rsc_tsc_v5 sc;
633633
} __packed; /* WOWLAN_GTK_MATERIAL_VER_3 */
634634

635+
/**
636+
* enum iwl_wowlan_key_status - Status of security keys in WoWLAN notifications
637+
* @IWL_WOWLAN_NOTIF_NO_KEY: No key is present; this entry should be ignored.
638+
* @IWL_WOWLAN_STATUS_OLD_KEY: old key exists; no rekey occurred, and only
639+
* metadata is available.
640+
* @IWL_WOWLAN_STATUS_NEW_KEY: A new key was created after a rekey; new key
641+
* material is available.
642+
*/
643+
enum iwl_wowlan_key_status {
644+
IWL_WOWLAN_NOTIF_NO_KEY = 0,
645+
IWL_WOWLAN_STATUS_OLD_KEY = 1,
646+
IWL_WOWLAN_STATUS_NEW_KEY = 2
647+
};
648+
649+
/**
650+
* struct iwl_wowlan_gtk_status - GTK status
651+
* @key: GTK material
652+
* @key_len: GTK length, if set to 0, the key is not available
653+
* @key_flags: information about the key:
654+
* bits[0:1]: key index assigned by the AP
655+
* bits[2:6]: GTK index of the key in the internal DB
656+
* bit[7]: Set iff this is the currently used GTK
657+
* @key_status: key status, see &enum iwl_wowlan_key_status
658+
* @reserved: padding
659+
* @tkip_mic_key: TKIP RX MIC key
660+
* @sc: RSC/TSC counters
661+
*/
662+
struct iwl_wowlan_gtk_status {
663+
u8 key[WOWLAN_KEY_MAX_SIZE];
664+
u8 key_len;
665+
u8 key_flags;
666+
u8 key_status;
667+
u8 reserved;
668+
u8 tkip_mic_key[IWL_MIC_KEY_SIZE];
669+
struct iwl_wowlan_all_rsc_tsc_v5 sc;
670+
} __packed; /* WOWLAN_GTK_MATERIAL_VER_4 */
671+
635672
#define IWL_WOWLAN_GTK_IDX_MASK (BIT(0) | BIT(1))
636673
#define IWL_WOWLAN_IGTK_BIGTK_IDX_MASK (BIT(0))
637674

675+
/**
676+
* struct iwl_wowlan_igtk_status_v1 - IGTK status
677+
* @key: IGTK material
678+
* @ipn: the IGTK packet number (replay counter)
679+
* @key_len: IGTK length, if set to 0, the key is not available
680+
* @key_flags: information about the key:
681+
* bits[0]: key index assigned by the AP (0: index 4, 1: index 5)
682+
* (0: index 6, 1: index 7 with bigtk)
683+
* bits[1:5]: IGTK index of the key in the internal DB
684+
* bit[6]: Set iff this is the currently used IGTK
685+
*/
686+
struct iwl_wowlan_igtk_status_v1 {
687+
u8 key[WOWLAN_KEY_MAX_SIZE];
688+
u8 ipn[6];
689+
u8 key_len;
690+
u8 key_flags;
691+
} __packed; /* WOWLAN_IGTK_MATERIAL_VER_1 */
692+
638693
/**
639694
* struct iwl_wowlan_igtk_status - IGTK status
640695
* @key: IGTK material
@@ -645,13 +700,17 @@ struct iwl_wowlan_gtk_status_v3 {
645700
* (0: index 6, 1: index 7 with bigtk)
646701
* bits[1:5]: IGTK index of the key in the internal DB
647702
* bit[6]: Set iff this is the currently used IGTK
703+
* @key_status: key status, see &enum iwl_wowlan_key_status
704+
* @reserved: padding
648705
*/
649706
struct iwl_wowlan_igtk_status {
650707
u8 key[WOWLAN_KEY_MAX_SIZE];
651708
u8 ipn[6];
652709
u8 key_len;
653710
u8 key_flags;
654-
} __packed; /* WOWLAN_IGTK_MATERIAL_VER_1 */
711+
u8 key_status;
712+
u8 reserved[3];
713+
} __packed; /* WOWLAN_IGTK_MATERIAL_VER_2 */
655714

656715
/**
657716
* struct iwl_wowlan_status_v6 - WoWLAN status
@@ -701,7 +760,7 @@ struct iwl_wowlan_status_v6 {
701760
*/
702761
struct iwl_wowlan_status_v7 {
703762
struct iwl_wowlan_gtk_status_v2 gtk[WOWLAN_GTK_KEYS_NUM];
704-
struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
763+
struct iwl_wowlan_igtk_status_v1 igtk[WOWLAN_IGTK_KEYS_NUM];
705764
__le64 replay_ctr;
706765
__le16 pattern_number;
707766
__le16 non_qos_seq_ctr;
@@ -736,7 +795,7 @@ struct iwl_wowlan_status_v7 {
736795
*/
737796
struct iwl_wowlan_info_notif_v1 {
738797
struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
739-
struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
798+
struct iwl_wowlan_igtk_status_v1 igtk[WOWLAN_IGTK_KEYS_NUM];
740799
__le64 replay_ctr;
741800
__le16 pattern_number;
742801
__le16 reserved1;
@@ -818,8 +877,8 @@ struct iwl_wowlan_mlo_gtk {
818877
*/
819878
struct iwl_wowlan_info_notif_v3 {
820879
struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
821-
struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
822-
struct iwl_wowlan_igtk_status bigtk[WOWLAN_BIGTK_KEYS_NUM];
880+
struct iwl_wowlan_igtk_status_v1 igtk[WOWLAN_IGTK_KEYS_NUM];
881+
struct iwl_wowlan_igtk_status_v1 bigtk[WOWLAN_BIGTK_KEYS_NUM];
823882
__le64 replay_ctr;
824883
__le16 pattern_number;
825884
__le16 reserved1;
@@ -833,6 +892,45 @@ struct iwl_wowlan_info_notif_v3 {
833892
u8 reserved2[2];
834893
} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_3 */
835894

895+
/**
896+
* struct iwl_wowlan_info_notif_v5 - WoWLAN information notification
897+
* @gtk: GTK data
898+
* @igtk: IGTK data
899+
* @bigtk: BIGTK data
900+
* @replay_ctr: GTK rekey replay counter
901+
* @pattern_number: number of the matched patterns
902+
* @qos_seq_ctr: QoS sequence counters to use next
903+
* @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
904+
* @num_of_gtk_rekeys: number of GTK rekeys
905+
* @transmitted_ndps: number of transmitted neighbor discovery packets
906+
* @received_beacons: number of received beacons
907+
* @tid_tear_down: bit mask of tids whose BA sessions were closed
908+
* in suspend state
909+
* @station_id: station id
910+
* @num_mlo_link_keys: number of &struct iwl_wowlan_mlo_gtk structs
911+
* following this notif
912+
* @tid_offloaded_tx: tid used by the firmware to transmit data packets
913+
* while in wowlan
914+
* @mlo_gtks: array of GTKs of size num_mlo_link_keys
915+
*/
916+
struct iwl_wowlan_info_notif_v5 {
917+
struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
918+
struct iwl_wowlan_igtk_status_v1 igtk[WOWLAN_IGTK_KEYS_NUM];
919+
struct iwl_wowlan_igtk_status_v1 bigtk[WOWLAN_BIGTK_KEYS_NUM];
920+
__le64 replay_ctr;
921+
__le16 pattern_number;
922+
__le16 qos_seq_ctr;
923+
__le32 wakeup_reasons;
924+
__le32 num_of_gtk_rekeys;
925+
__le32 transmitted_ndps;
926+
__le32 received_beacons;
927+
u8 tid_tear_down;
928+
u8 station_id;
929+
u8 num_mlo_link_keys;
930+
u8 tid_offloaded_tx;
931+
struct iwl_wowlan_mlo_gtk mlo_gtks[];
932+
} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_5 */
933+
836934
/**
837935
* struct iwl_wowlan_info_notif - WoWLAN information notification
838936
* @gtk: GTK data
@@ -855,7 +953,7 @@ struct iwl_wowlan_info_notif_v3 {
855953
* @mlo_gtks: array of GTKs of size num_mlo_link_keys
856954
*/
857955
struct iwl_wowlan_info_notif {
858-
struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
956+
struct iwl_wowlan_gtk_status gtk[WOWLAN_GTK_KEYS_NUM];
859957
struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
860958
struct iwl_wowlan_igtk_status bigtk[WOWLAN_BIGTK_KEYS_NUM];
861959
__le64 replay_ctr;
@@ -870,7 +968,7 @@ struct iwl_wowlan_info_notif {
870968
u8 num_mlo_link_keys;
871969
u8 tid_offloaded_tx;
872970
struct iwl_wowlan_mlo_gtk mlo_gtks[];
873-
} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_5 */
971+
} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_6 */
874972

875973
/**
876974
* struct iwl_wowlan_wake_pkt_notif - WoWLAN wake packet notification

drivers/net/wireless/intel/iwlwifi/fw/api/offload.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ enum iwl_prot_offload_subcmd_ids {
2020
/**
2121
* @WOWLAN_INFO_NOTIFICATION: Notification in
2222
* &struct iwl_wowlan_info_notif_v1, iwl_wowlan_info_notif_v3,
23-
* or &struct iwl_wowlan_info_notif
23+
* &struct iwl_wowlan_info_notif_v5 or &struct iwl_wowlan_info_notif
2424
*/
2525
WOWLAN_INFO_NOTIFICATION = 0xFD,
2626

0 commit comments

Comments
 (0)