Linux wireless drivers development
 help / color / mirror / Atom feed
From: igor.mitsyanko.os@quantenna.com
To: linux-wireless@vger.kernel.org
Cc: sergey.matyukevich.os@quantenna.com, avinashp@quantenna.com,
	johannes@sipsolutions.net,
	Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Subject: [PATCH 11/27] qtnfmac: make encryption info a part of "connect" command.
Date: Thu, 24 Aug 2017 19:30:08 -0700	[thread overview]
Message-ID: <20170825023024.10565-12-igor.mitsyanko.os@quantenna.com> (raw)
In-Reply-To: <20170825023024.10565-1-igor.mitsyanko.os@quantenna.com>

From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>

Encryption info is a constant part of STA settings, no point
to pass it as an optional TLV.
Remove QTN_TLV_ID_CRYPTO type as it's not used anymore.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
---
 drivers/net/wireless/quantenna/qtnfmac/commands.c | 42 ++++++++++-------------
 drivers/net/wireless/quantenna/qtnfmac/qlink.h    |  5 +--
 2 files changed, 22 insertions(+), 25 deletions(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index 65eee2b..195b777 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -2036,7 +2036,7 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
 {
 	struct sk_buff *cmd_skb;
 	struct qlink_cmd_connect *cmd;
-	struct qlink_auth_encr aen;
+	struct qlink_auth_encr *aen;
 	u16 res_code = QLINK_CMD_RESULT_OK;
 	int ret;
 	int i;
@@ -2048,8 +2048,6 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
 	if (unlikely(!cmd_skb))
 		return -ENOMEM;
 
-	qtnf_bus_lock(vif->mac->bus);
-
 	cmd = (struct qlink_cmd_connect *)cmd_skb->data;
 
 	ether_addr_copy(cmd->bssid, vif->bssid);
@@ -2076,41 +2074,39 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
 
 	cmd->flags = cpu_to_le32(connect_flags);
 
-	memset(&aen, 0, sizeof(aen));
-	aen.auth_type = sme->auth_type;
-	aen.privacy = !!sme->privacy;
-	aen.mfp = sme->mfp;
-	aen.wpa_versions = cpu_to_le32(sme->crypto.wpa_versions);
-	aen.cipher_group = cpu_to_le32(sme->crypto.cipher_group);
-	aen.n_ciphers_pairwise = cpu_to_le32(
-		sme->crypto.n_ciphers_pairwise);
+	aen = &cmd->aen;
+	aen->auth_type = sme->auth_type;
+	aen->privacy = !!sme->privacy;
+	aen->mfp = sme->mfp;
+	aen->wpa_versions = cpu_to_le32(sme->crypto.wpa_versions);
+	aen->cipher_group = cpu_to_le32(sme->crypto.cipher_group);
+	aen->n_ciphers_pairwise = cpu_to_le32(sme->crypto.n_ciphers_pairwise);
 
 	for (i = 0; i < QLINK_MAX_NR_CIPHER_SUITES; i++)
-		aen.ciphers_pairwise[i] = cpu_to_le32(
-			sme->crypto.ciphers_pairwise[i]);
+		aen->ciphers_pairwise[i] =
+			cpu_to_le32(sme->crypto.ciphers_pairwise[i]);
 
-	aen.n_akm_suites = cpu_to_le32(sme->crypto.n_akm_suites);
+	aen->n_akm_suites = cpu_to_le32(sme->crypto.n_akm_suites);
 
 	for (i = 0; i < QLINK_MAX_NR_AKM_SUITES; i++)
-		aen.akm_suites[i] = cpu_to_le32(
-			sme->crypto.akm_suites[i]);
+		aen->akm_suites[i] = cpu_to_le32(sme->crypto.akm_suites[i]);
 
-	aen.control_port = sme->crypto.control_port;
-	aen.control_port_no_encrypt =
+	aen->control_port = sme->crypto.control_port;
+	aen->control_port_no_encrypt =
 		sme->crypto.control_port_no_encrypt;
-	aen.control_port_ethertype = cpu_to_le16(be16_to_cpu(
-		sme->crypto.control_port_ethertype));
+	aen->control_port_ethertype =
+		cpu_to_le16(be16_to_cpu(sme->crypto.control_port_ethertype));
 
 	qtnf_cmd_skb_put_tlv_arr(cmd_skb, WLAN_EID_SSID, sme->ssid,
-		sme->ssid_len);
-	qtnf_cmd_skb_put_tlv_arr(cmd_skb, QTN_TLV_ID_CRYPTO, (u8 *)&aen,
-				 sizeof(aen));
+				 sme->ssid_len);
 
 	if (sme->ie_len != 0)
 		qtnf_cmd_skb_put_tlv_arr(cmd_skb, QTN_TLV_ID_IE_SET,
 					 sme->ie,
 					 sme->ie_len);
 
+	qtnf_bus_lock(vif->mac->bus);
+
 	ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code);
 
 	if (unlikely(ret))
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index 641d252..7b313d3 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -417,8 +417,9 @@ enum qlink_sta_connect_flags {
  * struct qlink_cmd_connect - data for QLINK_CMD_CONNECT command
  *
  * @flags: for future use.
- * @freq: center frequence of a channel which should be used to connect.
+ * @channel: channel which should be used to connect.
  * @bg_scan_period: period of background scan.
+ * @aen: authentication information.
  * @bssid: BSSID of the BSS to connect to.
  * @payload: variable portion of connection request.
  */
@@ -427,6 +428,7 @@ struct qlink_cmd_connect {
 	__le32 flags;
 	__le16 channel;
 	__le16 bg_scan_period;
+	struct qlink_auth_encr aen;
 	u8 bssid[ETH_ALEN];
 	u8 payload[0];
 } __packed;
@@ -950,7 +952,6 @@ enum qlink_tlv_id {
 	QTN_TLV_ID_STA_GENERIC_INFO	= 0x0301,
 	QTN_TLV_ID_KEY			= 0x0302,
 	QTN_TLV_ID_SEQ			= 0x0303,
-	QTN_TLV_ID_CRYPTO		= 0x0304,
 	QTN_TLV_ID_IE_SET		= 0x0305,
 };
 
-- 
2.9.5

  parent reply	other threads:[~2017-08-25  2:30 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25  2:29 [PATCH 00/27] qtnfmac: allow to configure channel, BW, HT/VHT caps igor.mitsyanko.os
2017-08-25  2:29 ` [PATCH 01/27] qtnfmac: qlink: convert channel width from bitfiled to simple enum igor.mitsyanko.os
2017-08-25  2:29 ` [PATCH 02/27] qtnfmac: make "Channel change" event report full channel info igor.mitsyanko.os
2017-08-29 14:31   ` Sergey Matyukevich
2017-08-30  1:45     ` Igor Mitsyanko
2017-08-25  2:30 ` [PATCH 03/27] qtnfmac: retreive current channel info from EP igor.mitsyanko.os
2017-08-29 14:42   ` Sergey Matyukevich
2017-08-30  1:39     ` Igor Mitsyanko
2017-08-25  2:30 ` [PATCH 04/27] qtnfmac: do not cache AP settings in driver structures igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 05/27] qtnfmac: pass all AP settings to wireless card for processing igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 06/27] qtnfmac: pass full channel definition to device on start_ap command igor.mitsyanko.os
2017-08-30 14:02   ` Sergey Matyukevich
2017-08-25  2:30 ` [PATCH 07/27] qtnfmac: get rid of QTNF_STATE_AP_CONFIG igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 08/27] qtnfmac: get rid of QTNF_STATE_AP_START usage igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 09/27] qtnfmac: do not cache BSS state in per-VIF structure igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 10/27] qtnfmac: do not cache channel info from "connect" command igor.mitsyanko.os
2017-08-25  2:30 ` igor.mitsyanko.os [this message]
2017-08-25  2:30 ` [PATCH 12/27] qtnfmac: let wifi card handle channel switch request to the same chan igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 13/27] qtnfmac: pass VIF info to SendChannel command igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 14/27] qtnfmac: do not cache CSA chandef info igor.mitsyanko.os
2017-08-29 15:44   ` Sergey Matyukevich
2017-08-30  1:48     ` Igor Mitsyanko
2017-08-30  8:05       ` Sergey Matyukevich
2017-08-25  2:30 ` [PATCH 15/27] qtnfmac: remove unused mac::status field igor.mitsyanko.os
2017-08-29 15:47   ` Sergey Matyukevich
2017-08-25  2:30 ` [PATCH 16/27] qtnfmac: stop using private driver info about current channel igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 17/27] qtnfmac: do not report channel changes until wiphy is registered igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 18/27] qtnfmac: use per-band HT/VHT info from wireless device igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 19/27] qtnfmac: initialize HT/VHT caps "can override" masks igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 20/27] qtnfmac: get rid of PHYMODE capabilities flags igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 21/27] qtnfmac: extend "IE set" TLV to include frame type info igor.mitsyanko.os
2017-08-30 12:07   ` Sergey Matyukevich
2017-08-30 12:20     ` Sergey Matyukevich
2017-08-25  2:30 ` [PATCH 22/27] qtnfmac: SCAN results: retreive frame type information from "IE set" TLV igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 23/27] qtnfmac: convert "Append IEs" command to QTN_TLV_ID_IE_SET usage igor.mitsyanko.os
2017-08-30 12:35   ` Sergey Matyukevich
2017-08-25  2:30 ` [PATCH 24/27] qtnfmac: configure and start AP interface with a single command igor.mitsyanko.os
2017-08-30 13:07   ` Sergey Matyukevich
2017-08-25  2:30 ` [PATCH 25/27] nl80211: look for HT/VHT capabilities in beacon's tail igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 26/27] qtnfmac: include HTCAP and VHTCAP into config AP command igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 27/27] qtnfmac: pass all CONNECT cmd params to wireless card for processing igor.mitsyanko.os
2017-08-30 16:16 ` [PATCH 00/27] qtnfmac: allow to configure channel, BW, HT/VHT caps Kalle Valo
2017-08-30 16:22   ` Kalle Valo
2017-08-30 16:28     ` Kalle Valo
2017-08-30 18:22       ` Igor Mitsyanko
2017-08-30 18:20   ` Igor Mitsyanko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170825023024.10565-12-igor.mitsyanko.os@quantenna.com \
    --to=igor.mitsyanko.os@quantenna.com \
    --cc=avinashp@quantenna.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sergey.matyukevich.os@quantenna.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox