From patchwork Thu Oct 5 01:38:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mitsyanko X-Patchwork-Id: 9986289 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 6230860291 for ; Thu, 5 Oct 2017 01:38:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5319128C06 for ; Thu, 5 Oct 2017 01:38:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4802C28C3F; Thu, 5 Oct 2017 01:38:41 +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 8802428C06 for ; Thu, 5 Oct 2017 01:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751272AbdJEBiW (ORCPT ); Wed, 4 Oct 2017 21:38:22 -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 S1751201AbdJEBiU (ORCPT ); Wed, 4 Oct 2017 21:38:20 -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=HasipCtkUaPmJOUfkXuq7OdwXUOJWSjTeIkvEeG4FAU=; b=V0+2H69PhzS4BLPRrgLzW8m8q2dv6HuE1QICmYsYkb8tNUPpusscOZmakw4dS362nx/F3pOkm/o/wTfadLph+61ek0JixUf7whDPnC7EbSDhzM69a+8siJNjgSwCaPFK1psjN/pDrlnJ5rNfIDUDQ4dSsrg/ImAq/pAkH6W/UjI= 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:18 +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 2/8] qtnfmac: pass all AP settings to wireless card for processing Date: Wed, 4 Oct 2017 18:38:07 -0700 Message-Id: <20171005013813.13332-3-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: 1a3a0958-d43e-4c46-c6db-08d50b91c184 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:SN1PR0501MB2047; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 3:SGv4YLQBIkywkUeSW6F8MCPGScqE+R381gtysqoueeS1kGO5ZGfKlComxYQcwqa1/IrmtiN5aDccSEC2wyTCfAWEzuu52AP5e52A9vYVFOi/WRUKvwsy/eOF9FkTkNwF4Rbt8ErNDA7i6nXaF0lxj3JHOD1j3Q03qikywPBURtq2bFTfoEiillaUWKjOf8gO8BDbBcCUw7dX/fliwIwspvo4J+JuvL+uoIOv7UXxpLHVpadK1EHT7pzBy6gv4RTj; 25:VjZbXlLFtB01pU55M1pJLifCHFstSDcZfqSq3deG66PfAxbDd+fJE/qmVwjGeVcZ4z+O7gaQ/NL9AN7rCjNbqCrsf87EU1J2LUCS9rxxnbrsFVBIbA7oHCJ8GBcvu7zwNmAF+94wD/mKBEQ+b95awyx+I3sZ+JJaIEP50LupsRLqcBEDQ/K30uz7wTuLfXy8tl54sTQ5Njp9S7ctrEvHL1shpF0YFnS6pqjzxSuM5BjRB0ZC+pJNktsYmQHGDBpjaGTTD9a6jdSvJkWdCcT7KX7w8AH1JlTeCaydesmqISfZq9kwTWRGAYyX1HOBRQIsodLROShfEdM7Hn26bPn7Hw==; 31:z5GLU4mkWxk0A5i9lbMx1x/q0qHGCdZZ5RuuczpUI0CX2+MU2B/m9oERa26WbqasdXkTZ9qRvc7neJa19yN8Ob61o7EOIJcywOnLOzIZa63Gmm1LEi+1TXBSZYIBpri1tGlYlQSFOzmZ/ubZdsU1EOv02vJKcgeXG3o+DpPo4Pej6LAc0HtvO4QZWMdRTE/M7WniRmsPJrNk4rk206fxCC8K3G1szHs7EH6htphlYxg= 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:JGvE19Cl/uTp/c1+i+oD5feEZb6OBcXVZhyIWGxePtW5vtZz4MGVDNZiACNxmDCDU69Q9xloKoffe6c9/p2NeDsf/ftysGljfmKVWYdPzQscx8nrjjRXOUAUdKQag5Fd622fX8EIwpbjDkBthFFdbhJTUI62xvdiYd50WJRngsFaIgybtaG5QnmUIyFCzGDQ0GTz7qHugcXfSfd75uZphtbUCZ5/J4FMNjrsbAnasIAxAnaE+zz/T2c5cs1LHCUDq6PZtetKt/hcKU3vx5pZ8AIaAI59NR30fD5cGVcjUHeQNWlCAXDDIKQY+OjNQ2C0zvWGR1kK3tBvWDP2HSf1UnBZxZ+Fm8qU0kO9KrJSkq9nwW9AtleS4jTgoF9RPi8kPkgxRAKQf9G7P6mUFKGvDzg+3l0btnr5SZMU4+Um0Ye00vsHjeY6oRfB4atiSrOaPdEtVVlpYTC7ok+KII4W/IzhKozvzXFPhitvMwxGfV/bT7rtqPqiT0+yHoTrBdb5/c3FHw+1GVW68ALj/ag9k7QGorWKeK20tK+5gerd22Z/PfoFX/5nSQAnBKJdS39UifxkLgm8MsoZ8UAVlaprGLodKMWX4cIFnaljgibi/ks=; 4:RBzJuH2StRtgaxPj5XLUWFTCGV6WrjREfdV4Qy2ZGhVdcWnJuhjdUSYeNC052OgBsRgPQbyXQ1VTVLn3NlipBjXGdPAGhHavi4tmahlTmPZRBU8Wu34qmCCSeVc3sPLVvxYxeSTLLpkcp2DnuXtVY9nqivy7UOMZW9kWKPzE4GIP0zyYGDF6rkDSCxoXJGSv5wNwLhmVZ9R0DiYXXiblf5fOOo83XQeLy3cuv/h3Y1V0OIVfMXMt0AX6iexFRIa4 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)(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)(20264003)(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:kAs59wCpF6FLQKkV6COFtpLwl9a7Yg/k3EuL5j8?= =?us-ascii?Q?FZkphjI/SHRAbb3Isqc1gz3Dt0f1Uqeing1UuUMD8rElemaKNdPeqyHk2zbo?= =?us-ascii?Q?LftCmCZNzkWqZQP/fXp2s1E4c6ZIijpyo/RSEoYS6Qh52rwcpQKS3S/0zkjU?= =?us-ascii?Q?sXwb3DZyFyhsOtX8BprK/RAmFa+sqcR8QNUdmkSj8TrDKf5Z8tyUxUEIyUGI?= =?us-ascii?Q?nFPZQYi0Gh8bLcyLk/lWmgz+TlYHaaCQgLdRs/d/640+n24OZ3MDT6OsPIjB?= =?us-ascii?Q?sPZnyr17ft3SA9kd/6Im+5ly7pbGph07kEatexeJsPdvkBtYM0H5rXIz5B4B?= =?us-ascii?Q?bfVqiiX8k1JzTg5KCTg8K3GLtn7/jPubuu7TM2kFG7lVve2QRMrvvwxVkhyz?= =?us-ascii?Q?iQYjgPqGQ94NJGZsfe0yTxqEZ545VnmUe/GGhY+bPZ2r1lZAQK68UMzoD+0f?= =?us-ascii?Q?R8fKfd1HKL8sFTO80k74jVXnYuchLh7GG0DPOGt2yXGEi0nq7Ov/3UIgjPMM?= =?us-ascii?Q?T6S+bD3YzOuJN1yG9EMB8w1EJeO4WpZNmASQaK0RY3Sd/whraEdZXDDbeXXa?= =?us-ascii?Q?P19zKMhS9TOK9k4LONwrZc6HWuHE7hGMi+uoX9FW9PxyfGr962py1jjEnXSq?= =?us-ascii?Q?dpu1jy9boMXNnCgIUvFIMm7bhJgLFIsIGfv+oJezwKvI3a0WLbaMTbUT1a4R?= =?us-ascii?Q?xMYYi4oBHBBCiYZqL989LBbI858c1aB+hH8LsbmcqbjONsVElHuAoW34C07x?= =?us-ascii?Q?VBVhctZ3QYYH9TqN4hE6tPQ4wrYqz5/vTeJrEMmLnxIdB5zmx9hApyJiaNDf?= =?us-ascii?Q?FoUkzZ+PlQWzs12m+lH6MVekjme8A/MbpECRn7yw5ORL4ySKGq5w5Nd9K0XP?= =?us-ascii?Q?+9ZZHbCLFOB95MDxizYbOTQFZLVVhiXJE6GpUbOI/2i+NsbUI5UaRT9bP6im?= =?us-ascii?Q?mpr5wCTEMzIQwJ/oUaiw4tzV9vgv3dHAw8hSYtNy8QJFiEicCWnfwDIIFAj1?= =?us-ascii?Q?jWNo0tKEjiwocGFke3MN5SCeZXRPT9P29KLd/5iFNgXBZgvnmzDuJMA0bCmY?= =?us-ascii?Q?RjVJmKtNJ17n3abkleRsfg5tCqICtqqNwhfQzw3cgBCMqdTft1N3al4Q85Ob?= =?us-ascii?Q?PZ0nxPW/Y11w1jE8w/1sboYIh6tX6vNCafHUZFI3+292woUDt8XzmvbilO2W?= =?us-ascii?Q?dtjvQ5HmowMDwYqorMLyzS8iOfH8xAae+mN2ASBS9LurVPnSUNWIGD6tteV/?= =?us-ascii?Q?ezfdfPpz8pEpsD8xgxQ++XDF3D17E2PLXZ/URV8Dc?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 6:TSwCI3RRUC9KQE2ZR/a2B7oKpEOEeeHxQmkhRiq+UgtAqjqJkewUMyCPbVIOFYQ0l6pIFaLzdwbQ73PaIpCbs+HLlKOhTpFnZWBNurwPwB+B058wsi6mtrvHCSEtHu4dKFdNs+ysMgl8zkwSNgAdaIl2gTPaRAVJdIGA6r90JvITxu8YA6ZDXVC4ZGNlmO3CFWc0VUhLSl5equ9w+d3VGRYLSy8HJcC8MJDnR+PMu+BXZlsX4RdyLr9Un75s5kD7dDTQYoCdtwKS7/TzftNXTZD2ROJbP1bNVYhw839Ztv6UHVn+kcW8EPYrLmLJfrTwRrlJXgI+Apph0iwG9yfneA==; 5:iIWDm46ewaP66m+EIue7TVO0xs9f/BQZqT7+mqkXh/eY20y1jnQVlQpVYIk1bF/Lr52CR5be/Ku8ZbH2+T51Np5sHkJ/KDuVzDS7rFBUGYq0iyVjQ96AEsIPCtS1Xef9xocxDdnJbLjXq7usNqSRag==; 24:8k+7rR75EBKCd3wLlXpKntchPFSOxwQ27izaZXN3X1Y1Phfzw7B7MbC+JjSh7ohDOf2Mi4jbqTiAWyvn9KHWZdwrDyTH24hQa7X/Jr7U58w=; 7:9jpQysYrxIHd1Ns+iP3LG5u5QISAUpFBvowq8FN3N+a0YE3qIKb2o3qw+xG+NEktbRXWrP5IFLMYkamKqQrN0QH29zrr5Co1GLIbRRYFgzX6LRFK/ThHLPFqVOHREvIcg8QC4270XixMyTPvSFp/aeLc1uqYx5DQKaUqZfgXAsSBPlZZtQe/qCs9r1E9kZNmHcMFGybUh4IwzYwSRNmq+VYeYKgyum96PI+IlJ7hq90= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2017 01:38:18.3285 (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 Modify QLINK START_AP command payload to pass all AP settings contained within struct cfg80211_ap_settings. Make most of settings a constant part of "config AP" command instead of passing it as an optional TLVs. Signed-off-by: Igor Mitsyanko --- drivers/net/wireless/quantenna/qtnfmac/commands.c | 52 ++++++++------- drivers/net/wireless/quantenna/qtnfmac/qlink.h | 78 ++++++++++++++++------ .../net/wireless/quantenna/qtnfmac/qlink_util.c | 13 ++++ .../net/wireless/quantenna/qtnfmac/qlink_util.h | 1 + 4 files changed, 101 insertions(+), 43 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 88fdf7d..493c3f8 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -187,27 +187,34 @@ int qtnf_cmd_send_config_ap(struct qtnf_vif *vif, struct sk_buff *cmd_skb; struct cfg80211_chan_def *chandef = &vif->mac->chandef; struct qlink_tlv_channel *qchan; - struct qlink_auth_encr aen; + struct qlink_cmd_config_ap *cmd; + struct qlink_auth_encr *aen; u16 res_code = QLINK_CMD_RESULT_OK; int ret; int i; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, QLINK_CMD_CONFIG_AP, - sizeof(struct qlink_cmd)); + sizeof(*cmd)); if (unlikely(!cmd_skb)) return -ENOMEM; - qtnf_bus_lock(vif->mac->bus); + cmd = (struct qlink_cmd_config_ap *)cmd_skb->data; + cmd->dtim_period = s->dtim_period; + cmd->beacon_interval = cpu_to_le16(s->beacon_interval); + cmd->hidden_ssid = qlink_hidden_ssid_nl2q(s->hidden_ssid); + cmd->inactivity_timeout = cpu_to_le16(s->inactivity_timeout); + cmd->smps_mode = s->smps_mode; + cmd->p2p_ctwindow = s->p2p_ctwindow; + cmd->p2p_opp_ps = s->p2p_opp_ps; + cmd->pbss = s->pbss; + cmd->ht_required = s->ht_required; + cmd->vht_required = s->vht_required; if (s->ssid && s->ssid_len > 0 && s->ssid_len <= IEEE80211_MAX_SSID_LEN) qtnf_cmd_skb_put_tlv_arr(cmd_skb, WLAN_EID_SSID, s->ssid, s->ssid_len); - qtnf_cmd_skb_put_tlv_u16(cmd_skb, QTN_TLV_ID_BCN_PERIOD, - s->beacon_interval); - qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_DTIM, s->dtim_period); - qchan = skb_put_zero(cmd_skb, sizeof(*qchan)); qchan->hdr.type = cpu_to_le16(QTN_TLV_ID_CHANNEL); qchan->hdr.len = cpu_to_le16(sizeof(*qchan) - @@ -215,26 +222,25 @@ int qtnf_cmd_send_config_ap(struct qtnf_vif *vif, qchan->hw_value = cpu_to_le16( ieee80211_frequency_to_channel(chandef->chan->center_freq)); - memset(&aen, 0, sizeof(aen)); - aen.auth_type = s->auth_type; - aen.privacy = !!s->privacy; - aen.mfp = 0; - aen.wpa_versions = cpu_to_le32(s->crypto.wpa_versions); - aen.cipher_group = cpu_to_le32(s->crypto.cipher_group); - aen.n_ciphers_pairwise = cpu_to_le32(s->crypto.n_ciphers_pairwise); + aen = &cmd->aen; + aen->auth_type = s->auth_type; + aen->privacy = !!s->privacy; + aen->mfp = 0; + aen->wpa_versions = cpu_to_le32(s->crypto.wpa_versions); + aen->cipher_group = cpu_to_le32(s->crypto.cipher_group); + aen->n_ciphers_pairwise = cpu_to_le32(s->crypto.n_ciphers_pairwise); for (i = 0; i < QLINK_MAX_NR_CIPHER_SUITES; i++) - aen.ciphers_pairwise[i] = - cpu_to_le32(s->crypto.ciphers_pairwise[i]); - aen.n_akm_suites = cpu_to_le32(s->crypto.n_akm_suites); + aen->ciphers_pairwise[i] = + cpu_to_le32(s->crypto.ciphers_pairwise[i]); + aen->n_akm_suites = cpu_to_le32(s->crypto.n_akm_suites); for (i = 0; i < QLINK_MAX_NR_AKM_SUITES; i++) - aen.akm_suites[i] = cpu_to_le32(s->crypto.akm_suites[i]); - aen.control_port = s->crypto.control_port; - aen.control_port_no_encrypt =s->crypto.control_port_no_encrypt; - aen.control_port_ethertype = + aen->akm_suites[i] = cpu_to_le32(s->crypto.akm_suites[i]); + aen->control_port = s->crypto.control_port; + aen->control_port_no_encrypt = s->crypto.control_port_no_encrypt; + aen->control_port_ethertype = cpu_to_le16(be16_to_cpu(s->crypto.control_port_ethertype)); - qtnf_cmd_skb_put_tlv_arr(cmd_skb, QTN_TLV_ID_CRYPTO, (u8 *)&aen, - sizeof(aen)); + 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 fb88f3e..6814254 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -132,6 +132,24 @@ struct qlink_chandef { u8 rsvd[3]; } __packed; +#define QLINK_MAX_NR_CIPHER_SUITES 5 +#define QLINK_MAX_NR_AKM_SUITES 2 + +struct qlink_auth_encr { + __le32 wpa_versions; + __le32 cipher_group; + __le32 n_ciphers_pairwise; + __le32 ciphers_pairwise[QLINK_MAX_NR_CIPHER_SUITES]; + __le32 n_akm_suites; + __le32 akm_suites[QLINK_MAX_NR_AKM_SUITES]; + __le16 control_port_ethertype; + u8 auth_type; + u8 privacy; + u8 mfp; + u8 control_port; + u8 control_port_no_encrypt; +} __packed; + /* QLINK Command messages related definitions */ @@ -521,6 +539,46 @@ struct qlink_cmd_chan_switch { u8 beacon_count; } __packed; +/** + * enum qlink_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID + * + * Refer to &enum nl80211_hidden_ssid + */ +enum qlink_hidden_ssid { + QLINK_HIDDEN_SSID_NOT_IN_USE, + QLINK_HIDDEN_SSID_ZERO_LEN, + QLINK_HIDDEN_SSID_ZERO_CONTENTS +}; + +/** + * struct qlink_cmd_config_ap - data for QLINK_CMD_CONFIG_AP command + * + * @beacon_interval: beacon interval + * @inactivity_timeout: station's inactivity period in seconds + * @dtim_period: DTIM period + * @hidden_ssid: whether to hide the SSID, one of &enum qlink_hidden_ssid + * @smps_mode: SMPS mode + * @ht_required: stations must support HT + * @vht_required: stations must support VHT + * @aen: encryption info + * @info: variable configurations + */ +struct qlink_cmd_config_ap { + struct qlink_cmd chdr; + __le16 beacon_interval; + __le16 inactivity_timeout; + u8 dtim_period; + u8 hidden_ssid; + u8 smps_mode; + u8 p2p_ctwindow; + u8 p2p_opp_ps; + u8 pbss; + u8 ht_required; + u8 vht_required; + struct qlink_auth_encr aen; + u8 info[0]; +} __packed; + /* QLINK Command Responses messages related definitions */ @@ -881,8 +939,6 @@ enum qlink_tlv_id { QTN_TLV_ID_RTS_THRESH = 0x0202, QTN_TLV_ID_SRETRY_LIMIT = 0x0203, QTN_TLV_ID_LRETRY_LIMIT = 0x0204, - QTN_TLV_ID_BCN_PERIOD = 0x0205, - QTN_TLV_ID_DTIM = 0x0206, QTN_TLV_ID_REG_RULE = 0x0207, QTN_TLV_ID_CHANNEL = 0x020F, QTN_TLV_ID_COVERAGE_CLASS = 0x0213, @@ -1072,24 +1128,6 @@ struct qlink_tlv_channel { u8 rsvd[2]; } __packed; -#define QLINK_MAX_NR_CIPHER_SUITES 5 -#define QLINK_MAX_NR_AKM_SUITES 2 - -struct qlink_auth_encr { - __le32 wpa_versions; - __le32 cipher_group; - __le32 n_ciphers_pairwise; - __le32 ciphers_pairwise[QLINK_MAX_NR_CIPHER_SUITES]; - __le32 n_akm_suites; - __le32 akm_suites[QLINK_MAX_NR_AKM_SUITES]; - __le16 control_port_ethertype; - u8 auth_type; - u8 privacy; - u8 mfp; - u8 control_port; - u8 control_port_no_encrypt; -} __packed; - struct qlink_chan_stats { __le32 chan_num; __le32 cca_tx; diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c index 3c1db5b..63a74b2 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c @@ -127,3 +127,16 @@ void qlink_chandef_q2cfg(struct wiphy *wiphy, break; } } + +enum qlink_hidden_ssid qlink_hidden_ssid_nl2q(enum nl80211_hidden_ssid nl_val) +{ + switch (nl_val) { + case NL80211_HIDDEN_SSID_ZERO_LEN: + return QLINK_HIDDEN_SSID_ZERO_LEN; + case NL80211_HIDDEN_SSID_ZERO_CONTENTS: + return QLINK_HIDDEN_SSID_ZERO_CONTENTS; + case NL80211_HIDDEN_SSID_NOT_IN_USE: + default: + return QLINK_HIDDEN_SSID_NOT_IN_USE; + } +} diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h index 5e49a8a..416f11d 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h @@ -66,5 +66,6 @@ u8 qlink_chan_width_mask_to_nl(u16 qlink_mask); void qlink_chandef_q2cfg(struct wiphy *wiphy, const struct qlink_chandef *qch, struct cfg80211_chan_def *chdef); +enum qlink_hidden_ssid qlink_hidden_ssid_nl2q(enum nl80211_hidden_ssid nl_val); #endif /* _QTN_FMAC_QLINK_UTIL_H_ */