From patchwork Mon Apr 27 13:40:18 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: 215806 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.8 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, 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 2D4CCC54FD0 for ; Mon, 27 Apr 2020 13:43:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1B16206B6 for ; Mon, 27 Apr 2020 13:43:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="PtYagRck" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728015AbgD0NlM (ORCPT ); Mon, 27 Apr 2020 09:41:12 -0400 Received: from mail-mw2nam12on2086.outbound.protection.outlook.com ([40.107.244.86]:6127 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727992AbgD0NlL (ORCPT ); Mon, 27 Apr 2020 09:41:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AuLPTCJPT+pvTo2W3Qllvd/2i/Q+yLAU1GYPY2+Mc5ISiSn9dQCSKLGFQwYpCDdhLS2EXUCygragCDtAR1lBz+7rDxSOvfMtTZmIlQrVxAp8kkyAC/d23eKyCMCQFdqZytYccX7jx2FZX6wuu/PXnh2eRYftJotvSbFPLYjOZrPgYYnM12bEIhkOQUlGkyzAzXc18B1J1yV/kczecerxTXZXK4M1oMNXILKTZ3/lgE358rtFMre+J7w0LJspBIXHXwSkS5mgWT8j2p5T2DieEGOmtX/8L/ro5HSjzbyVVh36pmlFqn1yfdmqwXh4btqbsknw+PCmKGi/9dwnKGCm1A== 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=P4Z9XHMk2EIFcuuUeSbslGWvZpkT0RcgtGB0oJKFgr0=; b=NlL99G+ohndy3UsnU7yDVJBHDhRbcafjHZBJsLLJE6Cx8ZxLGfGWtm+XVCn50U0Rfx8GGAVijqcDttZxbyt4Cny6xkmC0M9VHl7j6y0B0fmqx1iw4ruULCPDqPBacPHDnxc2z8w3OMvORsSrHkIYnoC+NJleY0xfOI3CkxdkkyM2oTL3/4AHRat/B7gmb5a281TimvjX//ASlAvY52XjP8hXKXX7U+HZa9ZMOrjSBQrn7C6mjci5lb4bA98p0rUQbrY35DTPFKpcnY08985Itu9PPfwuu6vqLqOqz30hSAmTit0taILkKe3xQ8N5l5S5lDH1wQ2BfWHhwB4KTRQM2g== 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=P4Z9XHMk2EIFcuuUeSbslGWvZpkT0RcgtGB0oJKFgr0=; b=PtYagRck0n60073veLaoidcJxOzY9EtbiBg8FRjMSh+9IiPAvQ+E4Ae9g7dSwQQp/3lEmWPY+xT5vJqhtlJ4e9k5JzUT5tF+4l3/8FtfiDVzx/ptSWvJ3FaEaJIM4/gFtoY/mQrKLHap0FoDqHJB4ttuWXGhhJIVAXMDZGZs4AA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1424.namprd11.prod.outlook.com (2603:10b6:300:26::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 13:41:08 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::81d5:b62b:3770:ffbe]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::81d5:b62b:3770:ffbe%10]) with mapi id 15.20.2937.023; Mon, 27 Apr 2020 13:41:08 +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 04/17] staging: wfx: fix support for AP that do not support PS-Poll Date: Mon, 27 Apr 2020 15:40:18 +0200 Message-Id: <20200427134031.323403-5-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200427134031.323403-1-Jerome.Pouiller@silabs.com> References: <20200427134031.323403-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0232.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1e::28) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (2a01:e35:2435:66a0:544b:f17b:7ae8:fb7) by PR0P264CA0232.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 13:41:06 +0000 X-Mailer: git-send-email 2.26.1 X-Originating-IP: [2a01:e35:2435:66a0:544b:f17b:7ae8:fb7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5619c46f-bbb2-4c49-21da-08d7eab0a3ef X-MS-TrafficTypeDiagnostic: MWHPR11MB1424: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:800; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(136003)(39850400004)(376002)(346002)(396003)(366004)(8886007)(66476007)(66556008)(4326008)(81156014)(86362001)(8936002)(6486002)(52116002)(6666004)(6506007)(5660300002)(16526019)(6512007)(1076003)(478600001)(8676002)(36756003)(186003)(2616005)(54906003)(107886003)(66574012)(2906002)(316002)(66946007); 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: fcEtMjYai7Rq7+dJ45dUF4QdCRG8QD1PBOodE//mBLCqc0bkH5UkTHI9JUhFBDFBqv+ebWi9aJ4JcNfv+NXVi390TAC+n9RdpC9yKhke+007YE6SDn7I01p+0TqfDg04Tpq0+v0Qgz/qIx2pVfwEgM9e1AxlyQXWdJo+icJr/Z7SV2kG+NQjAplmT6eWNzViAFQGHWpjjCDe98bBzOC+EW9pG+c7teBGoD0EfnWI2waZj/b0qrUJYTj7PFkpX/u68zHVPDjx5bG3kLAXNLB6VJeRvsPwpjughOyS7mJbzyqNT4pBbdbNv6m/MX4MbQzx31RlCr3ucS+rtMraoyG5UlNwCd5amYpXx0Nk6O/F/hgirELmfaBhdqovVelX+sS8HHYtlXpqIrywwMl7yFlqH8ufHgc1KEyg1505Qy8U47yik0WLRr/YYm1kA3mzSWOK X-MS-Exchange-AntiSpam-MessageData: xBrZGCj7CYMXoY49/QH+1DVO5CAG6zPu9DFeXUw2yh7THlJMLK3MeQ3B0MSyk8QgL/H9J9+/B62goWz5dWHqjheZcd5mPclQITlZ9MPry1l5hNadVFWqT+LtW17U9+LmieLNXC+xuVvMd0bKGtxY6IuOX4SbmEt354yXowjB1mOoCl1CW6UgdO6sz/DhF3l3vivwtr4nYmPpFFUPTxM1VEQNJq1lYTAFofMbcCARiLfGi+c/eun/aR+3Qas7oxXGm0y7H9IC6J40/iEeq17XLPeokRiC1HsktTmh74C4RAZkWC0+hygbo7//PJM4Aj8H0cGaeF2aaiqMNDpdtcIznUQDlTHfKjKkzQASN8PbyRsNJhwpXRfB4D3+tRWnjDv1Vg/JQJ0l9//sCCzljnz0BVhdKuSAxWQiBdszdimf9gZLB/vz/d1jpqLvBrB1uaqcDuVD/+HacqiAzdbte5FvWPskYFjAe3kdQ2ImS6Ld2g4DEu86sfnPoOtSwlZ/89RAlQVJ6BCfTYnCchq7gZ+7lASu4Eap5wS2stYRXtchZrn4yPe97ztrRs/lY3cMsSdrBK6A07DLD2ADlYW8QXBWCFWX4UThcSEla6+zUn1ZPbuLe0gWWnGOYav141pw11KUBTlt5UCtfMEvriJCTVLnv7KyMe1MkXCy3Lo4sI9S37mmlMRYdJhkVGPR29vZRLDqU/dTNJjZ90NgMiayp9Dycod1+G1XUJ9/Z4AbeXiKKMp0FGxKBYYknpQFSr4Y8Vw8PfswlICH9PSTtRyQ6lcG/Vzgpw8nFyFARoELrSRmcI39Kp9WCSbrmh4S/72pUmUfgQy12gZGatdov5JneBVTerRp08RQDUn4D/3u/5cOuhw= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5619c46f-bbb2-4c49-21da-08d7eab0a3ef X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 13:41:08.5734 (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: uG9VmFYLpqLCr8aRi98Z0BTZ7fuVcTe+5mC6jYWDJIH8ZvQHEGn4ttnVb5gtZZQ6AzpJhZ3ZV6yEutavh5cdBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1424 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller When multiple virtual interfaces (on different channels) are in use, the device ask to activate Power Save on station interfaces. The device developers recommends to use legacy PS-Poll in this case since it is the mode that disturb the less the other interface. However, some AP start to not answer anymore to PS-Poll. The device is able to detect this case and return a special warning in this case. So, this commit catch the warning and force usage of FastPS in this case. In order to confuse the less possible the other interface a small FastPS period is used (30ms). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 8 +++++++- drivers/staging/wfx/sta.c | 16 +++++++++++++++- drivers/staging/wfx/wfx.h | 2 ++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 6dbe289a368f..a2ac6c098163 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -176,7 +176,13 @@ static int hif_event_indication(struct wfx_dev *wdev, dev_dbg(wdev->dev, "ignore BSSREGAINED indication\n"); break; case HIF_EVENT_IND_PS_MODE_ERROR: - dev_warn(wdev->dev, "error while processing power save request\n"); + dev_warn(wdev->dev, "error while processing power save request: %d\n", + body->event_data.ps_mode_error); + if (body->event_data.ps_mode_error == + HIF_PS_ERROR_AP_NOT_RESP_TO_POLL) { + wvif->bss_not_support_ps_poll = true; + schedule_work(&wvif->update_pm_work); + } break; default: dev_warn(wdev->dev, "unhandled event indication: %.2x\n", diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 2262e1de37f6..77d5ff17a59a 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -205,7 +205,10 @@ static int wfx_update_pm(struct wfx_vif *wvif) if (chan0 && chan1 && chan0->hw_value != chan1->hw_value && wvif->vif->type != NL80211_IFTYPE_AP) { ps = true; - ps_timeout = 0; + if (wvif->bss_not_support_ps_poll) + ps_timeout = 30; + else + ps_timeout = 0; } if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, @@ -215,6 +218,14 @@ static int wfx_update_pm(struct wfx_vif *wvif) return hif_set_pm(wvif, ps, ps_timeout); } +static void wfx_update_pm_work(struct work_struct *work) +{ + struct wfx_vif *wvif = container_of(work, struct wfx_vif, + update_pm_work); + + wfx_update_pm(wvif); +} + int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params) { @@ -293,6 +304,7 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) if (wvif_count(wvif->wdev) <= 1) hif_set_block_ack_policy(wvif, 0xFF, 0xFF); wfx_tx_unlock(wvif->wdev); + wvif->bss_not_support_ps_poll = false; cancel_delayed_work_sync(&wvif->beacon_loss_work); } @@ -453,6 +465,7 @@ void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif) wfx_tx_policy_init(wvif); if (wvif_count(wvif->wdev) <= 1) hif_set_block_ack_policy(wvif, 0xFF, 0xFF); + wvif->bss_not_support_ps_poll = false; } static void wfx_join_finalize(struct wfx_vif *wvif, @@ -737,6 +750,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) init_completion(&wvif->set_pm_mode_complete); complete(&wvif->set_pm_mode_complete); + INIT_WORK(&wvif->update_pm_work, wfx_update_pm_work); INIT_WORK(&wvif->tx_policy_upload_work, wfx_tx_policy_upload_work); mutex_init(&wvif->scan_lock); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 77bb6c617546..c7a58ab3beaa 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -89,6 +89,8 @@ struct wfx_vif { bool scan_abort; struct ieee80211_scan_request *scan_req; + bool bss_not_support_ps_poll; + struct work_struct update_pm_work; struct completion set_pm_mode_complete; };