From patchwork Wed Apr 1 11:03:53 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: 221514 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 8F9D3C2D0F4 for ; Wed, 1 Apr 2020 11:05:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 666022078B for ; Wed, 1 Apr 2020 11:05:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="bryt0T8F" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732470AbgDALFO (ORCPT ); Wed, 1 Apr 2020 07:05:14 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732397AbgDALFH (ORCPT ); Wed, 1 Apr 2020 07:05:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h1JZye9hiymctHsY/I0hLU9FKhbmtUAVd+aQCpzPfJkwD6CddKrYqb3PuYx3ZUwnqJJbP6EBa4coeeEcHXZ2OAEximizbTBX0RqyBdM3DrS6nmBeJjRbCHGYtpemSm6EuP2VO+N7/DX0SmylHJ+wzHdQ1W/wDdSKlL8tca8RBByrgqi4UglkIpU73sduPjEOGAhLfMzD/W2x/viWgJEjNmvISYNNL/WLJchYBu5D8NQqy5V2mPYhf113oCGMC4yt1DyTe7tobhKVqwTuY41S0JpFvPAm0vQhw9zJi/NF9VzJpA+ksQ84K6GaDe9UKO03m9tnIK16tO+2zNf3T9fyTA== 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=ckRI9VlPgVa5+jADj0msC+suM5ZwBwbWygxuwsP1SDM=; b=mXxh2OSbGdxfFmLcgUEfihfU9viqMROuuHVsZo1+xMAE75rMTdiMw9NocsXIBARdee0kosRoXBD6SMUXpu9tsaZb5cQ32bM77t7/jXYl0+LofKwkbSj1toyu6k2NPpF/F43/JGXQUAjIOrzeSlINhl5rLgnHYEPNYUnMZxsKOGWRA55bBbU0GrCIp3pzFqie0pfAuPwhSHzFmoni7zCQptGFceSdnawzYp1HV3KmuMGdAyXOdXdajxFvTxKq+lR3qimJ60kZu80//Q2HuK8YgrJOLwb6Rm2hrk4VICQqefCnywdaaXV8Xs2cKKfoKAi6lBnruuVXJ6CrbnxdP1Hg2g== 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=ckRI9VlPgVa5+jADj0msC+suM5ZwBwbWygxuwsP1SDM=; b=bryt0T8F32rI02mleVev5MQRbgh1DYd8Ey17BHwy02QS0RqsWjbvAZJyBgkMCViJUs0twZixW8lnaXERHCBkH9ozwtTxDmgnQDWfr89epJlIiLfSPdKJnK3W2ZZmX+NAV2u4I4SdhGAz49B9lyxtJsSPxZnNa9P768mCTAVMPmU= 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 MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:00 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:00 +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 20/32] staging: wfx: replace wfx_tx_queues_get_after_dtim() by wfx_tx_queues_has_cab() Date: Wed, 1 Apr 2020 13:03:53 +0200 Message-Id: <20200401110405.80282-21-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) 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 SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:59 +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: 06119e87-49bb-4b4b-4862-08d7d62c859e X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 03607C04F0 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)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); 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: BcnC5xBsteWgenmoLkOeOIhZq7fwBzlwql+JhuLgLy9xPgaRW3LYkQcupxSTn4j+GM00iwEdrdjxJrf4CjHT4iWpitLMnbkedDhGGl2zAjCwGP7/Fp6pV4P6umlsgwe0Kpcfaptv500BovdS8OidimiTinP0U9VsiXM5sPFIHepVwnJI0vNVr8tog85ARnk7fK5m7Y6RcVyaX9i1qXpbKnUXe9w/RqQ1IxweIUTyylUQ5Yz2x84OwABCro5yd1/5JfXRWnWKtCGLJ0a8UEQZRT17Vxh+KECUoE9A3BAezh/f9ttisxpcOYbdGVOPl7dsaHwNQT8dDDzCt8/9LraZv8fjR7TGnLnl9iDc3ZacpuHYM6E2SZPxYsQeyylEskxMWh8GIU0lJYMifL7XbqjgndTb11TYTj0xCPxnvIfU5Wbw4kCq3uAklmwDcFb7iNuy X-MS-Exchange-AntiSpam-MessageData: yQSkw2LqeoUlc/ZYk9Ski8UbP7shmi3p6woKBAaUIRaXDeCSutir5LBsthHwFWaOf/gzH6kcQhG74g+PomE29gVygnS2fGp8zuafhUw0fCaRGyXhcpQMO7Iou84MbCAIeth9MAiJkr2lF8Suh0I/syJbUZjIS1jv2YfpCYKaY4tvRm/kd/HdXGG9alFO9vBeS/vJu4vVWEAD/z6SGL/ViA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06119e87-49bb-4b4b-4862-08d7d62c859e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:00.7800 (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: fIr9lblWd1l+RDm6AVoB/qK2S/kH4IzzQJcvXjuy20xb5o92i9XpcTABrSeg/DbfbWNSPI45KNM5Pl03d2kj5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller It is not necessary to return a skb. Just getting the information if there is traffic to be sent after DTIM is sufficient. In add, the acronym "cab" (Content After (DTIM) Beacon) is used in mac80211 to designate this kind of traffic. So, make wfx_tx_queues_get_after_dtim() return a boolean and rename accordingly. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 40 ++++++++++++++++++------------------- drivers/staging/wfx/queue.h | 2 +- drivers/staging/wfx/sta.c | 4 ++-- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 046aba77618a..4ddb2c7370cd 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -264,6 +264,26 @@ unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, return ktime_us_delta(now, tx_priv->xmit_timestamp); } +bool wfx_tx_queues_has_cab(struct wfx_vif *wvif) +{ + struct wfx_dev *wdev = wvif->wdev; + struct ieee80211_tx_info *tx_info; + struct hif_msg *hif; + struct sk_buff *skb; + int i; + + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + skb_queue_walk(&wdev->tx_queue[i].queue, skb) { + tx_info = IEEE80211_SKB_CB(skb); + hif = (struct hif_msg *)skb->data; + if ((tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) && + (hif->interface == wvif->id)) + return true; + } + } + return false; +} + bool wfx_tx_queues_empty(struct wfx_dev *wdev) { int i; @@ -344,26 +364,6 @@ static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif) return &wvif->wdev->tx_queue[winner]; } -struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif) -{ - struct wfx_dev *wdev = wvif->wdev; - struct ieee80211_tx_info *tx_info; - struct hif_msg *hif; - struct sk_buff *skb; - int i; - - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - skb_queue_walk(&wdev->tx_queue[i].queue, skb) { - tx_info = IEEE80211_SKB_CB(skb); - hif = (struct hif_msg *)skb->data; - if ((tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) && - (hif->interface == wvif->id)) - return (struct hif_msg *)skb->data; - } - } - return NULL; -} - struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) { struct sk_buff *skb; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 39c265e4b86e..2c4724699ed0 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -36,9 +36,9 @@ void wfx_tx_queues_init(struct wfx_dev *wdev); void wfx_tx_queues_deinit(struct wfx_dev *wdev); void wfx_tx_queues_clear(struct wfx_dev *wdev); bool wfx_tx_queues_empty(struct wfx_dev *wdev); +bool wfx_tx_queues_has_cab(struct wfx_vif *wvif); void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); -struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif); void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 5c5b52dc7bdd..e1d7a0670c9d 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -857,7 +857,7 @@ static int wfx_update_tim(struct wfx_vif *wvif) tim_ptr[2] = 0; /* Set/reset aid0 bit */ - if (wfx_tx_queues_get_after_dtim(wvif)) + if (wfx_tx_queues_has_cab(wvif)) tim_ptr[4] |= 1; else tim_ptr[4] &= ~1; @@ -888,7 +888,7 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) { - WARN(!wfx_tx_queues_get_after_dtim(wvif), "incorrect sequence"); + WARN(!wfx_tx_queues_has_cab(wvif), "incorrect sequence"); WARN(wvif->after_dtim_tx_allowed, "incorrect sequence"); wvif->after_dtim_tx_allowed = true; wfx_bh_request_tx(wvif->wdev);