From patchwork Thu May 31 09:11:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10440563 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 0D5766035E for ; Thu, 31 May 2018 09:11:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07295290A1 for ; Thu, 31 May 2018 09:11:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EFE97291B9; Thu, 31 May 2018 09:11:33 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, 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 72907290A1 for ; Thu, 31 May 2018 09:11:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754277AbeEaJLc (ORCPT ); Thu, 31 May 2018 05:11:32 -0400 Received: from mail-by2nam01on0082.outbound.protection.outlook.com ([104.47.34.82]:40832 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754183AbeEaJLY (ORCPT ); Thu, 31 May 2018 05:11:24 -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:X-MS-Exchange-SenderADCheck; bh=ZPKgn+Wh2rol92hkVrxWRyJR9Kf7H8zOOjWVm2XAb3k=; b=iykgvwBw2DqzkqMUf2HtkOdFt1HwrJD8tPWdMOnuxGqybmISiicrdJa6RlRzrXZZsFPgbH83xsF02y3gx4ISRvhwJQbVBF+n2Gcze5P7rx0hPuPF+wJmz5xiDnQmAYA/Dd+yJ6skgkS/upXMq0JMm2hDXBvSfKo/3SsKzrO00wg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BY2PR05MB1926.namprd05.prod.outlook.com (2a01:111:e400:58f7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.5; Thu, 31 May 2018 09:11:20 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Andrey Shevchenko , Sergei Maksimenko Subject: [PATCH 4/6] qtnfmac: enable multiple SSIDs scan support Date: Thu, 31 May 2018 12:11:00 +0300 Message-Id: <20180531091102.28666-5-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180531091102.28666-1-sergey.matyukevich.os@quantenna.com> References: <20180531091102.28666-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM6PR0102CA0019.eurprd01.prod.exchangelabs.com (2603:10a6:209:14::32) To BY2PR05MB1926.namprd05.prod.outlook.com (2a01:111:e400:58f7::12) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BY2PR05MB1926; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1926; 3:dgEotPaLoPSc/K5Xcv8CYxJxRtMpbleCGcMqZUjBgyZlbfNhBnha6ki4d+TdGGRpEXUAKNgaX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X5K2z827T2XedV8BmDe0yDzMf2hbw/hcW1OHwqxYMVIRfiH/1Iqx9GI/9kx3dRAfEFrGcSMhnIvv3/iqR39JxSZrp8FiS50pKg8i4eqaOdLikAviJTGJ8Nhp1O4KmGMMwfk9dO2hef2gjQcjd3v9QfDHlqaehUqL+W3MQY0M+BfFdGV7nE/w+akilAJXof2nhRapMHflvn6oU1ynyX10G8XDKXYR3lZdn6ZMmNFCx8P+XaWNpL4CySxZE1szheXb4hQFb0z6WjlMutIgyE//4cjyU; 4:IWPm6/1zZb8NC1NqA0sDFbtT7Xpo+HDSbKPa7zfOcm05I8rFkhWy87kKek6C4PNiAc96aVwt/Tl/6d+sPrz3qbfU6DkSnotRZPv/SHNJjWVHyAZsJbwJ5/2y+FbiyLD+JbORZkBsaPRNgb/Lw01xzyEw0fCCbH80CwmXxEHfK04pV5iPS2TtPswHz7jU15cwJVKwNGapz1BCAhWjKfGkAdD8khuns8jIIx/leMyZyGr6VQH7a4e3DJ9nYlwhQAkNVvjnmoLp8BwTCZmiyHlnqQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:BY2PR05MB1926; BCL:0; PCL:0; RULEID:; SRVR:BY2PR05MB1926; X-Forefront-PRVS: 06891E23FB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(366004)(39850400004)(396003)(39380400002)(346002)(199004)(189003)(52116002)(2906002)(68736007)(6116002)(6916009)(59450400001)(48376002)(3846002)(11346002)(2351001)(106356001)(7696005)(2616005)(476003)(81156014)(53936002)(76176011)(105586002)(956004)(2361001)(1076002)(26005)(16526019)(186003)(386003)(6666003)(36756003)(5660300001)(81166006)(51416003)(8936002)(478600001)(8676002)(54906003)(16586007)(86362001)(6486002)(50226002)(316002)(53416004)(446003)(25786009)(50466002)(69596002)(7736002)(47776003)(486006)(305945005)(107886003)(4326008)(97736004)(103116003)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR05MB1926; H:bars.quantenna.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR05MB1926; 23:wiIR7TP9ecsyvWR1ksOeUBVsRFjWfbO1SXE9hSrA5?= =?us-ascii?Q?1xPFtYc4VIx+WEwIZNCNCq1efdf0BcfE4c/5ie6zZRaJd81Oi6IaqGJ4P82s?= =?us-ascii?Q?V8Mseun4mDzBvkYluMuxdXMXOJTGrFnJR6kMUFIgDIk4YfFVBgl1GvBRWfaF?= =?us-ascii?Q?6xQfrkTaS+GQaClNK+yD6cU2b8hGmKO5TSqTntPuNSGCjAtSmJbW5cof5zWx?= =?us-ascii?Q?7Z09JgSlmc0x2/bAsXlb0aY1AxEGxmVIsAdOHvwfXFMaGqzZ0S1zMFkE0Am7?= =?us-ascii?Q?Jt1jvEeWX9t+WpyxZ9f4tUHIi1+WLumnHSA2a0cRsZZu1EI7OpiXw76nWIa/?= =?us-ascii?Q?IgN0P5Liqn4iZBTrofkcln1IAxCmVvocuA9qziSz3PtuC65Pe5Ucgnr/QJlX?= =?us-ascii?Q?9RIYFgtHzBGQ6ifA9jgKLj42BYmOwE0OVytrtS+BdbuxnbOvHz58sYagiK6V?= =?us-ascii?Q?EMVmDJeiZ8OnmnHnJ/Oy+xuqKu2FkuuCHd79+nJBBesvsnnzK+RVTJVOD6W8?= =?us-ascii?Q?oSOqVM/sHxz4uLMaYTx9tA+wQOssk2L3xosOby9BF5PqQnsZJf7qNc03JEtq?= =?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am7HHbQrwnQwFizR4yPKG7M9JpdAQN7bZHJEJbtiLQnPpT4rNvlGN8FxApLt/YxMFoyyxK1CXkWwi9C5PQu4CWiVYu7kL9ERGaJkazJuhlf1GW2Rkx2Ow7a X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1926; 6:U6S36FRDbMXxNUdHzFGrj/cWkjEpC/MCb3gehrcIiW27rAiE9R2LIasDnLiWvxXhEkCOSMg8k0zKUeN+//qZhKElVabRqfe1J4PX5NZFHvnlTnPtxndHTkw5JSdPgMpF5VB5gkrvOWevaqh6w75Ujg4+ZecqiMR3hmydk/LQoqbf6wrboVwe010duMzpXUZwMfEohrxvee0hMs7APmFD5DRmIA8VS24LOAbKbRRg0ZULNrk7qf8q7WhCYkY7JTR9/4uaF6z/3VfhdYoJzLQj26degildps1jJwP32FN/kR7TU+ouTWid2j4Avckm9ahVdqRzSnLr7QXmbKiSOZcnfIhaGk8JX79yRzXV6pCkTxF/L4IXiuyle4oQ8t+NoI+YVBTBmzObIxntt9AmDP5Ye1gpgBWgn1sq7IYCugPraUljS1iy8GGBivYSBTb6d01BwXlgzkRXCAo689UqQdfkfQ==; 5:e5jFzzS+lpInZtPLhCDIS3uXd03yZtn4vR25bNRD/+Nm3PLXFilpD1cHInicF2A3gCBZ1+qZQBGDDeU2oHrP/7Ab4r6FQz/ruuAR9XK6PzBjhogXEs3E3Dkd0EUKORvhxVe8DdDCTcNH8BxuEjKULwqq8wlzi8l0fNF9wETFFk4=; 24:HOuCA5ifE4lhdPGS/t2RA9ccKHDc4dBlrcM5nuGsS3bWxwa29zK6QztGKsnoXiqMIkg26eh3JmJ3HS9E5ucYh9hpIGRz6hCjXrwyUv0U+3s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1926; 7:6LsYOia4Rj9nUkJUwyOU3yx1uaAMdIryJ7S3Zqt2NrVlF35wr5ne2GjUOHWiTO3XhudDedX4Nz152nsPTNQI2wrAxVXDuLxcpeAHgMSXbplEWVEgcLXGp2WhA55bY3wCDSjyBqWt2Gf9lWdoemhDX6ubjY4zYtUAFo3qAQuwJ35XRRJnGblWl+1GHHf78aVYMCy9wy485nyraw0cli+3CgBDGsl+0LqOwP7VnumYOUAPLehghoXvyyBl7BQisf6k X-MS-Office365-Filtering-Correlation-Id: 0c0e4d45-896b-4379-0d2e-08d5c6d67a53 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2018 09:11:20.8457 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c0e4d45-896b-4379-0d2e-08d5c6d67a53 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB1926 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: Andrey Shevchenko Enable support for multiple SSIDs scans. Get max number of supported SSIDs from firmware and report to cfg80211 core. Signed-off-by: Andrey Shevchenko --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 3 ++- drivers/net/wireless/quantenna/qtnfmac/commands.c | 8 +++----- drivers/net/wireless/quantenna/qtnfmac/core.h | 2 +- drivers/net/wireless/quantenna/qtnfmac/qlink.h | 3 +++ 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 15bc26c9933f..307ab5c59bfd 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -996,7 +996,8 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac) wiphy->retry_long = macinfo->lretry_limit; wiphy->coverage_class = macinfo->coverage_class; - wiphy->max_scan_ssids = QTNF_MAX_SSID_LIST_LENGTH; + wiphy->max_scan_ssids = + (hw_info->max_scan_ssids) ? hw_info->max_scan_ssids : 1; wiphy->max_scan_ie_len = QTNF_MAX_VSIE_LEN; wiphy->mgmt_stypes = qtnf_mgmt_stypes; wiphy->max_remain_on_channel_duration = 5000; diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index a96d58f72c07..10836695c5f5 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -1092,6 +1092,9 @@ qtnf_cmd_resp_proc_hw_info(struct qtnf_bus *bus, case QTN_TLV_ID_UBOOT_VER: uboot_ver = (const void *)tlv->val; break; + case QTN_TLV_ID_MAX_SCAN_SSIDS: + hwinfo->max_scan_ssids = *tlv->val; + break; default: break; } @@ -2260,11 +2263,6 @@ int qtnf_cmd_send_scan(struct qtnf_wmac *mac) int count = 0; int ret; - if (scan_req->n_ssids > QTNF_MAX_SSID_LIST_LENGTH) { - pr_err("MAC%u: too many SSIDs in scan request\n", mac->macid); - return -EINVAL; - } - cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, QLINK_VIFID_RSVD, QLINK_CMD_SCAN, sizeof(struct qlink_cmd)); diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index 214435448335..c4808f1ba8b0 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -40,7 +40,6 @@ #undef pr_fmt #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__ -#define QTNF_MAX_SSID_LIST_LENGTH 2 #define QTNF_MAX_VSIE_LEN 255 #define QTNF_MAX_INTF 8 #define QTNF_MAX_EVENT_QUEUE_LEN 255 @@ -145,6 +144,7 @@ struct qtnf_hw_info { u8 total_rx_chain; char fw_version[ETHTOOL_FWVERS_LEN]; u32 hw_version; + u8 max_scan_ssids; }; struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac); diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index cbdebf0410df..8fbef67fbbb8 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -1091,6 +1091,8 @@ struct qlink_event_radar { * @QTN_TLV_ID_STA_STATS: per-STA statistics as defined by * &struct qlink_sta_stats. Valid values are marked as such in a bitmap * carried by QTN_TLV_ID_STA_STATS_MAP. + * @QTN_TLV_ID_MAX_SCAN_SSIDS: maximum number of SSIDs the device can scan + * for in any given scan. */ enum qlink_tlv_id { QTN_TLV_ID_FRAG_THRESH = 0x0201, @@ -1119,6 +1121,7 @@ enum qlink_tlv_id { QTN_TLV_ID_CALIBRATION_VER = 0x0406, QTN_TLV_ID_UBOOT_VER = 0x0407, QTN_TLV_ID_RANDOM_MAC_ADDR = 0x0408, + QTN_TLV_ID_MAX_SCAN_SSIDS = 0x0409, }; struct qlink_tlv_hdr {