From patchwork Wed Jan 15 12:13:19 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: 11333927 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 74CFD109A for ; Wed, 15 Jan 2020 12:14:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FA98222C3 for ; Wed, 15 Jan 2020 12:14:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="NibSf/RK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730819AbgAOMOM (ORCPT ); Wed, 15 Jan 2020 07:14:12 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:33252 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731673AbgAOMNs (ORCPT ); Wed, 15 Jan 2020 07:13:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UBh4Y08K0w8HE9sxblNhpWvS/R9cYFtOEsAF0MN7cefjEEseQUypIT/ZYeniPai6185r/OgiyOOG1VY070b7NYxEnNwb8X+5WNMFD7ErC1Bv/xdudSivA51v1OEuuZNo2FtIZERQ7IG9J7QunPnvPlLDeMhLGZv2rYPEvNIAW+fRerwSsDIXosjPQrGCrKSxoMGkqzebSyWw/HEm3hQtn4Mf6TwMcq7osQfPe0suyVlfhi+jvoXMFtVl9wtThMOrmMBONijVx5e/OLsKdk1p4If85zDB4viUEYaOm1x122nt9hQSKKjQ19USFpyceBJBPbQIjxyxn6zk7M6GOWEDqg== 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=GOfkk1dzUC/6ez+F5LEQHcokA7G0L9veToOFnzjqtGc=; b=FjQ3FLHIwc/z4rzUanEB8ye8k8Xw9n0RY1dYf/AO5pYzSjdjkirHMOVRfBUJpTykYtMvlFtKs3wq52GzSoglFTVVusEtv1D8HrVjkqxq+L4MZIGlDICMz7PGMXhVCotdgPp6AGbzxxikGIYUPbdUjpeWNhe5Fnpg1716T6HldMNReFfWNl6lKZTomnTPT3B5XGp6MGNDaFRIecUHe+Q2swAkdLvPSAFjA8RZcLzhZZZR55oaSUbekA6hrvvPTdrTHcLy4AjK2igSRN70fPCddR3xcND3AFh3SNFkJbaigtipTutfc7JiEjvc3iJw/ms/Wc0K/zBePZ4ZNYp60+Q3WA== 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=GOfkk1dzUC/6ez+F5LEQHcokA7G0L9veToOFnzjqtGc=; b=NibSf/RK+EHrPsp0R3M4D1g5zVjyfcOFOVc95DQ4/Asma9wb/l/tRpO824cCoAEAfMpUZHk6fHSL9siJoPICNmgri4++03KI1ULA17XOMwer3JvIWffUikBbS9pIqxq+oebwOiGz5fsP/LWLQwyCimXPcZnaBdL/7ptMCRAcxoo= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:33 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:33 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:18 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= 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 53/65] staging: wfx: pspoll_mask make no sense Thread-Topic: [PATCH 53/65] staging: wfx: pspoll_mask make no sense Thread-Index: AQHVy50sVno8itD1SEeZHKH340+g7w== Date: Wed, 15 Jan 2020 12:13:19 +0000 Message-ID: <20200115121041.10863-54-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: aaa1a99d-f173-4142-c042-08d799b44f09 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:283; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(136003)(39860400002)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB3934;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; 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: LGeeV9p1rMvugEHmbAbpHiakR8EcuRoNUCuNusK5ZGI9vHj2kfylpKTLg3MWqBQ2m6vFexY6O0APHeBGydUNqT/B8Bm8LWC0960hPd946Pjhi33+N6ewkmqdzFiMMM+7cyv59ijtCVUlchqNgsOXBSDI0wjlJdihZyQQqSWh3fPgqNCKILiHcxRKkE+G5+XKJjzMxBlnoNy7RWbJ0oNy2+O9I98JLMSo8tNQX16h0czFftY2w3Qq15D8kE01T3sm223/WcVG/zxL1Zs4yCJjihjOMc5YVUm9SEM9THe/0IJC1G+QL5LwLbGUhZjjqpu2Sa6og0v9J0z+bSgEbICogzM+SVMLZxFcJm9GZzd7TjIgOVYTWy68wsW+UMbAPjbJOXhPIURMmJMs7hRTCQ5uCQLC1KCr+LMTTDYc+pD0XFxHvl8BPmpZ8T76Mj9/3quz Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: aaa1a99d-f173-4142-c042-08d799b44f09 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:19.7195 (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: MSrfxtv+CQ5IueRNroK5Cg/9hGoA8qMvo9OieA51DYOxtXLhNViL5O6kGn7Ver3uDwX9Eoc05h8QuXtIes5ziA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller pspoll_mask is here to send data buffered in driver. But since station is marked buffered, TIM for this station is 1 and mac80211 will call sta_notify when a ps-poll is received. So pspoll_mask is useless and sta_alseep_mask is sufficient. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 39 ----------------------------------- drivers/staging/wfx/data_tx.c | 4 +--- drivers/staging/wfx/queue.c | 8 ++----- drivers/staging/wfx/sta.c | 2 -- drivers/staging/wfx/wfx.h | 1 - 5 files changed, 3 insertions(+), 51 deletions(-) diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index 699e2d60fa89..5d198457c6ce 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -13,41 +13,6 @@ #include "bh.h" #include "sta.h" -static int wfx_handle_pspoll(struct wfx_vif *wvif, struct sk_buff *skb) -{ - struct ieee80211_sta *sta; - struct ieee80211_pspoll *pspoll = (struct ieee80211_pspoll *)skb->data; - int link_id = 0; - u32 pspoll_mask = 0; - int i; - - if (wvif->state != WFX_STATE_AP) - return 1; - if (!ether_addr_equal(wvif->vif->addr, pspoll->bssid)) - return 1; - - rcu_read_lock(); - sta = ieee80211_find_sta(wvif->vif, pspoll->ta); - if (sta) - link_id = ((struct wfx_sta_priv *)&sta->drv_priv)->link_id; - rcu_read_unlock(); - if (link_id) - pspoll_mask = BIT(link_id); - else - return 1; - - wvif->pspoll_mask |= pspoll_mask; - /* Do not report pspols if data for given link id is queued already. */ - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - if (wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[i], - pspoll_mask)) { - wfx_bh_request_tx(wvif->wdev); - return 1; - } - } - return 0; -} - static int wfx_drop_encrypt_data(struct wfx_dev *wdev, const struct hif_ind_rx *arg, struct sk_buff *skb) @@ -125,10 +90,6 @@ void wfx_rx_cb(struct wfx_vif *wvif, goto drop; } - if (ieee80211_is_pspoll(frame->frame_control)) - if (wfx_handle_pspoll(wvif, skb)) - goto drop; - hdr->band = NL80211_BAND_2GHZ; hdr->freq = ieee80211_channel_to_frequency(arg->channel_number, hdr->band); diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 7da1afd6e9b5..7914c06578aa 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -286,10 +286,8 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, int tid = ieee80211_get_tid(hdr); spin_lock_bh(&wvif->ps_state_lock); - if (ieee80211_is_auth(hdr->frame_control)) { + if (ieee80211_is_auth(hdr->frame_control)) wvif->sta_asleep_mask &= mask; - wvif->pspoll_mask &= mask; - } if (tx_priv->link_id == WFX_LINK_ID_AFTER_DTIM && !wvif->mcast_buffered) { diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 3d40388739e3..42d64534c92c 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -493,12 +493,10 @@ static int wfx_tx_queue_mask_get(struct wfx_vif *wvif, /* Search for unicast traffic */ tx_allowed_mask = ~wvif->sta_asleep_mask; tx_allowed_mask |= BIT(WFX_LINK_ID_UAPSD); - if (wvif->sta_asleep_mask) { - tx_allowed_mask |= wvif->pspoll_mask; + if (wvif->sta_asleep_mask) tx_allowed_mask &= ~BIT(WFX_LINK_ID_AFTER_DTIM); - } else { + else tx_allowed_mask |= BIT(WFX_LINK_ID_AFTER_DTIM); - } idx = wfx_get_prio_queue(wvif, tx_allowed_mask, &total); if (idx < 0) return -ENOENT; @@ -585,8 +583,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) if (hif_handle_tx_data(wvif, skb, queue)) continue; /* Handled by WSM */ - wvif->pspoll_mask &= ~BIT(tx_priv->raw_link_id); - /* allow bursting if txop is set */ if (wvif->edca_params[queue_num].txop) burst = (int)wfx_tx_queue_get_num_queued(queue, tx_allowed_mask) + 1; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 61d64beb6143..6697c736a054 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -867,7 +867,6 @@ static void wfx_ps_notify(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd, case STA_NOTIFY_AWAKE: if (prev) { wvif->sta_asleep_mask &= ~bit; - wvif->pspoll_mask &= ~bit; if (link_id && !wvif->sta_asleep_mask) schedule_work(&wvif->mcast_stop_work); wfx_bh_request_tx(wvif->wdev); @@ -1178,7 +1177,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, wvif->mcast_tx = false; wvif->aid0_bit_set = false; wvif->mcast_buffered = false; - wvif->pspoll_mask = 0; /* reset.link_id = 0; */ hif_reset(wvif, false); break; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 365aacc073fb..8491f050478d 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -91,7 +91,6 @@ struct wfx_vif { struct work_struct tx_policy_upload_work; u32 sta_asleep_mask; - u32 pspoll_mask; spinlock_t ps_state_lock; struct work_struct update_tim_work;