wifi: iwlwifi: mvm: d3: fix IPN byte order
[ Upstream commit 0c769cb6b9f364423c255f117774c9ecd5bf23ea ] The IPN is reported by the firmware in 6 bytes little endian, but mac80211 expects big endian so it can do memcmp() on it. We used to store this as a u64 which was filled in the right way, but never used. When implementing that it's used, we changed it to just be 6 bytes, but lost the conversion. Add it back. Fixes: 04f78e242fff ("wifi: iwlwifi: mvm: Add support for IGTK in D3 resume flow") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240129211905.138ed8a698e3.I1b66c386e45b5392696424ec636474bff86fd5ef@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
503431174b
commit
8b15cdc00f
@ -2167,7 +2167,10 @@ static void iwl_mvm_convert_gtk_v3(struct iwl_wowlan_status_data *status,
|
||||
static void iwl_mvm_convert_igtk(struct iwl_wowlan_status_data *status,
|
||||
struct iwl_wowlan_igtk_status *data)
|
||||
{
|
||||
int i;
|
||||
|
||||
BUILD_BUG_ON(sizeof(status->igtk.key) < sizeof(data->key));
|
||||
BUILD_BUG_ON(sizeof(status->igtk.ipn) != sizeof(data->ipn));
|
||||
|
||||
if (!data->key_len)
|
||||
return;
|
||||
@ -2179,7 +2182,10 @@ static void iwl_mvm_convert_igtk(struct iwl_wowlan_status_data *status,
|
||||
+ WOWLAN_IGTK_MIN_INDEX;
|
||||
|
||||
memcpy(status->igtk.key, data->key, sizeof(data->key));
|
||||
memcpy(status->igtk.ipn, data->ipn, sizeof(data->ipn));
|
||||
|
||||
/* mac80211 expects big endian for memcmp() to work, convert */
|
||||
for (i = 0; i < sizeof(data->ipn); i++)
|
||||
status->igtk.ipn[i] = data->ipn[sizeof(data->ipn) - i - 1];
|
||||
}
|
||||
|
||||
static void iwl_mvm_parse_wowlan_info_notif(struct iwl_mvm *mvm,
|
||||
|
Loading…
x
Reference in New Issue
Block a user