Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp750152pxb; Thu, 30 Sep 2021 16:51:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHfUI8qeK0UihlI3pN6TiRp8D7dpph/zEF+68BO9iInIiz4GYoQQcfGTCjWxrvtgnhFos7 X-Received: by 2002:a63:4809:: with SMTP id v9mr7064682pga.368.1633045880043; Thu, 30 Sep 2021 16:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633045880; cv=none; d=google.com; s=arc-20160816; b=LFja+642lftZ4+4YWdPZxN5zqkxHGD/Fl5tRrxokuvilvkoy4cW3ofgeBFzYPk9FJk YuISE7BKJhX9Xphpz+qCjSiifAJk1NLhjIkGTlyOUSHw039w9xS2vpUX+n4+8GJ8swgI cg91AXQXHX9tzEQnX14dkJM6WnnNrbzjxRuX2jz993ZdmR8JL0KuIgBumqRJETLmf7Ai Ikj92+/H31N1mLgw53vqdfkcBJYidtjQ1KwJ4hs1phOv9gOM0f7NIN3lp+OJ6ORhH5K3 1Awuq7jHa/DwTxJx1zDTLKJSw3h522Siu7wjIj3eFvOxZRiohNVqd+Ap9O4ON9vtrQJm 6oiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=PTinnZB/JcWaWMAagcn0WnnMUC1kqMqlYw8++2+GjYs=; b=vNnTXOeiAe3WfUvDlEQWQICQj51TIV0kIhScE925hxd5AFWHHpkBiFiqtw/s1LAeJm X7dkbZjDGQnfwmyySAeOGE4tANYUG2yZxSBFhhusNBYK+DBiecW0OXCWVAR/1JAeqCye gkxwenE9REptU9A3s1YGmW4kdzlIXyb6mVqXv96uLYZcy3h9wPp7D8Qhyvb3u6z1jdz1 7E5rOPOejYfCqMwFETzNaFBqkqH0ZKBEQ5DnyU0OgBiTLRMwCfrbZxOO/J7gTPDO0JKE wdQnctr9SSya4pcltuGmsSfzVlBRCiycRNFA2Ku4k3v3r9+zO6jA5Ec1f2WtfG5u2g9p ilHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p21si5502885pgb.594.2021.09.30.16.51.09; Thu, 30 Sep 2021 16:51:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348832AbhI3XuC (ORCPT + 78 others); Thu, 30 Sep 2021 19:50:02 -0400 Received: from mailgw02.mediatek.com ([216.200.240.185]:13713 "EHLO mailgw02.mediatek.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbhI3XuC (ORCPT ); Thu, 30 Sep 2021 19:50:02 -0400 X-UUID: ac8af2a001ec4aa1855c14ca5df6697e-20210930 X-UUID: ac8af2a001ec4aa1855c14ca5df6697e-20210930 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 757708347; Thu, 30 Sep 2021 16:48:16 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 30 Sep 2021 16:48:14 -0700 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 1 Oct 2021 07:48:14 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v3 02/16] mt76: mt7921: refactor dma.c to be pcie specific Date: Fri, 1 Oct 2021 07:47:49 +0800 Message-ID: <8c608c4b4569e2dba681e3c15c5aa95d4fbcf705.1632961096.git.objelf@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Sean Wang This is a preliminary patch to introduce mt7921s support. make dma.c be used dedicately for mt7921e. by moving out mt7921_tx_cleanup from dma.c to mcu.c and then renaming mt7921_tx_cleanup to refect the exact thing the function actually does. Finally, dma.c totally become pcie specific one, only needed to be compiled only when CONFIG_MT7921E is enabled. Tested-by: Deren Wu Acked-by: Lorenzo Bianconi Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7921/dma.c | 8 +------- drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 7 ++++++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/dma.c b/drivers/net/wireless/mediatek/mt76/mt7921/dma.c index 802e40e42040..d3e2036a1974 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/dma.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/dma.c @@ -19,12 +19,6 @@ int mt7921_init_tx_queues(struct mt7921_phy *phy, int idx, int n_desc) return 0; } -void mt7921_tx_cleanup(struct mt7921_dev *dev) -{ - mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_WM], false); - mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_WA], false); -} - static int mt7921_poll_tx(struct napi_struct *napi, int budget) { struct mt7921_dev *dev; @@ -37,7 +31,7 @@ static int mt7921_poll_tx(struct napi_struct *napi, int budget) return 0; } - mt7921_tx_cleanup(dev); + mt7921_mcu_tx_cleanup(dev); if (napi_complete(napi)) mt7921_irq_enable(dev, MT_INT_TX_DONE_ALL); mt76_connac_pm_unref(&dev->mphy, &dev->pm); diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c index 0857d523bb06..eb27d8ab4a8b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c @@ -1386,7 +1386,7 @@ void mt7921_pm_wake_work(struct work_struct *work) mt76_for_each_q_rx(&dev->mt76, i) napi_schedule(&dev->mt76.napi[i]); mt76_connac_pm_dequeue_skbs(mphy, &dev->pm); - mt7921_tx_cleanup(dev); + mt7921_mcu_tx_cleanup(dev); if (test_bit(MT76_STATE_RUNNING, &mphy->state)) ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work, MT7921_WATCHDOG_TIME); diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h index 70c0f41180a1..a6c3661b2bdd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h @@ -316,6 +316,12 @@ static inline bool mt7921_dma_need_reinit(struct mt7921_dev *dev) return !mt76_get_field(dev, MT_WFDMA_DUMMY_CR, MT_WFDMA_NEED_REINIT); } +static inline void mt7921_mcu_tx_cleanup(struct mt7921_dev *dev) +{ + mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_WM], false); + mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_WA], false); +} + int mt7921_mac_init(struct mt7921_dev *dev); bool mt7921_mac_wtbl_update(struct mt7921_dev *dev, int idx, u32 mask); void mt7921_mac_reset_counters(struct mt7921_phy *phy); @@ -330,7 +336,6 @@ void mt7921_mac_work(struct work_struct *work); void mt7921_mac_reset_work(struct work_struct *work); void mt7921_mac_update_mib_stats(struct mt7921_phy *phy); void mt7921_reset(struct mt76_dev *mdev); -void mt7921_tx_cleanup(struct mt7921_dev *dev); int mt7921e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, enum mt76_txq_id qid, struct mt76_wcid *wcid, struct ieee80211_sta *sta, -- 2.25.1