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 2D8AEC433F5 for ; Tue, 29 Mar 2022 20:11:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 132A981DDF; Tue, 29 Mar 2022 22:10:53 +0200 (CEST) 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="CoU3zRSv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0545E83FCF; Tue, 29 Mar 2022 22:09:27 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (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 CB8748407C for ; Tue, 29 Mar 2022 22:09:09 +0200 (CEST) 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 9C4F2616C8; Tue, 29 Mar 2022 20:09:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E5FAC340ED; Tue, 29 Mar 2022 20:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648584547; bh=1/yLbRQe0gRg+x9ongvOp/2wcHDydkNQLTXMKSJDmAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CoU3zRSvaPap9iEqka/P46WH0AiXr7lklCPqoAQxaeiecIz8ZiBqbsoPNnwuTiPmE KRp/ZXloaOQcVfpGy/l5BkPE5Nlf6j58sXwcpP6AM2SwaECfOtwdlaxZx3AFqmd69i gUqGz2km2bImL9tT57Cy/W8ndlWvPgalo6gsA0c5uZs6VPFvcEX1tfSIYVME+aDSsz 9DB57RlgnZbjOa2QR6RKUrwsI2+tu3Yx56kmu+GD8oB0UnGT6hjhMSSZ5wccXprBOR doLCu68xVOxTh5rQRp+7zxzDJ8MSBBBNydlzM3jB6PEF+m62O0m8ugIin0JUEmd3b2 wOKx0h6YQ+a0Q== 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?= Subject: [PATCH u-boot-net v3 12/14] net: phy: use ->is_c45 instead of is_10g_interface() Date: Tue, 29 Mar 2022 22:08:43 +0200 Message-Id: <20220329200845.13435-13-kabel@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220329200845.13435-1-kabel@kernel.org> References: <20220329200845.13435-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 Reviewed-by: Ramon Fried --- 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