diff options
| author | Miri Korenblit <miriam.rachel.korenblit@intel.com> | 2025-08-26 18:54:50 +0300 |
|---|---|---|
| committer | Miri Korenblit <miriam.rachel.korenblit@intel.com> | 2025-08-28 09:56:42 +0300 |
| commit | da707495680bb429020c15c8f8daa744b08e11c4 (patch) | |
| tree | 36f6c360aae4de0ec3c6068bf2d8fd6248c87184 /drivers/net/wireless | |
| parent | 433570ee392f2f8f792a454bc2d34a4d3ce8d47d (diff) | |
wifi: iwlwifi: mld: don't check the cipher on resume
On resume, we are iterating all the keys in order to update the PN.
Currently we check the cipher of the key we are currently iterating on
to decide whether the key is PTK, GTK, IGTK or BIGTK.
But we can find the type of the key by the keyidx, and we anyway have to
check the keyidx, so just remove the cipher switch case and check only
the keyidx instead
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250826184046.8c4f9c30242c.Ie34c200f321aae60771476fa9907c333a8a99747@changeid
Diffstat (limited to 'drivers/net/wireless')
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mld/d3.c | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/d3.c b/drivers/net/wireless/intel/iwlwifi/mld/d3.c index 6a32aa22ffb8..dd8764029581 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/d3.c @@ -745,37 +745,32 @@ iwl_mld_resume_keys_iter(struct ieee80211_hw *hw, struct iwl_mld_wowlan_status *wowlan_status = data->wowlan_status; u8 status_idx; - switch (key->cipher) { - case WLAN_CIPHER_SUITE_CCMP: - case WLAN_CIPHER_SUITE_GCMP: - case WLAN_CIPHER_SUITE_GCMP_256: - case WLAN_CIPHER_SUITE_TKIP: + if (key->keyidx >= 0 && key->keyidx <= 3) { + /* PTK */ if (sta) { iwl_mld_update_ptk_rx_seq(data->mld, wowlan_status, sta, key, key->cipher == WLAN_CIPHER_SUITE_TKIP); - return; - } - - status_idx = key->keyidx == wowlan_status->gtk[1].id; - iwl_mld_update_mcast_rx_seq(key, &wowlan_status->gtk[status_idx]); - break; - case WLAN_CIPHER_SUITE_BIP_GMAC_128: - case WLAN_CIPHER_SUITE_BIP_GMAC_256: - case WLAN_CIPHER_SUITE_BIP_CMAC_256: - case WLAN_CIPHER_SUITE_AES_CMAC: - if (key->keyidx == 4 || key->keyidx == 5) { - if (key->keyidx == wowlan_status->igtk.id) - iwl_mld_update_mcast_rx_seq(key, - &wowlan_status->igtk); - } - if (key->keyidx == 6 || key->keyidx == 7) { - status_idx = key->keyidx == wowlan_status->bigtk[1].id; + /* GTK */ + } else { + status_idx = key->keyidx == wowlan_status->gtk[1].id; iwl_mld_update_mcast_rx_seq(key, - &wowlan_status->bigtk[status_idx]); + &wowlan_status->gtk[status_idx]); } - break; + } + + /* IGTK */ + if (key->keyidx == 4 || key->keyidx == 5) { + if (key->keyidx == wowlan_status->igtk.id) + iwl_mld_update_mcast_rx_seq(key, &wowlan_status->igtk); + } + + /* BIGTK */ + if (key->keyidx == 6 || key->keyidx == 7) { + status_idx = key->keyidx == wowlan_status->bigtk[1].id; + iwl_mld_update_mcast_rx_seq(key, + &wowlan_status->bigtk[status_idx]); } } |
