From patchwork Fri Aug 25 02:30:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mitsyanko X-Patchwork-Id: 9921181 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 298DA600C5 for ; Fri, 25 Aug 2017 02:31:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1268C204C1 for ; Fri, 25 Aug 2017 02:31:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07084205A4; Fri, 25 Aug 2017 02:31:22 +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 81F9C204C1 for ; Fri, 25 Aug 2017 02:31:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754527AbdHYCbU (ORCPT ); Thu, 24 Aug 2017 22:31:20 -0400 Received: from mail-cys01nam02on0057.outbound.protection.outlook.com ([104.47.37.57]:63780 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754463AbdHYCbJ (ORCPT ); Thu, 24 Aug 2017 22:31: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=vO48Un7mr1rc4iIu03tYG8dnmUolEovTpgf+7ff1/CA=; b=fHY3uJDFRz1zR6leerF6X5KEubgKO1ESsuo7WFtVk3Y45WSY+rY4E62eWg6XmlNxKdF5KPgBo3w28BObE96X9f7vU3DaowR00mLW/Vyon85Cedh+0dLZazKyMpoghlDRIIkNkobRq8bs1Gl2v7nKmuiYXmCjUorntXKuS1qkD4c= 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.1.1385.4; Fri, 25 Aug 2017 02:31:05 +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, Igor Mitsyanko Subject: [PATCH 23/27] qtnfmac: convert "Append IEs" command to QTN_TLV_ID_IE_SET usage Date: Thu, 24 Aug 2017 19:30:20 -0700 Message-Id: <20170825023024.10565-24-igor.mitsyanko.os@quantenna.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20170825023024.10565-1-igor.mitsyanko.os@quantenna.com> References: <20170825023024.10565-1-igor.mitsyanko.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [12.131.200.68] X-ClientProxiedBy: CY4PR15CA0017.namprd15.prod.outlook.com (10.172.74.27) To SN1PR0501MB2047.namprd05.prod.outlook.com (10.163.227.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2416bc36-dc44-4a16-b290-08d4eb61567d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SN1PR0501MB2047; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 3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D8fv5clniX85VwQAa3hTTSXCnP6dLBuZOvvuQHL5MEvQWi9xzlPiA98O82u0H0WcmzZgs+YzN3MN5OtCypm3fkcYAEsujhT1jPWbtT8Mr9ogNMnQJQCU0cKTFpmZCFwBTICt2dIzg/O8gfkVo/6CDRbuoGhILl/QPzxmS2RkSKD5bY4S/sWDShTwCaJOZJphE3VjDEHbH/Pp/5eL81Bx1jVncquoGuHpGAkURwWJTdXHYcIavfvGlukmdeD4lnGOo/0lfGhrRKZctbsU6rCIAtm4wZ/YYlFS+f0xvOhcRgq0utuECcneUUEh5WDMa/mZCCvF9NnvJQqx8FrWOpKZ0qH0CX2+HTyL7KvXGrMUpRwyL6Yx8ZtH7GG30R4a2IF51j/KRfYLCJG8r5Ft1MOkPqc2Nfzh0eegd06ElKBjnBd1VESFHix9sBNBG2LhUOxJ7aj7lToSSCnAikQfx0=; 4:a4DnsE+H3f54+RQ9ScDqtS30/oXmgaXUsPuuRLcGc135v5UmKPGxbOuRhXFZYhzSM5NAKCGukzaSKO7MR6pXLgoIe22zu+T+qJYfg75ZravQGEHRCmdVeGkTYICERX9dnBfWgrOBlJbwIjuNHYbcs7mGpk61cZca/uTrKYpD8ZYbied6FeXRMWWRle3wWV9FB0cwqlGJ3FqiDz+Px32YxK1BWdlsUv/paMe882CQzAS1yN/Ie0WfBoCV2ss0OOlp 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)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(10201501046)(6041248)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123555025)(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: 041032FF37 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(39830400002)(199003)(189002)(76176999)(53416004)(50986999)(110136004)(7350300001)(6916009)(6666003)(2950100002)(47776003)(2906002)(9686003)(53936002)(66066001)(2361001)(106356001)(105586002)(2351001)(86362001)(305945005)(33646002)(7736002)(42186005)(81166006)(81156014)(107886003)(8676002)(103116003)(478600001)(85782001)(68736007)(50226002)(50466002)(3846002)(6486002)(25786009)(36756003)(97736004)(5660300001)(1076002)(6116002)(69596002)(5003940100001)(101416001)(4326008)(189998001)(48376002)(85772001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0501MB2047; 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) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=igor.mitsyanko.os@quantenna.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0501MB2047; 23:f72Eql5a1TQX8gbfyhrpgctt1UdcHT1VaE2Oabf?= =?us-ascii?Q?ABDk/TA5QkSO2a3RZ3iLhaV0Lv6FuSbemblHTOYVV7qdj+v+WxV4V2YSbXWG?= =?us-ascii?Q?15CJGteW4lMscDs6mKqjT5xvbau78AensOnDdDhIzK7MflN5uS8Zo0O3dDMe?= =?us-ascii?Q?NJa+tr48ZlPJRY+oQAn9N5iE+9Xux3iuMhHPtMHBEe2sHUTKVUVgOD1tbRiX?= =?us-ascii?Q?/GCUlLZ4NO+/G4B4xr5qWfS62wtJWNQnoGwX5+i5gf8UXFWHLJch7G6IMax4?= =?us-ascii?Q?G/yp27lfdx6BhD5JPE9yyDBDoO1IFIkE09y9A3v2GPIW6B8c+L+MnvfWIkcy?= =?us-ascii?Q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2e9NNUb1tKX7O6geKu?= =?us-ascii?Q?v48NVLT6WNXwq++qjWD45KB3eszV6ZozMy+2Cy/9H?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 6:zh6WTGYIN5kRVlLigp6zbe8PTMW8msye+wTQFDWRYqqcEFS3N5XMbDNGmiDUeZLviJ95cjQ9d2xEvEifCmQOe3jUmTrreVS7TVKrWSuPTWN9Yd8jhdDQnB18C+fjjFg7FFV33oFxYhyLkrrxGl+m5asC4tJuQVwdx/Wp4lSkCpCYhHFbYDmW4Qxo5CMeK22DURDkKrjKHCT9O8zLpFkFJCmDhKaPkWTLLoPHNVLPndRCw4EMTTJp1LAxl2x3ptasz9ZMj3n2OkjzFxKOCVdmgReJHAlEJT3aDcr4C1MQIUuyry4rn+Q67vjUN+q8Y1Dt7k0XhZNo1Ud1UIVVdW6t8w==; 5:/qvAJw2grzHJiyEZUd9dzWfFVnQ725tgTs/jsqqW32pkWO6FqWpYme16BgXPdQ5donjPMYOreX9ic2SzZg4qLmqbYMgCarrAvHTA3IncFBeOGdY4qwtpejjerhTILUJJvwQQFZnFknRAKCTRuZZE6w==; 24:hBjFoJHK+LqruUSSBGwUMBaLIKXaQq+DS/QxptzE3PbuRVfnRCRWWSkqELA9NmpNUR/kIUZo9XsZZ865fbISpb5kO/ZmqNIVxGkKci6hyGU=; 7:BAvn5NaRupYV+T8STxdyyZtbJjhxnLAX9wfsWTby5nh34macOSL2169QXu3QLAZcPuj+0LcxFa5YWAv8tMi2RhzW90lVX1JoS75A18sHYsk3XRBk2nUD+rt6Hh2AX5zktPKwDORKMcIliIWY4CVWHrBmMJNXnEAaNyMq7smzyeIpfLO4yn/yMoJm86/5dfX1t8VsjqYd/SThllwGC1b/aiW2CNTcjoXPOytevXW4UFQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 02:31:05.5265 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted 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 Data contained within "Append IEs" command (QLINK_CMD_MGMT_SET_APPIE) duplicates QTN_TLV_ID_IE_SET TLV. Conver 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 3faac7a..2497493 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -212,10 +212,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); } @@ -225,11 +225,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); } @@ -239,11 +239,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 cc37114..2e30c26 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -394,11 +394,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; @@ -406,21 +405,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 e584d2e..eba73fd 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -290,21 +290,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.