diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2019-11-28 10:11:24 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-12-18 20:55:56 +0200 |
commit | 2d52378a0ad0c2c3e8a2572aa883da46ddfaac4e (patch) | |
tree | d4338179a459fffe0f4dfe671a5fd52c53238a4a /drivers/net/wireless/ralink/rt2x00 | |
parent | 57f9807d1ea2bd1154d9f58c39670fbc49b1975e (diff) | |
download | blackbird-op-linux-2d52378a0ad0c2c3e8a2572aa883da46ddfaac4e.tar.gz blackbird-op-linux-2d52378a0ad0c2c3e8a2572aa883da46ddfaac4e.zip |
rt2x00: use RESET state bit to prevent IV changes on restart
We can not set IV when we are under reset. Previously we read previous
IV value from registers and zeroed IV registers when key was deleted,
but this could possibly not work if DEL_KEY command was not performed.
Now when we have ->reconfig_complete ops and we fully mark mac80211
reset state via DEVICE_STATE_RESET flag, we can just skip setting IV
when keys are set during reset.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ralink/rt2x00')
-rw-r--r-- | drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c index a36c3fea7495..6beac1f74e7c 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c @@ -1652,20 +1652,17 @@ static void rt2800_config_wcid_attr_cipher(struct rt2x00_dev *rt2x00dev, rt2800_register_write(rt2x00dev, offset, reg); } - offset = MAC_IVEIV_ENTRY(key->hw_key_idx); + if (test_bit(DEVICE_STATE_RESET, &rt2x00dev->flags)) + return; - if (crypto->cmd == SET_KEY) { - rt2800_register_multiread(rt2x00dev, offset, - &iveiv_entry, sizeof(iveiv_entry)); - if ((crypto->cipher == CIPHER_TKIP) || - (crypto->cipher == CIPHER_TKIP_NO_MIC) || - (crypto->cipher == CIPHER_AES)) - iveiv_entry.iv[3] |= 0x20; - iveiv_entry.iv[3] |= key->keyidx << 6; - } else { - memset(&iveiv_entry, 0, sizeof(iveiv_entry)); - } + offset = MAC_IVEIV_ENTRY(key->hw_key_idx); + memset(&iveiv_entry, 0, sizeof(iveiv_entry)); + if ((crypto->cipher == CIPHER_TKIP) || + (crypto->cipher == CIPHER_TKIP_NO_MIC) || + (crypto->cipher == CIPHER_AES)) + iveiv_entry.iv[3] |= 0x20; + iveiv_entry.iv[3] |= key->keyidx << 6; rt2800_register_multiwrite(rt2x00dev, offset, &iveiv_entry, sizeof(iveiv_entry)); } |