From patchwork Fri Aug 25 02:30:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mitsyanko X-Patchwork-Id: 9921165 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 87D88600C5 for ; Fri, 25 Aug 2017 02:31:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70338205A8 for ; Fri, 25 Aug 2017 02:31:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65090205A4; Fri, 25 Aug 2017 02:31:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9D0E20564 for ; Fri, 25 Aug 2017 02:30:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754475AbdHYCa5 (ORCPT ); Thu, 24 Aug 2017 22:30:57 -0400 Received: from mail-cys01nam02on0041.outbound.protection.outlook.com ([104.47.37.41]:61440 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754463AbdHYCay (ORCPT ); Thu, 24 Aug 2017 22:30:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VyJkPWCv7cz/Mly0LF2dB1Pjwj3N5vERbctJ4/rxIek=; b=WockTVqXw3UCZI77Ucu4/V/rLs2ozYrJERVeQesWUEg/M+0XuzjbaEg5Ouk2IrjiHWRv/FdetaiydZsy8RMDZMBYX9ChCffvwzBMJyWdH+H4CN7YDXJ18jlHl22mzj4uoy49Vlm+4U3lYjJTB9YBdmIq8rXd/4XkVGl+Y3kj/Lw= Received: from dodo-dell.quantenna.com (12.131.200.68) by SN1PR0501MB2047.namprd05.prod.outlook.com (10.163.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.4; Fri, 25 Aug 2017 02:30:51 +0000 From: igor.mitsyanko.os@quantenna.com To: linux-wireless@vger.kernel.org Cc: sergey.matyukevich.os@quantenna.com, avinashp@quantenna.com, johannes@sipsolutions.net, Igor Mitsyanko Subject: [PATCH 08/27] qtnfmac: get rid of QTNF_STATE_AP_START usage Date: Thu, 24 Aug 2017 19:30:05 -0700 Message-Id: <20170825023024.10565-9-igor.mitsyanko.os@quantenna.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20170825023024.10565-1-igor.mitsyanko.os@quantenna.com> References: <20170825023024.10565-1-igor.mitsyanko.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [12.131.200.68] X-ClientProxiedBy: CY4PR15CA0017.namprd15.prod.outlook.com (10.172.74.27) To SN1PR0501MB2047.namprd05.prod.outlook.com (10.163.227.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 122bda3b-7932-45dd-4f87-08d4eb614e12 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SN1PR0501MB2047; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 3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B0yX7e6ICoHoU3L4/qfVNcKgUd5vtg20POtw4YhEBjEMZX48E05C4wvdiuSSqYLecUjpsEqgjZsa7zgu5S4cZrH17vux7MmMjiFT9XnFs1qz5weRvn1BCX+n2pK7M6kxofJS9UXARZA+1nPthpHbBxojPu0DuTt0lYuVngacFxpZmGd2pFRlWzrR4jfE6e739BS+vGm/AddfJdendkyuVPJWZyJCcuFktVxzNLpdPUOc0n3sOx7oyGjEW0O3h9YJRG2V2rwpH3Py8DaLLrrePdy7OJ7Q7CamMkFU4EUyYj8Yw7rj7n3l6tfnhC/bO88+LHnmY3Z/6UPIEdcZ23B3XaE9VZfBASaDXPEhYAR/dKdDbBMxeG1y9H3u8dPKMMICZ93+IyVHlPpZf+tYAJztNF5Il7lTKLCQib6stt371UnJbsHLDNusoMHIKUgEh2Bymi1ppLfacMwk=; 4:IeWnMVau9mGhWk58qc0V4LN49PBdl/Ffb4b8N8vZ6YUY7VbnCWRS5UqlWmiQnpbk9m+dADSz3zI4SBRcEzrRAkDCHyCs4lasuX2Ve+u69ccbpnymgMwYPr70FOQTdOhpvsOuxCOT6cSltEo0Yd3JUQd39PDE4em/tLfK+AcSC2WcGzzzMnhAa5f+eKTrnpRxmhL6HE+kCkLjclwkhmvmr8NxSPWDqqaxdqDGMTpjKPeazASrIoATcbLybc3nWAzI X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(10201501046)(6041248)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR0501MB2047; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR0501MB2047; X-Forefront-PRVS: 041032FF37 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(39830400002)(199003)(189002)(76176999)(53416004)(50986999)(110136004)(7350300001)(6916009)(6666003)(2950100002)(47776003)(2906002)(9686003)(53936002)(66066001)(2361001)(106356001)(105586002)(2351001)(86362001)(305945005)(33646002)(7736002)(42186005)(81166006)(81156014)(107886003)(8676002)(103116003)(478600001)(85782001)(68736007)(50226002)(50466002)(3846002)(6486002)(25786009)(36756003)(97736004)(5660300001)(1076002)(6116002)(69596002)(5003940100001)(101416001)(4326008)(189998001)(48376002)(26583001)(85772001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0501MB2047; H:dodo-dell.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=igor.mitsyanko.os@quantenna.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0501MB2047; 23:vzLIR8WIDUyT6dTmqTjRTGV7Z+E2pC8HCrdxZYq?= =?us-ascii?Q?9Nj5KJn55NYxj562kDRmWPfvWuiZmc1zSlebWgFcyHlFgXeVC72gaNDqI/7Y?= =?us-ascii?Q?bA/MQEAzWcxD09ZYj6z4ZnTUw77R10zPXnu7TNeaif9+bfXxNtSD72sxuQ58?= =?us-ascii?Q?UCJQXlmMirXqJovw315sYWPkU/RAmSzBHyegQFV0kcI+ZH2q8e+RVkR89724?= =?us-ascii?Q?sLz/aT8uwc7TDHeTfg4tvdx82e7qQVEkJLPyDWNDY5LGVn+KNB7BBYN+j4Oe?= =?us-ascii?Q?AjsFKfwq3+3jvZAmkn9mz6j6zFk7M3ygA5I+l8TK5Cg9xnIGusDTX+hRy3hc?= =?us-ascii?Q?TGzYS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M3gfuNIcK?= =?us-ascii?Q?IQPuoHtCklE6tcMHj9UFOkv8LQPuAiC66qOwNdzraxYUEuCxAmeIxXyJU2TU?= =?us-ascii?Q?1FA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 6:od3r3VsNvMR/BlC51Gm03ZX4ycTablC5sZnfrEN/G7syHimhKhmw4ICXXLeT5daULKRB0xgZRcUxxLwHUfw6oM2KcVQrSeTtcj9wN8Nf9Vml4Dx44cEK1QouVqHSfm3YbuRuCJtw3B6MBxrd+bS1dRWS6vLF7RYvtKqPtWMrh8x2fRNeRd+Jly7FZ3OIXXVYNJ1juaMfkia+APtQjhu63iaodsmIkhk8j8nvLd6cxVsG7bPEXbdH4Zn4O/xhqgA7FTWwHd8wOIPQHGKVH8pMPo0zfScbechPJ0I+U6C5yJMDF8XXD3QneJ9FS6bhn9B+ty81c7MaYjY1fT1og0kEfw==; 5:Ys5KTDxfEZQX+YScJ7lXUCXWJFctPdmeMS2IvbLniMA3gCKheat8+Lu/EbRVPln07AXVF5ISyVFdHxjN43vFu53p7hSPmGDb9crAzimf0TloO4mS9ui2r1cwjWnGQIFajfQYzwyEagyhfGt+z6I//A==; 24:5nxEwVp54aK0DNdBE2MwRQefoviAfeDxyEdCdPokX1YmNXRF5XtCizZeVR+0DgJMeoBy6mCWRlGTzPP2HpDfF4YP2Zt/U7wBXhpMDRJSNeI=; 7:RgjtycWrf799aQc7Tq+KFVnQaGmM6a4OcD/RSluAKjqDxkYWPoRpaIHlKK2n76GMxWkMgm9I3c/3cgxBX8Nf4CkfDEfl3xeoPk9qkaswODIMhO76KV4D+APhWmSUSawGlz7V7rcaXqnQpfhaWPfPkxrLGgA3TTU/j6rJesgY5kbzb3+4iOnDazkgs6nlb1px2zZv9TkFMgxV5igiUrR4htopaBW+nFx9ieEwlbdXX8s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 02:30:51.4635 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0501MB2047 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Igor Mitsyanko QTNF_STATE_AP_START usage is redundant and imposes additional state synchronization maintenance. We may as well leave state checking up to network card and upper layers (cfg80211, nl80211 and userspace). Signed-off-by: Igor Mitsyanko --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 29 +---------------------- drivers/net/wireless/quantenna/qtnfmac/commands.c | 3 --- drivers/net/wireless/quantenna/qtnfmac/core.h | 3 +-- drivers/net/wireless/quantenna/qtnfmac/event.c | 12 ---------- 4 files changed, 2 insertions(+), 45 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 26caaf6..999f1bd 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -254,11 +254,6 @@ static int qtnf_change_beacon(struct wiphy *wiphy, struct net_device *dev, { struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); - if (!(vif->bss_status & QTNF_STATE_AP_START)) { - pr_err("VIF%u.%u: not started\n", vif->mac->macid, vif->vifid); - return -EFAULT; - } - return qtnf_mgmt_set_appie(vif, info); } @@ -283,17 +278,9 @@ static int qtnf_start_ap(struct wiphy *wiphy, struct net_device *dev, } ret = qtnf_cmd_send_start_ap(vif); - if (ret) { + if (ret) pr_err("VIF%u.%u: failed to start AP\n", vif->mac->macid, vif->vifid); - goto out; - } - - if (!(vif->bss_status & QTNF_STATE_AP_START)) { - pr_err("VIF%u.%u: FW failed to start AP operation\n", - vif->mac->macid, vif->vifid); - ret = -EFAULT; - } out: return ret; @@ -308,7 +295,6 @@ static int qtnf_stop_ap(struct wiphy *wiphy, struct net_device *dev) if (ret) { pr_err("VIF%u.%u: failed to stop AP operation in FW\n", vif->mac->macid, vif->vifid); - vif->bss_status &= ~QTNF_STATE_AP_START; netif_carrier_off(vif->netdev); } @@ -797,19 +783,6 @@ static int qtnf_channel_switch(struct wiphy *wiphy, struct net_device *dev, params->chandef.chan->hw_value, params->count, params->radar_required, params->block_tx); - switch (vif->wdev.iftype) { - case NL80211_IFTYPE_AP: - if (!(vif->bss_status & QTNF_STATE_AP_START)) { - pr_warn("AP not started on %s\n", dev->name); - return -ENOTCONN; - } - break; - default: - pr_err("unsupported vif type (%d) on %s\n", - vif->wdev.iftype, dev->name); - return -EOPNOTSUPP; - } - if (vif->vifid != 0) { if (!(mac->status & QTNF_MAC_CSA_ACTIVE)) return -EOPNOTSUPP; diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 6b4ccf7..cb9632b 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -173,7 +173,6 @@ int qtnf_cmd_send_start_ap(struct qtnf_vif *vif) goto out; } - vif->bss_status |= QTNF_STATE_AP_START; netif_carrier_on(vif->netdev); out: @@ -286,8 +285,6 @@ int qtnf_cmd_send_stop_ap(struct qtnf_vif *vif) goto out; } - vif->bss_status &= ~QTNF_STATE_AP_START; - netif_carrier_off(vif->netdev); out: diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index 4d3e036..a40295e 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -52,9 +52,8 @@ #define QTNF_DEF_WDOG_TIMEOUT 5 #define QTNF_TX_TIMEOUT_TRSHLD 100 -#define QTNF_STATE_AP_START BIT(1) - extern const struct net_device_ops qtnf_netdev_ops; + struct qtnf_bus; struct qtnf_vif; diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index 52e2652..7435986 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -53,12 +53,6 @@ qtnf_event_handle_sta_assoc(struct qtnf_wmac *mac, struct qtnf_vif *vif, return -EPROTO; } - if (!(vif->bss_status & QTNF_STATE_AP_START)) { - pr_err("VIF%u.%u: STA_ASSOC event when AP is not started\n", - mac->macid, vif->vifid); - return -EPROTO; - } - sta_addr = sta_assoc->sta_addr; frame_control = le16_to_cpu(sta_assoc->frame_control); @@ -127,12 +121,6 @@ qtnf_event_handle_sta_deauth(struct qtnf_wmac *mac, struct qtnf_vif *vif, return -EPROTO; } - if (!(vif->bss_status & QTNF_STATE_AP_START)) { - pr_err("VIF%u.%u: STA_DEAUTH event when AP is not started\n", - mac->macid, vif->vifid); - return -EPROTO; - } - sta_addr = sta_deauth->sta_addr; reason = le16_to_cpu(sta_deauth->reason);