* [PATCH 0/2] Enable WPA3 cipher suites in WCN3990 firmware @ 2019-01-24 14:21 ` Abhishek Ambure 0 siblings, 0 replies; 10+ messages in thread From: Abhishek Ambure @ 2019-01-24 14:21 UTC (permalink / raw) To: ath10k; +Cc: Abhishek Ambure, linux-wireless This patchset brings changes to enable CCMP, GCMP & GCMP-256 cipher suites to run WPA3 security protocol in WCN3990. TLV based firmwares ex. QCA6174, WCN3990 and non-TLV based firmwares have differnet mapping for GCMP & GCMP-256 cipher suites. Cipher suites mapping in host driver is done according to wmi tlv and non-tlv versions of firmware. Abhishek Ambure (2): ath10k: Assign 'n_cipher_suites = 11' for WCN3990 to enable WPA3 ath10k: Update GCMP & GCMP-256 cipher suite number for WCN3990 drivers/net/wireless/ath/ath10k/core.c | 1 + drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/mac.c | 12 +++++------ drivers/net/wireless/ath/ath10k/wmi-tlv.c | 6 ++++-- drivers/net/wireless/ath/ath10k/wmi.c | 30 ++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.h | 33 ++++++++++++++++++++++--------- 6 files changed, 66 insertions(+), 17 deletions(-) -- 1.9.1 _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 0/2] Enable WPA3 cipher suites in WCN3990 firmware @ 2019-01-24 14:21 ` Abhishek Ambure 0 siblings, 0 replies; 10+ messages in thread From: Abhishek Ambure @ 2019-01-24 14:21 UTC (permalink / raw) To: ath10k; +Cc: linux-wireless, Abhishek Ambure This patchset brings changes to enable CCMP, GCMP & GCMP-256 cipher suites to run WPA3 security protocol in WCN3990. TLV based firmwares ex. QCA6174, WCN3990 and non-TLV based firmwares have differnet mapping for GCMP & GCMP-256 cipher suites. Cipher suites mapping in host driver is done according to wmi tlv and non-tlv versions of firmware. Abhishek Ambure (2): ath10k: Assign 'n_cipher_suites = 11' for WCN3990 to enable WPA3 ath10k: Update GCMP & GCMP-256 cipher suite number for WCN3990 drivers/net/wireless/ath/ath10k/core.c | 1 + drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/mac.c | 12 +++++------ drivers/net/wireless/ath/ath10k/wmi-tlv.c | 6 ++++-- drivers/net/wireless/ath/ath10k/wmi.c | 30 ++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.h | 33 ++++++++++++++++++++++--------- 6 files changed, 66 insertions(+), 17 deletions(-) -- 1.9.1 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] ath10k: Assign 'n_cipher_suites = 11' for WCN3990 to enable WPA3 2019-01-24 14:21 ` Abhishek Ambure @ 2019-01-24 14:21 ` Abhishek Ambure -1 siblings, 0 replies; 10+ messages in thread From: Abhishek Ambure @ 2019-01-24 14:21 UTC (permalink / raw) To: ath10k; +Cc: Abhishek Ambure, linux-wireless Hostapd uses CCMP, GCMP & GCMP-256 as 'wpa_pairwise' option to run WPA3. In WCN3990 firmware cipher suite numbers 9 to 11 are for CCMP, GCMP & GCMP-256. To enable CCMP, GCMP & GCMP-256 cipher suites in WCN3990 firmware, host sets 'n_cipher_suites = 11' while initializing hardware parameters. Tested HW: WCN3990 Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1 Signed-off-by: Abhishek Ambure <aambure@codeaurora.org> --- drivers/net/wireless/ath/ath10k/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 399b501f..6f37d0d 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -571,6 +571,7 @@ .rri_on_ddr = true, .hw_filter_reset_required = false, .fw_diag_ce_download = false, + .n_cipher_suites = 11, }, }; -- 1.9.1 _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 1/2] ath10k: Assign 'n_cipher_suites = 11' for WCN3990 to enable WPA3 @ 2019-01-24 14:21 ` Abhishek Ambure 0 siblings, 0 replies; 10+ messages in thread From: Abhishek Ambure @ 2019-01-24 14:21 UTC (permalink / raw) To: ath10k; +Cc: linux-wireless, Abhishek Ambure Hostapd uses CCMP, GCMP & GCMP-256 as 'wpa_pairwise' option to run WPA3. In WCN3990 firmware cipher suite numbers 9 to 11 are for CCMP, GCMP & GCMP-256. To enable CCMP, GCMP & GCMP-256 cipher suites in WCN3990 firmware, host sets 'n_cipher_suites = 11' while initializing hardware parameters. Tested HW: WCN3990 Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1 Signed-off-by: Abhishek Ambure <aambure@codeaurora.org> --- drivers/net/wireless/ath/ath10k/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 399b501f..6f37d0d 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -571,6 +571,7 @@ .rri_on_ddr = true, .hw_filter_reset_required = false, .fw_diag_ce_download = false, + .n_cipher_suites = 11, }, }; -- 1.9.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] ath10k: Assign 'n_cipher_suites = 11' for WCN3990 to enable WPA3 2019-01-24 14:21 ` Abhishek Ambure (?) @ 2019-02-07 16:00 ` Kalle Valo -1 siblings, 0 replies; 10+ messages in thread From: Kalle Valo @ 2019-02-07 16:00 UTC (permalink / raw) To: Abhishek Ambure; +Cc: linux-wireless, ath10k Abhishek Ambure <aambure@codeaurora.org> wrote: > Hostapd uses CCMP, GCMP & GCMP-256 as 'wpa_pairwise' option to run WPA3. > In WCN3990 firmware cipher suite numbers 9 to 11 are for CCMP, > GCMP & GCMP-256. > > To enable CCMP, GCMP & GCMP-256 cipher suites in WCN3990 firmware, > host sets 'n_cipher_suites = 11' while initializing hardware parameters. > > Tested HW: WCN3990 > Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1 > > Signed-off-by: Abhishek Ambure <aambure@codeaurora.org> > Signed-off-by: Kalle Valo <kvalo@codeaurora.org> This issued a new warning: drivers/net/wireless/ath/ath10k/core.c:564:18: warning: Initializer entry defined twice drivers/net/wireless/ath/ath10k/core.c:574:18: also defined here I fixed that in the pending branch: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=de1c369206cf48b73f74d5bf904ee26da485c84f -- https://patchwork.kernel.org/patch/10779097/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] ath10k: Assign 'n_cipher_suites = 11' for WCN3990 to enable WPA3 2019-01-24 14:21 ` Abhishek Ambure (?) (?) @ 2019-02-07 16:00 ` Kalle Valo -1 siblings, 0 replies; 10+ messages in thread From: Kalle Valo @ 2019-02-07 16:00 UTC (permalink / raw) To: Abhishek Ambure; +Cc: ath10k, linux-wireless, Abhishek Ambure Abhishek Ambure <aambure@codeaurora.org> wrote: > Hostapd uses CCMP, GCMP & GCMP-256 as 'wpa_pairwise' option to run WPA3. > In WCN3990 firmware cipher suite numbers 9 to 11 are for CCMP, > GCMP & GCMP-256. > > To enable CCMP, GCMP & GCMP-256 cipher suites in WCN3990 firmware, > host sets 'n_cipher_suites = 11' while initializing hardware parameters. > > Tested HW: WCN3990 > Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1 > > Signed-off-by: Abhishek Ambure <aambure@codeaurora.org> > Signed-off-by: Kalle Valo <kvalo@codeaurora.org> This issued a new warning: drivers/net/wireless/ath/ath10k/core.c:564:18: warning: Initializer entry defined twice drivers/net/wireless/ath/ath10k/core.c:574:18: also defined here I fixed that in the pending branch: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=de1c369206cf48b73f74d5bf904ee26da485c84f -- https://patchwork.kernel.org/patch/10779097/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] ath10k: Assign 'n_cipher_suites = 11' for WCN3990 to enable WPA3 2019-01-24 14:21 ` Abhishek Ambure ` (2 preceding siblings ...) (?) @ 2019-02-11 16:27 ` Kalle Valo -1 siblings, 0 replies; 10+ messages in thread From: Kalle Valo @ 2019-02-11 16:27 UTC (permalink / raw) To: Abhishek Ambure; +Cc: linux-wireless, ath10k Abhishek Ambure <aambure@codeaurora.org> wrote: > Hostapd uses CCMP, GCMP & GCMP-256 as 'wpa_pairwise' option to run WPA3. > In WCN3990 firmware cipher suite numbers 9 to 11 are for CCMP, > GCMP & GCMP-256. > > To enable CCMP, GCMP & GCMP-256 cipher suites in WCN3990 firmware, > host sets 'n_cipher_suites = 11' while initializing hardware parameters. > > Tested HW: WCN3990 > Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1 > > Signed-off-by: Abhishek Ambure <aambure@codeaurora.org> > Signed-off-by: Kalle Valo <kvalo@codeaurora.org> 2 patches applied to ath-next branch of ath.git, thanks. 7ba31e6e0cdc ath10k: assign 'n_cipher_suites = 11' for WCN3990 to enable WPA3 7d94f862d648 ath10k: update GCMP & GCMP-256 cipher suite number for WCN3990 -- https://patchwork.kernel.org/patch/10779097/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] ath10k: Assign 'n_cipher_suites = 11' for WCN3990 to enable WPA3 2019-01-24 14:21 ` Abhishek Ambure ` (3 preceding siblings ...) (?) @ 2019-02-11 16:27 ` Kalle Valo -1 siblings, 0 replies; 10+ messages in thread From: Kalle Valo @ 2019-02-11 16:27 UTC (permalink / raw) To: Abhishek Ambure; +Cc: ath10k, linux-wireless, Abhishek Ambure Abhishek Ambure <aambure@codeaurora.org> wrote: > Hostapd uses CCMP, GCMP & GCMP-256 as 'wpa_pairwise' option to run WPA3. > In WCN3990 firmware cipher suite numbers 9 to 11 are for CCMP, > GCMP & GCMP-256. > > To enable CCMP, GCMP & GCMP-256 cipher suites in WCN3990 firmware, > host sets 'n_cipher_suites = 11' while initializing hardware parameters. > > Tested HW: WCN3990 > Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1 > > Signed-off-by: Abhishek Ambure <aambure@codeaurora.org> > Signed-off-by: Kalle Valo <kvalo@codeaurora.org> 2 patches applied to ath-next branch of ath.git, thanks. 7ba31e6e0cdc ath10k: assign 'n_cipher_suites = 11' for WCN3990 to enable WPA3 7d94f862d648 ath10k: update GCMP & GCMP-256 cipher suite number for WCN3990 -- https://patchwork.kernel.org/patch/10779097/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] ath10k: Update GCMP & GCMP-256 cipher suite number for WCN3990 2019-01-24 14:21 ` Abhishek Ambure @ 2019-01-24 14:21 ` Abhishek Ambure -1 siblings, 0 replies; 10+ messages in thread From: Abhishek Ambure @ 2019-01-24 14:21 UTC (permalink / raw) To: ath10k; +Cc: Abhishek Ambure, linux-wireless 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: Abhishek Ambure <aambure@codeaurora.org> --- drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/mac.c | 12 +++++------ drivers/net/wireless/ath/ath10k/wmi-tlv.c | 6 ++++-- drivers/net/wireless/ath/ath10k/wmi.c | 30 ++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.h | 33 ++++++++++++++++++++++--------- 5 files changed, 65 insertions(+), 17 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 46e9c8c..f2278d0 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -1182,6 +1182,7 @@ struct ath10k { u32 ampdu_reference; + const u8 *wmi_key_cipher; void *ce_priv; u32 sta_tid_stats_mask; diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index e49b367..beaff23 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -250,24 +250,24 @@ static int ath10k_send_key(struct ath10k_vif *arvif, switch (key->cipher) { 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; break; 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_rxmic_len = 8; break; case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP104: - arg.key_cipher = WMI_CIPHER_WEP; + arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_WEP]; break; 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; case WLAN_CIPHER_SUITE_GCMP: 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; case WLAN_CIPHER_SUITE_BIP_GMAC_128: case WLAN_CIPHER_SUITE_BIP_GMAC_256: @@ -284,7 +284,7 @@ static int ath10k_send_key(struct ath10k_vif *arvif, key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; if (cmd == DISABLE_KEY) { - arg.key_cipher = WMI_CIPHER_NONE; + arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_NONE]; arg.key_data = NULL; } diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index e85d6be..bba032b 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -2060,9 +2060,11 @@ static struct sk_buff *ath10k_wmi_tlv_op_gen_init(struct ath10k *ar) size_t len; 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); - 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); len = sizeof(*tlv) + sizeof(*cmd) + diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 971ff36..a7f00a5 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -1606,6 +1606,30 @@ .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 = { .auth = WMI_PEER_AUTH, .qos = WMI_PEER_QOS, @@ -9252,6 +9276,7 @@ int ath10k_wmi_attach(struct ath10k *ar) ar->wmi.vdev_param = &wmi_10_4_vdev_param_map; ar->wmi.pdev_param = &wmi_10_4_pdev_param_map; ar->wmi.peer_flags = &wmi_10_2_peer_flags_map; + ar->wmi_key_cipher = wmi_key_cipher_suites; break; case ATH10K_FW_WMI_OP_VERSION_10_2_4: ar->wmi.cmd = &wmi_10_2_4_cmd_map; @@ -9259,6 +9284,7 @@ int ath10k_wmi_attach(struct ath10k *ar) ar->wmi.vdev_param = &wmi_10_2_4_vdev_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_key_cipher = wmi_key_cipher_suites; break; case ATH10K_FW_WMI_OP_VERSION_10_2: ar->wmi.cmd = &wmi_10_2_cmd_map; @@ -9266,6 +9292,7 @@ int ath10k_wmi_attach(struct ath10k *ar) ar->wmi.vdev_param = &wmi_10x_vdev_param_map; ar->wmi.pdev_param = &wmi_10x_pdev_param_map; ar->wmi.peer_flags = &wmi_10_2_peer_flags_map; + ar->wmi_key_cipher = wmi_key_cipher_suites; break; case ATH10K_FW_WMI_OP_VERSION_10_1: ar->wmi.cmd = &wmi_10x_cmd_map; @@ -9273,6 +9300,7 @@ int ath10k_wmi_attach(struct ath10k *ar) ar->wmi.vdev_param = &wmi_10x_vdev_param_map; ar->wmi.pdev_param = &wmi_10x_pdev_param_map; ar->wmi.peer_flags = &wmi_10x_peer_flags_map; + ar->wmi_key_cipher = wmi_key_cipher_suites; break; case ATH10K_FW_WMI_OP_VERSION_MAIN: ar->wmi.cmd = &wmi_cmd_map; @@ -9280,9 +9308,11 @@ int ath10k_wmi_attach(struct ath10k *ar) ar->wmi.vdev_param = &wmi_vdev_param_map; ar->wmi.pdev_param = &wmi_pdev_param_map; ar->wmi.peer_flags = &wmi_peer_flags_map; + ar->wmi_key_cipher = wmi_key_cipher_suites; break; case ATH10K_FW_WMI_OP_VERSION_TLV: ath10k_wmi_tlv_attach(ar); + ar->wmi_key_cipher = wmi_tlv_key_cipher_suites; break; case ATH10K_FW_WMI_OP_VERSION_UNSET: case ATH10K_FW_WMI_OP_VERSION_MAX: diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index ac04077c..ddd4d0f 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -4929,15 +4929,30 @@ struct wmi_key_seq_counter { __le32 key_seq_counter_h; } __packed; -#define WMI_CIPHER_NONE 0x0 /* clear key */ -#define WMI_CIPHER_WEP 0x1 -#define WMI_CIPHER_TKIP 0x2 -#define WMI_CIPHER_AES_OCB 0x3 -#define WMI_CIPHER_AES_CCM 0x4 -#define WMI_CIPHER_WAPI 0x5 -#define WMI_CIPHER_CKIP 0x6 -#define WMI_CIPHER_AES_CMAC 0x7 -#define WMI_CIPHER_AES_GCM 0x8 +enum wmi_cipher_suites { + WMI_CIPHER_NONE, + WMI_CIPHER_WEP, + WMI_CIPHER_TKIP, + WMI_CIPHER_AES_OCB, + WMI_CIPHER_AES_CCM, + WMI_CIPHER_WAPI, + WMI_CIPHER_CKIP, + 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 { __le32 vdev_id; -- 1.9.1 _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2] ath10k: Update GCMP & GCMP-256 cipher suite number for WCN3990 @ 2019-01-24 14:21 ` Abhishek Ambure 0 siblings, 0 replies; 10+ messages in thread From: Abhishek Ambure @ 2019-01-24 14:21 UTC (permalink / raw) To: ath10k; +Cc: linux-wireless, Abhishek Ambure 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: Abhishek Ambure <aambure@codeaurora.org> --- drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/mac.c | 12 +++++------ drivers/net/wireless/ath/ath10k/wmi-tlv.c | 6 ++++-- drivers/net/wireless/ath/ath10k/wmi.c | 30 ++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.h | 33 ++++++++++++++++++++++--------- 5 files changed, 65 insertions(+), 17 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 46e9c8c..f2278d0 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -1182,6 +1182,7 @@ struct ath10k { u32 ampdu_reference; + const u8 *wmi_key_cipher; void *ce_priv; u32 sta_tid_stats_mask; diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index e49b367..beaff23 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -250,24 +250,24 @@ static int ath10k_send_key(struct ath10k_vif *arvif, switch (key->cipher) { 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; break; 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_rxmic_len = 8; break; case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP104: - arg.key_cipher = WMI_CIPHER_WEP; + arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_WEP]; break; 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; case WLAN_CIPHER_SUITE_GCMP: 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; case WLAN_CIPHER_SUITE_BIP_GMAC_128: case WLAN_CIPHER_SUITE_BIP_GMAC_256: @@ -284,7 +284,7 @@ static int ath10k_send_key(struct ath10k_vif *arvif, key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; if (cmd == DISABLE_KEY) { - arg.key_cipher = WMI_CIPHER_NONE; + arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_NONE]; arg.key_data = NULL; } diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index e85d6be..bba032b 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -2060,9 +2060,11 @@ static struct sk_buff *ath10k_wmi_tlv_op_gen_init(struct ath10k *ar) size_t len; 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); - 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); len = sizeof(*tlv) + sizeof(*cmd) + diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 971ff36..a7f00a5 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -1606,6 +1606,30 @@ .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 = { .auth = WMI_PEER_AUTH, .qos = WMI_PEER_QOS, @@ -9252,6 +9276,7 @@ int ath10k_wmi_attach(struct ath10k *ar) ar->wmi.vdev_param = &wmi_10_4_vdev_param_map; ar->wmi.pdev_param = &wmi_10_4_pdev_param_map; ar->wmi.peer_flags = &wmi_10_2_peer_flags_map; + ar->wmi_key_cipher = wmi_key_cipher_suites; break; case ATH10K_FW_WMI_OP_VERSION_10_2_4: ar->wmi.cmd = &wmi_10_2_4_cmd_map; @@ -9259,6 +9284,7 @@ int ath10k_wmi_attach(struct ath10k *ar) ar->wmi.vdev_param = &wmi_10_2_4_vdev_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_key_cipher = wmi_key_cipher_suites; break; case ATH10K_FW_WMI_OP_VERSION_10_2: ar->wmi.cmd = &wmi_10_2_cmd_map; @@ -9266,6 +9292,7 @@ int ath10k_wmi_attach(struct ath10k *ar) ar->wmi.vdev_param = &wmi_10x_vdev_param_map; ar->wmi.pdev_param = &wmi_10x_pdev_param_map; ar->wmi.peer_flags = &wmi_10_2_peer_flags_map; + ar->wmi_key_cipher = wmi_key_cipher_suites; break; case ATH10K_FW_WMI_OP_VERSION_10_1: ar->wmi.cmd = &wmi_10x_cmd_map; @@ -9273,6 +9300,7 @@ int ath10k_wmi_attach(struct ath10k *ar) ar->wmi.vdev_param = &wmi_10x_vdev_param_map; ar->wmi.pdev_param = &wmi_10x_pdev_param_map; ar->wmi.peer_flags = &wmi_10x_peer_flags_map; + ar->wmi_key_cipher = wmi_key_cipher_suites; break; case ATH10K_FW_WMI_OP_VERSION_MAIN: ar->wmi.cmd = &wmi_cmd_map; @@ -9280,9 +9308,11 @@ int ath10k_wmi_attach(struct ath10k *ar) ar->wmi.vdev_param = &wmi_vdev_param_map; ar->wmi.pdev_param = &wmi_pdev_param_map; ar->wmi.peer_flags = &wmi_peer_flags_map; + ar->wmi_key_cipher = wmi_key_cipher_suites; break; case ATH10K_FW_WMI_OP_VERSION_TLV: ath10k_wmi_tlv_attach(ar); + ar->wmi_key_cipher = wmi_tlv_key_cipher_suites; break; case ATH10K_FW_WMI_OP_VERSION_UNSET: case ATH10K_FW_WMI_OP_VERSION_MAX: diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index ac04077c..ddd4d0f 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -4929,15 +4929,30 @@ struct wmi_key_seq_counter { __le32 key_seq_counter_h; } __packed; -#define WMI_CIPHER_NONE 0x0 /* clear key */ -#define WMI_CIPHER_WEP 0x1 -#define WMI_CIPHER_TKIP 0x2 -#define WMI_CIPHER_AES_OCB 0x3 -#define WMI_CIPHER_AES_CCM 0x4 -#define WMI_CIPHER_WAPI 0x5 -#define WMI_CIPHER_CKIP 0x6 -#define WMI_CIPHER_AES_CMAC 0x7 -#define WMI_CIPHER_AES_GCM 0x8 +enum wmi_cipher_suites { + WMI_CIPHER_NONE, + WMI_CIPHER_WEP, + WMI_CIPHER_TKIP, + WMI_CIPHER_AES_OCB, + WMI_CIPHER_AES_CCM, + WMI_CIPHER_WAPI, + WMI_CIPHER_CKIP, + 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 { __le32 vdev_id; -- 1.9.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2019-02-11 16:27 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-01-24 14:21 [PATCH 0/2] Enable WPA3 cipher suites in WCN3990 firmware Abhishek Ambure 2019-01-24 14:21 ` Abhishek Ambure 2019-01-24 14:21 ` [PATCH 1/2] ath10k: Assign 'n_cipher_suites = 11' for WCN3990 to enable WPA3 Abhishek Ambure 2019-01-24 14:21 ` Abhishek Ambure 2019-02-07 16:00 ` Kalle Valo 2019-02-07 16:00 ` Kalle Valo 2019-02-11 16:27 ` Kalle Valo 2019-02-11 16:27 ` Kalle Valo 2019-01-24 14:21 ` [PATCH 2/2] ath10k: Update GCMP & GCMP-256 cipher suite number for WCN3990 Abhishek Ambure 2019-01-24 14:21 ` Abhishek Ambure
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.