Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp49028pxb; Tue, 14 Sep 2021 18:18:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2M63t5OH9kC/UvNWdBKFNyUGGhohnY3FSDL1yFcm47c8cehbi6bT+n45tmaRvDoSatAQy X-Received: by 2002:a2e:b5d0:: with SMTP id g16mr17735500ljn.349.1631668715803; Tue, 14 Sep 2021 18:18:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631668715; cv=none; d=google.com; s=arc-20160816; b=xpfRG1fe42iT2GM8JPyyk+9RjnMyW97JpeiLAp3aE8peHxfZ5v2wzc1bRkEe/xSDso TCwEicdgATqfooUPLurZ/0iSkJRSKaGwYSJ2Dy6Dlh4F/3CA/yb3T/uEDT29/yanb4EG RYasARw676Ldcs9+aY1rXmy8GbAWQDIshzpmkl0fG4Thz2TeHkN0vVfb+pVGR3PnbEWz N5glhmV2v4+b11S9FgIvNes42dWt68XwDOPl1muNSU6IIoEzt6RqXct0CRnFrxFqZ+Su P0bu/SxIi5OHvuDAIMcAacKbtvkUpNaFQLXsu7OUD2c8EuMp5VUZ4pvgeKKHKoNIANsw sG/g== 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=VPFxTmNOd2MM8Og2Nenru0zyCK4v+oY6K65TC1zRL7I=; b=0A8cae575/JBYIt2tfiz3M60Kd0zsg1vpMhJU0eMhaVt+jk4E3NOoAqkP6bH4OQABr FYUbM5LA2OGTbzfLEqEM7/Zkp+/oXPJZlpkLa8WE1KDQUt9z6dCoaCsiVg08YLeTW+Nc R33J6tBj+5Z5YmaTo3QtJsj473b3sCyKAPcWoiMaFf+nLl7FrGYaJ7oadJ0rTgKe92rp jbKTGZVVILiM4qUHfxJBDQETKpp69jaeEKa9Gw0Ikn/ydMo0R1ycr2aMN82W/CZnzbj1 jADExRZqknDJOzG6eAsaxh2KZsM8HM2ZdGSW/EtrMAu+IuqzxTB2vVBgqGw+k90UfMaS Vxlg== 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 p15si14139099ljc.427.2021.09.14.18.17.48; Tue, 14 Sep 2021 18:18:35 -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 S232218AbhIOBQa (ORCPT + 99 others); Tue, 14 Sep 2021 21:16:30 -0400 Received: from mailgw02.mediatek.com ([216.200.240.185]:7170 "EHLO mailgw02.mediatek.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230408AbhIOBQ3 (ORCPT ); Tue, 14 Sep 2021 21:16:29 -0400 X-UUID: 07c222a4f3814261ad65154d0380a8f0-20210914 X-UUID: 07c222a4f3814261ad65154d0380a8f0-20210914 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 221330748; Tue, 14 Sep 2021 18:15:11 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Sep 2021 18:15:09 -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; Wed, 15 Sep 2021 09:15:09 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 02/16] mt76: mt7921: refactor dma.c to be pcie specific Date: Wed, 15 Sep 2021 09:14:35 +0800 Message-ID: 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 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/mcu.c | 6 ++++++ drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 2 +- 4 files changed, 9 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 d811702a3a2c..580a88b7841e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c @@ -1392,7 +1392,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/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c index ecdc879216b9..6ba431347b3b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c @@ -1369,3 +1369,9 @@ int mt7921_get_txpwr_info(struct mt7921_dev *dev, struct mt7921_txpwr *txpwr) return 0; } + +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); +} diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h index 70c0f41180a1..4c1c7c4eafac 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h @@ -330,7 +330,7 @@ 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); +void mt7921_mcu_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