From patchwork Fri Jul 21 11:03:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 13321877 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8548EEB64DC for ; Fri, 21 Jul 2023 11:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1lLurf5l7UEygCvnJu6P5MexRw+u9LqUqNngUj4Hyuo=; b=vuWV3nmYK09X/u /gT29FDDEboWMcu0I2JYomAfDAQbYPffPV5PEEErdng2hVxmb5mCNBK8kclx7XZkGE2Q3tCfADT5z 3vUr5qBt9DVLMlpzsSLERTeVjuV4QOef8gwnhmnCamp3yKbY1/1NiQiUn3WuOxmXW91TFReBGwxmZ qrGpUWoehmH6k6l0C24czxbEzP2ADJeGtJpd+tNU3mIcRmpHwDlUBYVQT/sycHGMg0fuQKezLEvBs ARoDyrmOLTkUBzHNP3QhiTZve90DyMPIS1ovRJ/Ql2mc3tqbHJwoHl7/mW1I/8Bqh/4socUay8Lty XzDe0IrNrkx7Xhza9Yrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qMnwO-00Ds81-2A; Fri, 21 Jul 2023 11:04:56 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMnw8-00Ds4H-1R for linux-arm-kernel@lists.infradead.org; Fri, 21 Jul 2023 11:04:42 +0000 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qMnvL-0000Ly-A7; Fri, 21 Jul 2023 13:03:51 +0200 From: Marco Felsch To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next v4 2/3] net: stmmac: introduce small helper to check STMMAC_FLAG_USE_PHY_WOL Date: Fri, 21 Jul 2023 13:03:44 +0200 Message-Id: <20230721110345.3925719-2-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230721110345.3925719-1-m.felsch@pengutronix.de> References: <20230721110345.3925719-1-m.felsch@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 X-SA-Exim-Mail-From: m.felsch@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230721_040440_478127_9FDF98A6 X-CRM114-Status: GOOD ( 11.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a convenient helper to make it easier to check the STMMAC_FLAG_USE_PHY_WOL flag which is useful for the follow up commit. Signed-off-by: Marco Felsch --- Changelog: v4: - new patch drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index e7ca52f0d2f2d..add271ec8d801 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6949,6 +6949,11 @@ static void stmmac_service_task(struct work_struct *work) clear_bit(STMMAC_SERVICE_SCHED, &priv->state); } +static bool stmmac_use_phy_wol(struct stmmac_priv *priv) +{ + return priv->plat->flags & STMMAC_FLAG_USE_PHY_WOL; +} + /** * stmmac_hw_init - Init the MAC device * @priv: driver private structure @@ -6983,7 +6988,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv) */ priv->plat->enh_desc = priv->dma_cap.enh_desc; priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up && - !(priv->plat->flags & STMMAC_FLAG_USE_PHY_WOL); + !stmmac_use_phy_wol(priv); priv->hw->pmt = priv->plat->pmt; if (priv->dma_cap.hash_tb_sz) { priv->hw->multicast_filter_bins =