From patchwork Fri Apr 10 13:32:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216048 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30712C2BA2B for ; Fri, 10 Apr 2020 13:34:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F23412145D for ; Fri, 10 Apr 2020 13:34:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="hLST5vOl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727136AbgDJNeF (ORCPT ); Fri, 10 Apr 2020 09:34:05 -0400 Received: from mail-dm6nam12on2082.outbound.protection.outlook.com ([40.107.243.82]:31903 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726950AbgDJNdi (ORCPT ); Fri, 10 Apr 2020 09:33:38 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Do9wm2Ed6CXC9vk9B+ydY/AFSGCyAq6zkUZ9iKMjxM6j338xhOpfmN+4RkauGFVU+DV7AcZXPMthrL4YgnIpSyhYW/TOCMPc9apK9xas7zReNVlMkYtDXoIPl5F93gN3Iq71jpBVZgiiZWJk/qRaBNxuxDWDYcSpcS8EtdLf7PzFCqPe0IxIv9DNjz385ox5dvzwJOVY9ZB+HTzQWjgLWEOmVe/rUylt3nUR1GgoLqkGNW57X3yctE2omP9pwXJDsonHWrREfC0sKj61i30WTl08nzNzyCeQkux6Cidc1rbIKTDUWMUv4+/DtTyPIRHjvRw7F6dwIeHbGrMp7D/NSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t8AN5xT7IguMhQFKKbm8f6euP1V+PzcY6ax0tLhh4Yc=; b=W5sDlwfm7H9uuIxg4BZeHnrT00IV+dLdGG2i8K6O7G6jQQFdppUzLDhBViZNZxzm/dKLW/9Y7I0jYgj8zDqv6EH+2iWNIWcT6XppeGL2iy65yCSHGTeaz/8wKweIFeAjkpRptIzw270+WyqyydM0oMiV2VjqNjXNZOKGhTvaiPsRPPnumEbQOsiMzo1agIQby6ZuYJJ7BdVK98ltHctXjnQJj+4zVYfdXBPeAkiQZ94hbfncqlbj0C514YM0CvreUs+jsSjNQ3odjNz/DAE6vvtwPo73nZe4BH1XCZ6mm48c1Tpa0+hxm650lw39bBR9Q8lOk9lgPYOOb9fgCFp8Ag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t8AN5xT7IguMhQFKKbm8f6euP1V+PzcY6ax0tLhh4Yc=; b=hLST5vOlGHkn7CPSqY75SDrSRhX7v+7BYagqH7XTKNoFIbAeJWjFT62OD7/jAwH3PbTcamwWDALG6Lw1900kToNKauhOtMS2VQVmpQa15F74lP9WVnlXqbLDEiRZF1VaYESBGzYFGwfMNeOajArrdfbHFEFk3fL6lc1b+lr7UbQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4398.namprd11.prod.outlook.com (2603:10b6:208:18b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.20; Fri, 10 Apr 2020 13:33:29 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::3d0a:d9ac:3df4:8b1]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::3d0a:d9ac:3df4:8b1%6]) with mapi id 15.20.2878.021; Fri, 10 Apr 2020 13:33:29 +0000 From: Jerome Pouiller To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 16/19] staging: wfx: re-enable BA after reset Date: Fri, 10 Apr 2020 15:32:36 +0200 Message-Id: <20200410133239.438347-17-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200410133239.438347-1-Jerome.Pouiller@silabs.com> References: <20200410133239.438347-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR15CA0056.namprd15.prod.outlook.com (2603:10b6:3:ae::18) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by DM5PR15CA0056.namprd15.prod.outlook.com (2603:10b6:3:ae::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15 via Frontend Transport; Fri, 10 Apr 2020 13:33:27 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9eba5aa-0f4a-45bd-8741-08d7dd53c14b X-MS-TrafficTypeDiagnostic: MN2PR11MB4398: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:466; X-Forefront-PRVS: 0369E8196C X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(366004)(346002)(396003)(136003)(39850400004)(376002)(107886003)(81156014)(54906003)(8676002)(86362001)(1076003)(6666004)(8936002)(4326008)(52116002)(66574012)(7696005)(316002)(66556008)(66946007)(186003)(478600001)(2906002)(6486002)(2616005)(66476007)(16526019)(5660300002)(36756003); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2AzICaktitYAJdEPNOKM9VUcnrZEAx+prlsUnKjQcOn6+WesOzesmfrN7KNMwffmBUX1ZZ/gd7mSWAW6KD4Ee5UCZOtg5HXBCmA1lcfzfQGSsWvO1x3wzniKO/Cy9azqasQSS+PuODIShj2v7YENzTh/+NYeax9y8EoQcNt+h2EmUWD6bfAV0GETBG3XIeJlfXCyJl4nojLUy7buHTNogQ4PiNEAHJtclDsdRseVWtdfB/Z0h/DSZuX7V2UbiMxfYDJX4ro9ZrA+2XDcrrjDNUXAX2V1jhXsP4HhmpdYfTgs8mRZ+S2bZyRtI9ExmS7yz0nvQrsFLI3pTH2ueGO7IC76dVlzRWpBUK0xj1BMLmeHzbCRSqt2C3/2JO1HhbsKvp+IW7ZA0urXfyGzHYdFZzc1qcEQD683sxz1GyOGMMN0V3UerAw5N/cYGzpVMoNu X-MS-Exchange-AntiSpam-MessageData: Byf+8mTT61DGtMMp3IaIrI5vyy1/qXQUhQxj6UUzL3kHgEnd/k+FySUwrt8Ag+M0HYsRjL02cKjPBYwrC0UwH5tzM+mIkBVmi5NAU/MGRb+riv2p+mVLD6eaSxKe+hn1tQBkRjGjJx6nEw3eHrYOs6c33965TQCuC/SjcfoTnIcU+5qJKsp1Qq/lzmMouQP59Aa9o0UJ37lCTMTiybOiWA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9eba5aa-0f4a-45bd-8741-08d7dd53c14b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2020 13:33:29.4199 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4DPcqjRyX5yNc2jKSzsw1oN51eP2ZA9lL2tPVIe/EbngtTONHH9CKC7IbQyMTlTLhFBPbh63owIOpzFTHN6LUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4398 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Firmware does not support Block Acks when multiple vif are running. Thus, wfx_add_interface() and wfx_remove_interface() enable and disable Block Acks as necessary. Block Ack policy is also reset after hif_reset(). Driver have to re-enable it after each call to hif_reset(). This patch reflects this behavior. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 21eceafc9a95..91b4ce945598 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -416,13 +416,12 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) hif_reset(wvif, false); wfx_tx_policy_init(wvif); hif_set_macaddr(wvif, wvif->vif->addr); + if (wvif_count(wvif->wdev) <= 1) + hif_set_block_ack_policy(wvif, 0xFF, 0xFF); wfx_free_event_queue(wvif); cancel_work_sync(&wvif->event_handler_work); wfx_cqm_bssloss_sm(wvif, 0, 0, 0); - /* Disable Block ACKs */ - hif_set_block_ack_policy(wvif, 0, 0); - wvif->disable_beacon_filter = false; wfx_update_filtering(wvif); memset(&wvif->bss_params, 0, sizeof(wvif->bss_params)); @@ -492,9 +491,6 @@ static void wfx_do_join(struct wfx_vif *wvif) } rcu_read_unlock(); - if (wvif_count(wvif->wdev) <= 1) - hif_set_block_ack_policy(wvif, 0xFF, 0xFF); - wfx_set_mfp(wvif, bss); cfg80211_put_bss(wvif->wdev->hw->wiphy, bss); @@ -591,8 +587,6 @@ int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif) struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; wfx_upload_keys(wvif); - if (wvif_count(wvif->wdev) <= 1) - hif_set_block_ack_policy(wvif, 0xFF, 0xFF); wvif->state = WFX_STATE_AP; wfx_update_filtering(wvif); wfx_upload_ap_templates(wvif); @@ -607,6 +601,8 @@ void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif) hif_reset(wvif, false); wfx_tx_policy_init(wvif); + if (wvif_count(wvif->wdev) <= 1) + hif_set_block_ack_policy(wvif, 0xFF, 0xFF); wvif->state = WFX_STATE_PASSIVE; }