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: 193605 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp709990dyb; Mon, 29 Jan 2024 09:15:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaMQcoUf02Us3FnNHChbxeMMP7CmYbL3/WYVBuNRcAVBjmihx8kCtNBrXiDJYOly096jFd X-Received: by 2002:a05:6122:1c10:b0:4bd:8283:4680 with SMTP id et16-20020a0561221c1000b004bd82834680mr2341181vkb.26.1706548520334; Mon, 29 Jan 2024 09:15:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706548520; cv=pass; d=google.com; s=arc-20160816; b=TofcNAf6iIgrWI0VHBdsuYcNxQAnA/Lecn9/9lYYqE/9QyrLcNK9MQRIWNu5aJhCQT PKG3UDmt1O4WlaKr2+A3J4Q+SIa9KSzQ/3VydCeOl46YE3i4CHAMULGZusa+z3isLlyR z0lO/87yl/ceS2LPIArhjX9Q5G60FJ6czDIAyIyL+plw8HZlYYX6vCOW/2DfabZXVQ6e griJu9jODu8ft351OsF7V4jkzcTc2QFZnxG0zV6YskMsBV4KVXKf6ZT96+29/5tGzZkt Mw7eUNT881RU6U9R7btGkO26/pYnuIO7sgGiwz3XiZhXkoY/I/hfcIfGOQpXnOjulZFm QjwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vdrLaV397LchfCYxU1IaTxcVFRt4r8mvvBYlM75u8Nk=; fh=/YJd8cagnZyj8HxcDZG6YnlmNxAW8XcSWCpxhbbfMGA=; b=DLmiWdxbnN9TYjfXucGJ70mHWIi1Neyxxro6m15qWvS3wwQTKSj+tQBIX83zhGA3xM bA/p3tMthz4b1zw0lTFqbbDS7lyLBvxOpj/ddHq1v0KTj6zLLVhLWeX14BznSr8HeTF/ XDqYN2g1ZmaSV/gd5kc9GYOwNKDy9VHHiPcvCmj1hH5y/aV4ws510y9ePutLS1j4aEEV yCh/KGoxm1H6UxvnjKwr4YBn+jkiZJ8igroiBX9s0437bP5S5FIyGm1kRAnNOR+DcHe/ zOQ1RCoHJI6x2VK1YzmXX4G73OrsFe7eFoGuubLF4bk9kfsMQ/Bnm1R37uWXH6R5R5JR JY3Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hLHzItpV; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42748-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42748-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i15-20020a056122208f00b004b6bbb03fd7si968165vkd.322.2024.01.29.09.15.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 09:15:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42748-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hLHzItpV; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42748-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42748-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 733FD1C233DC for ; Mon, 29 Jan 2024 13:06:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E2DC64AA3; Mon, 29 Jan 2024 13:05:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hLHzItpV" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 703A96280A; Mon, 29 Jan 2024 13:05:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706533526; cv=none; b=TEn+6e3ppKYhSuWORN0ebf4161CP0/Q2q3SOT/+qcRNvGmfkLyxWYcRZf3492B/LM9l5hkWILGy2kLGl1LmdCE6XMSX6R+TDTADYZSoeR66Zg8EEV6/jzDkJM8Cc1/T/r/47GA9frK12DtLB/XtV9x+4j6hdE//++CKVA2DP/+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706533526; c=relaxed/simple; bh=6NUJxzq+XVvVj6pNMncMX5L9x6cZh5iXbnFwIH3E42c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QguaieeaeoFXFTCcajY2txKXvsD7QTKgKIBvNWRwM8OgfYXkOC60M616y8WrifKHvtKQaV6AO7sm/1KuxB+aQ2XDdBXbdUl2xkW/bpKmYOuV6xL26XiMj3X4dJ7XRrpLQHBv4wyVMYzlr7wcPpev2P1kM28+cW+3lH5K72Zxlaw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hLHzItpV; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com 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="21473347" X-IronPort-AV: E=Sophos;i="6.05,227,1701158400"; d="scan'208";a="21473347" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789445821290187857 X-GMAIL-MSGID: 1789445821290187857 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 {