From patchwork Thu Dec 5 09:42:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13894917 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 AB83D1D63C6 for ; Thu, 5 Dec 2024 09:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733391753; cv=none; b=UlOPYTn5/o0OWrPOyAAriaszUxPdlaqTt167pOh+YB8XqAnsSEKRNpqL4/urlfraIT2YctmgXdbMV0lDGfbgB2c6JiPkEj2V/xDPa26Y8dUqRWMeaNVN1QkHHN4X/1C7FJ05bkYNjw5dYxldSSW4jaPwW6h457xd1t4OPkSRFB8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733391753; c=relaxed/simple; bh=pIzdI20dvJKGL2SESL4H2+F0XmvQiYc+5ukxILvmp4A=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=pVeGbXsCvhXwVhXKalamnd4BYgs/D+y/TYxvYPaG47GMh2VDAOhzBQG8o5QeX1nL0nI+2G0/qP0q5MRahCHqhIfF0u7RM+VuV3GupCOC4y+E/3j9A6k4oz+WaRe98ZDpM4wgZyIP20GeFTqLSeijgTYustzWa7D6Mw5eFsd+Bpk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=sAjRqda2; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="sAjRqda2" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=A3y6MwUAGsUHiozWMnJnTOPGfmVxoyuHA6Uc8vPNLyU=; b=sAjRqda2Pzz4zayqttQHebInbQ pltGcFA3wdx2kUu+lxknjca8uFBS2Q5PryXnPgxPxg2ipEMYdyu8RrRY/7giZE6k8MxrK0DeUGZyG 0/Zpj0AAmYwvkMcU5pLCzBiT1/xwH+7US45Gue74feSNXgsPuo8xVKuMTsx+6HUoS3wwWSO2boxsh zvRpyWVTM2DrHJrWnQkzFKKflmn9Mo00k3goQ7glOAmssnP3UWmwXmERVHKxEF1h2l/MBEaovR6+k Fn2L11+MSSaldWvYRzYBIYBdpMkGvfApsQm1jORDL1cyQBgaHL26EdmwZVHCKeKmck8pqkbaPLIUa +ciHJj/g==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:45918 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tJ8NN-0004To-1x; Thu, 05 Dec 2024 09:42:26 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tJ8NM-006L5J-AH; Thu, 05 Dec 2024 09:42:24 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Ioana Ciornei , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: [PATCH net-next 1/3] net: pcs: pcs-lynx: implement pcs_inband_caps() method Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Thu, 05 Dec 2024 09:42:24 +0000 X-Patchwork-Delegate: kuba@kernel.org Report the PCS in-band capabilities to phylink for the Lynx PCS. Reviewed-by: Maxime Chevallier Signed-off-by: Russell King (Oracle) --- drivers/net/pcs/pcs-lynx.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/pcs/pcs-lynx.c b/drivers/net/pcs/pcs-lynx.c index b79aedad855b..767a8c0714ac 100644 --- a/drivers/net/pcs/pcs-lynx.c +++ b/drivers/net/pcs/pcs-lynx.c @@ -35,6 +35,27 @@ enum sgmii_speed { #define phylink_pcs_to_lynx(pl_pcs) container_of((pl_pcs), struct lynx_pcs, pcs) #define lynx_to_phylink_pcs(lynx) (&(lynx)->pcs) +static unsigned int lynx_pcs_inband_caps(struct phylink_pcs *pcs, + phy_interface_t interface) +{ + switch (interface) { + case PHY_INTERFACE_MODE_1000BASEX: + case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_QSGMII: + return LINK_INBAND_DISABLE | LINK_INBAND_ENABLE; + + case PHY_INTERFACE_MODE_10GBASER: + case PHY_INTERFACE_MODE_2500BASEX: + return LINK_INBAND_DISABLE; + + case PHY_INTERFACE_MODE_USXGMII: + return LINK_INBAND_ENABLE; + + default: + return 0; + } +} + static void lynx_pcs_get_state_usxgmii(struct mdio_device *pcs, struct phylink_link_state *state) { @@ -306,6 +327,7 @@ static void lynx_pcs_link_up(struct phylink_pcs *pcs, unsigned int neg_mode, } static const struct phylink_pcs_ops lynx_pcs_phylink_ops = { + .pcs_inband_caps = lynx_pcs_inband_caps, .pcs_get_state = lynx_pcs_get_state, .pcs_config = lynx_pcs_config, .pcs_an_restart = lynx_pcs_an_restart,