From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 852DDC433EF for ; Thu, 17 Mar 2022 12:53:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B179083F6C; Thu, 17 Mar 2022 13:52:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="NDBjfgGZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 22C8483CDF; Thu, 17 Mar 2022 13:51:02 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5F02B83D14 for ; Thu, 17 Mar 2022 13:50:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 33CB861240; Thu, 17 Mar 2022 12:50:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EC28C36AE2; Thu, 17 Mar 2022 12:50:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647521437; bh=NA5897i0E3IlvHr1C76hOG1sCHnffnMfyPqlkuDZPRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NDBjfgGZf9x93BdY4ffvkFQ2bmZXBpy054+dz9wWOxuU93R8lw6XPb0I1+Ew3sAVe rnIOqxblhRzuXtkwccEH5/WLYC2UB3q5mgwo4aK8IBzMtVg8bFmoO3ghuugwm2rzKU r6aAqqEbOWU3TQ0vKK3o9vMCi7Xk471XDyTsPhjZZtAkH27wz6NiEUGJO2k7Qikpvg XqHyZg7kcEU02Te/3GV3/cayuxT+N6yjdcYhJP1U/MssT0YAh0kzArUckEw1FkTc4Z UpGuMZXybRIlRJysO+1wrNQH1eBeOiObFJvno7+RVNAzoNGOHtoRyGlfLmEllfq848 wj3OtfQAqA1JA== From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: Joe Hershberger , Ramon Fried Cc: u-boot@lists.denx.de, =?UTF-8?q?Marek=20Beh=C3=BAn?= , Bin Meng , Michal Simek , Priyanka Jain , "Radu Pirea (NXP OSS)" , Vladimir Oltean , Wolfgang Denk Subject: [PATCH u-boot-net 12/14] net: phy: use ->is_c45 instead of is_10g_interface() Date: Thu, 17 Mar 2022 13:49:56 +0100 Message-Id: <20220317124958.27921-13-kabel@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220317124958.27921-1-kabel@kernel.org> References: <20220317124958.27921-1-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean From: Marek BehĂșn Use phydev->is_c45 instead of is_10g_interface(phydev->interface) to determine whether clause 45 protocol should be used. Signed-off-by: Marek BehĂșn --- drivers/net/phy/phy.c | 8 ++++---- include/phy.h | 12 ------------ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 4109676a51..10c724388f 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -632,10 +632,10 @@ static int phy_probe(struct phy_device *phydev) return err; } -static struct phy_driver *generic_for_interface(phy_interface_t interface) +static struct phy_driver *generic_for_phy(struct phy_device *phydev) { #ifdef CONFIG_PHYLIB_10G - if (is_10g_interface(interface)) + if (phydev->is_c45) return &gen10g_driver; #endif @@ -656,7 +656,7 @@ static struct phy_driver *get_phy_driver(struct phy_device *phydev, } /* If we made it here, there's no driver for this PHY */ - return generic_for_interface(interface); + return generic_for_phy(phydev); } static struct phy_device *phy_device_create(struct mii_dev *bus, int addr, @@ -859,7 +859,7 @@ int phy_reset(struct phy_device *phydev) #ifdef CONFIG_PHYLIB_10G /* If it's 10G, we need to issue reset through one of the MMDs */ - if (is_10g_interface(phydev->interface)) { + if (phydev->is_c45) { if (!phydev->mmds) gen10g_discover_mmds(phydev); diff --git a/include/phy.h b/include/phy.h index dee8fb5f2e..9742ce6fe1 100644 --- a/include/phy.h +++ b/include/phy.h @@ -359,18 +359,6 @@ static inline int phy_clear_bits_mmd(struct phy_device *phydev, int devad, #ifdef CONFIG_PHYLIB_10G extern struct phy_driver gen10g_driver; - -/* - * List all 10G interfaces here, the assumption being that PHYs on these - * interfaces are C45 - */ -static inline int is_10g_interface(phy_interface_t interface) -{ - return interface == PHY_INTERFACE_MODE_XGMII || - interface == PHY_INTERFACE_MODE_USXGMII || - interface == PHY_INTERFACE_MODE_10GBASER; -} - #endif /** -- 2.34.1