Commit 710e6cc1 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Kalle Valo

rt2800: do not nullify initialization vector data

If we restart hw we should keep existing IV (initialization vector)
otherwise HW encryption will be broken after restart.

Also fix some coding style issues on the way.
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 09db3b00
...@@ -1647,7 +1647,8 @@ static void rt2800_config_wcid_attr_cipher(struct rt2x00_dev *rt2x00dev, ...@@ -1647,7 +1647,8 @@ static void rt2800_config_wcid_attr_cipher(struct rt2x00_dev *rt2x00dev,
offset = MAC_IVEIV_ENTRY(key->hw_key_idx); offset = MAC_IVEIV_ENTRY(key->hw_key_idx);
memset(&iveiv_entry, 0, sizeof(iveiv_entry)); rt2800_register_multiread(rt2x00dev, offset,
&iveiv_entry, sizeof(iveiv_entry));
if ((crypto->cipher == CIPHER_TKIP) || if ((crypto->cipher == CIPHER_TKIP) ||
(crypto->cipher == CIPHER_TKIP_NO_MIC) || (crypto->cipher == CIPHER_TKIP_NO_MIC) ||
(crypto->cipher == CIPHER_AES)) (crypto->cipher == CIPHER_AES))
...@@ -6079,13 +6080,11 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) ...@@ -6079,13 +6080,11 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
* ASIC will keep garbage value after boot, clear encryption keys. * ASIC will keep garbage value after boot, clear encryption keys.
*/ */
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
rt2800_register_write(rt2x00dev, rt2800_register_write(rt2x00dev, SHARED_KEY_MODE_ENTRY(i), 0);
SHARED_KEY_MODE_ENTRY(i), 0);
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
rt2800_config_wcid(rt2x00dev, NULL, i); rt2800_config_wcid(rt2x00dev, NULL, i);
rt2800_delete_wcid_attr(rt2x00dev, i); rt2800_delete_wcid_attr(rt2x00dev, i);
rt2800_register_write(rt2x00dev, MAC_IVEIV_ENTRY(i), 0);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment