Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1748991rwd; Fri, 9 Jun 2023 01:18:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ59GGVAxrsammT2nu+kAlxJmKf3fy16ccU/wPIcEpHWyNtko1X8mfaEYXornx5Bs74fQzNW X-Received: by 2002:a17:902:d2c9:b0:1b3:8aea:cac8 with SMTP id n9-20020a170902d2c900b001b38aeacac8mr240619plc.49.1686298736962; Fri, 09 Jun 2023 01:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686298736; cv=none; d=google.com; s=arc-20160816; b=K8PXFhSI1PQ9tdiX5IkNmKCxTeC8eDGg4FQ8JYXopmwUD1GSpBuVp7jml8wZmyzcu9 Co8ayHQ15BPPbENIZBxZZn9DER2u6sRBPR9b+qPGxK1JukmxZGdRamRLVp9HQuJycFWW GI9KAL5j1bh6j5Qb1F0wFG6UgQa9F1u+riZvCWpsQeldvxIxuVWHrD5pfGQV1hHmKT14 UKgs4k1qv/FCip88B4P7MhoAc6V61aF6Kpw9zmWmS1E5GERngQ6ZBdpmrHVvTHowoJ/G L/GETxRUSoLUuoQX7xQdJRV+zMVvFSmFw3WhMrOVsV0ESqzqreRF0f1r8sAk/ZZ5v0Bd Uxkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BBi/6pH6w25bQsfr9zlTlsoGIKQyreJjXZjIvmD2A0o=; b=s7ctC3CUqZC4XlhxHBJ8nGu7MeQSoyPdrXLv8TNufdHCnBMnrLhxX7pWpEGzScE9YB VUJzH0Ap8Nwd9vfQcLn8XtCIB2P8R6dPJcbY+ku3Li22VGuFp+yciuaw9RRQA6NX/hig fdsJMUvK1WaUvWxZSvq35QhaF0wLtO4wACopcTfcrhhzcJKimZWq8ODgPFbWZ4wpAQlS +2w1fTtZBwVA6pWsF+6u6TTxqnMccyErirbmf0tV/2HNrvif0QK3Dy9PU5kFw6LwQEk6 HM3Cn8w4h8J3FDkutsfGDZ/e70Ie11ah0TsjMEwmV4yTVjnLjZPiG25VDFUz+5WTpEpp P/5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bHX1psFM; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a170903304200b001ab1411f3e6si2288687pla.260.2023.06.09.01.18.49; Fri, 09 Jun 2023 01:18:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bHX1psFM; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238452AbjFIIQm (ORCPT + 62 others); 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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]; -- 2.40.1