From patchwork Wed Jun 2 16:20:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 453904 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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 F2859C47083 for ; Wed, 2 Jun 2021 16:20:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9D1761983 for ; Wed, 2 Jun 2021 16:20:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229989AbhFBQWf (ORCPT ); Wed, 2 Jun 2021 12:22:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbhFBQWd (ORCPT ); Wed, 2 Jun 2021 12:22:33 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46AE1C06174A for ; Wed, 2 Jun 2021 09:20:33 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id gb17so4693252ejc.8 for ; Wed, 02 Jun 2021 09:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=41Bl77NUyEnvs3+ONIvTMnq4lppJ6RHlCiScY9O6mbk=; b=Zld1fAfijyM1PF2W+nkDX1EI691BSzKDLZL1V/8C5nTLeg42yWU+l5JrNY7afWsieC vBzzpGXOitNUDOwoe6zNCCt66zfxcmfZlJt0AryWUXuU6qEXl07v8XceyCJVGDoOgbb6 EYhzybaoYXParPZtzI/UJIdAB9QF1IWbAX3RWN1igIaZSXQup60LLt+1c74hrRbFf8Qc Bp5ft1NZE87FsOarqTcdQ/1pZFI6UmpB4oLJswrt9pLgfZ1Q+tzn+PejCfRDEktpxILp CJOL7iuOPbm4E0/9GMEacfQsI37VSV3PfIwLvRmetDb2A9wZAG/Gw8NWbAgccVI9jX+S XV0g== 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:mime-version :content-transfer-encoding; bh=41Bl77NUyEnvs3+ONIvTMnq4lppJ6RHlCiScY9O6mbk=; b=d6kI/7kdLHIP5t30RE/rihtmPB6bC0pDO7w43izop4xdb026b9u4Jv/k6QIG4Trqq0 eCCNOxRr+OVbVNKkRu7fVaSsXrNrIcYv0zmIDQu2Zo+oarX7qkBDcXkBKcI2KIQcC+sb ajst/AEGIWS1r1YsEwcrHMTkPkeCQzu/JvDJCX+j1pJ14lBDSaXAAxycsCjHhuL1W2wE kBn6iyOZSYUJJrLDxmOc8ESvQ1alBGxO0g6oXpatBUBfEO84SPUmSTKKeYzvs1PGkHaH I+9JtaufVJtgj7qArh4rVKMacopKfv2/A/t7+6bPlLDncVljX1/F5JDAOzpYGPWq9gpu AY9A== X-Gm-Message-State: AOAM531jcfM4ep2v/Ijm0nBgwe9iOVohZ8pZrr/fUV6mOyuWfavoTxEQ bwekKNn+gj3L2t42z+afJYxWGRiIm2A= X-Google-Smtp-Source: ABdhPJxDbyzSxtIu9VaCLV+zhlHr3I1z/m4T0yHkU7M/Vwbb4ARfytPXT3rtDxh561gRnu5tgN4iXA== X-Received: by 2002:a17:906:2bd3:: with SMTP id n19mr34930378ejg.210.1622650831811; Wed, 02 Jun 2021 09:20:31 -0700 (PDT) Received: from localhost.localdomain ([188.26.52.84]) by smtp.gmail.com with ESMTPSA id m12sm228078edc.40.2021.06.02.09.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 09:20:31 -0700 (PDT) From: Vladimir Oltean To: Jakub Kicinski , "David S. Miller" , netdev@vger.kernel.org Cc: Wong Vee Khee , Ong Boon Leong , Michael Sit Wei Hong , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jose Abreu , Maxime Coquelin , Heiner Kallweit , Russell King - ARM Linux admin , Florian Fainelli , Andrew Lunn , Vladimir Oltean Subject: [PATCH v3 net-next 0/9] Convert xpcs to phylink_pcs_ops Date: Wed, 2 Jun 2021 19:20:10 +0300 Message-Id: <20210602162019.2201925-1-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vladimir Oltean Background: the sja1105 DSA driver currently drives a Designware XPCS for SGMII and 2500base-X, and it would be nice to reuse some code with the xpcs module. This would also help consolidate the phylink_pcs_ops, since the only other dedicated PCS driver, currently, is the lynx_pcs. Therefore, this series makes the xpcs expose the same kind of API that the lynx_pcs module does. The main changes are getting rid of struct mdio_xpcs_ops, being compatible with struct phylink_pcs_ops and being less reliant on the phy_interface_t passed to xpcs_probe (now renamed to xpcs_create). This patch series is partially tested (some code paths have been covered on the NXP SJA1105 and some others with the help of Vee Khee Wong on Intel Tiger Lake / stmmac) but further testing on 10G setups would be appreciated, if possible. Vladimir Oltean (9): net: pcs: xpcs: delete shim definition for mdio_xpcs_get_ops() net: pcs: xpcs: there is only one PHY ID net: pcs: xpcs: make the checks related to the PHY interface mode stateless net: pcs: xpcs: export xpcs_validate net: pcs: xpcs: export xpcs_config_eee net: pcs: xpcs: export xpcs_probe net: pcs: xpcs: use mdiobus_c45_addr in xpcs_{read,write} net: pcs: xpcs: convert to mdio_device net: pcs: xpcs: convert to phylink_pcs_ops drivers/net/ethernet/stmicro/stmmac/common.h | 3 +- drivers/net/ethernet/stmicro/stmmac/hwif.h | 14 - .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 12 +- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 39 +- .../net/ethernet/stmicro/stmmac/stmmac_mdio.c | 47 +-- drivers/net/pcs/pcs-xpcs.c | 395 ++++++++++++------ include/linux/pcs/pcs-xpcs.h | 40 +- 7 files changed, 319 insertions(+), 231 deletions(-)