aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2013-12-02 03:06:36 -0500
committerKalle Valo <kvalo@qca.qualcomm.com>2013-12-02 11:51:13 -0500
commitcfb27d29b61cc32c0bb75f741aeabb9c6e6af742 (patch)
tree8bbd665cffabd2062eb6996e7a4f2b56941a193c
parent6d33a9a658f73e15ab41ddcfe36f4b774207ef1d (diff)
ath10k: fix multi BSSID with WPA on FW 10.1
FW 10.1 seems to require the default key index to be updated to point to group key after it is installed. Otherwise Txed frames are corrupted. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/ath10k/mac.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index b70a3b2f9f46..7d3d3ac2343a 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2717,6 +2717,44 @@ static void ath10k_cancel_hw_scan(struct ieee80211_hw *hw,
2717 mutex_unlock(&ar->conf_mutex); 2717 mutex_unlock(&ar->conf_mutex);
2718} 2718}
2719 2719
2720static void ath10k_set_key_h_def_keyidx(struct ath10k *ar,
2721 struct ath10k_vif *arvif,
2722 enum set_key_cmd cmd,
2723 struct ieee80211_key_conf *key)
2724{
2725 u32 vdev_param = arvif->ar->wmi.vdev_param->def_keyid;
2726 int ret;
2727
2728 /* 10.1 firmware branch requires default key index to be set to group
2729 * key index after installing it. Otherwise FW/HW Txes corrupted
2730 * frames with multi-vif APs. This is not required for main firmware
2731 * branch (e.g. 636).
2732 *
2733 * FIXME: This has been tested only in AP. It remains unknown if this
2734 * is required for multi-vif STA interfaces on 10.1 */
2735
2736 if (arvif->vdev_type != WMI_VDEV_TYPE_AP)
2737 return;
2738
2739 if (key->cipher == WLAN_CIPHER_SUITE_WEP40)
2740 return;
2741
2742 if (key->cipher == WLAN_CIPHER_SUITE_WEP104)
2743 return;
2744
2745 if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE)
2746 return;
2747
2748 if (cmd != SET_KEY)
2749 return;
2750
2751 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
2752 key->keyidx);
2753 if (ret)
2754 ath10k_warn("failed to set group key as default key: %d\n",
2755 ret);
2756}
2757
2720static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, 2758static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
2721 struct ieee80211_vif *vif, struct ieee80211_sta *sta, 2759 struct ieee80211_vif *vif, struct ieee80211_sta *sta,
2722 struct ieee80211_key_conf *key) 2760 struct ieee80211_key_conf *key)
@@ -2778,6 +2816,8 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
2778 goto exit; 2816 goto exit;
2779 } 2817 }
2780 2818
2819 ath10k_set_key_h_def_keyidx(ar, arvif, cmd, key);
2820
2781 spin_lock_bh(&ar->data_lock); 2821 spin_lock_bh(&ar->data_lock);
2782 peer = ath10k_peer_find(ar, arvif->vdev_id, peer_addr); 2822 peer = ath10k_peer_find(ar, arvif->vdev_id, peer_addr);
2783 if (peer && cmd == SET_KEY) 2823 if (peer && cmd == SET_KEY)