From patchwork Thu Oct 5 01:38:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mitsyanko X-Patchwork-Id: 9986287 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D864360291 for ; Thu, 5 Oct 2017 01:38:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9C3128C06 for ; Thu, 5 Oct 2017 01:38:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC74B28C3F; Thu, 5 Oct 2017 01:38:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1633D28C06 for ; Thu, 5 Oct 2017 01:38:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751336AbdJEBif (ORCPT ); Wed, 4 Oct 2017 21:38:35 -0400 Received: from mail-sn1nam01on0084.outbound.protection.outlook.com ([104.47.32.84]:52980 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751259AbdJEBiZ (ORCPT ); Wed, 4 Oct 2017 21:38:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=v8nPJ+auG2PSQ/IixCgh1kM/j4+JkBnXqpVW+HvaUfQ=; b=v+XxX26bwTEC+D4Sa0s514crJhaYPNMG+RP3KB8dAbNnaHNVaN/jM8AxE5j3gjQ25k0qm0M2vg+k3d37PHFEvz3vrOffY5S0XDHPt7Wl2VC00gYCxci1OkNNOxT0ssZkEBC+vTMDUOyBWEUe+EhPIPIoCskinoTNBfoiXZO8ROs= Received: from dodo-dell.quantenna.com (12.131.200.68) by SN1PR0501MB2047.namprd05.prod.outlook.com (10.163.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.5; Thu, 5 Oct 2017 01:38:22 +0000 From: igor.mitsyanko.os@quantenna.com To: linux-wireless@vger.kernel.org Cc: sergey.matyukevich.os@quantenna.com, avinashp@quantenna.com, johannes@sipsolutions.net Subject: [PATCH V2 7/8] qtnfmac: make encryption info a part of CONNECT command. Date: Wed, 4 Oct 2017 18:38:12 -0700 Message-Id: <20171005013813.13332-8-igor.mitsyanko.os@quantenna.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com> References: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [12.131.200.68] X-ClientProxiedBy: MWHPR20CA0031.namprd20.prod.outlook.com (10.172.102.145) To SN1PR0501MB2047.namprd05.prod.outlook.com (10.163.227.20) X-MS-Office365-Filtering-Correlation-Id: 3140fbc1-aa21-4675-f4e8-08d50b91c40a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:SN1PR0501MB2047; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 3:9Ouo+1Ks29NexzjQetniObOxiWBkWTcDgOw9wcUsVP6fsMPJNrypq4q4+hpcrKvzroA+n2u7ODx1A74qVODEocBrq0G127BEDFIoC1XvSHXUBVRfdnpOVxPku/8DB+8AhBqxJ9JYLVH0E9+8zeT/jw4DIhivDeebDSPGm+i+YVZFJ0P2APSVrW9mhbJKbxR54NkNAeIw95kqtSrdTiN0wk3QI4s46ZyhXoYFn4ZzSabBBUKSxOBPqAfDTVMUkxrK; 25:9K+07ZX2RlOJr2iaH75/yRzDBfC+JAWRNuTW/sKBRC9Y97j0URv2CPW0NvkvuP+2A6eBxEyPVSLhl1qulWxDlmqPT+jRW/ev5x2KGaxppoY+xsTGcVxdZMLtuDFslSVfTmFcS5R8DF7WbP6XZlDG5ux4n/vXni3v5Wn/WrKlVhxyyKhxUMQR5hbxnx/XjytuH7SNGqj5LN+2evFY4BAC+r2g8DYx8mWasEN5lwNWVJ6EXOS2Px6jpJv8n9p/vaoLXu3N/AWTBczTrn2UKlogCtM+OfVjjxevWHKhm6vs9KCuEsuB4uHD3KL4/O9hMSR4gRYqjLu3lzSV7EUGffgdvg==; 31:I9mbJZWWyf90b7LIl4izYZYKswWDQ7M0LBEaBZFzvKoDK9e2L/WQ/lRJNW8P3FhRqlVN2pbPtpuzH+WH5fi0BtiMFyzXe65JdsAtkUSA2Wk2dNy//Fa1dvJwRBFvBw8V1aYlP5m7Y3BFOf7GI1yxIpXoVo9owLipg7/Q5xVue7e2GGP3Eezwhsp7K9IVLYx7w0I9qCXlK4uWzI46GAx9+5RoHLMP/crmY/K8TIEqtPo= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PR0501MB2047: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=igor.mitsyanko.os@quantenna.com; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 20:uZVcA2nuja4TwnvybfRQyggGs2lhADE0utgPHhkZXgy0mFNU7MXGb43DdT7gT42D7fyztpD+FET+LHteE3iZXkN+kGJWqpsrn2RrxWTwm1ku3tJsKzOouwkclYuT6hMHNsgY11EPDREO/VE8HYHNgIiOwG02u2nihRzzuBbUGxHMQ9QQTy8SpzJxPDK7t+FV46O/AKfyVmStRZ9r1SuvJ/P9JSjj/Sm/UEWePxuOEIFw4NV3GWWwL0TBOUnFqONQ1z3CHvDMh9pl8e+Sd0Xiu0XbMvaC0reYvmoqEI0tuDcewyiNPi4xQ2Ia23VhSN7/65uU6yO6et6F5lH0hRlub9aOnd4boS87D+w4Fg9u9pmRvqbyp7rxUuCIvfZt9y8h0Gpxlwch2+2YWzR2hPaNtW0b5Xv9cYbyUDl4KdGy5mQc2jOyiK6TxBNC17Ylcth3aY2yNMBdSWVad+PghRMcIJuXYB4ODNiXHwhKH1pB79nmdI4jfAHcdG97aNa51PgL2b92s4aYoXu2QD6mbeg66AOszPOZo9NmX5bdpR1x3HVUIqXdkjsux2THr6oTbLVqZJBD8mxNMuSKaEGnOMxKjblFgIHbXteZaR4mYTRlwMg=; 4:yXlCZwSq3pWvvBxWY+BEZLuv+Su4LTivxZ3WytBOudqK5O71iVezY4LBzuBCZE/BNYDZ+F6TeGGiWDZbeNVcrHRULtGZ+73I6w2OwsHoUVdFFOMhvSaUI8MW/0EZ9M+2WC4WYyuwZusW1JepFOkFiSvuW8hHbHp0gP2IpwL+mLpITqthn3u9EGAXsmtYleA7YZsRRsJ8xIYF76MZ/8kUNK2bRX8ehVn/t/KdMQuluIKkp0OD1KZ3GHpWjDkrt8q+w1B3hHq3lLEej/ROjej6bsDmwFiMzBEqr2i50Va9kdY= X-Exchange-Antispam-Report-Test: UriScan:(21532816269658); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR0501MB2047; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR0501MB2047; X-Forefront-PRVS: 04519BA941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39830400002)(189002)(199003)(25786009)(106356001)(103116003)(105586002)(2351001)(33646002)(69596002)(53416004)(2361001)(3846002)(16526018)(85782001)(53936002)(66066001)(16586007)(2906002)(316002)(1076002)(47776003)(6116002)(478600001)(7736002)(8676002)(68736007)(86362001)(6666003)(97736004)(101416001)(6486002)(81166006)(76176999)(48376002)(189998001)(2950100002)(50986999)(8936002)(5660300001)(4326008)(36756003)(6916009)(50226002)(50466002)(5003940100001)(305945005)(81156014)(9686003)(85772001)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0501MB2047; H:dodo-dell.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0501MB2047; 23:e9TSk1CQQ9/5eGRC9FWlHTGz/HGzQa2eZLgEx50?= =?us-ascii?Q?Vx8HPKpirc1SJpJfdDP+vr2Y1ImBc39WznMP+2dcJqcFKrVrTf1GchaRCQ5j?= =?us-ascii?Q?hMqZetNrIV/F1jBYyfovrW0wQk4lLwzGWzLLTXXiv+2d9RSDtPqMy6mgOT9t?= =?us-ascii?Q?uqLIgOrKZbZsMDv8EcCpPXV2bkgjgs/tRTaLxgpnHx0He23baSKGmWx/ll0y?= =?us-ascii?Q?7PWbV2/JM0BQl7/jk7QJ8Rt56Xv3J5iiRajEqBhogIj4Z6mQGmSZ3L7fw5nl?= =?us-ascii?Q?fBa00H4Q5dPR2oQWw1Oii9n+3qHY3TapdI23E2KwxgD0wrgEbv7s1EYdo7fZ?= =?us-ascii?Q?6R8RCU+y4bElMr7L+9IeWfUx7NK9mkp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ii?Q?EwuSy7MGwsER2mXbAugE=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 6:41ejFD0qdjEc7vl7n6Ae9vVoYPj8S8UqmKGrMBpmy3pY8GSMEHqWBjsRctDJr/CRuDv4oy/7WSA+4AxWT4wblSvEs9mbGXzqojK60sldZ/aVd+8D+eIdOg1HspYUFiF4YsfHR/IHh/kHDsaK6WL2M/PvngqH/8sBsjIb1C9HHXqLGODFJmEnmqoN8p+Gs0/nvXYdTpDH9e/4J0i962aQF0zr42yu/QNy3GykSkb5S6eel1JvelnWbuJ5LkbpcnzriHkW4I+/pZF4Enbg0l8eAOZr7l1JAV3y7Rj/dslCvyj0Z4GqBoYlGfPzsp12E9ictc8fNWIIOBI6zAnJlsHiBA==; 5:pgcnhCefUmJ4AjX7zSmsw3Zf0izVtn6MlNNf3unCcBk1Y/R4UBlRz1+LKGfeCmC8s6u2av22C6+vI5opoWCGw1+P0tDrDmEO6kT++W48HSvqXbC7ptVp1hTqC79cq+UbXHjoIwb6KeJ0KwpIHZ63Yw==; 24:1MA3HXu4Wr3W77GjMb182O6baK353Sh3eaLOWC6XmwOzqHAb8bjf57mEjq3+mIiNPjZtSUTYNyEkvzFNroAPvo7L57pc3tpxY6UloVa95xM=; 7:9pObpbxWWHKcT9duXDVTL5nYy/wW3hsXcKrmbabj6e4Ge2r7ZZu8CmvBgBwdMY8E9G9jZ9C/CcyDcASMcry4sMDjpJrpQLnj1voAMbxACyAcwKtsUVb1rJ6UEXuPGodwWabeBpyDW0p5dcK6r/GChvzXzcT8Z6Sel0cwviYCZpiYyKTi1fwBlozyVEIX6TZbOEsXtz6fVTtmdmAeDksQ9+iMLtm6UpNhtx5TY4J7beE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2017 01:38:22.4227 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0501MB2047 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Igor Mitsyanko 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 --- 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 b65d705..babdc60 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -2037,7 +2037,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; @@ -2049,8 +2049,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); @@ -2077,41 +2075,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, };