mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-16 15:34:48 +08:00
wifi: iwlwifi: mvm: d3: fix IPN byte order
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: 04f78e242f
("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>
This commit is contained in:
parent
8001849921
commit
0c769cb6b9
@ -2194,7 +2194,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;
|
||||
@ -2206,7 +2209,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_convert_bigtk(struct iwl_wowlan_status_data *status,
|
||||
|
Loading…
Reference in New Issue
Block a user