Commit 7d94f862 authored by Abhishek Ambure's avatar Abhishek Ambure Committed by Kalle Valo

ath10k: update GCMP & GCMP-256 cipher suite number for WCN3990

TLV based firmware ex. QCA6174, WCN3990 expects key cipher value
set to 9 while non-TLV firmware expects key cipher value set to 8
for enabling GCMP and GCMP-256 cipher suites.

To fix this problem, attach the key cipher suite values based on
wmi version.

Tested HW: WCN3990
Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1
Signed-off-by: default avatarAbhishek Ambure <aambure@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 7ba31e6e
...@@ -1182,6 +1182,7 @@ struct ath10k { ...@@ -1182,6 +1182,7 @@ struct ath10k {
u32 ampdu_reference; u32 ampdu_reference;
const u8 *wmi_key_cipher;
void *ce_priv; void *ce_priv;
u32 sta_tid_stats_mask; u32 sta_tid_stats_mask;
......
...@@ -250,24 +250,24 @@ static int ath10k_send_key(struct ath10k_vif *arvif, ...@@ -250,24 +250,24 @@ static int ath10k_send_key(struct ath10k_vif *arvif,
switch (key->cipher) { switch (key->cipher) {
case WLAN_CIPHER_SUITE_CCMP: case WLAN_CIPHER_SUITE_CCMP:
arg.key_cipher = WMI_CIPHER_AES_CCM; arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_AES_CCM];
key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV_MGMT; key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV_MGMT;
break; break;
case WLAN_CIPHER_SUITE_TKIP: case WLAN_CIPHER_SUITE_TKIP:
arg.key_cipher = WMI_CIPHER_TKIP; arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_TKIP];
arg.key_txmic_len = 8; arg.key_txmic_len = 8;
arg.key_rxmic_len = 8; arg.key_rxmic_len = 8;
break; break;
case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104: case WLAN_CIPHER_SUITE_WEP104:
arg.key_cipher = WMI_CIPHER_WEP; arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_WEP];
break; break;
case WLAN_CIPHER_SUITE_CCMP_256: case WLAN_CIPHER_SUITE_CCMP_256:
arg.key_cipher = WMI_CIPHER_AES_CCM; arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_AES_CCM];
break; break;
case WLAN_CIPHER_SUITE_GCMP: case WLAN_CIPHER_SUITE_GCMP:
case WLAN_CIPHER_SUITE_GCMP_256: case WLAN_CIPHER_SUITE_GCMP_256:
arg.key_cipher = WMI_CIPHER_AES_GCM; arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_AES_GCM];
break; break;
case WLAN_CIPHER_SUITE_BIP_GMAC_128: case WLAN_CIPHER_SUITE_BIP_GMAC_128:
case WLAN_CIPHER_SUITE_BIP_GMAC_256: case WLAN_CIPHER_SUITE_BIP_GMAC_256:
...@@ -284,7 +284,7 @@ static int ath10k_send_key(struct ath10k_vif *arvif, ...@@ -284,7 +284,7 @@ static int ath10k_send_key(struct ath10k_vif *arvif,
key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
if (cmd == DISABLE_KEY) { if (cmd == DISABLE_KEY) {
arg.key_cipher = WMI_CIPHER_NONE; arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_NONE];
arg.key_data = NULL; arg.key_data = NULL;
} }
......
...@@ -2060,9 +2060,11 @@ ath10k_wmi_tlv_op_gen_vdev_install_key(struct ath10k *ar, ...@@ -2060,9 +2060,11 @@ ath10k_wmi_tlv_op_gen_vdev_install_key(struct ath10k *ar,
size_t len; size_t len;
void *ptr; void *ptr;
if (arg->key_cipher == WMI_CIPHER_NONE && arg->key_data != NULL) if (arg->key_cipher == ar->wmi_key_cipher[WMI_CIPHER_NONE] &&
arg->key_data)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
if (arg->key_cipher != WMI_CIPHER_NONE && arg->key_data == NULL) if (arg->key_cipher != ar->wmi_key_cipher[WMI_CIPHER_NONE] &&
!arg->key_data)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
len = sizeof(*tlv) + sizeof(*cmd) + len = sizeof(*tlv) + sizeof(*cmd) +
......
...@@ -1606,6 +1606,30 @@ static struct wmi_pdev_param_map wmi_10_4_pdev_param_map = { ...@@ -1606,6 +1606,30 @@ static struct wmi_pdev_param_map wmi_10_4_pdev_param_map = {
.enable_btcoex = WMI_10_4_PDEV_PARAM_ENABLE_BTCOEX, .enable_btcoex = WMI_10_4_PDEV_PARAM_ENABLE_BTCOEX,
}; };
static const u8 wmi_key_cipher_suites[] = {
[WMI_CIPHER_NONE] = WMI_CIPHER_NONE,
[WMI_CIPHER_WEP] = WMI_CIPHER_WEP,
[WMI_CIPHER_TKIP] = WMI_CIPHER_TKIP,
[WMI_CIPHER_AES_OCB] = WMI_CIPHER_AES_OCB,
[WMI_CIPHER_AES_CCM] = WMI_CIPHER_AES_CCM,
[WMI_CIPHER_WAPI] = WMI_CIPHER_WAPI,
[WMI_CIPHER_CKIP] = WMI_CIPHER_CKIP,
[WMI_CIPHER_AES_CMAC] = WMI_CIPHER_AES_CMAC,
[WMI_CIPHER_AES_GCM] = WMI_CIPHER_AES_GCM,
};
static const u8 wmi_tlv_key_cipher_suites[] = {
[WMI_CIPHER_NONE] = WMI_TLV_CIPHER_NONE,
[WMI_CIPHER_WEP] = WMI_TLV_CIPHER_WEP,
[WMI_CIPHER_TKIP] = WMI_TLV_CIPHER_TKIP,
[WMI_CIPHER_AES_OCB] = WMI_TLV_CIPHER_AES_OCB,
[WMI_CIPHER_AES_CCM] = WMI_TLV_CIPHER_AES_CCM,
[WMI_CIPHER_WAPI] = WMI_TLV_CIPHER_WAPI,
[WMI_CIPHER_CKIP] = WMI_TLV_CIPHER_CKIP,
[WMI_CIPHER_AES_CMAC] = WMI_TLV_CIPHER_AES_CMAC,
[WMI_CIPHER_AES_GCM] = WMI_TLV_CIPHER_AES_GCM,
};
static const struct wmi_peer_flags_map wmi_peer_flags_map = { static const struct wmi_peer_flags_map wmi_peer_flags_map = {
.auth = WMI_PEER_AUTH, .auth = WMI_PEER_AUTH,
.qos = WMI_PEER_QOS, .qos = WMI_PEER_QOS,
...@@ -9252,6 +9276,7 @@ int ath10k_wmi_attach(struct ath10k *ar) ...@@ -9252,6 +9276,7 @@ int ath10k_wmi_attach(struct ath10k *ar)
ar->wmi.vdev_param = &wmi_10_4_vdev_param_map; ar->wmi.vdev_param = &wmi_10_4_vdev_param_map;
ar->wmi.pdev_param = &wmi_10_4_pdev_param_map; ar->wmi.pdev_param = &wmi_10_4_pdev_param_map;
ar->wmi.peer_flags = &wmi_10_2_peer_flags_map; ar->wmi.peer_flags = &wmi_10_2_peer_flags_map;
ar->wmi_key_cipher = wmi_key_cipher_suites;
break; break;
case ATH10K_FW_WMI_OP_VERSION_10_2_4: case ATH10K_FW_WMI_OP_VERSION_10_2_4:
ar->wmi.cmd = &wmi_10_2_4_cmd_map; ar->wmi.cmd = &wmi_10_2_4_cmd_map;
...@@ -9259,6 +9284,7 @@ int ath10k_wmi_attach(struct ath10k *ar) ...@@ -9259,6 +9284,7 @@ int ath10k_wmi_attach(struct ath10k *ar)
ar->wmi.vdev_param = &wmi_10_2_4_vdev_param_map; ar->wmi.vdev_param = &wmi_10_2_4_vdev_param_map;
ar->wmi.pdev_param = &wmi_10_2_4_pdev_param_map; ar->wmi.pdev_param = &wmi_10_2_4_pdev_param_map;
ar->wmi.peer_flags = &wmi_10_2_peer_flags_map; ar->wmi.peer_flags = &wmi_10_2_peer_flags_map;
ar->wmi_key_cipher = wmi_key_cipher_suites;
break; break;
case ATH10K_FW_WMI_OP_VERSION_10_2: case ATH10K_FW_WMI_OP_VERSION_10_2:
ar->wmi.cmd = &wmi_10_2_cmd_map; ar->wmi.cmd = &wmi_10_2_cmd_map;
...@@ -9266,6 +9292,7 @@ int ath10k_wmi_attach(struct ath10k *ar) ...@@ -9266,6 +9292,7 @@ int ath10k_wmi_attach(struct ath10k *ar)
ar->wmi.vdev_param = &wmi_10x_vdev_param_map; ar->wmi.vdev_param = &wmi_10x_vdev_param_map;
ar->wmi.pdev_param = &wmi_10x_pdev_param_map; ar->wmi.pdev_param = &wmi_10x_pdev_param_map;
ar->wmi.peer_flags = &wmi_10_2_peer_flags_map; ar->wmi.peer_flags = &wmi_10_2_peer_flags_map;
ar->wmi_key_cipher = wmi_key_cipher_suites;
break; break;
case ATH10K_FW_WMI_OP_VERSION_10_1: case ATH10K_FW_WMI_OP_VERSION_10_1:
ar->wmi.cmd = &wmi_10x_cmd_map; ar->wmi.cmd = &wmi_10x_cmd_map;
...@@ -9273,6 +9300,7 @@ int ath10k_wmi_attach(struct ath10k *ar) ...@@ -9273,6 +9300,7 @@ int ath10k_wmi_attach(struct ath10k *ar)
ar->wmi.vdev_param = &wmi_10x_vdev_param_map; ar->wmi.vdev_param = &wmi_10x_vdev_param_map;
ar->wmi.pdev_param = &wmi_10x_pdev_param_map; ar->wmi.pdev_param = &wmi_10x_pdev_param_map;
ar->wmi.peer_flags = &wmi_10x_peer_flags_map; ar->wmi.peer_flags = &wmi_10x_peer_flags_map;
ar->wmi_key_cipher = wmi_key_cipher_suites;
break; break;
case ATH10K_FW_WMI_OP_VERSION_MAIN: case ATH10K_FW_WMI_OP_VERSION_MAIN:
ar->wmi.cmd = &wmi_cmd_map; ar->wmi.cmd = &wmi_cmd_map;
...@@ -9280,9 +9308,11 @@ int ath10k_wmi_attach(struct ath10k *ar) ...@@ -9280,9 +9308,11 @@ int ath10k_wmi_attach(struct ath10k *ar)
ar->wmi.vdev_param = &wmi_vdev_param_map; ar->wmi.vdev_param = &wmi_vdev_param_map;
ar->wmi.pdev_param = &wmi_pdev_param_map; ar->wmi.pdev_param = &wmi_pdev_param_map;
ar->wmi.peer_flags = &wmi_peer_flags_map; ar->wmi.peer_flags = &wmi_peer_flags_map;
ar->wmi_key_cipher = wmi_key_cipher_suites;
break; break;
case ATH10K_FW_WMI_OP_VERSION_TLV: case ATH10K_FW_WMI_OP_VERSION_TLV:
ath10k_wmi_tlv_attach(ar); ath10k_wmi_tlv_attach(ar);
ar->wmi_key_cipher = wmi_tlv_key_cipher_suites;
break; break;
case ATH10K_FW_WMI_OP_VERSION_UNSET: case ATH10K_FW_WMI_OP_VERSION_UNSET:
case ATH10K_FW_WMI_OP_VERSION_MAX: case ATH10K_FW_WMI_OP_VERSION_MAX:
......
...@@ -4931,15 +4931,30 @@ struct wmi_key_seq_counter { ...@@ -4931,15 +4931,30 @@ struct wmi_key_seq_counter {
__le32 key_seq_counter_h; __le32 key_seq_counter_h;
} __packed; } __packed;
#define WMI_CIPHER_NONE 0x0 /* clear key */ enum wmi_cipher_suites {
#define WMI_CIPHER_WEP 0x1 WMI_CIPHER_NONE,
#define WMI_CIPHER_TKIP 0x2 WMI_CIPHER_WEP,
#define WMI_CIPHER_AES_OCB 0x3 WMI_CIPHER_TKIP,
#define WMI_CIPHER_AES_CCM 0x4 WMI_CIPHER_AES_OCB,
#define WMI_CIPHER_WAPI 0x5 WMI_CIPHER_AES_CCM,
#define WMI_CIPHER_CKIP 0x6 WMI_CIPHER_WAPI,
#define WMI_CIPHER_AES_CMAC 0x7 WMI_CIPHER_CKIP,
#define WMI_CIPHER_AES_GCM 0x8 WMI_CIPHER_AES_CMAC,
WMI_CIPHER_AES_GCM,
};
enum wmi_tlv_cipher_suites {
WMI_TLV_CIPHER_NONE,
WMI_TLV_CIPHER_WEP,
WMI_TLV_CIPHER_TKIP,
WMI_TLV_CIPHER_AES_OCB,
WMI_TLV_CIPHER_AES_CCM,
WMI_TLV_CIPHER_WAPI,
WMI_TLV_CIPHER_CKIP,
WMI_TLV_CIPHER_AES_CMAC,
WMI_TLV_CIPHER_ANY,
WMI_TLV_CIPHER_AES_GCM,
};
struct wmi_vdev_install_key_cmd { struct wmi_vdev_install_key_cmd {
__le32 vdev_id; __le32 vdev_id;
......
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