From patchwork Tue Oct 31 01:04:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mitsyanko X-Patchwork-Id: 10033521 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 71DF860291 for ; Tue, 31 Oct 2017 01:05:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62B7B286FB for ; Tue, 31 Oct 2017 01:05:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5694C28965; Tue, 31 Oct 2017 01:05:27 +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 C5BD4286FB for ; Tue, 31 Oct 2017 01:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753012AbdJaBFM (ORCPT ); Mon, 30 Oct 2017 21:05:12 -0400 Received: from mail-by2nam03on0048.outbound.protection.outlook.com ([104.47.42.48]:45504 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752905AbdJaBFJ (ORCPT ); Mon, 30 Oct 2017 21:05:09 -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=Kffnn70bXszLB0j1JvMzcplhQdzeFVsb/axzpLSOH5U=; b=PJ7JVJMZB0eBqTMtRb6ihhGWjSETmcM+cDGRkeoPTd9QG43miOCTY0ePl+MLfBBH5f6xVUyiabm6zX1NZQnlLRQ+EO3qF5Dz2vqa1R1rck3zMHOsCmEuHqCnnAAqUfd/anf+3EQfWj4E9/GZzXk67TvmjI9p9wxHANnPQqPLQgM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=igor.mitsyanko.os@quantenna.com; Received: from dodo-dell.quantenna.com (12.131.200.68) by BLUPR0501MB2036.namprd05.prod.outlook.com (10.164.23.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.4; Tue, 31 Oct 2017 01:05:06 +0000 From: igor.mitsyanko.os@quantenna.com To: linux-wireless@vger.kernel.org Cc: sergey.matyukevich.os@quantenna.com, vulyanov@quantenna.com, johannes@sipsolutions.net Subject: [PATCH V2 6/9] qtnfmac: convert "Append IEs" command to QTN_TLV_ID_IE_SET usage Date: Mon, 30 Oct 2017 18:04:52 -0700 Message-Id: <20171031010455.27772-7-igor.mitsyanko.os@quantenna.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171031010455.27772-1-igor.mitsyanko.os@quantenna.com> References: <20171031010455.27772-1-igor.mitsyanko.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [12.131.200.68] X-ClientProxiedBy: MWHPR19CA0008.namprd19.prod.outlook.com (10.173.246.146) To BLUPR0501MB2036.namprd05.prod.outlook.com (10.164.23.18) X-MS-Office365-Filtering-Correlation-Id: 51f76e71-20f0-42ec-fe0c-08d51ffb6d2a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(2017052603199); SRVR:BLUPR0501MB2036; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2036; 3:tv5wOk2I0JNVmVMfuL5QML+2CmWZF8+Yb1k3EMw3Dubw0K6c3b9uQG2WmJN61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GsaNzQOTGJA77HyTgH1ej0D6/GzjFq2b7RPURUK5XKJbE88nwwFBdtkdXcTlOJ0ivrsGv4qm6705k7zQEjMLOWFdKhpIlrVqAsGwYlOpQP5Eqkw0u3oNF1B1NkBDEd7OTAJyDYYomPIUS3h6b/QzPApUfVYrCLeCYT4ol01ZPY7T0WlzgFfz0LkI5btGnPfzVp1hX31C4Dz9+JvZM+JhcgBH/e8Sxw/T0hx9Baz5zBi7osYE1d9N3+piSqRkIoUOgJig5EaSAkzON/KlOHkVg1YXhwGVtbaN5zO0OWqvwKxG9Kkzc5v9DMHD0pnBHlWQS/+wNWKE9IizSgdyu7oGhLUBaiSPgSonrSFm+gymZa2emlKquRQtNb3UzxxJyfn4gDvUFlyLOM666c2dsHjtl7w1vIagJJ3IMYs=; 4:nO81QSRmQiGQwt3XOZxrlBrnn1QqJ8w02wi7sGlS8EtMX3EgL0HaG9+ZD9QcOtDDGQYhG+YSVzPscPJytHXLeLXf1GxEy1CGKe26yo+zCwznJU74HZT5fw1K9tJ0l5KiV3rHZ3ZqJySeWslxbRjz1B/okPF5xFQcDjeeCZFcAAoRf72ObiHbE0efjZz6YMyBjhS6yd4KfAQO9n6RnjlNd1cuO5/o/zSRPwrSI5n6uVOwMoDYxQv+1Wj5cmNkq+xhfBnCoFD2A9d7RIBxj+am4Q== X-Exchange-Antispam-Report-Test: UriScan:; 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)(100000703101)(100105400095)(93006095)(93001095)(3002001)(3231020)(10201501046)(6041248)(20161123555025)(20161123562025)(20161123560025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0501MB2036; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0501MB2036; X-Forefront-PRVS: 04772EA191 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39830400002)(346002)(199003)(189002)(9686003)(5660300001)(6916009)(6666003)(2950100002)(478600001)(25786009)(53936002)(36756003)(6486002)(33646002)(85782001)(50466002)(103116003)(48376002)(4326008)(81166006)(81156014)(8936002)(305945005)(7736002)(97736004)(68736007)(50986999)(76176999)(101416001)(6116002)(50226002)(8676002)(2906002)(2361001)(53416004)(3846002)(575784001)(86362001)(189998001)(1076002)(16586007)(316002)(2351001)(105586002)(106356001)(66066001)(47776003)(16526018)(5003940100001)(69596002)(85772001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0501MB2036; H:dodo-dell.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; BLUPR0501MB2036; 23:P4FQw9tteYc8EqHmcCgwlYQ0Os3U4f85DA1gvsH?= =?us-ascii?Q?HXNkIzJgPNAF+QGt/jPSYLrpfPzMXa0K607Q2GBzCb9bansa9+8iiin1G3Tb?= =?us-ascii?Q?Qa7O3yDN8uvg8I14PDr1QJpxKCtpkpp5l3PtgNRSoHfrArpFmXJwqwut4aNe?= =?us-ascii?Q?nsYb1+SlmOYMUiCJ0yGMIBV3ZkEi92pml/eNwsuC9VhBdtwCBjlOBT9gj4WT?= =?us-ascii?Q?u2rb4GxAt80HY8r+IiH08299d0BHSN2jf/2jb6asCvD7uVaD/YWHtBtIebUP?= =?us-ascii?Q?SNyswJC7PDybzgBcvDYi25fRzkDZ1aN07jiF5F7yxlYxIkeFb27Gy2dvYBQS?= =?us-ascii?Q?7H4V0IWHSgk/ecVnFU09V1ASwbxG1TG+CvXstUt9E32vlmkl7ikXy/7GvwTY?= =?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=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2036; 6:q8yGRnGiAzthwLVByCJ+zUgJ4VGqHnhoIk7MA4dmLu3OWA1/hcLbgcuHQn740oIYrATrM1O6MDieYS4yg/S4lQc6WFnKTyTSfp024dV3jjd1cTsk97KeeKN1MTF9YtocFQ/fuAdenmraaO0buWK4keN2ybJb2ycXI1sY8w2K3dc2G1XaRrSQ7OyDpIaERBK0tSE1kTHZcElwIMTtEiLMy1bAV81OGNVtTgjgCjIhm/8kyXNTsHS3H6RZa3zSzlKUw98X+OzqwCyQVPzU7iTBEQfwNGi56bbwA7yFjO8/ecueSfYK/BeiME9/7j5RFMrkduVpA28sxoy+gUb3PfPbA3kzz2RBTmVgeK3EA4SmR2U=; 5:sGWApEphSfyGElUW0jvsvVjNW3Vc1ng3quQoxx/kmHrXMMMFoFt9TIZ187GC7b3tGYFD2RoiUpENBxDU+z4KTNG7NnhFeRg0TA6NBQgmJFEcJijNhJDc9u9s5aE3XkSY1/mQx0j88gbNGi3LTYIrox25V6HfyLRK81zbjeiYxWo=; 24:EliNdVNzLOZhcEISX72G31A9z6YsV6fmgci1iM/VFYgiwZv7SsxdIvkdr7bJ58NbGrHsg4+eUUZkJBdvGS6N+wzE0l7Geljyim1iysYXA7w=; 7:rB5WQunTOGqRcWNjiOBZOIYEs+YUr9r2bpb2p7Pw9fqC1Al/HRzwERUCNPjopYUuePLPgHzDXfgvvSIyghTFE1aB8rjXZDEgx5yONFEphg0xu0inIrgWx4X/mAedRuJb2aEuIIXK+3X3WCf3PGE+r/ZlH+fvj1pcPtI9VQte1ZvJLPsTiSyNvQ6v0bKUTRusV3jDwjjGJH4UllTzemAVlKC1aWfVPlrgYyeWXfAU2ureLkJa00Ck/V7LuyINYoK7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2017 01:05:06.5329 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 51f76e71-20f0-42ec-fe0c-08d51ffb6d2a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0501MB2036 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 Data contained within "Append IEs" command (QLINK_CMD_MGMT_SET_APPIE) duplicates QTN_TLV_ID_IE_SET TLV. Convert the command to use that TLV instead. Signed-off-by: Igor Mitsyanko --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 12 ++++++------ drivers/net/wireless/quantenna/qtnfmac/commands.c | 17 ++++------------- drivers/net/wireless/quantenna/qtnfmac/qlink.h | 15 --------------- 3 files changed, 10 insertions(+), 34 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 1a0c538..27b11dc 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -217,10 +217,10 @@ static int qtnf_mgmt_set_appie(struct qtnf_vif *vif, int ret = 0; if (!info->beacon_ies || !info->beacon_ies_len) { - ret = qtnf_cmd_send_mgmt_set_appie(vif, QLINK_MGMT_FRAME_BEACON, + ret = qtnf_cmd_send_mgmt_set_appie(vif, QLINK_IE_SET_BEACON_IES, NULL, 0); } else { - ret = qtnf_cmd_send_mgmt_set_appie(vif, QLINK_MGMT_FRAME_BEACON, + ret = qtnf_cmd_send_mgmt_set_appie(vif, QLINK_IE_SET_BEACON_IES, info->beacon_ies, info->beacon_ies_len); } @@ -230,11 +230,11 @@ static int qtnf_mgmt_set_appie(struct qtnf_vif *vif, if (!info->proberesp_ies || !info->proberesp_ies_len) { ret = qtnf_cmd_send_mgmt_set_appie(vif, - QLINK_MGMT_FRAME_PROBE_RESP, + QLINK_IE_SET_PROBE_RESP_IES, NULL, 0); } else { ret = qtnf_cmd_send_mgmt_set_appie(vif, - QLINK_MGMT_FRAME_PROBE_RESP, + QLINK_IE_SET_PROBE_RESP_IES, info->proberesp_ies, info->proberesp_ies_len); } @@ -244,11 +244,11 @@ static int qtnf_mgmt_set_appie(struct qtnf_vif *vif, if (!info->assocresp_ies || !info->assocresp_ies_len) { ret = qtnf_cmd_send_mgmt_set_appie(vif, - QLINK_MGMT_FRAME_ASSOC_RESP, + QLINK_IE_SET_ASSOC_RESP, NULL, 0); } else { ret = qtnf_cmd_send_mgmt_set_appie(vif, - QLINK_MGMT_FRAME_ASSOC_RESP, + QLINK_IE_SET_ASSOC_RESP, info->assocresp_ies, info->assocresp_ies_len); } diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 8d3cdba..294418c 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -395,11 +395,10 @@ int qtnf_cmd_send_mgmt_set_appie(struct qtnf_vif *vif, u8 frame_type, const u8 *buf, size_t len) { struct sk_buff *cmd_skb; - struct qlink_cmd_mgmt_append_ie *cmd; u16 res_code = QLINK_CMD_RESULT_OK; int ret; - if (sizeof(*cmd) + len > QTNF_MAX_CMD_BUF_SIZE) { + if (len > QTNF_MAX_CMD_BUF_SIZE) { pr_warn("VIF%u.%u: %u frame is too big: %zu\n", vif->mac->macid, vif->vifid, frame_type, len); return -E2BIG; @@ -407,21 +406,13 @@ int qtnf_cmd_send_mgmt_set_appie(struct qtnf_vif *vif, u8 frame_type, cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, QLINK_CMD_MGMT_SET_APPIE, - sizeof(*cmd)); + sizeof(struct qlink_cmd)); if (unlikely(!cmd_skb)) return -ENOMEM; - qtnf_bus_lock(vif->mac->bus); - - cmd = (struct qlink_cmd_mgmt_append_ie *)cmd_skb->data; - cmd->type = frame_type; - cmd->flags = 0; + qtnf_cmd_tlv_ie_set_add(cmd_skb, frame_type, buf, len); - /* If len == 0 then IE buf for specified frame type - * should be cleared on EP. - */ - if (len && buf) - qtnf_cmd_skb_put_buffer(cmd_skb, buf, len); + qtnf_bus_lock(vif->mac->bus); ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 81effd2..43ce451 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -299,21 +299,6 @@ struct qlink_cmd_mgmt_frame_tx { } __packed; /** - * struct qlink_cmd_mgmt_append_ie - data for QLINK_CMD_MGMT_SET_APPIE command - * - * @type: type of MGMT frame to appent requested IEs to, one of - * &enum qlink_mgmt_frame_type. - * @flags: for future use. - * @ie_data: IEs data to append. - */ -struct qlink_cmd_mgmt_append_ie { - struct qlink_cmd chdr; - u8 type; - u8 flags; - u8 ie_data[0]; -} __packed; - -/** * struct qlink_cmd_get_sta_info - data for QLINK_CMD_GET_STA_INFO command * * @sta_addr: MAC address of the STA statistics is requested for.