Commit 436a4e88 authored by Karthikeyan Kathirvel's avatar Karthikeyan Kathirvel Committed by Kalle Valo

ath11k: clear the keys properly via DISABLE_KEY

DISABLE_KEY sets the key_len to 0, firmware will not delete the keys if
key_len is 0. Changing from security mode to open mode will cause mcast
to be still encrypted without vdev restart.

Set the proper key_len for DISABLE_KEY cmd to clear the keys in
firmware.

Tested-on: IPQ6018 hw1.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1

Fixes: d5c65159 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Reported-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarKarthikeyan Kathirvel <kathirve@codeaurora.org>
[sven@narfation.org: split into separate patches, clean up commit message]
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211115100441.33771-1-sven@narfation.org
parent 886433a9
...@@ -3461,9 +3461,7 @@ static int ath11k_install_key(struct ath11k_vif *arvif, ...@@ -3461,9 +3461,7 @@ static int ath11k_install_key(struct ath11k_vif *arvif,
return 0; return 0;
if (cmd == DISABLE_KEY) { if (cmd == DISABLE_KEY) {
/* TODO: Check if FW expects value other than NONE for del */ arg.key_cipher = WMI_CIPHER_NONE;
/* arg.key_cipher = WMI_CIPHER_NONE; */
arg.key_len = 0;
arg.key_data = NULL; arg.key_data = NULL;
goto install; goto install;
} }
......
...@@ -1725,7 +1725,8 @@ int ath11k_wmi_vdev_install_key(struct ath11k *ar, ...@@ -1725,7 +1725,8 @@ int ath11k_wmi_vdev_install_key(struct ath11k *ar,
tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd));
tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) |
FIELD_PREP(WMI_TLV_LEN, key_len_aligned); FIELD_PREP(WMI_TLV_LEN, key_len_aligned);
memcpy(tlv->value, (u8 *)arg->key_data, key_len_aligned); if (arg->key_data)
memcpy(tlv->value, (u8 *)arg->key_data, key_len_aligned);
ret = ath11k_wmi_cmd_send(wmi, skb, WMI_VDEV_INSTALL_KEY_CMDID); ret = ath11k_wmi_cmd_send(wmi, skb, WMI_VDEV_INSTALL_KEY_CMDID);
if (ret) { if (ret) {
......
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