From patchwork Mon Jan 22 12:46:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10178447 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 5D1DB60224 for ; Mon, 22 Jan 2018 12:47:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A352281DB for ; Mon, 22 Jan 2018 12:47:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4ED0728236; Mon, 22 Jan 2018 12:47:03 +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 D5FB0281DB for ; Mon, 22 Jan 2018 12:47:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751099AbeAVMrB (ORCPT ); Mon, 22 Jan 2018 07:47:01 -0500 Received: from mail-bl2nam02on0074.outbound.protection.outlook.com ([104.47.38.74]:27801 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751024AbeAVMq6 (ORCPT ); Mon, 22 Jan 2018 07:46:58 -0500 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=0XXfq7YKDH+c9MNeSj+tH4LVa3mNEiF6VAJPSrQbiSI=; b=10JFCO+nEDZHzkZI1ZlRCNx5F1iB+HLYRFsae9xj0jOYQtEzhBuKKj2T9MOqXN8OKq3EqaEXXeTVXnex/7UCN/QQkkHoG5CuInmxIwjr7WV11bVR5haiQmrewISzpgXyFTMs3VETKgpIXFfXzyVV+wnzXWhogReOzzg3yRpwPCw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by CY1PR05MB1931.namprd05.prod.outlook.com (10.162.216.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.5; Mon, 22 Jan 2018 12:46:55 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Vasily Ulyanov Subject: [PATCH 01/11] qtnfmac: remove struct qlink_cmd_set_mac_acl Date: Mon, 22 Jan 2018 15:46:24 +0300 Message-Id: <20180122124634.8430-2-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180122124634.8430-1-sergey.matyukevich.os@quantenna.com> References: <20180122124634.8430-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: VI1PR08CA0220.eurprd08.prod.outlook.com (10.170.234.157) To CY1PR05MB1931.namprd05.prod.outlook.com (10.162.216.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52572266-bf03-4fd5-65bd-08d5619638e9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534125)(4602075)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:CY1PR05MB1931; X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1931; 3:7lzXRb91WQMgm6QSsXi1KJk0EGX1fXiez+l+YVCc7RzOc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oSlvZy0mkWVAhORQybj7vjn0Z5C1+cIkf4Yeori5RTfHTsy1mLcuJ4p5bN76xLGh/APO3+XU/fpMYfLCnoGa6mgPazg+574dez5RLgcaKGON3lOJyNRRnOP9KBKcEIhweBpniW4b+V3YcwTeTA8Gb+7kN8BiXjPvZ0q8tXK4FtG0EurKHEXXwiXI4Ajkxjem72k36BTSSoWLUJPJ4xHOYbYfpF/DCzcUCsNTBWrqCupHW8iSLsiSzftFxSpRY+MuKhutpqt6NvuGk59FqkWNVT5sLjfpgUVwDbnspbjGVTwMOQnxBDrYEuG9yHpvlBOjD+pRYCRGXh6BR; 4:lixce2x0syGsnzPUgdYyQAGJgCqHDeT3udTWoNaw4uvUyO3E5GZL4bo7fyX4JiCqfAKWiHdQuJlFEScGnIMaKM76PRV0Hp7cpa4whkAZQHtuTqiDcI9SMMTEKDwlkQoP0r1SDOAQTVOZvsLGXe2AUUcuvf4NQn1EhEHWPNSklmKKxo3ZJhoGr7l15UzRcTPhfdXErFCkzJTsp55f58DP1hdbK6zUciXIUW+vJUXHDXt+NcEX2OxDggk06q777TK8y3T5A0xqmEHjbvImQpm+Eg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3231023)(2400081)(944501161)(10201501046)(3002001)(93006095)(93001095)(6041288)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY1PR05MB1931; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY1PR05MB1931; X-Forefront-PRVS: 0560A2214D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39840400004)(396003)(366004)(346002)(39380400002)(199004)(189003)(2351001)(25786009)(52116002)(1076002)(6116002)(26005)(59450400001)(2361001)(36756003)(4326008)(76176011)(107886003)(478600001)(8676002)(8936002)(50226002)(7736002)(81166006)(6916009)(6666003)(2950100002)(305945005)(2906002)(106356001)(105586002)(68736007)(6486002)(81156014)(53936002)(48376002)(66066001)(16526018)(47776003)(103116003)(97736004)(50466002)(5660300001)(3846002)(386003)(16586007)(316002)(51416003)(7696005)(53416004)(54906003)(69596002)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR05MB1931; H:bars.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; CY1PR05MB1931; 23:awT9dDUPNG/ydplxxvQVikmPdeRykFPoCY9qeekGi?= =?us-ascii?Q?wQke2yr77aYawKXZ8BPu/yi9e21cB8LrNTww4H4kZ4gU1HfeTb9AP+enL8EA?= =?us-ascii?Q?ZaiJI4ISlHM/9kWQrh7TePCWZhm1+6WnaLRlKOk7Fa5LcQmEbCZlhAmkOsvA?= =?us-ascii?Q?2Tz+SDn/s7AbEIEb2oLXO1TCivSo5qinkJ9PAxluJxPP+VK4RUkcFvXja7fa?= =?us-ascii?Q?dbys9Pi3ubXy/EboRmGNdew5aQHYicb/nkOzHUV266tmoqxO1N1Pp0rLY4DW?= =?us-ascii?Q?kcjq90r6PFRQ+JWrCWosrbThtc6WxjxOz5k9KxxQCmhML6jNMCIPKhYXcbTS?= =?us-ascii?Q?ptmuyV5k0emaTlFmkb6SIsM+psiCgBlfDcAKMM1jpdFm9I2T8qEJRj8GVwFo?= =?us-ascii?Q?yA9rJsUrxZw2Vivn64gWzDP3Bkf5Sf579LayFWMaS5W17DdkgTHjgf9x39+s?= =?us-ascii?Q?nOlDBDIE+FTZB0V5T2il0BfqCuq5uQsw0FqdzpTdQYdg1s+RXy5zNhWmRGqz?= =?us-ascii?Q?58jcwcoiAwMP6MWQVT8o5Ha4xmKdUt80ovWji053Zs+KW8Q3LOp0yhm+jDuG?= =?us-ascii?Q?Uxj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02zpMYsQl20p4W53jQKx5JSnBqUwRhl5pIvnl+bBMdaE0eld9z2hyidpz4POcobHSAkoyyV56yLs0JX1sbLOzvECpsDNizQNc9wVdv+SZVFa5LfRWnKuqcaEhEzT9GrHFm5hBfad6XtbsuQtw+fYfgAZAnIos=; 5:5XuDG180PxPKRfUFFSV7cGNBWtSPuEDdNYIrWv+zM/Inw93UO917D2/42Wb65nkFpBCjLizu56pr7rNYfdFJBCohOdh0m7rkBdTZ79Eywj+76WSJTk7hOHBD8TgH+bX9waBT0GYMQbXOAxTL88OPbGKx2Zv9fsEe9LcW05f/ifg=; 24:J80GEcNWCBxcZ+sRCBlYeJWp32supTrRvgv5+uYGLbMBgACs2BYEA5MPC8jW9Qbq00TFK0V+J2ImY6kvlGcw7gx+uuLAiLjS/Y4Kb595olQ=; 7:/Uz/WNiZ1trM08OKRA2lp+cPPM7v707pGtOCOBYXQHn6H7+IGdnijgJNAE7E/R92eAqSE2qxI3bocYs+VycxG1ArW9zeVDpKv2B/nOSyGCR/aIIHKOTIgzmhs8PPa6jJ8Qh75IsxzjyzWPVoBX4+eEooqvrxKzpcmKPJoA17BhBaB69o0kzIOJ7hG/9YygzKe2fHOztEPg9AB9S7FmflD4QlTIzD+89lEsp2DesrVcvkrxUqlQQ67djXp3lb/JEe SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2018 12:46:55.7633 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52572266-bf03-4fd5-65bd-08d5619638e9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR05MB1931 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: Vasily Ulyanov TLV is used to pass ACL data to firmware in start_ap cfg80211 callback. Use the same approach in set_mac_acl cfg80211 callback. Signed-off-by: Vasily Ulyanov --- drivers/net/wireless/quantenna/qtnfmac/commands.c | 15 +++++++++------ drivers/net/wireless/quantenna/qtnfmac/qlink.h | 10 ---------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 6ffe4837bbdb..b47b06bd680f 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -187,7 +187,8 @@ static bool qtnf_cmd_start_ap_can_fit(const struct qtnf_vif *vif, len += sizeof(struct qlink_tlv_chandef); if (s->acl) - len += qtnf_cmd_acl_data_size(s->acl); + len += sizeof(struct qlink_tlv_hdr) + + qtnf_cmd_acl_data_size(s->acl); if (len > (sizeof(struct qlink_cmd) + QTNF_MAX_CMD_BUF_SIZE)) { pr_err("VIF%u.%u: can not fit AP settings: %u\n", @@ -2637,19 +2638,21 @@ int qtnf_cmd_set_mac_acl(const struct qtnf_vif *vif, { struct qtnf_bus *bus = vif->mac->bus; struct sk_buff *cmd_skb; - struct qlink_cmd_set_mac_acl *cmd; + struct qlink_tlv_hdr *tlv; + size_t acl_size = qtnf_cmd_acl_data_size(params); u16 res_code; int ret; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, QLINK_CMD_SET_MAC_ACL, - sizeof(*cmd) + - qtnf_cmd_acl_data_size(params)); + sizeof(struct qlink_cmd)); if (unlikely(!cmd_skb)) return -ENOMEM; - cmd = (struct qlink_cmd_set_mac_acl *)cmd_skb->data; - qlink_acl_data_cfg2q(params, &cmd->acl); + tlv = skb_put(cmd_skb, sizeof(*tlv) + acl_size); + tlv->type = cpu_to_le16(QTN_TLV_ID_ACL_DATA); + tlv->len = cpu_to_le16(acl_size); + qlink_acl_data_cfg2q(params, (struct qlink_acl_data *)tlv->val); qtnf_bus_lock(bus); ret = qtnf_cmd_send(bus, cmd_skb, &res_code); diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 6a1f960228a1..f4d49565161e 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -663,16 +663,6 @@ struct qlink_acl_data { struct qlink_mac_address mac_addrs[0]; } __packed; -/** - * struct qlink_cmd_set_mac_acl - data for QLINK_CMD_SET_MAC_ACL command - * - * @acl: ACL data. - */ -struct qlink_cmd_set_mac_acl { - struct qlink_cmd chdr; - struct qlink_acl_data acl; -} __packed; - /* QLINK Command Responses messages related definitions */