From patchwork Fri Jun 9 08:15:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13273431 X-Patchwork-Delegate: nbd@nbd.name Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDF60C7EE25 for ; Fri, 9 Jun 2023 08:16:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238452AbjFIIQm (ORCPT ); Fri, 9 Jun 2023 04:16:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240134AbjFIIQk (ORCPT ); Fri, 9 Jun 2023 04:16:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71DAF30DB for ; Fri, 9 Jun 2023 01:16:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0F3E860C00 for ; Fri, 9 Jun 2023 08:16:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20B42C433D2; Fri, 9 Jun 2023 08:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686298588; bh=yKZz2ZsDU1MyM56KnR6CGsLopFqK07krZu9V+BDDPP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bHX1psFMX7vFGOaXXjhCKYnMd3/AW4DcrwML/VuYmA3SyXbYd3mqH6fKsw0pDCfHc 3ngjYIhMCV6bV9pVpjHlypHdyQBalu61dC2Yn2744O717SH1KrfYdSb0D8sVy6gnIA LXKuo5iggpBUsiTv58o2qpAzKXz0kPwNpd/4SUoOklHNm8kzbtCLcuQvq5W5c5UKUB VF5ZL09YIcAalM8ElbsyGx+gDrKprlevb4qoCXS+43KAmjJAMBQE6fM1EWkug5a6rR 7x8bbZqo7d3zl8UgnGb3++WtrFITJn2Eg8PnXfh943kBLiHyegW3RZEivVVZCDBFGn I4jezfhGWjxTg== From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org Subject: [PATCH v2 09/15] wifi: mt76: mt7996: rely on shared poll_list field Date: Fri, 9 Jun 2023 10:15:38 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Rely on poll_list field in mt76_wcid structure and get rid of private copy. Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7996/mac.c | 16 ++++++++-------- drivers/net/wireless/mediatek/mt76/mt7996/main.c | 12 ++++++------ .../net/wireless/mediatek/mt76/mt7996/mt7996.h | 1 - 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c index 18249572cb2e..5e1f26d3c5ad 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c @@ -130,8 +130,8 @@ static void mt7996_mac_sta_poll(struct mt7996_dev *dev) break; } msta = list_first_entry(&sta_poll_list, - struct mt7996_sta, poll_list); - list_del_init(&msta->poll_list); + struct mt7996_sta, wcid.poll_list); + list_del_init(&msta->wcid.poll_list); spin_unlock_bh(&dev->mt76.sta_poll_lock); idx = msta->wcid.idx; @@ -682,8 +682,8 @@ mt7996_mac_fill_rx(struct mt7996_dev *dev, struct sk_buff *skb) msta = container_of(status->wcid, struct mt7996_sta, wcid); spin_lock_bh(&dev->mt76.sta_poll_lock); - if (list_empty(&msta->poll_list)) - list_add_tail(&msta->poll_list, + if (list_empty(&msta->wcid.poll_list)) + list_add_tail(&msta->wcid.poll_list, &dev->mt76.sta_poll_list); spin_unlock_bh(&dev->mt76.sta_poll_lock); } @@ -1288,8 +1288,8 @@ mt7996_mac_tx_free(struct mt7996_dev *dev, void *data, int len) msta = container_of(wcid, struct mt7996_sta, wcid); spin_lock_bh(&mdev->sta_poll_lock); - if (list_empty(&msta->poll_list)) - list_add_tail(&msta->poll_list, + if (list_empty(&msta->wcid.poll_list)) + list_add_tail(&msta->wcid.poll_list, &mdev->sta_poll_list); spin_unlock_bh(&mdev->sta_poll_lock); continue; @@ -1497,8 +1497,8 @@ static void mt7996_mac_add_txs(struct mt7996_dev *dev, void *data) goto out; spin_lock_bh(&dev->mt76.sta_poll_lock); - if (list_empty(&msta->poll_list)) - list_add_tail(&msta->poll_list, &dev->mt76.sta_poll_list); + if (list_empty(&msta->wcid.poll_list)) + list_add_tail(&msta->wcid.poll_list, &dev->mt76.sta_poll_list); spin_unlock_bh(&dev->mt76.sta_poll_lock); out: diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c index ecac04066fda..1a5d646631a6 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c @@ -200,7 +200,7 @@ static int mt7996_add_interface(struct ieee80211_hw *hw, idx = MT7996_WTBL_RESERVED - mvif->mt76.idx; INIT_LIST_HEAD(&mvif->sta.rc_list); - INIT_LIST_HEAD(&mvif->sta.poll_list); + INIT_LIST_HEAD(&mvif->sta.wcid.poll_list); mvif->sta.wcid.idx = idx; mvif->sta.wcid.phy_idx = band_idx; mvif->sta.wcid.hw_key_idx = -1; @@ -263,8 +263,8 @@ static void mt7996_remove_interface(struct ieee80211_hw *hw, mutex_unlock(&dev->mt76.mutex); spin_lock_bh(&dev->mt76.sta_poll_lock); - if (!list_empty(&msta->poll_list)) - list_del_init(&msta->poll_list); + if (!list_empty(&msta->wcid.poll_list)) + list_del_init(&msta->wcid.poll_list); spin_unlock_bh(&dev->mt76.sta_poll_lock); mt76_packet_id_flush(&dev->mt76, &msta->wcid); @@ -632,7 +632,7 @@ int mt7996_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif, return -ENOSPC; INIT_LIST_HEAD(&msta->rc_list); - INIT_LIST_HEAD(&msta->poll_list); + INIT_LIST_HEAD(&msta->wcid.poll_list); msta->vif = mvif; msta->wcid.sta = 1; msta->wcid.idx = idx; @@ -668,8 +668,8 @@ void mt7996_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif, mt7996_mac_twt_teardown_flow(dev, msta, i); spin_lock_bh(&mdev->sta_poll_lock); - if (!list_empty(&msta->poll_list)) - list_del_init(&msta->poll_list); + if (!list_empty(&msta->wcid.poll_list)) + list_del_init(&msta->wcid.poll_list); if (!list_empty(&msta->rc_list)) list_del_init(&msta->rc_list); spin_unlock_bh(&mdev->sta_poll_lock); diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h b/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h index 9be7a5f80f4d..e1ab38bf9118 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h @@ -95,7 +95,6 @@ struct mt7996_sta { struct mt7996_vif *vif; - struct list_head poll_list; struct list_head rc_list; u32 airtime_ac[8];