Skip to content

Commit 710e6cc

Browse files
Stanislaw GruszkaKalle Valo
authored andcommitted
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: Stanislaw Gruszka <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 09db3b0 commit 710e6cc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/net/wireless/ralink/rt2x00/rt2800lib.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,14 +1647,15 @@ static void rt2800_config_wcid_attr_cipher(struct rt2x00_dev *rt2x00dev,
16471647

16481648
offset = MAC_IVEIV_ENTRY(key->hw_key_idx);
16491649

1650-
memset(&iveiv_entry, 0, sizeof(iveiv_entry));
1650+
rt2800_register_multiread(rt2x00dev, offset,
1651+
&iveiv_entry, sizeof(iveiv_entry));
16511652
if ((crypto->cipher == CIPHER_TKIP) ||
16521653
(crypto->cipher == CIPHER_TKIP_NO_MIC) ||
16531654
(crypto->cipher == CIPHER_AES))
16541655
iveiv_entry.iv[3] |= 0x20;
16551656
iveiv_entry.iv[3] |= key->keyidx << 6;
16561657
rt2800_register_multiwrite(rt2x00dev, offset,
1657-
&iveiv_entry, sizeof(iveiv_entry));
1658+
&iveiv_entry, sizeof(iveiv_entry));
16581659
}
16591660

16601661
int rt2800_config_shared_key(struct rt2x00_dev *rt2x00dev,
@@ -6079,13 +6080,11 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
60796080
* ASIC will keep garbage value after boot, clear encryption keys.
60806081
*/
60816082
for (i = 0; i < 4; i++)
6082-
rt2800_register_write(rt2x00dev,
6083-
SHARED_KEY_MODE_ENTRY(i), 0);
6083+
rt2800_register_write(rt2x00dev, SHARED_KEY_MODE_ENTRY(i), 0);
60846084

60856085
for (i = 0; i < 256; i++) {
60866086
rt2800_config_wcid(rt2x00dev, NULL, i);
60876087
rt2800_delete_wcid_attr(rt2x00dev, i);
6088-
rt2800_register_write(rt2x00dev, MAC_IVEIV_ENTRY(i), 0);
60896088
}
60906089

60916090
/*

0 commit comments

Comments
 (0)