From patchwork Fri Oct 5 10:11:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627791 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-2.web.codeaurora.org (Postfix) with ESMTP id 0DB5215E2 for ; Fri, 5 Oct 2018 10:11:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A02D28E36 for ; Fri, 5 Oct 2018 10:11:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F27C828E3E; Fri, 5 Oct 2018 10:11:32 +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 491DB28E36 for ; Fri, 5 Oct 2018 10:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728020AbeJERJg (ORCPT ); Fri, 5 Oct 2018 13:09:36 -0400 Received: from mail-bl2nam02on0042.outbound.protection.outlook.com ([104.47.38.42]:30496 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727616AbeJERJf (ORCPT ); Fri, 5 Oct 2018 13:09:35 -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=Y42ppIgBX5CrXQDb+54JHqLDJRBqNShEOU+0+PepX14=; b=LaTxkl/5WA8fITS+ZAy6trjJtuVylKrF5Eyz1AcC8cz5Ss8cKVMqKz33fLUHKLWnGYKUo2LviEQF2okN7RNAxhQGHQ8XqtXrijU4GEOWSkA61qKfvHLzts5UHjpsBkbQh7zhheTtmiJDyVGjss2aRvg7a/yn5tiXgeEKPvLdKeo= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB4375.namprd05.prod.outlook.com (52.135.202.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.13; Fri, 5 Oct 2018 10:11:27 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:27 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Sergey Matyukevich Subject: [PATCH v2 01/13] qtnfmac: do not track STA states in driver Thread-Topic: [PATCH v2 01/13] qtnfmac: do not track STA states in driver Thread-Index: AQHUXJPHFGcPHuWBbEuV96JQbGs6cQ== Date: Fri, 5 Oct 2018 10:11:27 +0000 Message-ID: <20181005101114.3013-2-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB4375;6:Cd1rPVSQx/v9uWyELn++LWstlw4zD/sHlCn4Hjf03+AbJ7dfE/kugkSEs1ZWpbTa7djJAfr1qwdFeUisD49sVagiog1F18YZy/h5cgpW5XPVT8UkiIjN2cBWKQ5bJQsMyLIHeWT3nT+cQOVvcrKZ1zaWBxSSJvOsD3ml4ay66j5iG2lWUOgcpHzi1ZLCKIJHPMxJqGQrnjJzP0Ne7mPIu7IPb4LF45YVihB9ZdavSJvpwfBsgcQzWT1Q3vLHP6mAxd+kawMghEYsc82yt5XaX1AWZFJRksuy1vwAwzBkFJi9Xs94wLt6sHqOXfSleBrabFE1g9Y4uZmkODW97HTccnRJlj1hmAuBbJzt/5eqYeEuyrKX562CDE/qThv1IZLIJc1XZnOAafHar9piA2RqWQfyaY5sjyR1dZIiGBZltAQDBWIEdG+j+KbiljevPEUIXF9axseufBcOCv1iSAv+Lg==;5:Fe3CD2zw6QB0LjAj02XJQoCCG+MvwzT0tzvWnGCyOsN/iOeNORz4FxvC6PnzDrGQPEuPTRQyr9SJ999F2uPT/m7zUStjDZ1mh6BiSo+H5EUwKDALsO7bSBD1muHuANYUHy7yw7VfWTTz5sjWf0hXpYqmt41RdKALKX/tD9uOmew=;7:d+xBrQ7lVUlBtiE495moa1yUY82LJ2SeeqfF6g0YpWYMdulv1geP2H+Mrowzw8inhyDVPrn6D+B7l66ac4BzegRlQnBA6LKHOunwcIQ+87pgtqyfKC9FiIyvtMDz+KqHlQM+3U5V5zbpuvXANZYXKIYYHmxOQ9Nn/dkkd8jARK08YI67X3OGsH5EWl92/1zBhLRIci5mDKbXKLZRBwwBwa7Ch19TCJdaTFzBQhdGO+4klxzL5FJYCDEHgm+N1vh2 x-ms-office365-filtering-correlation-id: aee0dec9-3ecf-45d6-d48f-08d62aaae980 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB4375; x-ms-traffictypediagnostic: BYAPR05MB4375: 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)(3231355)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051);SRVR:BYAPR05MB4375;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB4375; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(136003)(39850400004)(366004)(376002)(346002)(189003)(199004)(6916009)(478600001)(6506007)(386003)(106356001)(105586002)(99286004)(6512007)(2900100001)(97736004)(2351001)(4326008)(25786009)(76176011)(36756003)(53936002)(2906002)(103116003)(107886003)(2501003)(52116002)(486006)(5660300001)(5250100002)(2616005)(446003)(476003)(305945005)(8676002)(8936002)(102836004)(14444005)(26005)(11346002)(3846002)(71190400001)(71200400001)(1076002)(6116002)(14454004)(68736007)(6436002)(6486002)(5640700003)(7736002)(54906003)(186003)(86362001)(316002)(256004)(66066001)(81156014)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB4375;H:BYAPR05MB4597.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: JGZdYwn6Wo7x5zHBluEhbrROJ4xsB5b4PFDLRMD9nt9hIF05yPtdp9bk3yhvwVwN/8cncybKTBxbX5Rc1DjnK3DeAyjACV9Fn+/eknJulkZ+ZP+yAy1yV9fhpiv2hA3rdZExIOFa1ZY3Ky5wISEwlchMSaYPNpaPDMaVKPvlhF8Ssf0sZWkkwOIX+dU2kkQnbLsttxUtG1H9sRZ7e2W8dcwScRRYLPbNZ1O+zS4abEisbwTMlcnho0kbtG+Dw5DudLb06ThrMUIIl1niSsZNKGnceHeJuObLIQoSyrDOD+d2/ysfizJAyF4TGtMjL8csYaOUelajIsPmzYHuAud6r70Evkk0LN5uBe3t4ST6Snw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: aee0dec9-3ecf-45d6-d48f-08d62aaae980 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:27.4238 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4375 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 Remove STA connection states tracking from driver. Leave it wireless core on host and to firmware. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 59 +++-------------------- drivers/net/wireless/quantenna/qtnfmac/core.h | 7 --- drivers/net/wireless/quantenna/qtnfmac/event.c | 18 +------ 3 files changed, 8 insertions(+), 76 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 452d4b7c832d..776cfba7396e 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -216,7 +216,6 @@ static struct wireless_dev *qtnf_add_virtual_intf(struct wiphy *wiphy, eth_zero_addr(vif->mac_addr); eth_zero_addr(vif->bssid); vif->bss_priority = QTNF_DEF_BSS_PRIORITY; - vif->sta_state = QTNF_STA_DISCONNECTED; memset(&vif->wdev, 0, sizeof(vif->wdev)); vif->wdev.wiphy = wiphy; vif->wdev.iftype = type; @@ -624,9 +623,6 @@ qtnf_connect(struct wiphy *wiphy, struct net_device *dev, if (vif->wdev.iftype != NL80211_IFTYPE_STATION) return -EOPNOTSUPP; - if (vif->sta_state != QTNF_STA_DISCONNECTED) - return -EBUSY; - if (sme->bssid) ether_addr_copy(vif->bssid, sme->bssid); else @@ -639,7 +635,6 @@ qtnf_connect(struct wiphy *wiphy, struct net_device *dev, return ret; } - vif->sta_state = QTNF_STA_CONNECTING; return 0; } @@ -664,9 +659,6 @@ qtnf_disconnect(struct wiphy *wiphy, struct net_device *dev, qtnf_scan_done(mac, true); - if (vif->sta_state == QTNF_STA_DISCONNECTED) - goto out; - ret = qtnf_cmd_send_disconnect(vif, reason_code); if (ret) { pr_err("VIF%u.%u: failed to disconnect\n", mac->macid, @@ -675,9 +667,6 @@ qtnf_disconnect(struct wiphy *wiphy, struct net_device *dev, } out: - if (vif->sta_state == QTNF_STA_CONNECTING) - vif->sta_state = QTNF_STA_DISCONNECTED; - return ret; } @@ -1152,28 +1141,10 @@ void qtnf_virtual_intf_cleanup(struct net_device *ndev) struct qtnf_wmac *mac = wiphy_priv(vif->wdev.wiphy); if (vif->wdev.iftype == NL80211_IFTYPE_STATION) { - switch (vif->sta_state) { - case QTNF_STA_DISCONNECTED: - break; - case QTNF_STA_CONNECTING: - cfg80211_connect_result(vif->netdev, - vif->bssid, NULL, 0, - NULL, 0, - WLAN_STATUS_UNSPECIFIED_FAILURE, - GFP_KERNEL); - qtnf_disconnect(vif->wdev.wiphy, ndev, - WLAN_REASON_DEAUTH_LEAVING); - break; - case QTNF_STA_CONNECTED: - cfg80211_disconnected(vif->netdev, - WLAN_REASON_DEAUTH_LEAVING, - NULL, 0, 1, GFP_KERNEL); - qtnf_disconnect(vif->wdev.wiphy, ndev, - WLAN_REASON_DEAUTH_LEAVING); - break; - } - - vif->sta_state = QTNF_STA_DISCONNECTED; + cfg80211_disconnected(vif->netdev, WLAN_REASON_DEAUTH_LEAVING, + NULL, 0, 1, GFP_KERNEL); + qtnf_disconnect(vif->wdev.wiphy, ndev, + WLAN_REASON_DEAUTH_LEAVING); } qtnf_scan_done(mac, true); @@ -1181,27 +1152,11 @@ void qtnf_virtual_intf_cleanup(struct net_device *ndev) void qtnf_cfg80211_vif_reset(struct qtnf_vif *vif) { - if (vif->wdev.iftype == NL80211_IFTYPE_STATION) { - switch (vif->sta_state) { - case QTNF_STA_CONNECTING: - cfg80211_connect_result(vif->netdev, - vif->bssid, NULL, 0, - NULL, 0, - WLAN_STATUS_UNSPECIFIED_FAILURE, - GFP_KERNEL); - break; - case QTNF_STA_CONNECTED: - cfg80211_disconnected(vif->netdev, - WLAN_REASON_DEAUTH_LEAVING, - NULL, 0, 1, GFP_KERNEL); - break; - case QTNF_STA_DISCONNECTED: - break; - } - } + if (vif->wdev.iftype == NL80211_IFTYPE_STATION) + cfg80211_disconnected(vif->netdev, WLAN_REASON_DEAUTH_LEAVING, + NULL, 0, 1, GFP_KERNEL); cfg80211_shutdown_all_interfaces(vif->wdev.wiphy); - vif->sta_state = QTNF_STA_DISCONNECTED; } void qtnf_band_init_rates(struct ieee80211_supported_band *band) diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index a1e338a1f055..1722aecf7633 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -64,12 +64,6 @@ struct qtnf_sta_list { atomic_t size; }; -enum qtnf_sta_state { - QTNF_STA_DISCONNECTED, - QTNF_STA_CONNECTING, - QTNF_STA_CONNECTED -}; - struct qtnf_vif { struct wireless_dev wdev; u8 bssid[ETH_ALEN]; @@ -77,7 +71,6 @@ struct qtnf_vif { u8 vifid; u8 bss_priority; u8 bss_status; - enum qtnf_sta_state sta_state; u16 mgmt_frames_bitmask; struct net_device *netdev; struct qtnf_wmac *mac; diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index 68da81bec4e9..8b542b431b75 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -171,24 +171,14 @@ qtnf_event_handle_bss_join(struct qtnf_vif *vif, return -EPROTO; } - if (vif->sta_state != QTNF_STA_CONNECTING) { - pr_err("VIF%u.%u: BSS_JOIN event when STA is not connecting\n", - vif->mac->macid, vif->vifid); - return -EPROTO; - } - pr_debug("VIF%u.%u: BSSID:%pM\n", vif->mac->macid, vif->vifid, join_info->bssid); cfg80211_connect_result(vif->netdev, join_info->bssid, NULL, 0, NULL, 0, le16_to_cpu(join_info->status), GFP_KERNEL); - if (le16_to_cpu(join_info->status) == WLAN_STATUS_SUCCESS) { - vif->sta_state = QTNF_STA_CONNECTED; + if (le16_to_cpu(join_info->status) == WLAN_STATUS_SUCCESS) netif_carrier_on(vif->netdev); - } else { - vif->sta_state = QTNF_STA_DISCONNECTED; - } return 0; } @@ -211,16 +201,10 @@ qtnf_event_handle_bss_leave(struct qtnf_vif *vif, return -EPROTO; } - if (vif->sta_state != QTNF_STA_CONNECTED) - pr_warn("VIF%u.%u: BSS_LEAVE event when STA is not connected\n", - vif->mac->macid, vif->vifid); - pr_debug("VIF%u.%u: disconnected\n", vif->mac->macid, vif->vifid); cfg80211_disconnected(vif->netdev, le16_to_cpu(leave_info->reason), NULL, 0, 0, GFP_KERNEL); - - vif->sta_state = QTNF_STA_DISCONNECTED; netif_carrier_off(vif->netdev); return 0; From patchwork Fri Oct 5 10:11:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627793 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-2.web.codeaurora.org (Postfix) with ESMTP id 5CC1215E8 for ; Fri, 5 Oct 2018 10:11:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AD2128E36 for ; Fri, 5 Oct 2018 10:11:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F3B428E3E; Fri, 5 Oct 2018 10:11:34 +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 E0EEA28E36 for ; Fri, 5 Oct 2018 10:11:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728060AbeJERJh (ORCPT ); Fri, 5 Oct 2018 13:09:37 -0400 Received: from mail-bl2nam02on0042.outbound.protection.outlook.com ([104.47.38.42]:30496 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727535AbeJERJh (ORCPT ); Fri, 5 Oct 2018 13:09:37 -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=7iIMcYyWK629rso8WbwMXe6QPffSLlpGQvKmeWbL40Y=; b=00kq4K7w3SiQ4ustcLa+wIctho0G3oxTNqoZCpipJCdrZfxEEMfIz/ABKaNS1tucz6pBRAXOiJiF5FVjrvWaOoe5ez7gjDHh8/TaGi05wAnTfEPVdCcSfjzkBl4FgiCwRuMFavRhe3tBDA3WijdnzgPguF6B8d2Q2hulueDhyCs= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB4375.namprd05.prod.outlook.com (52.135.202.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.13; Fri, 5 Oct 2018 10:11:28 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:28 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko Subject: [PATCH v2 02/13] qtnfmac: generate local disconnect event in disconnect callback Thread-Topic: [PATCH v2 02/13] qtnfmac: generate local disconnect event in disconnect callback Thread-Index: AQHUXJPIoEyU+ziYJkS9h6eyAhf4MA== Date: Fri, 5 Oct 2018 10:11:28 +0000 Message-ID: <20181005101114.3013-3-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB4375;6:rIrFvkLOhTK7li8BqKsRSOU31amTa+SjosYTX64R2wh9LpDz8bVOUtdtOiXdl97uque2gp14tZbsCtftUE0vHvwt4Qs5XGpoNnGnVC/vl/vIqLYq1UmZkhaYgIHeAkXb4E5WgtJn1eVzi3Sxj/THcXS9uaFLA5rBsYio+pgBIRjp0UPQx0fG9DsZBhujaSFd5QoJMIysTV/0Xt9yHKfrwF2sDTkX4xQ6KRBbenYH+FnbyCYY+sCqrKCynQqBdiL5dSx/7fWJ4Qtm1qitjl0X8+GK7W/udIKol/4EeeFPMeaPpi8YqHc0BNGRR3RzpbnKBNCWD5Ij0B4hJDZDpcsCULLtg3aPeO/cdEE4d8DbmDsHfJIDgRrg4nMIT/T5XMRr4J9HNBK/RC1cMT8KuBO9QIAJHCY0xTCSvfNL1wOg5dpS7bDYfFxllzfPLhgogsSnS1WRh97qru7Fnv4ReaaT/w==;5:rxoHkCe1f6XK1eyfTW3Q6CbhWGP0Pypa6H/vEIT0srdlilZnfk3MdndsfTBs17BV+gXV21McXhwcbQSymEDDN+wrWrENiECkImetkrfS3lIm11NrErUPnAXhXfvUVvCc4Bjk3SyIHofm28lWy6JJTG5M1LH7ZHrg3FE4//u1sCE=;7:7Tb+NkZfNQoDWnoABFubKnuLnXz8vkYjSbuxCuWB69ciriXSD+r5oP/8WOaIwMvD2fF8EQTMSurP0JGelAUPeuX1FKmOASg0U7LDyX60QuHsX/4sHNAoAFgaFpMCR39h/ayxrQc5ZFGJjTGv9rhyrX8AgntKbKoPsYDr1fvjYbf1C9/DIqugyoPa8EHqc0DhsMPP3v8Y5vdyA37TbPEb7U5FDegHVHpbv0wF6JTSW15BdxwLEYVUYuj4nej40Ll8 x-ms-office365-filtering-correlation-id: 88fea22a-7d39-4be6-4b06-08d62aaaea61 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB4375; x-ms-traffictypediagnostic: BYAPR05MB4375: 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)(3231355)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051);SRVR:BYAPR05MB4375;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB4375; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(136003)(39850400004)(366004)(376002)(346002)(189003)(199004)(6916009)(478600001)(6506007)(386003)(106356001)(105586002)(99286004)(6512007)(2900100001)(97736004)(2351001)(4326008)(25786009)(76176011)(36756003)(53936002)(2906002)(103116003)(107886003)(2501003)(52116002)(486006)(5660300001)(5250100002)(2616005)(446003)(476003)(305945005)(8676002)(8936002)(102836004)(26005)(11346002)(3846002)(71190400001)(71200400001)(1076002)(6116002)(14454004)(68736007)(6436002)(6486002)(5640700003)(7736002)(186003)(86362001)(316002)(256004)(66066001)(81156014)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB4375;H:BYAPR05MB4597.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: k8s2RYrRj1JeVtALvZklP/8R+t4ZAGROZdBj4tbDI+PS2U5tHJy6sau+RGv1ycoxLZT7c/l5cjlySG1mWPB7Cys0m94wGFwvyUOuaZTLf0t5sbGi6vXkcVfQ4VC3R/3rwbkluiEFi68ZnLay+M3fJR2mH5hPNwUCxHlAYxMwvyW+3WFYdLnPenfjHghHk0ZtywjE91OTOX+5aabKmkUbLsYUel/bjOYBFepcA48nTvCgVVhQqeVnmv90QbFzvFkjw//JZ4SkL0u64t+rzl35kzX1hEmUrjTUgs8yP9+9Tm6kDaceizNsOUz/0jW84DPLnucR+2STWoJ1MrhsD4YV6npfwOHOPRJxAjkAh2BF038= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88fea22a-7d39-4be6-4b06-08d62aaaea61 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:28.8068 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4375 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 When cfg80211 disconnect callback is triggered and command is processed by firmware, disconnect event with local parameter set must be sent immediately. Indicating that it's a "local" event (not from AP) will help upper layers to process this event correctly. Signed-off-by: Igor Mitsyanko --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 776cfba7396e..87f48b7fb673 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -660,10 +660,14 @@ qtnf_disconnect(struct wiphy *wiphy, struct net_device *dev, qtnf_scan_done(mac, true); ret = qtnf_cmd_send_disconnect(vif, reason_code); - if (ret) { + if (ret) pr_err("VIF%u.%u: failed to disconnect\n", mac->macid, vif->vifid); - goto out; + + if (vif->wdev.current_bss) { + netif_carrier_off(vif->netdev); + cfg80211_disconnected(vif->netdev, reason_code, + NULL, 0, true, GFP_KERNEL); } out: @@ -1140,12 +1144,9 @@ void qtnf_virtual_intf_cleanup(struct net_device *ndev) struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); struct qtnf_wmac *mac = wiphy_priv(vif->wdev.wiphy); - if (vif->wdev.iftype == NL80211_IFTYPE_STATION) { - cfg80211_disconnected(vif->netdev, WLAN_REASON_DEAUTH_LEAVING, - NULL, 0, 1, GFP_KERNEL); + if (vif->wdev.iftype == NL80211_IFTYPE_STATION) qtnf_disconnect(vif->wdev.wiphy, ndev, WLAN_REASON_DEAUTH_LEAVING); - } qtnf_scan_done(mac, true); } From patchwork Fri Oct 5 10:11:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627795 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-2.web.codeaurora.org (Postfix) with ESMTP id 7C73E15E8 for ; Fri, 5 Oct 2018 10:11:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A52E28E36 for ; Fri, 5 Oct 2018 10:11:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6ED9E28E3E; Fri, 5 Oct 2018 10:11:35 +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 0DB9728E36 for ; Fri, 5 Oct 2018 10:11:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728069AbeJERJi (ORCPT ); Fri, 5 Oct 2018 13:09:38 -0400 Received: from mail-bl2nam02on0042.outbound.protection.outlook.com ([104.47.38.42]:30496 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728025AbeJERJi (ORCPT ); Fri, 5 Oct 2018 13:09:38 -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=CMZwiB34r0+j+TOYKfgXdqyb4IR+iGzNarTPysNRe58=; b=p3kkuS6o6i325DFbXjQlSZUi9kR+xOhJ/oArDIKqIJAt/mJc22j+3e1S4l1un2ABHySxZhXRHeY7vfsxvXinDT+DpUBvQhu+gz4/gwXfRAJn9bbqPxxXRdn9Xz2+DUdY7N6R7A3lOGEupiKggqqWj2ZaQmY4wySq3IOujLoO1OI= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB4375.namprd05.prod.outlook.com (52.135.202.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.13; Fri, 5 Oct 2018 10:11:30 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:30 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko Subject: [PATCH v2 03/13] qtnfmac: request userspace to do OBSS scanning if FW can not Thread-Topic: [PATCH v2 03/13] qtnfmac: request userspace to do OBSS scanning if FW can not Thread-Index: AQHUXJPISlsKP0wcNkuNFKGzKPwXYg== Date: Fri, 5 Oct 2018 10:11:30 +0000 Message-ID: <20181005101114.3013-4-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB4375;6:kwoWkoAF3TZGsHifOnhQMEKgMscWZdw4xzvcvI87AzzHpwMeU4e0qC3gAMBMLPruwUrS/PiVzsM02ZdQD3x6RNqLHfO4KNj4zfc2HjxV5SVRsV1xj2hGx5Ds/GCQYZXA6+XqHjxsqnRW5Ilicrj6lVtCEnialorp5nJBsn59SwNg9FS8sXfjFebFjDcx2nR7945JJ8rw8QVC586cPhOl9pjJFEkYoYnBlqQErkRbH5gGAu5O7gphspEQefS2ZaHz0PiIUKpxnFR/fYEF3gK1kiRjhvUTInCOHKrYzwWwmEa7hFSd6Yo2nXBki7huV/lDFbYN9thqzY5nxXISyKB1j8Y3Mzc54liC6yDlh7AtYxetuSFu5KVuFmEwFqcWHyCmtnBTsI9Wv/NfKbsTKOMkBOOUJAd8Q73cFD3YH+cusbpUxL2UEUC7mGb3gGqwwDqaUJy2nsN+9GX6jx+QRsnOnw==;5:bnBW1ytvas8DJwFFjWpKH+3cPotXXIDJEzayilBsziGvCfN7cM0IeAaJstM+EvbKz0HyufXB3+OVTGdZ61ZkK3UDxhLGCb7krgdHbiGxRyVGI99BMH67YizgXEgbaAUsrJrsATgL9HUj75jH3a8AjPy0KP/TxDvfiP34b72NJ4E=;7:N4UtT+Y0Gt072woVrO3MeDfId9Urn9Be8kR5ITH9luGR2oOIhRTvmQBrQH5USvl2Y3NOQ6nuF/ajK3+4o0sPoO9hPSqbAn0PkffJxH951eYcrjtafCFw36xVxiQhWSOPYC6hbrrTai5UAdrXiZ26Ua0OsmWbWiB/o70YbkF13dXAteOkxoU/ajNzWvJif2ks8fxO1AhnZWyn7D6ea94B2DbJFAddkTLm6RtIm6h2DqK/Y6GYl2+SwKLc3mZ5c6nT x-ms-office365-filtering-correlation-id: e895a3b0-4dd1-4b96-6368-08d62aaaeb35 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB4375; x-ms-traffictypediagnostic: BYAPR05MB4375: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(20558992708506); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051);SRVR:BYAPR05MB4375;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB4375; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(136003)(39850400004)(366004)(376002)(346002)(189003)(199004)(6916009)(478600001)(6506007)(386003)(106356001)(105586002)(99286004)(6512007)(2900100001)(97736004)(2351001)(4326008)(25786009)(76176011)(36756003)(53936002)(2906002)(103116003)(107886003)(2501003)(52116002)(486006)(5660300001)(5250100002)(2616005)(446003)(476003)(305945005)(8676002)(8936002)(102836004)(14444005)(26005)(11346002)(3846002)(71190400001)(71200400001)(1076002)(6116002)(14454004)(68736007)(6436002)(6486002)(5640700003)(7736002)(186003)(86362001)(316002)(256004)(66066001)(81156014)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB4375;H:BYAPR05MB4597.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: nekjUPzWJdImCSUkLwsLo0oXyMcd2ihlEE1k7k4D4wo9vLxlSpx5Njxm2j8gCBwI9aDfNCTc0fGeI9y3PJebwPaW7z0hvoTKA17EL2qkW0HBoB2PIw3r2bD0ycr8JZVNVqGKX2MfPnSo3CHlZ6K+qooO+GXcfjOpDRAVQ8IhGlCHmULDyzHO5us6/1rvQfOSb2E8zX2aB5UyOPOMH8o9uqmb3H9RxBA3GGHH+DKv85gC6nUJaD2HiMt1oROxt2/k8WsXsD+QrsWSHAjjGpoAj14ClEf9Aty5OIgc/QXLkIIJr7/Ew1rCToCfjNt68iKjGPeAORhtNkldhbxbivmeSegDXNkzA+zR5mrdjdfayZE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: e895a3b0-4dd1-4b96-6368-08d62aaaeb35 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:30.1667 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4375 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 In case firmware reports that it can not do OBSS scanning for 40MHz 2.4GHz channels itself, tell userpsace to do that instead by setting NL80211_FEATURE_NEED_OBSS_SCAN flag. Signed-off-by: Igor mitsyanko --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 3 +++ drivers/net/wireless/quantenna/qtnfmac/qlink.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 87f48b7fb673..c4961e16d91a 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -1099,6 +1099,9 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac) if (hw_info->hw_capab & QLINK_HW_CAPAB_SCAN_RANDOM_MAC_ADDR) wiphy->features |= NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR; + if (!(hw_info->hw_capab & QLINK_HW_CAPAB_OBSS_SCAN)) + wiphy->features |= NL80211_FEATURE_NEED_OBSS_SCAN; + #ifdef CONFIG_PM if (macinfo->wowlan) wiphy->wowlan = macinfo->wowlan; diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 99d37e3efba6..c5ae4ea9a47a 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -71,6 +71,7 @@ struct qlink_msg_header { * @QLINK_HW_CAPAB_DFS_OFFLOAD: device implements DFS offload functionality * @QLINK_HW_CAPAB_SCAN_RANDOM_MAC_ADDR: device supports MAC Address * Randomization in probe requests. + * @QLINK_HW_CAPAB_OBSS_SCAN: device can perform OBSS scanning. */ enum qlink_hw_capab { QLINK_HW_CAPAB_REG_UPDATE = BIT(0), @@ -78,6 +79,7 @@ enum qlink_hw_capab { QLINK_HW_CAPAB_DFS_OFFLOAD = BIT(2), QLINK_HW_CAPAB_SCAN_RANDOM_MAC_ADDR = BIT(3), QLINK_HW_CAPAB_PWR_MGMT = BIT(4), + QLINK_HW_CAPAB_OBSS_SCAN = BIT(5), }; enum qlink_iface_type { From patchwork Fri Oct 5 10:11:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627797 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-2.web.codeaurora.org (Postfix) with ESMTP id DE3BF15E2 for ; Fri, 5 Oct 2018 10:11:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC36F28E36 for ; Fri, 5 Oct 2018 10:11:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0DF728E3E; Fri, 5 Oct 2018 10:11:37 +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 5F5C128E36 for ; Fri, 5 Oct 2018 10:11:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728082AbeJERJl (ORCPT ); Fri, 5 Oct 2018 13:09:41 -0400 Received: from mail-sn1nam01on0082.outbound.protection.outlook.com ([104.47.32.82]:13887 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727616AbeJERJl (ORCPT ); Fri, 5 Oct 2018 13:09:41 -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=i5ktRmOIn04oT6E8rlxJnxDUbuJUAXYLinJCi7mc42k=; b=o1Xq5OocHwojXLkLZiYn5UqEOy+RGKIquaaRbGIoySQNEK2FjIqFYCRrQspqRzvaszAN0LMmAceeZrQTqMq/Fdi0IhXVYXGGiIFfry+64jbouXXWbjpR7inRfxne2XdmCe/3+NethLTjk6n8OvE/sRdg3+5Al1WEvuLxIwNqIUg= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB5110.namprd05.prod.outlook.com (20.177.231.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.14; Fri, 5 Oct 2018 10:11:31 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:31 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko Subject: [PATCH v2 04/13] qtnfmac: do not initialize per-MAC data multiple times Thread-Topic: [PATCH v2 04/13] qtnfmac: do not initialize per-MAC data multiple times Thread-Index: AQHUXJPJFY0xRx2MVky4wCPMnQ91+Q== Date: Fri, 5 Oct 2018 10:11:31 +0000 Message-ID: <20181005101114.3013-5-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB5110;6:LJUxSoI8e8WrXJsOaVL2146km6sLAQW304lDvDUxue9cUYlDfJVbdcJSW4+CpufgmOb2ZNI7DYtOA6QGzFBTBHANTKrBYlrfzAiJkWVM5l/1Q0mi+9NIaY2qp8IyRwqbFPSKoUdk/AD5VW9rzSq11ParA5Md6ja20PTG4lIKWaPQf2dvPJHa7Hkl9dZHV4AlvTMbdNOs5zRU7QTHJ/wSVTtIpqc27yNrgK/vRDvyC/v5dysqpgvsqtOajaXaHV12vjH1I6+FmnkOSXhPFzT2zrTdUlLPHslMjosAtc1+eNjaHCBETjHNOFKZx5m+weULhh0chQDjoJ9fcsl61DnwkSxoxRIyM2W3XcwX8noB9UhB5wgPGYOeoLSe3+De/eo0aDJXtAliiesr9XznmOukgVEduVF8WCOfZ62Yw44yROPt0uVVzfcam0/x7naDRCCTP17+nZoO8SBVIgaSZpFt9w==;5:Wj79ln8w3sJLmH9POA3hkvga0P2P+6u+IgYuK/rSMsVG72yf+P0P8EZ3sbimI3q50N7+rrh1ew5cegdiSgne51uJbkysh87Gnmmr6lv1OqSv+bxBj91kdQ8AjYdBYvgTyjSTPWEhP5LeT9TVDn8WGzgtEp2JwQc7+sgUjIpjlR8=;7:JlJbF7b+mgl6Bm/yUkgBtcvRzIElaEjFToOu9PbdGeSYW6qTXnIIrSEZ/6tXYSjPB4JVxxw/ibRVkco/9FqSpl7ZPn//ZsKtqjXN7h5OOLG/yYHjhJauzQstkMm2/pcUQAmC1Ny62Yqk6PQsEyhD5hbCC4M1vUO+ECkLAeqMC0DS6iEsafjAXWSXBkMQeUz0mkTwihKgp/rYebD1stHijN6+RE0rbVt3g9L553wzXyWedPEeO/SfjkbGz2BmVBHb x-ms-office365-filtering-correlation-id: 222fd542-7a42-461b-587b-08d62aaaec07 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB5110; x-ms-traffictypediagnostic: BYAPR05MB5110: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; 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)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(3002001)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991048);SRVR:BYAPR05MB5110;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB5110; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(979002)(396003)(346002)(376002)(136003)(39850400004)(366004)(199004)(189003)(52116002)(76176011)(11346002)(2900100001)(6916009)(2906002)(5640700003)(99286004)(478600001)(476003)(2616005)(5250100002)(8936002)(6512007)(6116002)(3846002)(68736007)(1076002)(53936002)(486006)(7736002)(305945005)(71200400001)(71190400001)(81166006)(81156014)(8676002)(103116003)(2501003)(86362001)(6486002)(102836004)(6506007)(386003)(36756003)(2351001)(14454004)(256004)(14444005)(186003)(66066001)(26005)(106356001)(5660300001)(4326008)(107886003)(446003)(97736004)(316002)(105586002)(6436002)(25786009)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB5110;H:BYAPR05MB4597.namprd05.prod.outlook.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-antispam-message-info: R4ZWFkRpYGl3U0/nlnkZBZLoEiZwSFesLPAWcRZDeO57BIVLdORHPXB/DBIO+yyzmjq/lAIRYMKDw1F2IaJ6LD51JPNLnFTPYRd9UytDZ03niTxmOQYY4WO0IKyD8NCHhggUfFxiwJITmT/HFNCYxPAD036VGptuWUkxHBDhqDSPbTYSUa5/wRPJUPTrCMASVU6J2P0ykUcMPSS0vJvZm7QA95cZyx7gepJXWc2XCSdgciJAD07zKa4SIGeeAAT5oPYnLXJ7g1c3hdkCzOIb7FacdvbasNFvewbP8NNjvmo6FI35UFVV4J1Aaa+vhb2fw9EK17wuZe8ta85RrwklHocv60D0479MGoXbNIdXuZA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 222fd542-7a42-461b-587b-08d62aaaec07 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:31.5277 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB5110 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 Several members of pwr-MAC structure are re-initialized several times together with per-VIF initialization. Fix that and simplify the code. Signed-off-by: Igor Mitsyanko --- drivers/net/wireless/quantenna/qtnfmac/core.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 19abbc4e23e0..aaa218eb70c8 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -370,6 +370,7 @@ static void qtnf_mac_scan_timeout(struct work_struct *work) static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus, unsigned int macid) { + struct qtnf_vif *vif; struct wiphy *wiphy; struct qtnf_wmac *mac; unsigned int i; @@ -382,18 +383,20 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus, mac->macid = macid; mac->bus = bus; + mutex_init(&mac->mac_lock); + INIT_DELAYED_WORK(&mac->scan_timeout, qtnf_mac_scan_timeout); for (i = 0; i < QTNF_MAX_INTF; i++) { - memset(&mac->iflist[i], 0, sizeof(struct qtnf_vif)); - mac->iflist[i].wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; - mac->iflist[i].mac = mac; - mac->iflist[i].vifid = i; - qtnf_sta_list_init(&mac->iflist[i].sta_list); - mutex_init(&mac->mac_lock); - INIT_DELAYED_WORK(&mac->scan_timeout, qtnf_mac_scan_timeout); - mac->iflist[i].stats64 = - netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); - if (!mac->iflist[i].stats64) + vif = &mac->iflist[i]; + + memset(vif, 0, sizeof(*vif)); + vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; + vif->mac = mac; + vif->vifid = i; + qtnf_sta_list_init(&vif->sta_list); + + vif->stats64 = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); + if (!vif->stats64) pr_warn("VIF%u.%u: per cpu stats allocation failed\n", macid, i); } From patchwork Fri Oct 5 10:11:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627803 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-2.web.codeaurora.org (Postfix) with ESMTP id B3EF815E8 for ; Fri, 5 Oct 2018 10:11:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AECFC28E36 for ; Fri, 5 Oct 2018 10:11:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2B5F28E40; Fri, 5 Oct 2018 10:11:47 +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 5C6AC28E36 for ; Fri, 5 Oct 2018 10:11:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728110AbeJERJt (ORCPT ); Fri, 5 Oct 2018 13:09:49 -0400 Received: from mail-eopbgr730079.outbound.protection.outlook.com ([40.107.73.79]:1696 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727616AbeJERJt (ORCPT ); Fri, 5 Oct 2018 13:09:49 -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=z4vbOPmahAPB4BB6YqJed3+aGFtO+9yHdBIl+Git34A=; b=FU4amXHbmVw7V2pbq5lp+cyTyc7x36oi6IanxajlutWNH8E4JKtlIcAPBj6xiqFhk9v0gF0VEPXPnYJFvSb8ryWVGonHVySd/9TfdVrXAPfeYx38MHxVrmZ19ectbvuxHgwb5fCcMsBaKAiOwA6AFn3Uv1Mf8V0vHzh84OD/7aQ= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB4439.namprd05.prod.outlook.com (52.135.203.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.13; Fri, 5 Oct 2018 10:11:33 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:33 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Sergey Matyukevich Subject: [PATCH v2 05/13] qtnfmac: cleanup and unify command error handling Thread-Topic: [PATCH v2 05/13] qtnfmac: cleanup and unify command error handling Thread-Index: AQHUXJPK9ubpU/y5jk6yJCNy7JgNCA== Date: Fri, 5 Oct 2018 10:11:33 +0000 Message-ID: <20181005101114.3013-6-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB4439;6:eGabJt9CFdILpONFSqdjb77KKUFZyhXCoaafdiSzsXaPfo0Qvj8XG1O0aQPnnBXUUDl9ZFM8jGj+XhLRhsT538kILVxHa2XxAW3/QHgyeoMIc0yAICMbLvLhLOaq56pLzgd8NJpde0d/g51IFbPZya2EO4JTOJGHihlQgRXhXXyeaLYzQdw6z1bwjftoSR1I9oWWE0rGLfw+Bzv7bkSvvt7AOciGtbx4TVLxw+hTWryh6aFkVdXLQEeKBaqNlV7bi1fXYDaPXbou5iP+RcXctnlDLUofHkSZdaiTGZz21UkcK1vpA6lJudOqcfDtDWt/jcbs6QVje1RNyTap9SpgLsn/QRl42HIx4pdJYgnAQDrli6PtQxvuV7DTAFhikVLeRa6xTcHiWq7mgENQz2W/yoOTJU9l3JyGo2mXtZKDAGU8iUVjCb3csXNzMBpctA+Hc8MzorpaEwybFieikKuHMA==;5:swmX+vVYN64yLA/tqixWndY3WnwN4LYvz7ZvNUfnk1p8fWnbBVvFAL45prZVeUarh60hlIvE6b9k1lkUnGNvyDwjUrZ/EXsrLn+kpVyKL2pvW0j/kGDj/QtPYRSuYsgoxveI0Uo4E0m0Npbx2Bp/FwlXpihbu4aLujo6CQirHRI=;7:gl1srz3mBPPKj6GBd1QzPy9NqHlx1ePyohUqs2j75/YTOwN2m4xW5gMj2XAqyChEv9pgJm0I0yZT0OPbsOGHKY5eZWqmS+Bot7IfCYTKleRbrBQWD575txZGjL6bT0G4/dCeEUa5K3+gxkjKBTl7lwGjaAx3+h1fC/wuawO4d+UEbQgIevKeWpoyMJMjQOho3HTNbUGlRDckRf5DH6VYlsQgWJOWL6NC4LydU7MPJRCUhBXis+k8C1J6538Rh42c x-ms-office365-filtering-correlation-id: c00ab0a7-ae2f-4bc3-25ad-08d62aaaecf8 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB4439; x-ms-traffictypediagnostic: BYAPR05MB4439: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(21532816269658)(269456686620040); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(149066)(150057)(6041310)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(201708071742011)(7699051);SRVR:BYAPR05MB4439;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB4439; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(39850400004)(396003)(366004)(136003)(189003)(199004)(305945005)(7736002)(26005)(1076002)(186003)(103116003)(2906002)(36756003)(2616005)(54906003)(256004)(5024004)(14444005)(86362001)(476003)(11346002)(446003)(14454004)(486006)(6512007)(2351001)(316002)(106356001)(53946003)(105586002)(16200700003)(8936002)(81156014)(81166006)(97736004)(8676002)(478600001)(53936002)(66066001)(5250100002)(5640700003)(6436002)(2900100001)(4744004)(68736007)(2501003)(4326008)(71190400001)(6486002)(76176011)(71200400001)(102836004)(6506007)(386003)(5660300001)(6916009)(3846002)(99286004)(52116002)(6116002)(107886003)(25786009)(559001)(579004)(569006);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB4439;H:BYAPR05MB4597.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: wtvKhDXiLe9yd+voXvMrf6bRY1kB0DLgvtLL32SwnG99Bkx/etpZmD/teae2AkSvieISW/uJmZkPOjJZpEY6tIZxAu+679res/yJL70UVFdHkHaeYA6C10bXqCxGDOiDMjGqjThtdCz9SiMKvA67KsvAeKIl+5bih0dPaGBgq098RF6wc5w3LDu7KjB9K5BdnLw1NM03DB+H/Mv6YOWtoxG8vVh9tFM8iyRrS6/OcpKtgYajuHgI3nbA0Rh8sPQn/iVCkRkBKAIFgmOYnSRcec8HDTwZvFM3XXGEyik2XNF5F08XZpZ62n2tcQ27u9LoRk1L6AkHDbCSgk4O3XBsQ/0UDyjI6rQTqnjGzh2bkdI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: c00ab0a7-ae2f-4bc3-25ad-08d62aaaecf8 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:33.7062 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4439 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 Unify command error handling using qtnf_cmd_resp_result_decode function. Do not duplicate error messages in command handlers and cfg80211 callbacks: report 'cmd exec fail' only on control path internal failure. Remove redundant 'unlikely' macros. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 64 ++- drivers/net/wireless/quantenna/qtnfmac/commands.c | 518 +++++----------------- 2 files changed, 149 insertions(+), 433 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index c4961e16d91a..4631277092bf 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -141,8 +141,8 @@ qtnf_change_virtual_intf(struct wiphy *wiphy, ret = qtnf_cmd_send_change_intf_type(vif, type, mac_addr); if (ret) { - pr_err("VIF%u.%u: failed to change VIF type: %d\n", - vif->mac->macid, vif->vifid, ret); + pr_err("VIF%u.%u: failed to change type to %d\n", + vif->mac->macid, vif->vifid, type); return ret; } @@ -228,18 +228,22 @@ static struct wireless_dev *qtnf_add_virtual_intf(struct wiphy *wiphy, if (params) mac_addr = params->macaddr; - if (qtnf_cmd_send_add_intf(vif, type, mac_addr)) { - pr_err("VIF%u.%u: failed to add VIF\n", mac->macid, vif->vifid); + ret = qtnf_cmd_send_add_intf(vif, type, mac_addr); + if (ret) { + pr_err("VIF%u.%u: failed to add VIF %pM\n", + mac->macid, vif->vifid, mac_addr); goto err_cmd; } if (!is_valid_ether_addr(vif->mac_addr)) { pr_err("VIF%u.%u: FW reported bad MAC: %pM\n", mac->macid, vif->vifid, vif->mac_addr); + ret = -EINVAL; goto err_mac; } - if (qtnf_core_net_attach(mac, vif, name, name_assign_t)) { + ret = qtnf_core_net_attach(mac, vif, name, name_assign_t); + if (ret) { pr_err("VIF%u.%u: failed to attach netdev\n", mac->macid, vif->vifid); goto err_net; @@ -255,7 +259,7 @@ static struct wireless_dev *qtnf_add_virtual_intf(struct wiphy *wiphy, err_cmd: vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; - return ERR_PTR(-EFAULT); + return ERR_PTR(ret); } static int qtnf_mgmt_set_appie(struct qtnf_vif *vif, @@ -334,12 +338,11 @@ static int qtnf_stop_ap(struct wiphy *wiphy, struct net_device *dev) qtnf_scan_done(vif->mac, true); ret = qtnf_cmd_send_stop_ap(vif); - if (ret) { + if (ret) pr_err("VIF%u.%u: failed to stop AP operation in FW\n", vif->mac->macid, vif->vifid); - netif_carrier_off(vif->netdev); - } + netif_carrier_off(vif->netdev); return ret; } @@ -589,6 +592,7 @@ qtnf_del_station(struct wiphy *wiphy, struct net_device *dev, if (ret) pr_err("VIF%u.%u: failed to delete STA %pM\n", vif->mac->macid, vif->vifid, params->mac); + return ret; } @@ -596,21 +600,25 @@ static int qtnf_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) { struct qtnf_wmac *mac = wiphy_priv(wiphy); + int ret; cancel_delayed_work_sync(&mac->scan_timeout); mac->scan_req = request; - if (qtnf_cmd_send_scan(mac)) { + ret = qtnf_cmd_send_scan(mac); + if (ret) { pr_err("MAC%u: failed to start scan\n", mac->macid); mac->scan_req = NULL; - return -EFAULT; + goto out; } + pr_debug("MAC%u: scan started\n", mac->macid); queue_delayed_work(mac->bus->workqueue, &mac->scan_timeout, QTNF_SCAN_TIMEOUT_SEC * HZ); - return 0; +out: + return ret; } static int @@ -630,12 +638,13 @@ qtnf_connect(struct wiphy *wiphy, struct net_device *dev, ret = qtnf_cmd_send_connect(vif, sme); if (ret) { - pr_err("VIF%u.%u: failed to connect\n", vif->mac->macid, - vif->vifid); - return ret; + pr_err("VIF%u.%u: failed to connect\n", + vif->mac->macid, vif->vifid); + goto out; } - return 0; +out: + return ret; } static int @@ -661,8 +670,8 @@ qtnf_disconnect(struct wiphy *wiphy, struct net_device *dev, ret = qtnf_cmd_send_disconnect(vif, reason_code); if (ret) - pr_err("VIF%u.%u: failed to disconnect\n", mac->macid, - vif->vifid); + pr_err("VIF%u.%u: failed to disconnect\n", + mac->macid, vif->vifid); if (vif->wdev.current_bss) { netif_carrier_off(vif->netdev); @@ -740,7 +749,6 @@ qtnf_dump_survey(struct wiphy *wiphy, struct net_device *dev, default: pr_debug("failed to get chan(%d) stats from card\n", chan->hw_value); - ret = -EINVAL; break; } @@ -763,6 +771,7 @@ qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, ret = qtnf_cmd_get_channel(vif, chandef); if (ret) { pr_err("%s: failed to get channel: %d\n", ndev->name, ret); + ret = -ENODATA; goto out; } @@ -772,6 +781,7 @@ qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, chandef->center_freq1, chandef->center_freq2, chandef->width); ret = -ENODATA; + goto out; } out: @@ -841,10 +851,8 @@ static int qtnf_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, ret = qtnf_cmd_send_pm_set(vif, enabled ? QLINK_PM_AUTO_STANDBY : QLINK_PM_OFF, timeout); - if (ret) { + if (ret) pr_err("%s: failed to set PM mode ret=%d\n", dev->name, ret); - return ret; - } return ret; } @@ -964,9 +972,16 @@ static void qtnf_cfg80211_reg_notifier(struct wiphy *wiphy_in, ret = qtnf_cmd_reg_notify(bus, req); if (ret) { - if (ret != -EOPNOTSUPP && ret != -EALREADY) + if (ret == -EOPNOTSUPP) { + pr_warn("reg update not supported\n"); + } else if (ret == -EALREADY) { + pr_info("regulatory domain is already set to %c%c", + req->alpha2[0], req->alpha2[1]); + } else { pr_err("failed to update reg domain to %c%c\n", req->alpha2[0], req->alpha2[1]); + } + return; } @@ -1139,7 +1154,8 @@ void qtnf_netdev_updown(struct net_device *ndev, bool up) struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); if (qtnf_cmd_send_updown_intf(vif, up)) - pr_err("failed to send up/down command to FW\n"); + pr_err("failed to send %s command to VIF%u.%u\n", + up ? "UP" : "DOWN", vif->mac->macid, vif->vifid); } void qtnf_virtual_intf_cleanup(struct net_device *ndev) diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index ae9e77300533..63d93cf3ace0 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -80,7 +80,6 @@ static int qtnf_cmd_resp_result_decode(enum qlink_cmd_result qcode) static int qtnf_cmd_send_with_reply(struct qtnf_bus *bus, struct sk_buff *cmd_skb, struct sk_buff **response_skb, - u16 *result_code, size_t const_resp_size, size_t *var_resp_size) { @@ -88,7 +87,8 @@ static int qtnf_cmd_send_with_reply(struct qtnf_bus *bus, const struct qlink_resp *resp; struct sk_buff *resp_skb = NULL; u16 cmd_id; - u8 mac_id, vif_id; + u8 mac_id; + u8 vif_id; int ret; cmd = (struct qlink_cmd *)cmd_skb->data; @@ -97,8 +97,11 @@ static int qtnf_cmd_send_with_reply(struct qtnf_bus *bus, vif_id = cmd->vifid; cmd->mhdr.len = cpu_to_le16(cmd_skb->len); - if (unlikely(bus->fw_state != QTNF_FW_STATE_ACTIVE && - le16_to_cpu(cmd->cmd_id) != QLINK_CMD_FW_INIT)) { + pr_debug("VIF%u.%u cmd=0x%.4X\n", mac_id, vif_id, + le16_to_cpu(cmd->cmd_id)); + + if (bus->fw_state != QTNF_FW_STATE_ACTIVE && + le16_to_cpu(cmd->cmd_id) != QLINK_CMD_FW_INIT) { pr_warn("VIF%u.%u: drop cmd 0x%.4X in fw state %d\n", mac_id, vif_id, le16_to_cpu(cmd->cmd_id), bus->fw_state); @@ -106,24 +109,16 @@ static int qtnf_cmd_send_with_reply(struct qtnf_bus *bus, return -ENODEV; } - pr_debug("VIF%u.%u cmd=0x%.4X\n", mac_id, vif_id, - le16_to_cpu(cmd->cmd_id)); - ret = qtnf_trans_send_cmd_with_resp(bus, cmd_skb, &resp_skb); - - if (unlikely(ret)) + if (ret) goto out; resp = (const struct qlink_resp *)resp_skb->data; ret = qtnf_cmd_check_reply_header(resp, cmd_id, mac_id, vif_id, const_resp_size); - - if (unlikely(ret)) + if (ret) goto out; - if (likely(result_code)) - *result_code = le16_to_cpu(resp->result); - /* Return length of variable part of response */ if (response_skb && var_resp_size) *var_resp_size = le16_to_cpu(resp->mhdr.len) - const_resp_size; @@ -134,14 +129,18 @@ static int qtnf_cmd_send_with_reply(struct qtnf_bus *bus, else consume_skb(resp_skb); + if (!ret && resp) + return qtnf_cmd_resp_result_decode(le16_to_cpu(resp->result)); + + pr_warn("VIF%u.%u: cmd 0x%.4X failed: %d\n", + mac_id, vif_id, le16_to_cpu(cmd->cmd_id), ret); + return ret; } -static inline int qtnf_cmd_send(struct qtnf_bus *bus, - struct sk_buff *cmd_skb, - u16 *result_code) +static inline int qtnf_cmd_send(struct qtnf_bus *bus, struct sk_buff *cmd_skb) { - return qtnf_cmd_send_with_reply(bus, cmd_skb, NULL, result_code, + return qtnf_cmd_send_with_reply(bus, cmd_skb, NULL, sizeof(struct qlink_resp), NULL); } @@ -228,7 +227,6 @@ int qtnf_cmd_send_start_ap(struct qtnf_vif *vif, struct sk_buff *cmd_skb; struct qlink_cmd_start_ap *cmd; struct qlink_auth_encr *aen; - u16 res_code = QLINK_CMD_RESULT_OK; int ret; int i; @@ -329,30 +327,21 @@ int qtnf_cmd_send_start_ap(struct qtnf_vif *vif, } qtnf_bus_lock(vif->mac->bus); - - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, res_code); - ret = -EFAULT; + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - } netif_carrier_on(vif->netdev); out: qtnf_bus_unlock(vif->mac->bus); + return ret; } int qtnf_cmd_send_stop_ap(struct qtnf_vif *vif) { struct sk_buff *cmd_skb; - u16 res_code = QLINK_CMD_RESULT_OK; int ret; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -362,23 +351,13 @@ int qtnf_cmd_send_stop_ap(struct qtnf_vif *vif) return -ENOMEM; qtnf_bus_lock(vif->mac->bus); - - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, res_code); - ret = -EFAULT; + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - } - - netif_carrier_off(vif->netdev); out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -386,7 +365,6 @@ int qtnf_cmd_send_register_mgmt(struct qtnf_vif *vif, u16 frame_type, bool reg) { struct sk_buff *cmd_skb; struct qlink_cmd_mgmt_frame_register *cmd; - u16 res_code = QLINK_CMD_RESULT_OK; int ret; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -401,20 +379,13 @@ int qtnf_cmd_send_register_mgmt(struct qtnf_vif *vif, u16 frame_type, bool reg) cmd->frame_type = cpu_to_le16(frame_type); cmd->do_register = reg; - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, res_code); - ret = -EFAULT; + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - } out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -423,7 +394,6 @@ int qtnf_cmd_send_mgmt_frame(struct qtnf_vif *vif, u32 cookie, u16 flags, { struct sk_buff *cmd_skb; struct qlink_cmd_mgmt_frame_tx *cmd; - u16 res_code = QLINK_CMD_RESULT_OK; int ret; if (sizeof(*cmd) + len > QTNF_MAX_CMD_BUF_SIZE) { @@ -448,20 +418,13 @@ int qtnf_cmd_send_mgmt_frame(struct qtnf_vif *vif, u32 cookie, u16 flags, if (len && buf) qtnf_cmd_skb_put_buffer(cmd_skb, buf, len); - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - - if (unlikely(ret)) + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, res_code); - ret = -EFAULT; - goto out; - } - out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -469,7 +432,6 @@ 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; - u16 res_code = QLINK_CMD_RESULT_OK; int ret; if (len > QTNF_MAX_CMD_BUF_SIZE) { @@ -487,21 +449,13 @@ int qtnf_cmd_send_mgmt_set_appie(struct qtnf_vif *vif, u8 frame_type, qtnf_cmd_tlv_ie_set_add(cmd_skb, frame_type, buf, len); qtnf_bus_lock(vif->mac->bus); - - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - - if (unlikely(ret)) + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u frame %u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, frame_type, res_code); - ret = -EFAULT; - goto out; - } - out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -730,7 +684,6 @@ int qtnf_cmd_get_sta_info(struct qtnf_vif *vif, const u8 *sta_mac, struct qlink_cmd_get_sta_info *cmd; const struct qlink_resp_get_sta_info *resp; size_t var_resp_len; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -745,31 +698,13 @@ int qtnf_cmd_get_sta_info(struct qtnf_vif *vif, const u8 *sta_mac, ether_addr_copy(cmd->sta_addr, sta_mac); ret = qtnf_cmd_send_with_reply(vif->mac->bus, cmd_skb, &resp_skb, - &res_code, sizeof(*resp), - &var_resp_len); - - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - switch (res_code) { - case QLINK_CMD_RESULT_ENOTFOUND: - pr_warn("VIF%u.%u: %pM STA not found\n", - vif->mac->macid, vif->vifid, sta_mac); - ret = -ENOENT; - break; - default: - pr_err("VIF%u.%u: can't get info for %pM: %u\n", - vif->mac->macid, vif->vifid, sta_mac, res_code); - ret = -EFAULT; - break; - } + sizeof(*resp), &var_resp_len); + if (ret) goto out; - } resp = (const struct qlink_resp_get_sta_info *)resp_skb->data; - if (unlikely(!ether_addr_equal(sta_mac, resp->sta_addr))) { + if (!ether_addr_equal(sta_mac, resp->sta_addr)) { pr_err("VIF%u.%u: wrong mac in reply: %pM != %pM\n", vif->mac->macid, vif->vifid, resp->sta_addr, sta_mac); ret = -EINVAL; @@ -795,7 +730,6 @@ static int qtnf_cmd_send_add_change_intf(struct qtnf_vif *vif, struct sk_buff *cmd_skb, *resp_skb = NULL; struct qlink_cmd_manage_intf *cmd; const struct qlink_resp_manage_intf *resp; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -828,17 +762,9 @@ static int qtnf_cmd_send_add_change_intf(struct qtnf_vif *vif, eth_zero_addr(cmd->intf_info.mac_addr); ret = qtnf_cmd_send_with_reply(vif->mac->bus, cmd_skb, &resp_skb, - &res_code, sizeof(*resp), NULL); - - if (unlikely(ret)) - goto out; - - ret = qtnf_cmd_resp_result_decode(res_code); - if (ret) { - pr_err("VIF%u.%u: CMD %d failed: %u\n", vif->mac->macid, - vif->vifid, cmd_type, res_code); + sizeof(*resp), NULL); + if (ret) goto out; - } resp = (const struct qlink_resp_manage_intf *)resp_skb->data; ether_addr_copy(vif->mac_addr, resp->intf_info.mac_addr); @@ -868,7 +794,6 @@ int qtnf_cmd_send_del_intf(struct qtnf_vif *vif) { struct sk_buff *cmd_skb; struct qlink_cmd_manage_intf *cmd; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -897,17 +822,9 @@ int qtnf_cmd_send_del_intf(struct qtnf_vif *vif) eth_zero_addr(cmd->intf_info.mac_addr); - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, res_code); - ret = -EFAULT; + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - } out: qtnf_bus_unlock(vif->mac->bus); @@ -1732,7 +1649,6 @@ int qtnf_cmd_get_mac_info(struct qtnf_wmac *mac) struct sk_buff *cmd_skb, *resp_skb = NULL; const struct qlink_resp_get_mac_info *resp; size_t var_data_len; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, QLINK_VIFID_RSVD, @@ -1742,18 +1658,11 @@ int qtnf_cmd_get_mac_info(struct qtnf_wmac *mac) return -ENOMEM; qtnf_bus_lock(mac->bus); - - ret = qtnf_cmd_send_with_reply(mac->bus, cmd_skb, &resp_skb, &res_code, + ret = qtnf_cmd_send_with_reply(mac->bus, cmd_skb, &resp_skb, sizeof(*resp), &var_data_len); - if (unlikely(ret)) + if (ret) goto out; - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("MAC%u: CMD failed: %u\n", mac->macid, res_code); - ret = -EFAULT; - goto out; - } - resp = (const struct qlink_resp_get_mac_info *)resp_skb->data; qtnf_cmd_resp_proc_mac_info(mac, resp); ret = qtnf_parse_variable_mac_info(mac, resp->var_info, var_data_len); @@ -1769,7 +1678,6 @@ int qtnf_cmd_get_hw_info(struct qtnf_bus *bus) { struct sk_buff *cmd_skb, *resp_skb = NULL; const struct qlink_resp_get_hw_info *resp; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; size_t info_len; @@ -1780,18 +1688,10 @@ int qtnf_cmd_get_hw_info(struct qtnf_bus *bus) return -ENOMEM; qtnf_bus_lock(bus); - - ret = qtnf_cmd_send_with_reply(bus, cmd_skb, &resp_skb, &res_code, + ret = qtnf_cmd_send_with_reply(bus, cmd_skb, &resp_skb, sizeof(*resp), &info_len); - - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("cmd exec failed: 0x%.4X\n", res_code); - ret = -EFAULT; + if (ret) goto out; - } resp = (const struct qlink_resp_get_hw_info *)resp_skb->data; ret = qtnf_cmd_resp_proc_hw_info(bus, resp, info_len); @@ -1810,7 +1710,6 @@ int qtnf_cmd_band_info_get(struct qtnf_wmac *mac, size_t info_len; struct qlink_cmd_band_info_get *cmd; struct qlink_resp_band_info_get *resp; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; u8 qband; @@ -1838,18 +1737,10 @@ int qtnf_cmd_band_info_get(struct qtnf_wmac *mac, cmd->band = qband; qtnf_bus_lock(mac->bus); - - ret = qtnf_cmd_send_with_reply(mac->bus, cmd_skb, &resp_skb, &res_code, + ret = qtnf_cmd_send_with_reply(mac->bus, cmd_skb, &resp_skb, sizeof(*resp), &info_len); - - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("MAC%u: CMD failed: %u\n", mac->macid, res_code); - ret = -EFAULT; + if (ret) goto out; - } resp = (struct qlink_resp_band_info_get *)resp_skb->data; if (resp->band != qband) { @@ -1873,7 +1764,6 @@ int qtnf_cmd_send_get_phy_params(struct qtnf_wmac *mac) struct sk_buff *cmd_skb, *resp_skb = NULL; size_t response_size; struct qlink_resp_phy_params *resp; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, 0, @@ -1883,18 +1773,10 @@ int qtnf_cmd_send_get_phy_params(struct qtnf_wmac *mac) return -ENOMEM; qtnf_bus_lock(mac->bus); - - ret = qtnf_cmd_send_with_reply(mac->bus, cmd_skb, &resp_skb, &res_code, + ret = qtnf_cmd_send_with_reply(mac->bus, cmd_skb, &resp_skb, sizeof(*resp), &response_size); - - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("MAC%u: CMD failed: %u\n", mac->macid, res_code); - ret = -EFAULT; + if (ret) goto out; - } resp = (struct qlink_resp_phy_params *)resp_skb->data; ret = qtnf_cmd_resp_proc_phy_params(mac, resp->info, response_size); @@ -1910,7 +1792,6 @@ int qtnf_cmd_send_update_phy_params(struct qtnf_wmac *mac, u32 changed) { struct wiphy *wiphy = priv_to_wiphy(mac); struct sk_buff *cmd_skb; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, 0, @@ -1931,26 +1812,19 @@ int qtnf_cmd_send_update_phy_params(struct qtnf_wmac *mac, u32 changed) qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_COVERAGE_CLASS, wiphy->coverage_class); - ret = qtnf_cmd_send(mac->bus, cmd_skb, &res_code); - - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("MAC%u: CMD failed: %u\n", mac->macid, res_code); - ret = -EFAULT; + ret = qtnf_cmd_send(mac->bus, cmd_skb); + if (ret) goto out; - } out: qtnf_bus_unlock(mac->bus); + return ret; } int qtnf_cmd_send_init_fw(struct qtnf_bus *bus) { struct sk_buff *cmd_skb; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(QLINK_MACID_RSVD, QLINK_VIFID_RSVD, @@ -1960,20 +1834,13 @@ int qtnf_cmd_send_init_fw(struct qtnf_bus *bus) return -ENOMEM; qtnf_bus_lock(bus); - - ret = qtnf_cmd_send(bus, cmd_skb, &res_code); - - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("cmd exec failed: 0x%.4X\n", res_code); - ret = -EFAULT; + ret = qtnf_cmd_send(bus, cmd_skb); + if (ret) goto out; - } out: qtnf_bus_unlock(bus); + return ret; } @@ -1988,9 +1855,7 @@ void qtnf_cmd_send_deinit_fw(struct qtnf_bus *bus) return; qtnf_bus_lock(bus); - - qtnf_cmd_send(bus, cmd_skb, NULL); - + qtnf_cmd_send(bus, cmd_skb); qtnf_bus_unlock(bus); } @@ -1999,7 +1864,6 @@ int qtnf_cmd_send_add_key(struct qtnf_vif *vif, u8 key_index, bool pairwise, { struct sk_buff *cmd_skb; struct qlink_cmd_add_key *cmd; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -2031,19 +1895,13 @@ int qtnf_cmd_send_add_key(struct qtnf_vif *vif, u8 key_index, bool pairwise, params->seq, params->seq_len); - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", - vif->mac->macid, vif->vifid, res_code); - ret = -EFAULT; + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - } out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -2052,7 +1910,6 @@ int qtnf_cmd_send_del_key(struct qtnf_vif *vif, u8 key_index, bool pairwise, { struct sk_buff *cmd_skb; struct qlink_cmd_del_key *cmd; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -2072,19 +1929,14 @@ int qtnf_cmd_send_del_key(struct qtnf_vif *vif, u8 key_index, bool pairwise, cmd->key_index = key_index; cmd->pairwise = pairwise; - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - if (unlikely(ret)) - goto out; - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", - vif->mac->macid, vif->vifid, res_code); - ret = -EFAULT; + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - } out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -2093,7 +1945,6 @@ int qtnf_cmd_send_set_default_key(struct qtnf_vif *vif, u8 key_index, { struct sk_buff *cmd_skb; struct qlink_cmd_set_def_key *cmd; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -2108,19 +1959,14 @@ int qtnf_cmd_send_set_default_key(struct qtnf_vif *vif, u8 key_index, cmd->key_index = key_index; cmd->unicast = unicast; cmd->multicast = multicast; - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - if (unlikely(ret)) - goto out; - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, res_code); - ret = -EFAULT; + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - } out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -2128,7 +1974,6 @@ int qtnf_cmd_send_set_default_mgmt_key(struct qtnf_vif *vif, u8 key_index) { struct sk_buff *cmd_skb; struct qlink_cmd_set_def_mgmt_key *cmd; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -2141,19 +1986,14 @@ int qtnf_cmd_send_set_default_mgmt_key(struct qtnf_vif *vif, u8 key_index) cmd = (struct qlink_cmd_set_def_mgmt_key *)cmd_skb->data; cmd->key_index = key_index; - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - if (unlikely(ret)) - goto out; - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, res_code); - ret = -EFAULT; + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - } out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -2183,7 +2023,6 @@ int qtnf_cmd_send_change_sta(struct qtnf_vif *vif, const u8 *mac, { struct sk_buff *cmd_skb; struct qlink_cmd_change_sta *cmd; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -2214,19 +2053,13 @@ int qtnf_cmd_send_change_sta(struct qtnf_vif *vif, const u8 *mac, goto out; } - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - if (unlikely(ret)) + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, res_code); - ret = -EFAULT; - goto out; - } - out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -2235,7 +2068,6 @@ int qtnf_cmd_send_del_sta(struct qtnf_vif *vif, { struct sk_buff *cmd_skb; struct qlink_cmd_del_sta *cmd; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -2256,19 +2088,13 @@ int qtnf_cmd_send_del_sta(struct qtnf_vif *vif, cmd->subtype = params->subtype; cmd->reason_code = cpu_to_le16(params->reason_code); - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, res_code); - ret = -EFAULT; + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - } out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -2312,7 +2138,6 @@ static void qtnf_cmd_randmac_tlv_add(struct sk_buff *cmd_skb, int qtnf_cmd_send_scan(struct qtnf_wmac *mac) { struct sk_buff *cmd_skb; - u16 res_code = QLINK_CMD_RESULT_OK; struct ieee80211_channel *sc; struct cfg80211_scan_request *scan_req = mac->scan_req; int n_channels; @@ -2370,20 +2195,13 @@ int qtnf_cmd_send_scan(struct qtnf_wmac *mac) scan_req->mac_addr_mask); } - ret = qtnf_cmd_send(mac->bus, cmd_skb, &res_code); - - if (unlikely(ret)) + ret = qtnf_cmd_send(mac->bus, cmd_skb); + if (ret) goto out; - pr_debug("MAC%u: scan started\n", mac->macid); - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("MAC%u: CMD failed: %u\n", mac->macid, res_code); - ret = -EFAULT; - goto out; - } out: qtnf_bus_unlock(mac->bus); + return ret; } @@ -2393,7 +2211,6 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif, struct sk_buff *cmd_skb; struct qlink_cmd_connect *cmd; struct qlink_auth_encr *aen; - u16 res_code = QLINK_CMD_RESULT_OK; int ret; int i; u32 connect_flags = 0; @@ -2474,20 +2291,13 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif, qtnf_cmd_channel_tlv_add(cmd_skb, sme->channel); qtnf_bus_lock(vif->mac->bus); - - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - - if (unlikely(ret)) + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, res_code); - ret = -EFAULT; - goto out; - } out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -2495,7 +2305,6 @@ int qtnf_cmd_send_disconnect(struct qtnf_vif *vif, u16 reason_code) { struct sk_buff *cmd_skb; struct qlink_cmd_disconnect *cmd; - u16 res_code = QLINK_CMD_RESULT_OK; int ret; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -2509,19 +2318,13 @@ int qtnf_cmd_send_disconnect(struct qtnf_vif *vif, u16 reason_code) cmd = (struct qlink_cmd_disconnect *)cmd_skb->data; cmd->reason = cpu_to_le16(reason_code); - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - - if (unlikely(ret)) + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, res_code); - ret = -EFAULT; - goto out; - } out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -2529,7 +2332,6 @@ int qtnf_cmd_send_updown_intf(struct qtnf_vif *vif, bool up) { struct sk_buff *cmd_skb; struct qlink_cmd_updown *cmd; - u16 res_code = QLINK_CMD_RESULT_OK; int ret; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -2542,20 +2344,13 @@ int qtnf_cmd_send_updown_intf(struct qtnf_vif *vif, bool up) cmd->if_up = !!up; qtnf_bus_lock(vif->mac->bus); - - ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); - - if (unlikely(ret)) + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) goto out; - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("VIF%u.%u: CMD failed: %u\n", vif->mac->macid, - vif->vifid, res_code); - ret = -EFAULT; - goto out; - } out: qtnf_bus_unlock(vif->mac->bus); + return ret; } @@ -2563,7 +2358,6 @@ int qtnf_cmd_reg_notify(struct qtnf_bus *bus, struct regulatory_request *req) { struct sk_buff *cmd_skb; int ret; - u16 res_code; struct qlink_cmd_reg_notify *cmd; cmd_skb = qtnf_cmd_alloc_new_cmdskb(QLINK_MACID_RSVD, QLINK_VIFID_RSVD, @@ -2604,29 +2398,10 @@ int qtnf_cmd_reg_notify(struct qtnf_bus *bus, struct regulatory_request *req) } qtnf_bus_lock(bus); - - ret = qtnf_cmd_send(bus, cmd_skb, &res_code); + ret = qtnf_cmd_send(bus, cmd_skb); if (ret) goto out; - switch (res_code) { - case QLINK_CMD_RESULT_ENOTSUPP: - pr_warn("reg update not supported\n"); - ret = -EOPNOTSUPP; - break; - case QLINK_CMD_RESULT_EALREADY: - pr_info("regulatory domain is already set to %c%c", - req->alpha2[0], req->alpha2[1]); - ret = -EALREADY; - break; - case QLINK_CMD_RESULT_OK: - ret = 0; - break; - default: - ret = -EFAULT; - break; - } - out: qtnf_bus_unlock(bus); @@ -2640,7 +2415,6 @@ int qtnf_cmd_get_chan_stats(struct qtnf_wmac *mac, u16 channel, struct qlink_cmd_get_chan_stats *cmd; struct qlink_resp_get_chan_stats *resp; size_t var_data_len; - u16 res_code = QLINK_CMD_RESULT_OK; int ret = 0; cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, QLINK_VIFID_RSVD, @@ -2654,25 +2428,10 @@ int qtnf_cmd_get_chan_stats(struct qtnf_wmac *mac, u16 channel, cmd = (struct qlink_cmd_get_chan_stats *)cmd_skb->data; cmd->channel = cpu_to_le16(channel); - ret = qtnf_cmd_send_with_reply(mac->bus, cmd_skb, &resp_skb, &res_code, + ret = qtnf_cmd_send_with_reply(mac->bus, cmd_skb, &resp_skb, sizeof(*resp), &var_data_len); - if (unlikely(ret)) { - qtnf_bus_unlock(mac->bus); - return ret; - } - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - switch (res_code) { - case QLINK_CMD_RESULT_ENOTFOUND: - ret = -ENOENT; - break; - default: - pr_err("cmd exec failed: 0x%.4X\n", res_code); - ret = -EFAULT; - break; - } + if (ret) goto out; - } resp = (struct qlink_resp_get_chan_stats *)resp_skb->data; ret = qtnf_cmd_resp_proc_chan_stat_info(stats, resp->info, @@ -2681,6 +2440,7 @@ int qtnf_cmd_get_chan_stats(struct qtnf_wmac *mac, u16 channel, out: qtnf_bus_unlock(mac->bus); consume_skb(resp_skb); + return ret; } @@ -2690,7 +2450,6 @@ int qtnf_cmd_send_chan_switch(struct qtnf_vif *vif, struct qtnf_wmac *mac = vif->mac; struct qlink_cmd_chan_switch *cmd; struct sk_buff *cmd_skb; - u16 res_code = QLINK_CMD_RESULT_OK; int ret; cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, vif->vifid, @@ -2707,32 +2466,13 @@ int qtnf_cmd_send_chan_switch(struct qtnf_vif *vif, cmd->block_tx = params->block_tx; cmd->beacon_count = params->count; - ret = qtnf_cmd_send(mac->bus, cmd_skb, &res_code); - - if (unlikely(ret)) + ret = qtnf_cmd_send(mac->bus, cmd_skb); + if (ret) goto out; - switch (res_code) { - case QLINK_CMD_RESULT_OK: - ret = 0; - break; - case QLINK_CMD_RESULT_ENOTFOUND: - ret = -ENOENT; - break; - case QLINK_CMD_RESULT_ENOTSUPP: - ret = -EOPNOTSUPP; - break; - case QLINK_CMD_RESULT_EALREADY: - ret = -EALREADY; - break; - case QLINK_CMD_RESULT_INVALID: - default: - ret = -EFAULT; - break; - } - out: qtnf_bus_unlock(mac->bus); + return ret; } @@ -2742,7 +2482,6 @@ int qtnf_cmd_get_channel(struct qtnf_vif *vif, struct cfg80211_chan_def *chdef) const struct qlink_resp_channel_get *resp; struct sk_buff *cmd_skb; struct sk_buff *resp_skb = NULL; - u16 res_code = QLINK_CMD_RESULT_OK; int ret; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, @@ -2752,25 +2491,18 @@ int qtnf_cmd_get_channel(struct qtnf_vif *vif, struct cfg80211_chan_def *chdef) return -ENOMEM; qtnf_bus_lock(bus); - - ret = qtnf_cmd_send_with_reply(bus, cmd_skb, &resp_skb, &res_code, + ret = qtnf_cmd_send_with_reply(bus, cmd_skb, &resp_skb, sizeof(*resp), NULL); - - qtnf_bus_unlock(bus); - - if (unlikely(ret)) - goto out; - - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - ret = -ENODATA; + if (ret) goto out; - } resp = (const struct qlink_resp_channel_get *)resp_skb->data; qlink_chandef_q2cfg(priv_to_wiphy(vif->mac), &resp->chan, chdef); out: + qtnf_bus_unlock(bus); consume_skb(resp_skb); + return ret; } @@ -2782,7 +2514,6 @@ int qtnf_cmd_start_cac(const struct qtnf_vif *vif, struct sk_buff *cmd_skb; struct qlink_cmd_start_cac *cmd; int ret; - u16 res_code; cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, QLINK_CMD_START_CAC, @@ -2795,19 +2526,12 @@ int qtnf_cmd_start_cac(const struct qtnf_vif *vif, qlink_chandef_cfg2q(chdef, &cmd->chan); qtnf_bus_lock(bus); - ret = qtnf_cmd_send(bus, cmd_skb, &res_code); - qtnf_bus_unlock(bus); - + ret = qtnf_cmd_send(bus, cmd_skb); if (ret) - return ret; + goto out; - switch (res_code) { - case QLINK_CMD_RESULT_OK: - break; - default: - ret = -EOPNOTSUPP; - break; - } +out: + qtnf_bus_unlock(bus); return ret; } @@ -2819,7 +2543,6 @@ int qtnf_cmd_set_mac_acl(const struct qtnf_vif *vif, struct sk_buff *cmd_skb; 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, @@ -2834,22 +2557,12 @@ int qtnf_cmd_set_mac_acl(const struct qtnf_vif *vif, qlink_acl_data_cfg2q(params, (struct qlink_acl_data *)tlv->val); qtnf_bus_lock(bus); - ret = qtnf_cmd_send(bus, cmd_skb, &res_code); - qtnf_bus_unlock(bus); - - if (unlikely(ret)) - return ret; + ret = qtnf_cmd_send(bus, cmd_skb); + if (ret) + goto out; - switch (res_code) { - case QLINK_CMD_RESULT_OK: - break; - case QLINK_CMD_RESULT_INVALID: - ret = -EINVAL; - break; - default: - ret = -EOPNOTSUPP; - break; - } +out: + qtnf_bus_unlock(bus); return ret; } @@ -2858,7 +2571,6 @@ int qtnf_cmd_send_pm_set(const struct qtnf_vif *vif, u8 pm_mode, int timeout) { struct qtnf_bus *bus = vif->mac->bus; struct sk_buff *cmd_skb; - u16 res_code = QLINK_CMD_RESULT_OK; struct qlink_cmd_pm_set *cmd; int ret = 0; @@ -2873,18 +2585,13 @@ int qtnf_cmd_send_pm_set(const struct qtnf_vif *vif, u8 pm_mode, int timeout) qtnf_bus_lock(bus); - ret = qtnf_cmd_send(bus, cmd_skb, &res_code); - - if (unlikely(ret)) + ret = qtnf_cmd_send(bus, cmd_skb); + if (ret) goto out; - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("cmd exec failed: 0x%.4X\n", res_code); - ret = -EFAULT; - } - out: qtnf_bus_unlock(bus); + return ret; } @@ -2893,7 +2600,6 @@ int qtnf_cmd_send_wowlan_set(const struct qtnf_vif *vif, { struct qtnf_bus *bus = vif->mac->bus; struct sk_buff *cmd_skb; - u16 res_code = QLINK_CMD_RESULT_OK; struct qlink_cmd_wowlan_set *cmd; u32 triggers = 0; int count = 0; @@ -2929,16 +2635,10 @@ int qtnf_cmd_send_wowlan_set(const struct qtnf_vif *vif, cmd->triggers = cpu_to_le32(triggers); - ret = qtnf_cmd_send(bus, cmd_skb, &res_code); - - if (unlikely(ret)) + ret = qtnf_cmd_send(bus, cmd_skb); + if (ret) goto out; - if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { - pr_err("cmd exec failed: 0x%.4X\n", res_code); - ret = -EFAULT; - } - out: qtnf_bus_unlock(bus); return ret; From patchwork Fri Oct 5 10:11:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627801 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-2.web.codeaurora.org (Postfix) with ESMTP id D971915E2 for ; Fri, 5 Oct 2018 10:11:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D722528E37 for ; Fri, 5 Oct 2018 10:11:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB1C928E40; Fri, 5 Oct 2018 10:11:46 +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 6974E28E37 for ; Fri, 5 Oct 2018 10:11:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728126AbeJERJu (ORCPT ); Fri, 5 Oct 2018 13:09:50 -0400 Received: from mail-eopbgr730079.outbound.protection.outlook.com ([40.107.73.79]:1696 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727616AbeJERJu (ORCPT ); Fri, 5 Oct 2018 13:09:50 -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=mmjHCkuQzwD/ijy5/i2LA5UBofyW/RonqfieindctQM=; b=sJ/hztcZR1+coxgHk7a1Nw+Y5PKaSfr2jeTtinBiFE4byFosmbwC1avPMb+6XoPltg2CdlNE8Uy8aIouUxn56/sewTJNczye/vK2FTp/yvK7tticyyRYrJaJ1vJU1sauYjGxcvm4ENXxACQCpkA5VcQCHjl5BSH3n8LhBlnYRqM= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB4439.namprd05.prod.outlook.com (52.135.203.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.13; Fri, 5 Oct 2018 10:11:35 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:35 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko Subject: [PATCH v2 06/13] qtnfmac: do not cancel scan in disconnect callback Thread-Topic: [PATCH v2 06/13] qtnfmac: do not cancel scan in disconnect callback Thread-Index: AQHUXJPLZkrVixFa5USoKjxK52hAgg== Date: Fri, 5 Oct 2018 10:11:35 +0000 Message-ID: <20181005101114.3013-7-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB4439;6:d5MfQsSf9UcEpS2SnGFEQPx5Zis0JGpvhWR58WwcvkitcOvqttx43Z5L+vzYs3r35k0N5FXfPXCVbqXbcinFWLZIO4z7xRNdtdDcH7Qeze6HXuqx9xqjKL0Jl8gJq69rn/or88WZoV+UnjkWgopUTzYzrwX8rM3AzRkMr2S1xo876uYcvQpFkYCYtiBbFLCM9iyn1GVx1u5+jG/McL+rbKyHQKshJ3JLEWt1DO3nOtYXEfZ6QfZGoGjiY5mCivXkeb1l4Sxqv+612t5eTAAX4gmuYSqWbaE4h9V3SFs+/5mwhjfhBK24PAapngmCwoj0i/CL0Fcw0Ff94MbdlxPiC/1sJNldSwU/eqO/6dHy9cNMyFpC1nKxue7RXWmZPCu/rKlcP6GEEKOANWNdo9Dzzj6kcKlB5ETejcy/gTc9sENtP9yNPn6AYpskeotQNrEa5HCF2WvEbYJly6mDOTYfWA==;5:Kx3OjSP3Svry44FYb+Pp4G46Sw41AGqZgu8xa9rd3rjlYcM7Z87TRpr3jF4zPTkVgkstIlsvBBChESnnSwRiO0HEB+4ADD2GCr7g9xNn00Ee/2p/5XGeu+EoavoquA44o24jA9OJbSxdQWawzQGjW50bz+EWEGHs2Mt2I/+b9cw=;7:5AREnU4JpS5DplgiEZGoOmaUWkUadD6L0nhUTZ3qVkWJmrIjCSPyCUkGZLcD8niekVoGBbUIhDfgs/Raj+SEVLUS+5M3e5R8pWdmy7eBU32OIYGMnYwAdgZIkud3Pba5tIHl3UKYmYGgH55uPNmMXutiTT9B4xGGZ/dTgoTyNTet3t883VKJlLfCM5r/tgUQMBOjVu1EtHPe6/TI1/rzmvdUm5hueeX2M2V+4Cvbf2FebRsoS2/PNaaVjsUjenhf x-ms-office365-filtering-correlation-id: 05732074-4b5a-41ef-e7a8-08d62aaaee21 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB4439; x-ms-traffictypediagnostic: BYAPR05MB4439: 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)(8121501046)(5005006)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(149066)(150057)(6041310)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(201708071742011)(7699051);SRVR:BYAPR05MB4439;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB4439; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(39850400004)(396003)(366004)(136003)(189003)(199004)(305945005)(7736002)(26005)(1076002)(186003)(103116003)(2906002)(36756003)(2616005)(256004)(86362001)(476003)(11346002)(446003)(14454004)(486006)(6512007)(2351001)(316002)(106356001)(105586002)(8936002)(81156014)(81166006)(97736004)(8676002)(478600001)(53936002)(66066001)(5250100002)(5640700003)(6436002)(2900100001)(68736007)(2501003)(4326008)(71190400001)(6486002)(76176011)(71200400001)(102836004)(6506007)(386003)(5660300001)(6916009)(3846002)(99286004)(52116002)(6116002)(107886003)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB4439;H:BYAPR05MB4597.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 3qRq4Lq2A5rQQKZdW545Q2438c76Kwo7JZzBKZveB4ow9pFy0LeLD13bqPJucxGmAlQDJc2fyE9xchXBsfXuJ7C8IyjZu5+5wipda9amH8Xjiqtl5kaPSXsQuw23/9ppV851Ure07pBd2z7aQOGUJlbNo2KNbXovpw3QqNwBI8it+4cVIQ38yZRqobDxCYthBxsmiHQHl5v1jzRvWUk92+ZRBvA/HqGoLXxny8o7ciEr88tWndehBg1b1L95HTfSbjE0sJ9p3OKKVDHwQaCtA7VAYILTKmaC9rqQrDskznfboM5JVFi2pQ/9SxGL/7DAuKU341lUFqROsCviQpcJhrAaIoMmXyZLiNvoq68/1ac= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05732074-4b5a-41ef-e7a8-08d62aaaee21 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:35.2443 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4439 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 Do not cancel scan in disconnect callback. If there is an active scan, it will be cancelled by firmware, then host driver will be properly notified by event. Cancelling scan in disconnect callback occasionally may lead to the following race issue. Host is able to queue one scan after scan abort in disconnect callback, and another scan after scan abort in event handler. As a result, firmware receives second scan before the first scan completes. Signed-off-by: Igor Mitsyanko --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 4631277092bf..8b30d651cbe3 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -666,8 +666,6 @@ qtnf_disconnect(struct wiphy *wiphy, struct net_device *dev, goto out; } - qtnf_scan_done(mac, true); - ret = qtnf_cmd_send_disconnect(vif, reason_code); if (ret) pr_err("VIF%u.%u: failed to disconnect\n", From patchwork Fri Oct 5 10:11:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627799 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-2.web.codeaurora.org (Postfix) with ESMTP id 8319A15E8 for ; Fri, 5 Oct 2018 10:11:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81E4B28E36 for ; Fri, 5 Oct 2018 10:11:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7605028E3E; Fri, 5 Oct 2018 10:11:42 +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 8C28B28E36 for ; Fri, 5 Oct 2018 10:11:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728097AbeJERJo (ORCPT ); Fri, 5 Oct 2018 13:09:44 -0400 Received: from mail-sn1nam01on0057.outbound.protection.outlook.com ([104.47.32.57]:36694 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728025AbeJERJo (ORCPT ); Fri, 5 Oct 2018 13:09:44 -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=HtJNtii34ZuJVEMEiHis1hfOgzYteHUaD4WOQk8CioA=; b=cC1KiilxykvmrHCOMeJ7B5xV7muSVbM2uu4mQYheNNw0kKjnoqEYIZaZsC0B15eJQwOQwVWMDRFLnexFIAwOyCu4OopCzqjQesoUX4zXpLPLgJ4XaRtXAn9dcdxto8PJajfYe5PXfoSz8IVhMhWC5CU8TJQcLjmbK6e3z5s0Ftg= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB5110.namprd05.prod.outlook.com (20.177.231.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.14; Fri, 5 Oct 2018 10:11:37 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:37 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Sergey Matyukevich Subject: [PATCH v2 07/13] qtnfmac: pass sgi rate info flag to wireless core Thread-Topic: [PATCH v2 07/13] qtnfmac: pass sgi rate info flag to wireless core Thread-Index: AQHUXJPMUjd3FKIZ6EuO9jkF2zJsAA== Date: Fri, 5 Oct 2018 10:11:36 +0000 Message-ID: <20181005101114.3013-8-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB5110;6:ldyG5kBwIqs56zayXWYeyeb2c6XOkMbi8cm7pdTr6lbQBVNegha/VHG2O3Yp3BLSNAJal33yJ6E0/rSACaRREllieP54zYczQMH7kqguozr3XHxUXiKWk6Oxcnwmp39lFfpXyvyaEas3PW3h6+HVJfBfHMrpaGFUiQcIHdssjig/N1dUVqFe7pZARwYUOAETLI9d/mES0Vc2g35zbMriGyaO4p8wGy7gCrkXrt6tMg88uV9YyTzUWLkCsANkxEq2WV+ZUJkhxA1JrLqlui3pgocoMLPThqXk10qUTWdGmVJPSLfCNzKAyPhZ2kZuHyM6jGKb9lV0VSn1fCCi5WJfm0fkcDIi+V8kAhzqLio9big1JdQWMaZS+kTvFk7KUU11xwWBjvm3TKOUOeaVwq5tls/TLxBosyicLLXcJIluZEdb3nJst0ovnuP+egphyLdsMVFBOOypj25W+46BkxDrIQ==;5:qxZp7y/0lIU6ssiyHpUSN++A0BSGM8+nAMHIiqD4A31JnP9oyQttUjSlF1a0yFLQgae2G7uRsbFFOpnN9FPXWHbocCepqpV4RYzGajiDBKoWsTnFOgSCoJwiuwMMMLSN9j6cr9AbYPE50Wx+oZsyuL8biSLIdaurfF4a/Pz4N7c=;7:seWZWdO4/COXoPjjPYfqgoOp3mNnshYwTjgC9f0/LqAwRoFq8SEf4fB6D49mxbvcdCWvoxVqJFm9XSuGv1KVkSmdRvN7A+PJQrVecS0zcbqT9BbFkWxEYUGa2Aw+yrf3K31Qpx/UJg2aQTYrTN6lpJII+gZS12ECINqmeakhm6ps0idZN7ZUOpEB4YvFkL5ILNNZ7f5//gXurZJu7tBBIxochB+fCDTLfejr26k2b+MP4FoP55f4CFGQWBr+d646 x-ms-office365-filtering-correlation-id: 1341351b-5fa0-4478-5ff0-08d62aaaef2a x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB5110; x-ms-traffictypediagnostic: BYAPR05MB5110: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; 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)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(3002001)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991048);SRVR:BYAPR05MB5110;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB5110; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(346002)(376002)(136003)(39850400004)(366004)(199004)(189003)(52116002)(76176011)(11346002)(2900100001)(6916009)(2906002)(5640700003)(99286004)(478600001)(476003)(2616005)(5250100002)(8936002)(6512007)(6116002)(3846002)(68736007)(1076002)(53936002)(486006)(7736002)(305945005)(71200400001)(71190400001)(81166006)(81156014)(8676002)(103116003)(2501003)(86362001)(6486002)(102836004)(6506007)(386003)(36756003)(2351001)(14454004)(256004)(186003)(66066001)(26005)(106356001)(5660300001)(4326008)(107886003)(54906003)(446003)(97736004)(316002)(105586002)(6436002)(575784001)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB5110;H:BYAPR05MB4597.namprd05.prod.outlook.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-antispam-message-info: fOuY5rxC3gfP6TWNh9KM+Y+i5depn6Eoj+eSz7YPWvhljUos1KA6L169QNHUMpZHblHaqmJOkkGCsPK76bDvLNsOTck1f4SmgKZ3+0I+ukJKQshcWLQ5uYTb57sJdYIjiWiPEEG6vw+j+D8y3UvYpR1KkmW38ixfNrlLhnS1ouvawNt2uefeYfhPf+PJhpQOopV5MiaAv99TJlm34+vpVh3yu8aMS/cAbNRjpw3fUcelNnoCsdreyjwlUV7SaPbNkQAA7ooeT5BDukKOmHZH3KIfoHI/nmB1FXaplpVRU4WYbai7T3BycNbuTBKWJGz8pSwylIeGm+uXvb6mmMAFU1uSiIj4ib/3dkH9b9vstVI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1341351b-5fa0-4478-5ff0-08d62aaaef2a X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:36.8955 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB5110 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 SGI should be passed to wireless core as a part of rate structure. Otherwise wireless core performs incorrect rate calculation when SGI is enabled in hardware but not reported to host. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/commands.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 63d93cf3ace0..74edb5a0ae19 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -498,6 +498,9 @@ qtnf_sta_info_parse_rate(struct rate_info *rate_dst, rate_dst->flags |= RATE_INFO_FLAGS_MCS; else if (rate_src->flags & QLINK_STA_INFO_RATE_FLAG_VHT_MCS) rate_dst->flags |= RATE_INFO_FLAGS_VHT_MCS; + + if (rate_src->flags & QLINK_STA_INFO_RATE_FLAG_SHORT_GI) + rate_dst->flags |= RATE_INFO_FLAGS_SHORT_GI; } static void From patchwork Fri Oct 5 10:11:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627805 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-2.web.codeaurora.org (Postfix) with ESMTP id 1FA401731 for ; Fri, 5 Oct 2018 10:11:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DCDC28E36 for ; Fri, 5 Oct 2018 10:11:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11BA828E37; Fri, 5 Oct 2018 10:11:48 +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 7C75528E3E for ; Fri, 5 Oct 2018 10:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728145AbeJERJv (ORCPT ); Fri, 5 Oct 2018 13:09:51 -0400 Received: from mail-eopbgr730079.outbound.protection.outlook.com ([40.107.73.79]:1696 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727616AbeJERJv (ORCPT ); Fri, 5 Oct 2018 13:09:51 -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=9HtwuiLSFeh6ZzZ4VbSPoHHMfXM469h2WV3bSuE9J60=; b=js0lQrR7VP5ge5DTOomi6aVuuzsok++6xEKk3HhJZ6m0LVQz1+37bTaYI2T2zVy8EdcVGdk/UmFhRchkpwoR6c7jjSTw+6RnR4REMv1vi3kMa5kgTrk+H+cO5xWDLW7+GXUmgLfsNSaJ4CRKnWCmERfHi/GXR5tMkuyGsmZkOmc= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB4439.namprd05.prod.outlook.com (52.135.203.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.13; Fri, 5 Oct 2018 10:11:38 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:38 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Sergey Matyukevich Subject: [PATCH v2 08/13] qtnfmac: inform wireless core about supported extended capabilities Thread-Topic: [PATCH v2 08/13] qtnfmac: inform wireless core about supported extended capabilities Thread-Index: AQHUXJPNsx8U2c+pmUeer29m9bkaFA== Date: Fri, 5 Oct 2018 10:11:38 +0000 Message-ID: <20181005101114.3013-9-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB4439;6:QXzyd8xJXztXYod3dZoIhJNXGwyB/mnPLk+8w7O/V9dISqHD45i8OS1QmLV/eFnjcAgEy6niqJrLeVrRuNHBQLQOPvL6hdm6VsMj7xcK+JBMkWG4wHY+PoYzHg+F+Ga69Fuulfk/pGuFHXWjt6tZvYWVeBkHjBZ79xMPxd6c+hUxUlido0vSsl/+NnknVR48AJ+7iol2LP/AXdKE8MRG27IloJuF56ej/8n+ulC2EPrGHlkXpg9VMIfW8JJ00PyxOzW+TSS63bb1zjZ9IGvPJBGjktdr7GHNLH/wKO0uzYMLGWOMfSjIfZDObGbkDe2mhFJFlf6ts4Y+B9jpIa7mjauH4V1DDIKYRs4fld9cuaRJKdhASDLvVaRiX2T/8zaDWGoKPC2X/LNUJRb0XqUTp9jZYfEMUZJsWNOWiwa5EwbjXXvaVQf1Lf6NpHOnpcH+G5l9qub8NJgmjqoKD7mgIQ==;5:ED7FTTaDq5ldBLI2FRkXfnYnFX3+B1Kr95pwRMWElz62jsJozNpTOnuk+wvP4rT/CmLi5Fe82FOZ47hsFgf1dHrNVSJQJkCUkc4EaWTvCKaF0glmzwkWXQeIY6Tk4AZYB9zE1Iq37KeAuth7V/I2xiYjzBDzQErH7HlknfJlDDM=;7:+0UGfhOcpcGZfkr213tmn3FlWRwoPFlnzAOaqPTvKjx6ZZF7psuXHvDR0Mb509C3IkkDlVzzSNCY8uPOgg6ux148f8Hwa/c5Soofz6iLqiO2sX9kyhuhPn3lg8UOs21B/gx6+W9+9Q516k0Lm9VVGwcaSY4NCiHujX6sRFceYEFTEfbVhV3nmYSkGFJDIy07fJpBiDxfoq7e7oIwrBacyboZEDCUfXxFo6NkhR8+soW3aV6eVtaZg+iP5VcVz/X8 x-ms-office365-filtering-correlation-id: ba84e5f1-9174-488c-047a-08d62aaaf026 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB4439; x-ms-traffictypediagnostic: BYAPR05MB4439: 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)(8121501046)(5005006)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(149066)(150057)(6041310)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(201708071742011)(7699051);SRVR:BYAPR05MB4439;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB4439; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(39850400004)(396003)(366004)(136003)(189003)(199004)(305945005)(7736002)(26005)(1076002)(186003)(103116003)(2906002)(36756003)(2616005)(54906003)(256004)(5024004)(14444005)(86362001)(476003)(11346002)(446003)(14454004)(486006)(575784001)(6512007)(2351001)(316002)(106356001)(105586002)(8936002)(81156014)(81166006)(97736004)(8676002)(478600001)(53936002)(66066001)(5250100002)(5640700003)(6436002)(2900100001)(68736007)(2501003)(4326008)(71190400001)(6486002)(76176011)(71200400001)(102836004)(6506007)(386003)(5660300001)(6916009)(3846002)(99286004)(52116002)(6116002)(107886003)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB4439;H:BYAPR05MB4597.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: n2g7MjlXLI9m8fil5boyP/9iuUOjQXycqE+L2mjYtI7wkze0RyhIm7yirYTRYF3zDwyC67DRdNG0tvAVZSFA7z3y/6RESClXAhg1KzoHSRXTh0R1wAK99/IjpCe6XwNvCQpQTOEGQfyUOiOHKOoYqKSytbIwOgBbASLyQhUQQaY7DnQDu+AeaKBn3GtR9b784QMaMyKu4eaJbOIp/eRJPh0o92FxFcM6HJH2CMhCFwLm8hsaxVvM/gv3OTnMjoG2TH2jDcO8cTQspYfoJ0tsqCCpeBX3Wg2kd8ByNu5YKFaM6Zb+DQLSOPGXn1iUOHVh3OESs6wc7mI2AIGJYz2NpcEJaIT7nLyKb/AwxKJGcIU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba84e5f1-9174-488c-047a-08d62aaaf026 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:38.4966 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4439 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 Driver retrieves information about supported extended capabilities from wireless card. However this information is not propagated further to Linux wireless core. Fix this by setting extended capabilities fields of wiphy structure. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 9 +++++++++ drivers/net/wireless/quantenna/qtnfmac/commands.c | 3 +-- drivers/net/wireless/quantenna/qtnfmac/core.c | 16 ++++++++++++++-- drivers/net/wireless/quantenna/qtnfmac/core.h | 1 + 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 8b30d651cbe3..8ecd37ddc0f9 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -1129,6 +1129,15 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac) wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED; } + if (mac->macinfo.extended_capabilities_len) { + wiphy->extended_capabilities = + mac->macinfo.extended_capabilities; + wiphy->extended_capabilities_mask = + mac->macinfo.extended_capabilities_mask; + wiphy->extended_capabilities_len = + mac->macinfo.extended_capabilities_len; + } + strlcpy(wiphy->fw_version, hw_info->fw_version, sizeof(wiphy->fw_version)); wiphy->hw_version = hw_info->hw_version; diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 74edb5a0ae19..8dbd6c45c233 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -1273,8 +1273,7 @@ static int qtnf_parse_variable_mac_info(struct qtnf_wmac *mac, ext_capa_mask = NULL; } - kfree(mac->macinfo.extended_capabilities); - kfree(mac->macinfo.extended_capabilities_mask); + qtnf_mac_ext_caps_free(mac); mac->macinfo.extended_capabilities = ext_capa; mac->macinfo.extended_capabilities_mask = ext_capa_mask; mac->macinfo.extended_capabilities_len = ext_capa_len; diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index aaa218eb70c8..5d18a4a917c9 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -304,6 +304,19 @@ void qtnf_mac_iface_comb_free(struct qtnf_wmac *mac) } } +void qtnf_mac_ext_caps_free(struct qtnf_wmac *mac) +{ + if (mac->macinfo.extended_capabilities_len) { + kfree(mac->macinfo.extended_capabilities); + mac->macinfo.extended_capabilities = NULL; + + kfree(mac->macinfo.extended_capabilities_mask); + mac->macinfo.extended_capabilities_mask = NULL; + + mac->macinfo.extended_capabilities_len = 0; + } +} + static void qtnf_vif_reset_handler(struct work_struct *work) { struct qtnf_vif *vif = container_of(work, struct qtnf_vif, reset_work); @@ -496,8 +509,7 @@ static void qtnf_core_mac_detach(struct qtnf_bus *bus, unsigned int macid) } qtnf_mac_iface_comb_free(mac); - kfree(mac->macinfo.extended_capabilities); - kfree(mac->macinfo.extended_capabilities_mask); + qtnf_mac_ext_caps_free(mac); kfree(mac->macinfo.wowlan); wiphy_free(wiphy); bus->mac[macid] = NULL; diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index 1722aecf7633..293055049caa 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -144,6 +144,7 @@ struct qtnf_hw_info { struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac); struct qtnf_vif *qtnf_mac_get_base_vif(struct qtnf_wmac *mac); void qtnf_mac_iface_comb_free(struct qtnf_wmac *mac); +void qtnf_mac_ext_caps_free(struct qtnf_wmac *mac); struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus); int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *priv, const char *name, unsigned char name_assign_type); From patchwork Fri Oct 5 10:11:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627807 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-2.web.codeaurora.org (Postfix) with ESMTP id 54B6015E2 for ; Fri, 5 Oct 2018 10:11:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52FFC28E36 for ; Fri, 5 Oct 2018 10:11:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4626D28E3E; Fri, 5 Oct 2018 10:11:49 +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 DDBEF28E36 for ; Fri, 5 Oct 2018 10:11:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728168AbeJERJw (ORCPT ); Fri, 5 Oct 2018 13:09:52 -0400 Received: from mail-eopbgr730079.outbound.protection.outlook.com ([40.107.73.79]:1696 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728129AbeJERJw (ORCPT ); Fri, 5 Oct 2018 13:09:52 -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=Zt/lgleD8/5SijlzkJyFoeSzS1Tc7zK72G9fiWAOQoY=; b=kn8ZkQNo8XE1oehBCDBi5fMuMxoB53VHpXvaoRqFD70osSPSr6YuRbfk0gVk/TfuoRfuxHsRBYvPLamPj5C/MSzECVQdpxT0Cx1RTs11uPxaeB864tkcr+uJs4Pq6H+a+ziaP9+OHgNof525Sl9RVXQWw0WxmKTazuBMJOc+Inc= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB4439.namprd05.prod.outlook.com (52.135.203.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.13; Fri, 5 Oct 2018 10:11:40 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:40 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Sergey Matyukevich Subject: [PATCH v2 09/13] qtnfmac: drop error reports for out-of-bounds key indexes Thread-Topic: [PATCH v2 09/13] qtnfmac: drop error reports for out-of-bounds key indexes Thread-Index: AQHUXJPOb1piPpjLFk2QAy7vE7U1nQ== Date: Fri, 5 Oct 2018 10:11:40 +0000 Message-ID: <20181005101114.3013-10-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB4439;6:sDt5D8STjw5edCzyrojx0jUSW2wn8FNJENW+nNeXZpEZENsPaE7Jt5KfR/LwhdGNjoVjPwS5keQCSfRQJ76s0P/AFewvET1LNGDYozlvKrJQ0Hs2+mge3BChOhgtbVOjMyZLMsXMqFyos8yWur0AqnpZwfxXpTBtsSoRo3PwsPoZ9RxWc0qQZSrrDv02eof+xYua/vLYyJGMUV5hO6dURsRWagIHBnbKhnxmRpddrZ0YLY5qC/LjmQQFeSICL8dfpgnRciQgUTGRfxtZrYLJm7ohCeZbbGMiPyrFC+ih+vzU1E/sThPA3UHSX97/rkgY2etBmu8moBkRzKKJgyohiRlpYHdS01XdxgyOGa4s7q8g2wNE/caGt9+MIT4LQzGAULnBXW5GrzutRGA76kz7P5he/H/FUNu1KhXTJIJfRfwsoU3xeUSnvb2UMwrSGq8VQdygHIuR5no51CukZpBpwg==;5:A8MEW0cRIfcV5dMyJWZaGfO+tEUs7Bs4AShoHmEDc1fxi8pgfb6abIH/8tEyEw/H1wzQ3nozwxQs2kCBmnYIYmWiQwwiGem5Dg0JFz/SMBg+50vNXtrqU484O/CgofRtABSnaA7u0jEmTEbJY4LFzraJpEbWflw5Abn4yz0IfT0=;7:D0Krb/3kXbtgYFBcOC6O9GmXS3oA8aJyoj6eidxi6cSgUcivEwM9I0iKuasBm3Q/aZjrFKE5Qjh8K77vV57bRxXK9M3XIJyjJ/9mqEIDkMdFIBzm7+Luw8hvsTNq/huYJWptht5RQbz64kn6MFyBiSwDe7xf5vXe5RiXk/Uywb29I7ZiEQxyfIknh/oZz1c63qC3dcW91Sinm97tB+Gfdv93b/XIJuVQ8px+y4cd0Ijoifs1NKQaxAOn+mTU3DgZ x-ms-office365-filtering-correlation-id: 2af5bcf1-9871-4404-2dcd-08d62aaaf11a x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB4439; x-ms-traffictypediagnostic: BYAPR05MB4439: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(20558992708506); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(149066)(150057)(6041310)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(201708071742011)(7699051);SRVR:BYAPR05MB4439;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB4439; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(39850400004)(396003)(366004)(136003)(189003)(199004)(305945005)(7736002)(26005)(1076002)(186003)(103116003)(2906002)(36756003)(2616005)(54906003)(256004)(14444005)(86362001)(476003)(11346002)(446003)(14454004)(486006)(575784001)(6512007)(2351001)(316002)(106356001)(105586002)(8936002)(81156014)(81166006)(97736004)(8676002)(478600001)(53936002)(66066001)(5250100002)(5640700003)(6436002)(2900100001)(68736007)(2501003)(4326008)(71190400001)(6486002)(76176011)(71200400001)(102836004)(6506007)(386003)(5660300001)(6916009)(3846002)(99286004)(52116002)(6116002)(107886003)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB4439;H:BYAPR05MB4597.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: CA9YheWSss33cZ7t9dFjGJv4MvRBS/ZrUa7QkdfUZw3y2cJJ7VOf3cQ9K6f+kN4onLw3jF06JK3TGEdVzxcuNIH/wcH8KaSkrgwD9BRCkgh5qqw+z7Qu8p80GUjMxDDnw/H5XEBocpW8nZuA1tW/HKABQmJH4ZsbYSewa9acLJsTdG0iUK2fG91Z0Uam7P5y7KGmgHbDVMSzlUWKd7ntGssiM2LDHX4k4PRUFahF9INP2hO19cru+Flfy8s+fyW226z/N9gIVcCwt30qSGQ//yENjksD6xwOt6mDVe/7FdaPzMCtHnlZ/7vfAVhBWRGYj7SnyAGeQzemhiWDuoeFL5jJgMVcpIja06ZeNDnUv3c= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2af5bcf1-9871-4404-2dcd-08d62aaaf11a X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:40.2669 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4439 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 On disconnect wireless core attempts to remove all the supported keys. Following cfg80211_ops conventions, firmware returns -ENOENT code for the out-of-bound key indexes. This is a normal behavior, so no need to report errors for this case. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 8ecd37ddc0f9..9845cf287118 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -523,9 +523,16 @@ static int qtnf_del_key(struct wiphy *wiphy, struct net_device *dev, int ret; ret = qtnf_cmd_send_del_key(vif, key_index, pairwise, mac_addr); - if (ret) - pr_err("VIF%u.%u: failed to delete key: idx=%u pw=%u\n", - vif->mac->macid, vif->vifid, key_index, pairwise); + if (ret) { + if (ret == -ENOENT) { + pr_debug("VIF%u.%u: key index %d out of bounds\n", + vif->mac->macid, vif->vifid, key_index); + } else { + pr_err("VIF%u.%u: failed to delete key: idx=%u pw=%u\n", + vif->mac->macid, vif->vifid, + key_index, pairwise); + } + } return ret; } From patchwork Fri Oct 5 10:11:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627809 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-2.web.codeaurora.org (Postfix) with ESMTP id 7CA3215E2 for ; Fri, 5 Oct 2018 10:11:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79E0B28E36 for ; Fri, 5 Oct 2018 10:11:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E2F528E3E; Fri, 5 Oct 2018 10:11:50 +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 EBA8028E36 for ; Fri, 5 Oct 2018 10:11:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728175AbeJERJx (ORCPT ); Fri, 5 Oct 2018 13:09:53 -0400 Received: from mail-eopbgr730079.outbound.protection.outlook.com ([40.107.73.79]:1696 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727616AbeJERJx (ORCPT ); Fri, 5 Oct 2018 13:09:53 -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=UWNcrcZGMxXagv5p8mieH+yUzC6JS575msfJJpBHBGA=; b=xXYXQUohdMgIT1uF7eGEu5mLibn322+05BCqkH0tZCcyk1vdV4qolXmFEz7P1S12vXe14lJcP+NsbnUZmRN+BgW9rf5Z9gNK/CjxhKqsn75rkBcjsuHLLix+LVP3DZxRr2Ez2/FJv25upKvO0JexuSoic6U77UfweuU7uMCgGf8= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB4439.namprd05.prod.outlook.com (52.135.203.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.13; Fri, 5 Oct 2018 10:11:42 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:41 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Sergey Matyukevich Subject: [PATCH v2 10/13] qtnfmac: add support for scan flush Thread-Topic: [PATCH v2 10/13] qtnfmac: add support for scan flush Thread-Index: AQHUXJPPPivQXcDrdEWD0AOO6N3x0g== Date: Fri, 5 Oct 2018 10:11:41 +0000 Message-ID: <20181005101114.3013-11-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB4439;6:+AwZFoaYAwjQ8Hqr0QwtkEqeoH4Ui78GtK31nTaUbw0YbqBD/Hl3bJ4mITz8tBwDosPPP8RFk9FphaFp6GbKPh2KpGixgbdcvFeTpZzptYNfWM8E/uphRk9mWd0ssEKU/QZYVxRXe0CHlA2BcOoe9/fe/afich3pF5z+0XVhZfD0YXTO9MzGC6conwy7PWaNiqINOZYhqET/RrJCFHaePaZpVcY0r6Y2rH2SN6NVpnpJN+ihOUr/uH1vqhhrfKcw50gY3U50FbTqGwFcu1NhNjU7NcdK1uQzwnYT1NFhX2KfpdImgtmyUfIl9WxsCHG2gafIulTqjToiUHHNX3tqWhVGUEI2iyvNB8Bfyog+O7H//Rlg15y0Apd5xlRcBzt1i2HoX2G2mTpr1+fAwj+n9CRd28eeQrERbytohX30QYZHULRzZ9Mdf+LwhdBlI6tbzFmu4ITdfYJCwUehf84PyQ==;5:2WNry/4OTma8wagEiuqo8wt/gjzu91YkRFloMPQBODX8epjLJIr+oEmXNuVg6ptj9wygE0AOdXnQ6onzD0kg6a0W9+BS2+pBJEkZog1ls+c0uX/1az/k3pFbfdToA1sL9T2Z+usIHd3kwt3a6thhMOKb2KN8dJIaDZHYFuqsIN8=;7:NSq/9IlZKBZipqGYWIg1UQ01pmaT/pywjdL/FJyq+jsJsA49Ju2m6fu4UpMhIqLozvKXFje5XMFKQedUem7iAixmCqGgshUsiRjBOH4AexQDMtsjqDa6GrKSc0LmoIhPI2LoxzkvurHcS5GziXFY1pF2unqcCFZVB6k+1BSAblClQsJ5YHZepl3Qjcbb2fpx8Kecw4ZEfkQgg6HcEcjTNASMhc4maCMpMlvFl23Yua5nUnBl3pfggVpJsR8HthB2 x-ms-office365-filtering-correlation-id: 4e79ee3e-307f-4495-c1ba-08d62aaaf228 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB4439; x-ms-traffictypediagnostic: BYAPR05MB4439: 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)(8121501046)(5005006)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(149066)(150057)(6041310)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(201708071742011)(7699051);SRVR:BYAPR05MB4439;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB4439; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(39850400004)(396003)(366004)(136003)(189003)(199004)(305945005)(7736002)(26005)(1076002)(186003)(103116003)(2906002)(36756003)(2616005)(54906003)(256004)(86362001)(476003)(11346002)(446003)(14454004)(486006)(6512007)(2351001)(316002)(106356001)(105586002)(8936002)(81156014)(81166006)(97736004)(8676002)(478600001)(53936002)(66066001)(5250100002)(5640700003)(6436002)(2900100001)(68736007)(2501003)(4326008)(71190400001)(6486002)(76176011)(71200400001)(102836004)(6506007)(386003)(5660300001)(6916009)(3846002)(99286004)(52116002)(6116002)(107886003)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB4439;H:BYAPR05MB4597.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: AgeRe30lYAqY6mjd0H2rMxRdIbBE0NfT25PxWY8gQ1xlcs5u/d/oQDdf4LZYTV7MwoOY8OQNusPVzxXWvx8N8gz5Zvle2srqiXpBGzb5swYhoZ965Lfqqb31rkpbAPWAieH08YZ/HMpYQSHizsaX4Ly5DmE3j7OwZyNpeV6QoiLJXDZgVKqkuVViEHskAKA2mVjiOw2SAoBFDF5vNhn/Wocr1i5t8TeZjfOg+o7Q9bTR+E1WlDoCbIL4oRsJwfxXxE3AvH2seZIhwV/ZZLI+cR+NsJyBRRpfjDbwznQ+FafUnffdweeB/RsxCQGjFatSNUo0IcjJjahOtyW6iC1xtPpLDg5puaoooiwONDzjU2U= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e79ee3e-307f-4495-c1ba-08d62aaaf228 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:41.8050 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4439 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 Notify firmware to flush cache before scanning when needed. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/commands.c | 6 ++++++ drivers/net/wireless/quantenna/qtnfmac/qlink.h | 1 + drivers/net/wireless/quantenna/qtnfmac/qlink_util.h | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 8dbd6c45c233..8fb15cbf5005 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -2197,6 +2197,12 @@ int qtnf_cmd_send_scan(struct qtnf_wmac *mac) scan_req->mac_addr_mask); } + if (scan_req->flags & NL80211_SCAN_FLAG_FLUSH) { + pr_debug("MAC%u: flush cache before scan\n", mac->macid); + + qtnf_cmd_skb_put_tlv_tag(cmd_skb, QTN_TLV_ID_SCAN_FLUSH); + } + ret = qtnf_cmd_send(mac->bus, cmd_skb); if (ret) goto out; diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index c5ae4ea9a47a..699157100309 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -1151,6 +1151,7 @@ enum qlink_tlv_id { QTN_TLV_ID_MAX_SCAN_SSIDS = 0x0409, QTN_TLV_ID_WOWLAN_CAPAB = 0x0410, QTN_TLV_ID_WOWLAN_PATTERN = 0x0411, + QTN_TLV_ID_SCAN_FLUSH = 0x0412, }; struct qlink_tlv_hdr { diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h index 54caeb38917c..960d5d97492f 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h @@ -40,6 +40,14 @@ static inline void qtnf_cmd_skb_put_tlv_arr(struct sk_buff *skb, memcpy(hdr->val, arr, arr_len); } +static inline void qtnf_cmd_skb_put_tlv_tag(struct sk_buff *skb, u16 tlv_id) +{ + struct qlink_tlv_hdr *hdr = skb_put(skb, sizeof(*hdr)); + + hdr->type = cpu_to_le16(tlv_id); + hdr->len = cpu_to_le16(0); +} + static inline void qtnf_cmd_skb_put_tlv_u8(struct sk_buff *skb, u16 tlv_id, u8 value) { From patchwork Fri Oct 5 10:11:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627817 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-2.web.codeaurora.org (Postfix) with ESMTP id A835A15E8 for ; Fri, 5 Oct 2018 10:12:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A603428E36 for ; Fri, 5 Oct 2018 10:12:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A5D028E40; Fri, 5 Oct 2018 10:12:31 +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 1408628E36 for ; Fri, 5 Oct 2018 10:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728001AbeJERKf (ORCPT ); Fri, 5 Oct 2018 13:10:35 -0400 Received: from mail-eopbgr730044.outbound.protection.outlook.com ([40.107.73.44]:44960 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727616AbeJERKf (ORCPT ); Fri, 5 Oct 2018 13:10:35 -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=T1F0TlLn2H9HbN2VKELFtZRc8OrpRs/JOxS8pban2oE=; b=iE2JyTRak5ehX1uFhZNJTaz4gctr2mxQ8kH+eErkhpZRIN2gEDD2E7oDrHL0GpZsqaJRo4yNf8FAdxmOvlF5TnlMdfJyC45lh5hKiV+gMKxu8rqJHhW447vDW8TUG+9jShqqA8T3wdQ9gKiH2FiGtps/lj2Mpms9oHq/Kl6yBeo= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB4439.namprd05.prod.outlook.com (52.135.203.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.13; Fri, 5 Oct 2018 10:11:43 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:43 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Sergey Matyukevich Subject: [PATCH v2 11/13] qtnfmac: add support for scan dwell time configuration Thread-Topic: [PATCH v2 11/13] qtnfmac: add support for scan dwell time configuration Thread-Index: AQHUXJPQzn6p77khMkWBr5XA3foRSw== Date: Fri, 5 Oct 2018 10:11:43 +0000 Message-ID: <20181005101114.3013-12-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB4439;6:IR5tyjQyk1kIFVFpw9C3w39MqifREfsi6EMMCwXKyDwYPU1krpp1nDY5gIydUyD9ckqOf107C+8dSKiDhqPBDmPRn06LT6NwM+Cf7R8C2f0fK1Ry1rRz3EDtHW3/c9cL7u12QACtgJUPVmgf1qhq2bQCBD8Wy1w0LAjQj8C+9ARliqdOcepdSr4K/BnyTmlS7UdgTk5hi9UsbO7Y4SSPLcgkqd/eAX+TH2Fp3paH1V7INf5GYDFrlbQQNAAncFSGpbnpgfS2Nzn4oz6Q5acmYbJpfDqYTNsBo6qYpwat4MMWJ/RGJUEyZOow5jLXc5GoyvLMqRnGymZjSEiMHpb/TVpeQiSbVHVQZLe7w0nDKnENA0H0+xum8omj9bsYP7X8PKEctVDWVxAGpXTtMGUPnM6WqBtLmlx6Y56/2xAsV5z7zUgBX+Mjzt08CuH/mZsNQIKYDvhw4MmeXD6/Ul1NIg==;5:d21z9cSJz2dxwefkeUtXBkUHrKxtVEon/rJ3LDzugIs30dreZTMyAj3P5JglXdMPD4ds9JnFSSVkFL5MOWAvu+FNjb4mJoU5OOBcGwXxdHOll97uNJA0Le3ARFQ9rct6subeMXd7bLaPLU+SOEGHbThmFzVjHwuu1ZqqgYYq/F0=;7:8veG8LBKOKtA8YjB4r0poXCGnsGqZAa23ZsMEs6g1XkqdeTn3I1qs820MDiwBXDCP16YQo15aaipC7d6FHcbqhSFLbl4eR3HNtVbyHuuv/2Arynkn+3473b3xdgKAEm4Lh7TiRFGlH1+ZKSf9RGge9vlrFEeilade5w/Nq/YsFRWunEfm3UBb+eaITtegHWwbtTeqvVcAnOMkzFDpguutE+fD0AjVriYz7bfzYYhXk2XigjdA4mwSKJECDYmcMJn x-ms-office365-filtering-correlation-id: e4bceabd-58f8-4613-e4c1-08d62aaaf348 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB4439; x-ms-traffictypediagnostic: BYAPR05MB4439: 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)(8121501046)(5005006)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(149066)(150057)(6041310)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(201708071742011)(7699051);SRVR:BYAPR05MB4439;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB4439; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(39850400004)(396003)(366004)(136003)(189003)(199004)(305945005)(7736002)(26005)(1076002)(186003)(103116003)(2906002)(36756003)(2616005)(54906003)(256004)(14444005)(86362001)(476003)(11346002)(446003)(14454004)(486006)(6512007)(2351001)(316002)(106356001)(105586002)(8936002)(81156014)(81166006)(97736004)(8676002)(478600001)(53936002)(66066001)(5250100002)(5640700003)(6436002)(2900100001)(68736007)(2501003)(4326008)(71190400001)(6486002)(76176011)(71200400001)(102836004)(6506007)(386003)(5660300001)(6916009)(3846002)(99286004)(52116002)(6116002)(107886003)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB4439;H:BYAPR05MB4597.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: RLS9mDMzx7c/ZkgpTJES0qjk5dK8L7uQ0GEbZQ9UFTgzkmUvk565YSRCsP+ZjYI2IsRNwc5OQm7u7B4VxdPV0Jzvuvyn4gGZd3WlVTvXwDnIVYgr/RgoZiJKcpP/ZdF3VMZEWa+jbw1FAE6He4jCvls1vUfZyfF//Ltn3raZZxy+lR/9YOeESnk4FMyWWOJqraNLAMPmHelfHXrOo0HCj9IajDx/F66J3nzfzxYdDveEb4PbWA7PcdHnfW4ROlUD4l8j3aKvwvIDIJDFEX7nOdV+3cegbbYtATeUlRHRzCR0OqYlpv2rw5gZJU2qpiDNzdsx04WKl5rsMsN0jkayQPzmycAPQkKkbH038jTUzvQ= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4bceabd-58f8-4613-e4c1-08d62aaaf348 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:43.6923 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4439 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 Firmware supports scan dwell time tuning for various types of scans. Enable support for this feature: - advertise capability to configure channel dwell time to host - pass scan dwell parameters to wireless card in scan request Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 4 ++++ drivers/net/wireless/quantenna/qtnfmac/commands.c | 9 +++++++++ drivers/net/wireless/quantenna/qtnfmac/qlink.h | 2 ++ 3 files changed, 15 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 9845cf287118..18179965bd38 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -1101,6 +1101,10 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac) if (hw_info->hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD) wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_DFS_OFFLOAD); + if (hw_info->hw_capab & QLINK_HW_CAPAB_SCAN_DWELL) + wiphy_ext_feature_set(wiphy, + NL80211_EXT_FEATURE_SET_SCAN_DWELL); + wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS | NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2; diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 8fb15cbf5005..bfdc1ad30c13 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -2203,6 +2203,15 @@ int qtnf_cmd_send_scan(struct qtnf_wmac *mac) qtnf_cmd_skb_put_tlv_tag(cmd_skb, QTN_TLV_ID_SCAN_FLUSH); } + if (scan_req->duration) { + pr_debug("MAC%u: %s scan duration %u\n", mac->macid, + scan_req->duration_mandatory ? "mandatory" : "max", + scan_req->duration); + + qtnf_cmd_skb_put_tlv_u16(cmd_skb, QTN_TLV_ID_SCAN_DWELL, + scan_req->duration); + } + ret = qtnf_cmd_send(mac->bus, cmd_skb); if (ret) goto out; diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 699157100309..8d62addea895 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -80,6 +80,7 @@ enum qlink_hw_capab { QLINK_HW_CAPAB_SCAN_RANDOM_MAC_ADDR = BIT(3), QLINK_HW_CAPAB_PWR_MGMT = BIT(4), QLINK_HW_CAPAB_OBSS_SCAN = BIT(5), + QLINK_HW_CAPAB_SCAN_DWELL = BIT(6), }; enum qlink_iface_type { @@ -1152,6 +1153,7 @@ enum qlink_tlv_id { QTN_TLV_ID_WOWLAN_CAPAB = 0x0410, QTN_TLV_ID_WOWLAN_PATTERN = 0x0411, QTN_TLV_ID_SCAN_FLUSH = 0x0412, + QTN_TLV_ID_SCAN_DWELL = 0x0413, }; struct qlink_tlv_hdr { From patchwork Fri Oct 5 10:11:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627813 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-2.web.codeaurora.org (Postfix) with ESMTP id 1464915E2 for ; Fri, 5 Oct 2018 10:12:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 111BD28E35 for ; Fri, 5 Oct 2018 10:12:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04E5D28E40; Fri, 5 Oct 2018 10:12: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=-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 79C5128E35 for ; Fri, 5 Oct 2018 10:12:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727758AbeJERKZ (ORCPT ); Fri, 5 Oct 2018 13:10:25 -0400 Received: from mail-sn1nam01on0065.outbound.protection.outlook.com ([104.47.32.65]:3040 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727354AbeJERKZ (ORCPT ); Fri, 5 Oct 2018 13:10:25 -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=JlSkaE+yQZLKAYzAsOTKaJjjSOUZfwInx8SvaA4kVY8=; b=ngKeIVW1lbO2O/RIXLC9CH87blcE2xi6VE1V1nUpnHmMrr9XRxPIp3UETG8ef/VNnZlSndNUMgv4mQ6RVs0PdjdlmbUX2wJFd6ClBkMI2/KQLJri2lfhZXaIY3C2nVdy/CQfPeaVEUTDT5dIacgpupz9ln5InQxYmaxdUZ9VzqY= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB4439.namprd05.prod.outlook.com (52.135.203.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.13; Fri, 5 Oct 2018 10:11:45 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:45 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Sergey Matyukevich Subject: [PATCH v2 12/13] qtnfmac: drop redundant data copy in control path Thread-Topic: [PATCH v2 12/13] qtnfmac: drop redundant data copy in control path Thread-Index: AQHUXJPRg67aDI8ig0WVAbmEnxP4yQ== Date: Fri, 5 Oct 2018 10:11:45 +0000 Message-ID: <20181005101114.3013-13-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB4439;6:7JQnzgNIDHqBWdzRfIo2JoXFZh5loJ/hqLCHPiZg5jKNQy7KCT4pppe3sU0QWUKnIFO1AVb38aHHf/VYwJKVgPYG1h/dayBOb8mPLfgFO2fvhfleG7ki8NwtPoxQcB0fq//jGiTX2HMqfncdFnu6SRLqvf2mao4xKYf5OrX2Gv5RlZ1fRHcmVpG1GP92LwmU4uFy5wYECA8eU1tQ/22LkZHfiWML1eI+THITyRkHsXjpndxTIReNRMo0qumbtS87R2UsShF5UggFUkTYjLuZxSfcMJipRCA84g14xiLLVYju3K5SqVtU8cawSAieE7/bKchC28eZtnCIWiNYX33qu78xanRfLzcB3Ol2dwj7KaO3nHZHNttf42aHDBJXR4hrb8FRDwdqPP3IQ2ZdgUnrFo80EVpCDcz72B28zJBT1eBqViP56N3ENgLeppS6L3YcaCD07HM5JK6udYHaCbPXFA==;5:bxmA3/fHrUtSdgzlBvXqIYK9gXbeBDJEuBSqTL6aQjc5M8qQ1yVudvQJPUO99fVAVSoxpn5cnSm9bax2czAccLcZlt2LBg7sorCw9aoKvUAHxtqTeh5Xtdf2HXdYcx2cijPGQO6bqPdz2xeiRs8DJH5vSw3RcWLju9ry0UHIp/w=;7:JS9k6K9YdZp5SbzwNZaiIuRaZU+QRJ9j1Czjn8xh98VEt6/oVXZ8KCSL/v7WRtfNQKomsdEZcazWhZhoXUoRm2JMQ82qPz+HF11Lnfsd+owD4VkGaPzQbjF9aUVRsFwDaDhWVwNf0ikixNfSoNIdNJq1CULy0yCHwDvwv/VkZMo0Qc/pMIuEEbuTTnM3O5wKydudn+aiQQikuTCi0+H4qDg++uh/+rAg2eELdEKWMstsQSZ6dsVK6dTB2djGn5XC x-ms-office365-filtering-correlation-id: 98bdb181-bc2c-4ceb-0bc5-08d62aaaf434 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB4439; x-ms-traffictypediagnostic: BYAPR05MB4439: 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)(8121501046)(5005006)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(149066)(150057)(6041310)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(201708071742011)(7699051);SRVR:BYAPR05MB4439;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB4439; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(39850400004)(396003)(366004)(136003)(189003)(199004)(305945005)(7736002)(26005)(1076002)(186003)(103116003)(2906002)(36756003)(2616005)(54906003)(256004)(86362001)(476003)(11346002)(446003)(14454004)(486006)(575784001)(6512007)(2351001)(316002)(106356001)(105586002)(8936002)(81156014)(81166006)(97736004)(8676002)(478600001)(53936002)(66066001)(5250100002)(5640700003)(6436002)(2900100001)(68736007)(2501003)(4326008)(71190400001)(6486002)(76176011)(71200400001)(102836004)(6506007)(386003)(5660300001)(6916009)(3846002)(99286004)(52116002)(6116002)(107886003)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB4439;H:BYAPR05MB4597.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: oa6yggRCTjmip5imySBrKygA52/E3ZCUh6sDp3cCoOYL1Op5ANKXPSjvNsD14Ar8CYzcAuvkfiGMFZh8baBENgQF43K7XNtRZwKv/ebM08YhsOLzUytFUJwFmNsmQwYBtFLG61yQYkc7yVPP13SvmBDIYVS4d+4Z/6Z/rkc3I/YXX5WR+3Rhy5PwjYlWzIur0giGpUsPv7bQNcjRtVL0YKcT/ox0qdgRrM3nD2ylkM7HQsNxx81U4UT4B5ofbZQ874TJTtk3fOi4toIWZCsNdpmNPUAX+ht1jd26ua7VXA5dOxD+5XzaJEgseSOgC7ptF+qvBLEwD7mS+rsH+UNaRFZX4Nt0ZecyYy6zRnsTTYA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98bdb181-bc2c-4ceb-0bc5-08d62aaaf434 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:45.2844 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4439 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 Command responses and events from the firmware are copied twice in control path: at first in shm core (qtnf_shm_handle_new_data) and then in pcie bus drivers (qtnf_pcie_control_rx_callback). There is no need to copy this data twice, it can be done only once in rx callbacks. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c | 5 +++-- drivers/net/wireless/quantenna/qtnfmac/shm_ipc.c | 13 ++++++------- drivers/net/wireless/quantenna/qtnfmac/shm_ipc.h | 4 +--- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c index d1637f2354a6..16795dbe475b 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c @@ -242,7 +242,8 @@ static int qtnf_pcie_init_memory(struct qtnf_pcie_bus_priv *priv) return 0; } -static void qtnf_pcie_control_rx_callback(void *arg, const u8 *buf, size_t len) +static void qtnf_pcie_control_rx_callback(void *arg, const u8 __iomem *buf, + size_t len) { struct qtnf_pcie_bus_priv *priv = arg; struct qtnf_bus *bus = pci_get_drvdata(priv->pdev); @@ -260,7 +261,7 @@ static void qtnf_pcie_control_rx_callback(void *arg, const u8 *buf, size_t len) return; } - skb_put_data(skb, buf, len); + memcpy_fromio(skb_put(skb, len), buf, len); qtnf_trans_handle_rx_ctl_packet(bus, skb); } diff --git a/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.c b/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.c index aa106dd0a14b..2ec334199c2b 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.c +++ b/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.c @@ -42,19 +42,18 @@ static void qtnf_shm_handle_new_data(struct qtnf_shm_ipc *ipc) if (unlikely(size == 0 || size > QTN_IPC_MAX_DATA_SZ)) { pr_err("wrong rx packet size: %zu\n", size); rx_buff_ok = false; - } else { - memcpy_fromio(ipc->rx_data, ipc->shm_region->data, size); + } + + if (likely(rx_buff_ok)) { + ipc->rx_packet_count++; + ipc->rx_callback.fn(ipc->rx_callback.arg, + ipc->shm_region->data, size); } writel(QTNF_SHM_IPC_ACK, &shm_reg_hdr->flags); readl(&shm_reg_hdr->flags); /* flush PCIe write */ ipc->interrupt.fn(ipc->interrupt.arg); - - if (likely(rx_buff_ok)) { - ipc->rx_packet_count++; - ipc->rx_callback.fn(ipc->rx_callback.arg, ipc->rx_data, size); - } } static void qtnf_shm_ipc_irq_work(struct work_struct *work) diff --git a/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.h b/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.h index 453dd6477b12..c2a3702a9ee7 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.h +++ b/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.h @@ -32,7 +32,7 @@ struct qtnf_shm_ipc_int { }; struct qtnf_shm_ipc_rx_callback { - void (*fn)(void *arg, const u8 *buf, size_t len); + void (*fn)(void *arg, const u8 __iomem *buf, size_t len); void *arg; }; @@ -51,8 +51,6 @@ struct qtnf_shm_ipc { u8 waiting_for_ack; - u8 rx_data[QTN_IPC_MAX_DATA_SZ] __aligned(sizeof(u32)); - struct qtnf_shm_ipc_int interrupt; struct qtnf_shm_ipc_rx_callback rx_callback; From patchwork Fri Oct 5 10:11:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10627815 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-2.web.codeaurora.org (Postfix) with ESMTP id 68AF815E2 for ; Fri, 5 Oct 2018 10:12:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 670EC28E35 for ; Fri, 5 Oct 2018 10:12:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B6D628E37; Fri, 5 Oct 2018 10:12:23 +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 EE54928E35 for ; Fri, 5 Oct 2018 10:12:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727859AbeJERK1 (ORCPT ); Fri, 5 Oct 2018 13:10:27 -0400 Received: from mail-sn1nam01on0065.outbound.protection.outlook.com ([104.47.32.65]:3040 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727540AbeJERK0 (ORCPT ); Fri, 5 Oct 2018 13:10:26 -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=z55vT5yGx+eQN7rDevT1J0sznBZHKneYLK7QeZxXS9M=; b=otKWk9ZODZ3CH0m715p9GjW8txAeUJRHpbP8oLpEUbM8VxfQv7VRSkgPInqBUJLmo6w/I2fBt7TC+Tj87miQDa9nHn31ZxfLCh9WKZ3Ljbw4ty3aD9wPlqH94q5Za85BJtKE5mkGFutJFJ+BUzU+GC1+oNU1NNENklyUUsX+HN8= Received: from BYAPR05MB4597.namprd05.prod.outlook.com (52.135.233.18) by BYAPR05MB4439.namprd05.prod.outlook.com (52.135.203.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.13; Fri, 5 Oct 2018 10:11:47 +0000 Received: from BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373]) by BYAPR05MB4597.namprd05.prod.outlook.com ([fe80::fc58:438:5b30:9373%4]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:11:47 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Sergey Matyukevich Subject: [PATCH v2 13/13] qtnfmac: implement dump_station support for STA mode Thread-Topic: [PATCH v2 13/13] qtnfmac: implement dump_station support for STA mode Thread-Index: AQHUXJPSJoNlwT9x60Wk/e/d1iUu3Q== Date: Fri, 5 Oct 2018 10:11:46 +0000 Message-ID: <20181005101114.3013-14-sergey.matyukevich.os@quantenna.com> References: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20181005101114.3013-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::23) To BYAPR05MB4597.namprd05.prod.outlook.com (2603:10b6:a03:4c::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR05MB4439;6:mRBOsPX+m/03n+zJgXS3sqJjAbgRn2s3VzKgy2PMYvXmJzXz08CkHLvqikceYHAwJJtxZIQAQdR96fTiP9dVbSF3Y/nKdKJ2yzXr7yT+W11o421gE6iWIgxTAUP6HKuRSts/pB3Y7gu9/f7iKh25H6anZLLnFdlL/qPIVMr5jJ384v3760rdsDmmdnzK2/+Zqln6ZxLO8632yvv4ryYMONex3xEDUX6RvoCryKV3n1PO5XSSKb+qscHVRbLK414qV4DCKxXncuSXr7PCJoIV8R2jWA/9IYowe9VFtp71OKvawn0R1F/rrdMQUsGlGQIYveh5gmGMh7eBkXhHnrmRFNcxIARfrcaxM0suVuvr4mbXiBNO3DsJ7/3c/KxvbhFjdW9cTuOooyCNejbLIiuaCx7LOeDxu3rLugXOm0HY9rbWToK7oUZKLrpVQHFCI+jqJMcpP3UH9fDLrKp6yziYKg==;5:FQjzz3IxpEky9mndmS2wztGCbLmr/GEWs7vUOtnvkj6+QvrOUYzHEOfIAnUOj3g8McKYngKZ60imSfK9qXYDEcjPEXKYe5n/MEPuJhkXf9fYLsxEvTd8f60K4HB2A3MLy7rA6QLb8NUhYkOVK2jlwBA4fea6YtXujNf2ttMcUGs=;7:sHZvE7ugfNrOELQkw9CrUvOiDcFTFhYsXxgDd1iDV4G5KzKAEQ0avwDUGavBrcRzWucDTsCt27yFMZYHekjv0cgAR9AwPVIJkpbIizUK5/yhMAOWp/TI5sNc/0COVcnKikeu0Gc4DlTvEgruBiEhBoE1yejC6+/NqCqLKvV+FShhzZAvHvoZm5kz8R299AEEuECXbMAEkr8DEjJ5U00VUEfwxjY+YdCTXTWJCxyPeNYJi2nNm9UEXyNXtJsrdqyd x-ms-office365-filtering-correlation-id: 02330baf-f96e-4392-871e-08d62aaaf526 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR05MB4439; x-ms-traffictypediagnostic: BYAPR05MB4439: 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)(8121501046)(5005006)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(149066)(150057)(6041310)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(201708071742011)(7699051);SRVR:BYAPR05MB4439;BCL:0;PCL:0;RULEID:;SRVR:BYAPR05MB4439; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(39850400004)(396003)(366004)(136003)(189003)(199004)(305945005)(7736002)(26005)(1076002)(186003)(103116003)(2906002)(36756003)(2616005)(54906003)(256004)(86362001)(476003)(11346002)(446003)(14454004)(486006)(6512007)(2351001)(316002)(106356001)(105586002)(8936002)(81156014)(81166006)(97736004)(8676002)(478600001)(53936002)(66066001)(5250100002)(5640700003)(6436002)(2900100001)(68736007)(2501003)(4326008)(71190400001)(6486002)(76176011)(71200400001)(102836004)(6506007)(386003)(5660300001)(6916009)(3846002)(99286004)(52116002)(6116002)(107886003)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB4439;H:BYAPR05MB4597.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: S+NzgmVAkZTZB7gQmrW2b6CnwuxVP/JhhzHAFFaHSlbRQN5rhZHCHiEMtz5Q7bNFeKgt0scgb67CZy2cGxEWfpBrd622eksgycXcBNGCfkRLbZkkJtDbpAZqKIrpI6iMgRIkgSQjQo9ixTlTw1sKn8kstwc/whj9UxnQ9WgTL8lD+j4xzszQVzTzlttt0os7d3nv0mtUL+x38JuFOSxzhjLTlhbTu7Cp4fwuJSeM5Uwf74XaynY4a6ZCG44VOracxYzfupN4eLdOZeMN5ZBtW3S9cRvFH945hMOUkDysbonpFfT2rYSAFMlHnxZ6aOweArfJP65RxE/BQEJh8qtXw25ZZrSjmR6zWK7O7N4NSJw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02330baf-f96e-4392-871e-08d62aaaf526 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:11:46.8155 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4439 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 Current implementation of dump_station cfg80211 callback supports AP mode only. Add support for STA mode as well: by default in STA mode this callback is supposed to return AP on managed interface. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 30 ++++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 18179965bd38..51b33ec78fac 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -480,19 +480,31 @@ qtnf_dump_station(struct wiphy *wiphy, struct net_device *dev, const struct qtnf_sta_node *sta_node; int ret; - sta_node = qtnf_sta_list_lookup_index(&vif->sta_list, idx); + switch (vif->wdev.iftype) { + case NL80211_IFTYPE_STATION: + if (idx != 0 || !vif->wdev.current_bss) + return -ENOENT; - if (unlikely(!sta_node)) - return -ENOENT; + ether_addr_copy(mac, vif->bssid); + break; + case NL80211_IFTYPE_AP: + sta_node = qtnf_sta_list_lookup_index(&vif->sta_list, idx); + if (unlikely(!sta_node)) + return -ENOENT; - ether_addr_copy(mac, sta_node->mac_addr); + ether_addr_copy(mac, sta_node->mac_addr); + break; + default: + return -ENOTSUPP; + } - ret = qtnf_cmd_get_sta_info(vif, sta_node->mac_addr, sinfo); + ret = qtnf_cmd_get_sta_info(vif, mac, sinfo); - if (unlikely(ret == -ENOENT)) { - qtnf_sta_list_del(vif, mac); - cfg80211_del_sta(vif->netdev, mac, GFP_KERNEL); - sinfo->filled = 0; + if (vif->wdev.iftype == NL80211_IFTYPE_AP) { + if (ret == -ENOENT) { + cfg80211_del_sta(vif->netdev, mac, GFP_KERNEL); + sinfo->filled = 0; + } } sinfo->generation = vif->generation;