From patchwork Thu Aug 19 13:11:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerhard Engleder X-Patchwork-Id: 12447199 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F32CC4338F for ; Thu, 19 Aug 2021 13:12:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBF4B61101 for ; Thu, 19 Aug 2021 13:12:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239788AbhHSNNE (ORCPT ); Thu, 19 Aug 2021 09:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239655AbhHSNND (ORCPT ); Thu, 19 Aug 2021 09:13:03 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B98EC061575 for ; Thu, 19 Aug 2021 06:12:27 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id z9so9017836wrh.10 for ; Thu, 19 Aug 2021 06:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=engleder-embedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M5wvJU9nS0PBB383gj3PbquvMXX21vpI+F/H85bw73U=; b=nY708PVkbDn8F0pt3wBszkImYQJSAayIW0moQApvzeC/1QHnWzlKaV+fDxpQlhtN3U lk90ItknFP7bNOy8nxXWhS5er17Dsfe+m/2locNt3/ar746M/DUFJPoOCEmoif52JBcX 5l6MyamVs0E3g3cotx0avwrit1yBDHKpumRA/vtD4HcwlqDJg4LtWICJgEM2/fepLx5H pJZGyBo3SjRTz8nBNshElBlHb6I/U0YpgL5vnHiUh1FUEbJJPZ6tN5aSh7js/Be112Y/ xImYBIeFXQDxiL0GXmJeGIpZ0yILeFYf09fP+dW0R1669tKcuZJKlAYfANJJ2HJDaLgd XuYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M5wvJU9nS0PBB383gj3PbquvMXX21vpI+F/H85bw73U=; b=MAV6rc+msNhFogTga4OY9QXidaHWKYbdwQEhhn75r1qAV/rj9cPdgkL2vUTc6rhAx+ 9jTinKb1Jitr5DOr2nPnBYqyx/sGGbU9DnjEf3RwAnQ/AJaAB9RhB03l5TeBnOku8z+K 1S8rT5sAIrwf2WyKuSg/JuQ4MyP2tRRIP0ffHm/8fVQHXxmcSseTP0q527j0BtPbaI5x BYDeTl5YX9ULoXK+j4f3o9AD63e9UfQIEPFAmjdXPLeFTpC82AOgh3f8PSwVtJseeTSk lTj5BlTqF7yR7868Tr5PstMpsCz6ceUVZ3itoC4IXIlyJgAoMRW6cC+HviduV8WUsmqj Y/Xw== X-Gm-Message-State: AOAM530fxvY3Pq/fS5pug7OdulUZO29p2LCHrl/rQyMJGjVZfYrIB1b1 XZUw+t0w0yZgYKnJgpNRQ5etfA== X-Google-Smtp-Source: ABdhPJyAHLVBC4VmVfk/H47m2iMI9lVeLmXc0y2wiUNxH9/Gk0GyS0VJBRQXpDiqed+L5MQnYDyDIg== X-Received: by 2002:adf:de83:: with SMTP id w3mr3860087wrl.342.1629378745700; Thu, 19 Aug 2021 06:12:25 -0700 (PDT) Received: from hornet.engleder.at (dynamic-2el0lv6sxxeorz8a81-pd01.res.v6.highway.a1.net. [2001:871:23a:b9:6e3b:e5ff:fe2c:34c1]) by smtp.gmail.com with ESMTPSA id d4sm3087088wrc.34.2021.08.19.06.12.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 06:12:25 -0700 (PDT) From: Gerhard Engleder To: andrew@lunn.ch Cc: netdev@vger.kernel.org, Gerhard Engleder Subject: [PATCH net-next v2 1/3] net: phy: Support set_loopback override Date: Thu, 19 Aug 2021 15:11:52 +0200 Message-Id: <20210819131154.6586-2-gerhard@engleder-embedded.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210819131154.6586-1-gerhard@engleder-embedded.com> References: <20210819131154.6586-1-gerhard@engleder-embedded.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org phy_read_status and various other PHY functions support PHY specific overriding of driver functions by using a PHY specific pointer to the PHY driver. Add support of PHY specific override to phy_loopback too. Signed-off-by: Gerhard Engleder --- drivers/net/phy/phy_device.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 107aa6d7bc6b..ba5ad86ec826 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1821,11 +1821,10 @@ EXPORT_SYMBOL(phy_resume); int phy_loopback(struct phy_device *phydev, bool enable) { - struct phy_driver *phydrv = to_phy_driver(phydev->mdio.dev.driver); int ret = 0; - if (!phydrv) - return -ENODEV; + if (!phydev->drv) + return -EIO; mutex_lock(&phydev->lock); @@ -1839,8 +1838,8 @@ int phy_loopback(struct phy_device *phydev, bool enable) goto out; } - if (phydrv->set_loopback) - ret = phydrv->set_loopback(phydev, enable); + if (phydev->drv->set_loopback) + ret = phydev->drv->set_loopback(phydev, enable); else ret = genphy_loopback(phydev, enable); From patchwork Thu Aug 19 13:11:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerhard Engleder X-Patchwork-Id: 12447201 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDB7BC4338F for ; Thu, 19 Aug 2021 13:12:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D93B86112D for ; Thu, 19 Aug 2021 13:12:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239790AbhHSNNI (ORCPT ); Thu, 19 Aug 2021 09:13:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239794AbhHSNNH (ORCPT ); Thu, 19 Aug 2021 09:13:07 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C69F1C061575 for ; Thu, 19 Aug 2021 06:12:30 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id x12so9018914wrr.11 for ; Thu, 19 Aug 2021 06:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=engleder-embedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V09boSFG66nz8jPL2ItfwtlzK7dZXPHZLQbwCkrST28=; b=o8fK1m3ttjkL4PWcg9GbTcBzaZMP2B2d0mmLqVkR82YcS70BVKRa3L4O0GNXZGOrgP hhP9y0VY0dTUz/lnJh9PWmMnEWwNwOe5TmEolP88YG8CdEUT8TU4GqtImS1htQZHRiDI kG05kYVxn3PQvcCWnhUvZIsGXR1EnI9YJm9KstIEfrpK/l3zUpthVFzVBxN4N39jP/sX /4GRqM3xR6LGHAg6js/35OxlcAeK2UsdLF1bitMaNxeSNqNPVt8w3nNt6NSipM2KjS3u ktxUssRWCcoSnNVM+dImZt5wRxyklMfubzaIJaNX9momWbTMPKF4Mpx1jnu5dZsBRZuw sF/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V09boSFG66nz8jPL2ItfwtlzK7dZXPHZLQbwCkrST28=; b=OlFrfEjiuIYvYCfQgrq1MV0/sE+b/mIyBo//rwKfovkC2FgZsZTqWtsfM+NQaBlHjg 8DZphTm12wXtuXdSzG+EP12CbswPm2BnzEyrFYW1t/BEb6XaMkPy0nOx3XFnnFk8U7pU C08mBiXWZj57Au4/oeet4gw+RKhENfwan9T3dxxCPKaOb7fuEGoyChDS62rhYdgag+vr H8LX+7sPM5kFgVOx5OWvj7zlW92xaM2aaaRETUW5y5OS0KUF2rn3ncaHCxWe+DVlMTDy vDZYeQSwWSfxPvrg0Xod7xZQfIxZMbKk6p5TXML7Iu5ANgaChM0TZ31OAkJ7AsIyDjtF Ncdw== X-Gm-Message-State: AOAM531RtO0tPhWKec1wAFi375azoDfQIDs7vERuXEkO4Q8HKXeAJ0VK s2Ovxk8LXTEp2KrKUF9a3B73vQ== X-Google-Smtp-Source: ABdhPJzVPprl4Ghl6UnsNll/DcE2oidNlSshbGPael1zWBN8Zwx/CkhTcVSIMyzbYsPCaB9EvCjKIA== X-Received: by 2002:a5d:4088:: with SMTP id o8mr3761276wrp.34.1629378749495; Thu, 19 Aug 2021 06:12:29 -0700 (PDT) Received: from hornet.engleder.at (dynamic-2el0lv6sxxeorz8a81-pd01.res.v6.highway.a1.net. [2001:871:23a:b9:6e3b:e5ff:fe2c:34c1]) by smtp.gmail.com with ESMTPSA id d4sm3087088wrc.34.2021.08.19.06.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 06:12:29 -0700 (PDT) From: Gerhard Engleder To: andrew@lunn.ch Cc: netdev@vger.kernel.org, Gerhard Engleder Subject: [PATCH net-next v2 2/3] net: phy: Uniform PHY driver access Date: Thu, 19 Aug 2021 15:11:53 +0200 Message-Id: <20210819131154.6586-3-gerhard@engleder-embedded.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210819131154.6586-1-gerhard@engleder-embedded.com> References: <20210819131154.6586-1-gerhard@engleder-embedded.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org struct phy_device contains a pointer to the PHY driver and nearly everywhere this pointer is used to access the PHY driver. Only mdio_bus_phy_may_suspend() is still using to_phy_driver() instead of the PHY driver pointer. Uniform PHY driver access by eliminating to_phy_driver() use in mdio_bus_phy_may_suspend(). Only phy_bus_match() and phy_probe() are still using to_phy_driver(), because PHY driver pointer is not available there. Signed-off-by: Gerhard Engleder --- drivers/net/phy/phy_device.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index ba5ad86ec826..9e2891d8e8dd 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -233,11 +233,9 @@ static DEFINE_MUTEX(phy_fixup_lock); static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) { - struct device_driver *drv = phydev->mdio.dev.driver; - struct phy_driver *phydrv = to_phy_driver(drv); struct net_device *netdev = phydev->attached_dev; - if (!drv || !phydrv->suspend) + if (!phydev->drv->suspend) return false; /* PHY not attached? May suspend if the PHY has not already been From patchwork Thu Aug 19 13:11:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerhard Engleder X-Patchwork-Id: 12447203 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19A3BC4338F for ; Thu, 19 Aug 2021 13:12:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 023766108E for ; Thu, 19 Aug 2021 13:12:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239799AbhHSNNP (ORCPT ); Thu, 19 Aug 2021 09:13:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239808AbhHSNNJ (ORCPT ); Thu, 19 Aug 2021 09:13:09 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 234C1C061756 for ; Thu, 19 Aug 2021 06:12:33 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id f9-20020a05600c1549b029025b0f5d8c6cso6779465wmg.4 for ; Thu, 19 Aug 2021 06:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=engleder-embedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=41vzQz17yY023l5WeMyfnRBC0yKCfFsWSJLJ4kmuWB0=; b=uIvVIpuYUYl+rROb47a8U0dUIX8Q/zFRZJIti5ypNef2+0vn6pZR//V4FX+TpTKsRR lJWb0CqCIpzs2p4sX23CaD4LutIIvHQwKbllk1lk0m6AdcyDlPKscgU8cXm7DJpGkNKT XBwPWP+sE9Q+7F7aVH8SXpjHntybx9MtUFKCQE7Fxp8FPKfbexaL7ZPntE8cE65ZHq7o tyVdiCg9MjK6vfaBomdoxNfGQYX/FqKiIhbHgGfj0niLa4pcOXhS2GcnJc1gu6nFxS/v JgVzAGozJEbnzTitPNLKoyytxBPPB+DWsBm1NKXV6j8qRF/7XOygtZ9rMdoRyMfxLmXQ aY2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=41vzQz17yY023l5WeMyfnRBC0yKCfFsWSJLJ4kmuWB0=; b=CvX5i/v61J1l3dn5aFwIR07MSwucMU1Cy4MRQp/AVsTPD7MIWeyE9rebBdPZKLQTiw vVX1GXyYr+ZnEhI2Aeep4Gxv2vEGLh3p3lthrU1cW4QkhhwIVPxmPvs8d/M59YrWf3A+ CNAt3CqYkN7eHnuXPH/1Px7mdtCbARTEOGKTnwhxAAr1afTxQKJbHtHY4ZdOMvfmT+Jp sboVcrDBK45x0syTLAO345o/p7sgcp9B/COAsgqig8yAv8FaN+04zoGT2ZGAw3JEqBlc ANHGLw4xNYNvhnHtf0jVPb7IuMp+fgtQQ+6iEBMpEx6M1CPFZRCtuE2xOSZWG7hvBlxC HiUA== X-Gm-Message-State: AOAM532NBIaP2em6k6pZ8uhWbaoAELaO+3/Yw/cCuNTaXdUV7b1nHppd 0Cvja53E7nQ5M9vL+5Vmxp+VYQ== X-Google-Smtp-Source: ABdhPJx7p/Q2U170DrSuVWLkIvnIE64c+YJs/hMeV7g4n9/p7kNXo73GDAgkVyFuVjQiSgr5a50mNQ== X-Received: by 2002:a05:600c:4ec8:: with SMTP id g8mr11921627wmq.34.1629378751790; Thu, 19 Aug 2021 06:12:31 -0700 (PDT) Received: from hornet.engleder.at (dynamic-2el0lv6sxxeorz8a81-pd01.res.v6.highway.a1.net. [2001:871:23a:b9:6e3b:e5ff:fe2c:34c1]) by smtp.gmail.com with ESMTPSA id d4sm3087088wrc.34.2021.08.19.06.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 06:12:31 -0700 (PDT) From: Gerhard Engleder To: andrew@lunn.ch Cc: netdev@vger.kernel.org, Gerhard Engleder Subject: [PATCH net-next v2 3/3] net: phy: gmii2rgmii: Support PHY loopback Date: Thu, 19 Aug 2021 15:11:54 +0200 Message-Id: <20210819131154.6586-4-gerhard@engleder-embedded.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210819131154.6586-1-gerhard@engleder-embedded.com> References: <20210819131154.6586-1-gerhard@engleder-embedded.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Configure speed if loopback is used. read_status is not called for loopback. Signed-off-by: Gerhard Engleder --- drivers/net/phy/xilinx_gmii2rgmii.c | 46 ++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c index 151c2a3f0b3a..8dcb49ed1f3d 100644 --- a/drivers/net/phy/xilinx_gmii2rgmii.c +++ b/drivers/net/phy/xilinx_gmii2rgmii.c @@ -27,12 +27,28 @@ struct gmii2rgmii { struct mdio_device *mdio; }; -static int xgmiitorgmii_read_status(struct phy_device *phydev) +static void xgmiitorgmii_configure(struct gmii2rgmii *priv, int speed) { - struct gmii2rgmii *priv = mdiodev_get_drvdata(&phydev->mdio); struct mii_bus *bus = priv->mdio->bus; int addr = priv->mdio->addr; - u16 val = 0; + u16 val; + + val = mdiobus_read(bus, addr, XILINX_GMII2RGMII_REG); + val &= ~XILINX_GMII2RGMII_SPEED_MASK; + + if (speed == SPEED_1000) + val |= BMCR_SPEED1000; + else if (speed == SPEED_100) + val |= BMCR_SPEED100; + else + val |= BMCR_SPEED10; + + mdiobus_write(bus, addr, XILINX_GMII2RGMII_REG, val); +} + +static int xgmiitorgmii_read_status(struct phy_device *phydev) +{ + struct gmii2rgmii *priv = mdiodev_get_drvdata(&phydev->mdio); int err; if (priv->phy_drv->read_status) @@ -42,17 +58,24 @@ static int xgmiitorgmii_read_status(struct phy_device *phydev) if (err < 0) return err; - val = mdiobus_read(bus, addr, XILINX_GMII2RGMII_REG); - val &= ~XILINX_GMII2RGMII_SPEED_MASK; + xgmiitorgmii_configure(priv, phydev->speed); - if (phydev->speed == SPEED_1000) - val |= BMCR_SPEED1000; - else if (phydev->speed == SPEED_100) - val |= BMCR_SPEED100; + return 0; +} + +static int xgmiitorgmii_set_loopback(struct phy_device *phydev, bool enable) +{ + struct gmii2rgmii *priv = mdiodev_get_drvdata(&phydev->mdio); + int err; + + if (priv->phy_drv->set_loopback) + err = priv->phy_drv->set_loopback(phydev, enable); else - val |= BMCR_SPEED10; + err = genphy_loopback(phydev, enable); + if (err < 0) + return err; - mdiobus_write(bus, addr, XILINX_GMII2RGMII_REG, val); + xgmiitorgmii_configure(priv, phydev->speed); return 0; } @@ -90,6 +113,7 @@ static int xgmiitorgmii_probe(struct mdio_device *mdiodev) memcpy(&priv->conv_phy_drv, priv->phy_dev->drv, sizeof(struct phy_driver)); priv->conv_phy_drv.read_status = xgmiitorgmii_read_status; + priv->conv_phy_drv.set_loopback = xgmiitorgmii_set_loopback; mdiodev_set_drvdata(&priv->phy_dev->mdio, priv); priv->phy_dev->drv = &priv->conv_phy_drv;