From patchwork Thu Oct 5 01:38:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mitsyanko X-Patchwork-Id: 9986279 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 11BCE60291 for ; Thu, 5 Oct 2017 01:38:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 023FA28C06 for ; Thu, 5 Oct 2017 01:38:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB68D28C42; Thu, 5 Oct 2017 01:38:28 +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 530FA28C40 for ; Thu, 5 Oct 2017 01:38:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751315AbdJEBi0 (ORCPT ); Wed, 4 Oct 2017 21:38:26 -0400 Received: from mail-sn1nam01on0084.outbound.protection.outlook.com ([104.47.32.84]:52980 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751201AbdJEBiX (ORCPT ); Wed, 4 Oct 2017 21:38:23 -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=DBEt1QLO3TkpXjLs/r7ylNgWUuYNLZlT1i7USMueHNw=; b=B/A4Z6IQZ8GM8+8OqSYQtCC0oS1iwTyE8B9M/SFimesDMufnB+xE4n00mt0f+06IdFhYfb52MeiIZxuJsH3GjKryAbTp1Je8Dvp5Hev0YiKCkmdIidjGPC/OniBmPBmzom1vnf5nMDXfNxOgcm+Nh9fm/fkBTEmI+99akh8vhuU= Received: from dodo-dell.quantenna.com (12.131.200.68) by SN1PR0501MB2047.namprd05.prod.outlook.com (10.163.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.5; Thu, 5 Oct 2017 01:38:20 +0000 From: igor.mitsyanko.os@quantenna.com To: linux-wireless@vger.kernel.org Cc: sergey.matyukevich.os@quantenna.com, avinashp@quantenna.com, johannes@sipsolutions.net Subject: [PATCH V2 5/8] qtnfmac: get rid of QTNF_STATE_AP_START flag Date: Wed, 4 Oct 2017 18:38:10 -0700 Message-Id: <20171005013813.13332-6-igor.mitsyanko.os@quantenna.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com> References: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [12.131.200.68] X-ClientProxiedBy: MWHPR20CA0031.namprd20.prod.outlook.com (10.172.102.145) To SN1PR0501MB2047.namprd05.prod.outlook.com (10.163.227.20) X-MS-Office365-Filtering-Correlation-Id: 754df940-08a3-4c89-fa89-08d50b91c2f3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:SN1PR0501MB2047; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 3:4fWse8O4ePq1PsQM9h5kWzlu1y9d/A3vQG+JrDduq8sddfmm4a4odVsTHqD1Wy7fo92/wVa12p8Fz3s2C8g/T0Yh82EykrL49xpfS/UnrZfqlxe7QHKmPhwuJu8d0anZ8oq/NCumnBtuPQznD4ZBoLwDyKHXbseqUiIfHYTSufSmKYTgavHhBX+p5IKb4yieRVObb1drbBDoNTQD4vdB2Nyydo2aqRgN6akwgxP7mQcL06koeri5sFfoObIjPd+a; 25:fWAs5szPUwrdRyY+5yKO8dRyvibJsjJb5fjy/8lnh+BPhlWtfPU7zD5BKHTaChOQcCA+SCLM+1Y0Lc3LCTgNH5HcpWtpQ1YOlubPbQfFJqD0gNcZB0o1ZcxnXPHLxfePArfq//dBX5k1bfnNUfWM1glFcJfCLOHQMUs0voL+DHbTfPf72giL/VxKaz+2NJt+5iG9HbNA6lv/kgQiXbFTeRetLz8PEPm92UVA+tS9vQI0D9cwAaFBmOEWihvDvvk08lhNqMCB3OEd0tRu55zLtlR7m+rYwp4DYvFOtf0ZP7TM3X9vNkjV7HxM8l5D3SDewNTRDuJGQx1VNgd5rJYlMw==; 31:cMAG8JRFbQfGFIENaehb3OljxdA1f3V8Dw+rL4hREa25UDE97101PtfhwlzrcbFk2VkjxFSQIgnVWOiuEQ3Al2UC7EdKXVeE32Ayeo8Qx9AC+nmeIi+5Bdtluc0bQcyE0A77qSoA60QHGVWLjRpNEjUEBjb2Q0z1FVPAQ/xYw7FlQDV5eT9JEHlYnNdRfWxqfEzfJXC4tQcYF7mFmG8f6fs5n/6caQQosevTHHKWKZo= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PR0501MB2047: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=igor.mitsyanko.os@quantenna.com; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 20:LGa1CpHttgK6sc164EXTv0BJf6JJaqd1hVMimeo6kfymynmRxsef436/Af8Jn5pdwMFEwuWgN/vxBWIzjlE/4BMGczov8fSrDpILK5wUzJpU4fBoGWHIn+qd00hXPSjmobKsKMPfVNIb/wHeq6ngO3J4RyKikiDi/+8sgD63iqUxPkGXFmEuRcK8F6fpe8qOjXIv2AvxewjfZt3+HxtQbvaG+PqLoJaWSuiwJOFzfZRTSPBWdU71pD+gHIreIqcbrNu4mop3fkhFf0/VIrq4gDN6auFmSH6re3dRUBBbQdySfRwJ+HPhvrvRsUq6U9/sGy3w0JgkUOdHLm3DuJRZ+mp+QZczWij+r5Jf/aSyiZptoRry/50VkoYNwbe8bm4+/wnP13NdvFD9l+romd9r84JTbpmR1r9poYCib2fu3UalJWhs8/r+v6J8g9QwgwK1sfi4+0AA/wqRkQ8I97rv8tVNNigimflngMDDzZmz1COl+SQE8QLWQGhCBoboPoeG0zp+ZVPPs80YWycFz1PtXzZiJSIin0kwl2i3bPwZ37bUO+hODKkp98UYgWtZ+UMXY3vP9hDHvBbP7bLmAqmdjO51JMIXqEwdHM16F3LIs/Y=; 4:c/oMJrVYwN7bwi2suFDxjE39qIPuUUNxMgvVp/QkuO2WDydZfu3Tmec8PsVyxEF5V80EF2FQWcRGVIUa901n9u3hjvfu/239jKsIxFU50rX3rdmcnC1R+pNL9303jqqC1Kvfsm64SATrWX7ltPQr61ao8Aeg0g4w+irZRjaU8WLf4xKbpNMTADyzSO9JQh488OfGa02cckTubCJvItxlQjGb+ShSa2kdkLyzAOVOohXu0LWmLFrU5JIBUCn1aY6T X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR0501MB2047; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR0501MB2047; X-Forefront-PRVS: 04519BA941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39830400002)(189002)(199003)(25786009)(106356001)(103116003)(105586002)(2351001)(33646002)(69596002)(53416004)(2361001)(3846002)(16526018)(85782001)(53936002)(66066001)(16586007)(2906002)(316002)(1076002)(47776003)(6116002)(478600001)(7736002)(8676002)(68736007)(86362001)(6666003)(97736004)(101416001)(6486002)(81166006)(76176999)(48376002)(189998001)(2950100002)(50986999)(8936002)(5660300001)(4326008)(36756003)(6916009)(50226002)(50466002)(5003940100001)(305945005)(81156014)(9686003)(26583001)(85772001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0501MB2047; H:dodo-dell.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0501MB2047; 23:ewcQLbp4ffhoZuzOkrN4Qfw1ZFfFVbqTFHLsT+a?= =?us-ascii?Q?lSENmhgiimW8BNyLCPTeD5eEqLdyYotfE3GIOSq3aS+/7oyS2AW6VIpxVfNu?= =?us-ascii?Q?fFP9vWDz45wTr2Cu3E9VkLcvaVVAERFxflupxUpLpOtRkUDM3UJfEeHhC+js?= =?us-ascii?Q?QyQfwK0xPvoj7lrQfvnqcZXRNeHPwG3eyMCWDrY5DTwnfX02F3bGj5a9nB8R?= =?us-ascii?Q?oyNvUWT4jev6k6TzxhTonQ6xSfB/FTBKqploBxKkcjrrEl5c0AcUjYjvhvQ2?= =?us-ascii?Q?Q6fNLNN7tz9gmfKIMMAFs2hcGIqXHNA+Y60DjpF+EheN7mvvoD6fyrnHedg+?= =?us-ascii?Q?+xcmGgGsigei5SEsafEgul//ZmXaEdVFeRvlw0bSKxTrh1L4BD/8IOWxezCP?= =?us-ascii?Q?0ONEa7URi/7dIKnr1oqjQhk7Qg8qq8m97plZuc0EIBDVZYO11YBpdy3zG3ZV?= =?us-ascii?Q?zCBf8FTgkzYqHf3ZMgEfyY7rk8LtoapIAz9A8GVkdEqMas1uPGAZx3X1Mjt7?= =?us-ascii?Q?jKsV2d5AQ8wKop7lDm3hue41aWq2XRYBKV+1/+2nnJnTqlWwh8bkdV0wCNxy?= =?us-ascii?Q?rqFKFY0pdmkTFLepEx0NySKshw9Rw1cuCCRCnzDRm2pKBf78drlasSYYFwRE?= =?us-ascii?Q?BXVi2T6IvMGTw9Iq2CDAoWtu+BbTwq7s0qb4gxrP8qsBELRAmWJgbVsVh/cq?= =?us-ascii?Q?vvBkVU+Og/eVt00uRsd5s7dlbef3L69ijAktc6YzyIAZM4gj5u16dSHjIbrJ?= =?us-ascii?Q?L5MSAasDN3iDSZq2MN8xszYh6az+H8aWqdw/sWVhpsypNb9rBjbghb0g9MSC?= =?us-ascii?Q?RKsMDNN7kXtWh0cYTSgG0+76w4E6YkrzdB2Q8GhSsJiecVjaoLa9gDHuKJIX?= =?us-ascii?Q?F6aO94nJ38zXHnyYXB5DtPGBTOmjXORAO3oFTVfwgrfuDQqiakORzss8Kpup?= =?us-ascii?Q?ffu+AEpfha/N3M/qi0Kcq1L6q42cNULsxA1T8qbLVQ5OiQnf74Jo7xZwCZrF?= =?us-ascii?Q?d86AMAdOCgzGF4eJkU4EqKUbpi09BwZZoXHkAnoOFXbvoCOXTeBpw165ADKL?= =?us-ascii?Q?238vLDKQw49s6yWEtmQIIRwZQs44dehfc37clwhBbEkqNbHG+cKebxA751hP?= =?us-ascii?Q?y09UbOKGUYnghmMHUEvTgsj/GIAi86BLYZtiW0PseeiGMYpKQMVs/p6Tsv5w?= =?us-ascii?Q?P8PDj3yyMblHgKs0Yq0wHilrq4TM1ckALVKWQ7Cj4jl/eQs64mAkUx9MhfKG?= =?us-ascii?Q?EN60gSY2SlSkZtXXm52o=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2047; 6:EUdsKmdEaMRJdhwdMkuaGWoZBrIM5T4GiDDofk9deGYGFkS0KwwoaczwtF2ZXqU/dzhM4I8lSF64tW/aOwHiWGdCW/5mfPPOLVIqcKoEXDAFtkok2oGPzKXxdOo+O7lkGJoGIpl2+Nt+hFx+VTCiRpYcxNljVHYstAyyB/wQ6CeO45gcvXJkb7qGr5A9k/m6YvHO9rVM/txBBCtHDxLeo/DseHaawSORqSeJTw0PGPVNHZAQmzrPdvNAg8blYx87x3mQALcChiQs4NEBGmv5S5Lkdtl6SQN8C8xtlqvfiAuensgPboCJnbFEMokoTJKyS+zoKS33mCspmxmjnGa/qQ==; 5:7VEIz2RAMtU1Zb1lTgVE5jcOHzJUGj94USF4k7gewxBsR8KNZP9S9UbLJ+UDOJrPxHhXJ3nOyj2J66iaTLkHAh2sVj/k4vF6X5HB38/5lpPamsLE4uRDHU36BT5eGx5q2bgrrmYrXcKOnyyfLyDxjw==; 24:2PpFGJtctYsA3PIJPD8g+kj2Ix4kB7XpWwj7uZ68/9VxD74LkSOV8lueK9EIsyEe/CbG6rgqb9xqcRCTwH0QecgQwIUUsges2odI2wDIKlU=; 7:/hUU9wE7LpcxEyjy3sqrvL70RaIxxokug3zm0EY/GOkdX3bCVCTemToTHJbIdRUY49BbEJRq7BMcy+cVBvGpK4cy+G/GYEvOtpX9/tny21GiOkr4bxYNWQNbbh4878tU242Tfco9jQz/F51HjyGIhL06pya89BrF7TOUxxD/JOTgLK73Txl/BXnEXtdpGXdvvvUEPoGtbAh/TmdO73fv14PyhypfqQJyklxlOaO+3u0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2017 01:38:20.7506 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0501MB2047 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Igor Mitsyanko QTNF_STATE_AP_START usage is redundant and imposes additional state synchronization maintenance. We may as well leave state checking 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 c660846..08f1f54 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); } @@ -784,19 +770,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 (!cfg80211_chandef_valid(¶ms->chandef)) { pr_err("%s: invalid channel\n", dev->name); return -EINVAL; diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 59ca6ca..60d65df 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: @@ -287,8 +286,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 f8165a7..b35200d 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 7481d5b..d7fb076 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);