From patchwork Mon Jan 29 13:02:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Choong Yong Liang X-Patchwork-Id: 13535615 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 7D52BC47422 for ; Mon, 29 Jan 2024 13:05:48 +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=1PSjKphJOzxPvN3UvNj5WNM7Y5Cho/XqNjeUndmJEJE=; b=aT9Q3fntHpaOS+ U8eMRKqvJeqwF1JQ36fs4F96DL49SYYFCeM09qh0mn9kOWuWdleHnKi0g4mKnNSacf+Fe4oBtcYH2 tLSdM273K+W6He+ZV/whEpdFhgw+mE0W006oHvs475T827Ig86/UqXGElPZ7HKGR06MRZnzdyOBtC Ia1vE3Qp190SCiX2whxtLRVks6g+EbXQAnl5scW0NcftC7eeeoH81JSkhm7ZHL3tEPiCJyoB1c4EJ FnPZL6317k+hKko3DZIGZGFzB5MpMK72URZkt43yNqXdBcir74EjlaHnGFPTerxbUas0Px5LzF9KL DbZwlDuFMBaTjnVJJ5xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rURKP-0000000ClNF-3ufS; Mon, 29 Jan 2024 13:05:33 +0000 Received: from mgamail.intel.com ([198.175.65.9]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rURKH-0000000ClIV-0ptm for linux-arm-kernel@lists.infradead.org; Mon, 29 Jan 2024 13:05:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706533526; x=1738069526; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6NUJxzq+XVvVj6pNMncMX5L9x6cZh5iXbnFwIH3E42c=; b=hLHzItpVaeDBrdZ+DaFZZyKzvVUR4rZ4EmkzGyr1e8hf9pQyCi2fFAkM vul8k9YZCzGb5piEm7FbiJWee2Z9sHBfJKlOVuOadKbdXnx6Hama52UJg 7oLDH43fNk5h3GUTSrkrXbSv4j7UwtT0WiimUOQmyFN9HvqyBLIZOgxxy 4gswoiSZ+nvTZ24YnCBtCIFMSP9VB6nfofY4Vw01O5vLUY/xValLxfjqW XN/vpilkKLXFNflR6ZO7T0mPyiyuUtWwbMJ8piqwrGN7S+XYemnT3WCIT YIyKGX+ioGSkSauuJ+cC76G0RqvPxON8kdWPNQuk1Q++sPUyWTNaMMquB A==; X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="21473334" X-IronPort-AV: E=Sophos;i="6.05,227,1701158400"; d="scan'208";a="21473334" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2024 05:05:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="907106724" X-IronPort-AV: E=Sophos;i="6.05,227,1701158400"; d="scan'208";a="907106724" Received: from yongliang-ubuntu20-ilbpg12.png.intel.com ([10.88.229.33]) by fmsmga002.fm.intel.com with ESMTP; 29 Jan 2024 05:05:17 -0800 From: Choong Yong Liang To: Rajneesh Bhardwaj , David E Box , Hans de Goede , Mark Gross , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Richard Cochran , Russell King , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Andrew Lunn , Heiner Kallweit , Philipp Zabel Cc: Andrew Halaney , Simon Horman , Serge Semin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org, bpf@vger.kernel.org, Voon Wei Feng , Michael Sit Wei Hong , Lai Peter Jun Ann , Abdul Rahim Faizal Subject: [PATCH net-next v4 02/11] net: stmmac: provide allow_switch_interface flag Date: Mon, 29 Jan 2024 21:02:44 +0800 Message-Id: <20240129130253.1400707-3-yong.liang.choong@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129130253.1400707-1-yong.liang.choong@linux.intel.com> References: <20240129130253.1400707-1-yong.liang.choong@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240129_050525_360287_4F28E770 X-CRM114-Status: GOOD ( 14.48 ) 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 Provide the allow_switch_interface flag to indicate the platform supports interface mode switching. Signed-off-by: Choong Yong Liang --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 ++++- include/linux/stmmac.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index a0e46369ae15..d1ec075ae10a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1222,9 +1222,12 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) priv->phylink_config.mac_managed_pm = true; mdio_bus_data = priv->plat->mdio_bus_data; - if (mdio_bus_data) + if (mdio_bus_data) { priv->phylink_config.ovr_an_inband = mdio_bus_data->xpcs_an_inband; + priv->phylink_config.allow_switch_interface = + mdio_bus_data->allow_switch_interface; + } /* Set the platform/firmware specified interface mode. Note, phylink * deals with the PHY interface mode, not the MAC interface mode. diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index dee5ad6e48c5..b99d11f4ff26 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -87,6 +87,7 @@ struct stmmac_mdio_bus_data { int *irqs; int probed_phy_irq; bool needs_reset; + bool allow_switch_interface; }; struct stmmac_dma_cfg {