From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 D986C36F8F2 for ; Thu, 21 May 2026 14:07:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779372435; cv=none; b=fQP3rgEVKuO7jL3mqVa/+sy37lXtfBLfI4za3ViG5Z0qw1BX8gf4PzZCLVDGaFXIYovDOmOq4uiMHL4sBo3ZShDvawbvxmscKrtnehfOnxKswoVpEvsvhj2i4SHFA2ltU3lte45oGX0jRQ34/SUSLHucvzJxBuwOI1egKi/QZAE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779372435; c=relaxed/simple; bh=3wcma+CYANg6pRxfXPDCkFSD2scL1M4CzqEWqkmAytA=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=DJwjhN4jWdeeunYhHe7b3YWb1iQ3Yd6tA1qLCI3MfAB/Qa5IzGnNOBkNt/w0jNGSMjJBjuiTcCoFdFnZAId9qFNmhwxm8NYwa9NeegyAyMTh4O1wz/Y9Pp4e2I2i6mMcaaEtAlZrj2qunH9geJs+fhXqI+sNfodvD/qWyEYxn1Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=B3R/VDvG; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="B3R/VDvG" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 54F4EC2C64D; Thu, 21 May 2026 14:08:05 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 22B3A60495; Thu, 21 May 2026 14:07:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5F661107E8BA9; Thu, 21 May 2026 16:07:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1779372430; h=from:subject:date:message-id:to:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=YY5/UthRyy4kFw/w3iv+VtM6z32YZ3PoyOhxwTW4sYQ=; b=B3R/VDvGPSoIhK3GydoxNc2xvNYDNtCuER/ObYepv5o8sTNuqhVSj52qZXauj4j3amlWox S1L5/W/UPpxXeffHFxIMBD6WZCbqaUZvjkGbZa4vstNF6CPx2T6dppsTCstzjpZrmYCDgK dMfSPpgkOBzEp1hE7pZIdV6iP+c4+VkdM1Tk+JqgM4k3wHLCr1+OaF+TKUCv9SJ/3Y1mJ6 LljLNv42TjtHzAR2Xq4TTdvgB7VPrBZLqi088yLr6EZHpp0BJD7/J8q9I2LyczELpqhsoD OUPjuSt1UxiRE8wkRXgx/n2Ea973U9+c6JH5DO3yDU209VTbJorCkjBk0nsDrQ== Message-ID: Date: Thu, 21 May 2026 16:07:03 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/4] net: dsa: mxl862xx: move phylink stubs to mxl862xx-phylink.c To: Daniel Golle , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <8e31ea20fa8a7650176ce4c9c1603ee34571eeb5.1779330653.git.daniel@makrotopia.org> Content-Language: en-US From: Maxime Chevallier In-Reply-To: <8e31ea20fa8a7650176ce4c9c1603ee34571eeb5.1779330653.git.daniel@makrotopia.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 Hi Daniel, On 5/21/26 04:40, Daniel Golle wrote: > Move the phylink MAC operations and get_caps callback from mxl862xx.c > into a dedicated mxl862xx-phylink.c file. This prepares for the SerDes > PCS implementation which adds substantial phylink/PCS code -- keeping > it in a separate file avoids function-position churn in the main > driver file. > > No functional change. > > Signed-off-by: Daniel Golle Reviewed-by: Maxime Chevallier Maxime > --- > v2: no changes > > drivers/net/dsa/mxl862xx/Makefile | 2 +- > drivers/net/dsa/mxl862xx/mxl862xx-phylink.c | 51 +++++++++++++++++++++ > drivers/net/dsa/mxl862xx/mxl862xx-phylink.h | 14 ++++++ > drivers/net/dsa/mxl862xx/mxl862xx.c | 38 +-------------- > 4 files changed, 67 insertions(+), 38 deletions(-) > create mode 100644 drivers/net/dsa/mxl862xx/mxl862xx-phylink.c > create mode 100644 drivers/net/dsa/mxl862xx/mxl862xx-phylink.h > > diff --git a/drivers/net/dsa/mxl862xx/Makefile b/drivers/net/dsa/mxl862xx/Makefile > index d23dd3cd511d..a7be0e6669df 100644 > --- a/drivers/net/dsa/mxl862xx/Makefile > +++ b/drivers/net/dsa/mxl862xx/Makefile > @@ -1,3 +1,3 @@ > # SPDX-License-Identifier: GPL-2.0 > obj-$(CONFIG_NET_DSA_MXL862) += mxl862xx_dsa.o > -mxl862xx_dsa-y := mxl862xx.o mxl862xx-host.o > +mxl862xx_dsa-y := mxl862xx.o mxl862xx-host.o mxl862xx-phylink.o > diff --git a/drivers/net/dsa/mxl862xx/mxl862xx-phylink.c b/drivers/net/dsa/mxl862xx/mxl862xx-phylink.c > new file mode 100644 > index 000000000000..f17c429d1f1d > --- /dev/null > +++ b/drivers/net/dsa/mxl862xx/mxl862xx-phylink.c > @@ -0,0 +1,51 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +/* > + * Phylink and PCS support for MaxLinear MxL862xx switch family > + * > + * Copyright (C) 2024 MaxLinear Inc. > + * Copyright (C) 2025 John Crispin > + * Copyright (C) 2025 Daniel Golle > + */ > + > +#include > +#include > + > +#include "mxl862xx.h" > +#include "mxl862xx-phylink.h" > + > +void mxl862xx_phylink_get_caps(struct dsa_switch *ds, int port, > + struct phylink_config *config) > +{ > + config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | MAC_10 | > + MAC_100 | MAC_1000 | MAC_2500FD; > + > + __set_bit(PHY_INTERFACE_MODE_INTERNAL, > + config->supported_interfaces); > +} > + > +static void mxl862xx_phylink_mac_config(struct phylink_config *config, > + unsigned int mode, > + const struct phylink_link_state *state) > +{ > +} > + > +static void mxl862xx_phylink_mac_link_down(struct phylink_config *config, > + unsigned int mode, > + phy_interface_t interface) > +{ > +} > + > +static void mxl862xx_phylink_mac_link_up(struct phylink_config *config, > + struct phy_device *phydev, > + unsigned int mode, > + phy_interface_t interface, > + int speed, int duplex, > + bool tx_pause, bool rx_pause) > +{ > +} > + > +const struct phylink_mac_ops mxl862xx_phylink_mac_ops = { > + .mac_config = mxl862xx_phylink_mac_config, > + .mac_link_down = mxl862xx_phylink_mac_link_down, > + .mac_link_up = mxl862xx_phylink_mac_link_up, > +}; > diff --git a/drivers/net/dsa/mxl862xx/mxl862xx-phylink.h b/drivers/net/dsa/mxl862xx/mxl862xx-phylink.h > new file mode 100644 > index 000000000000..c3d5215bdf60 > --- /dev/null > +++ b/drivers/net/dsa/mxl862xx/mxl862xx-phylink.h > @@ -0,0 +1,14 @@ > +/* SPDX-License-Identifier: GPL-2.0-or-later */ > + > +#ifndef __MXL862XX_PHYLINK_H > +#define __MXL862XX_PHYLINK_H > + > +#include > + > +#include "mxl862xx.h" > + > +extern const struct phylink_mac_ops mxl862xx_phylink_mac_ops; > +void mxl862xx_phylink_get_caps(struct dsa_switch *ds, int port, > + struct phylink_config *config); > + > +#endif /* __MXL862XX_PHYLINK_H */ > diff --git a/drivers/net/dsa/mxl862xx/mxl862xx.c b/drivers/net/dsa/mxl862xx/mxl862xx.c > index 2f22adedfbf6..a193f3c07d35 100644 > --- a/drivers/net/dsa/mxl862xx/mxl862xx.c > +++ b/drivers/net/dsa/mxl862xx/mxl862xx.c > @@ -22,6 +22,7 @@ > #include "mxl862xx-api.h" > #include "mxl862xx-cmd.h" > #include "mxl862xx-host.h" > +#include "mxl862xx-phylink.h" > > #define MXL862XX_API_WRITE(dev, cmd, data) \ > mxl862xx_api_wrap(dev, cmd, &(data), sizeof((data)), false, false) > @@ -1424,16 +1425,6 @@ static void mxl862xx_port_teardown(struct dsa_switch *ds, int port) > priv->ports[port].setup_done = false; > } > > -static void mxl862xx_phylink_get_caps(struct dsa_switch *ds, int port, > - struct phylink_config *config) > -{ > - config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | MAC_10 | > - MAC_100 | MAC_1000 | MAC_2500FD; > - > - __set_bit(PHY_INTERFACE_MODE_INTERNAL, > - config->supported_interfaces); > -} > - > static int mxl862xx_get_fid(struct dsa_switch *ds, struct dsa_db db) > { > struct mxl862xx_priv *priv = ds->priv; > @@ -2099,33 +2090,6 @@ static const struct dsa_switch_ops mxl862xx_switch_ops = { > .get_stats64 = mxl862xx_get_stats64, > }; > > -static void mxl862xx_phylink_mac_config(struct phylink_config *config, > - unsigned int mode, > - const struct phylink_link_state *state) > -{ > -} > - > -static void mxl862xx_phylink_mac_link_down(struct phylink_config *config, > - unsigned int mode, > - phy_interface_t interface) > -{ > -} > - > -static void mxl862xx_phylink_mac_link_up(struct phylink_config *config, > - struct phy_device *phydev, > - unsigned int mode, > - phy_interface_t interface, > - int speed, int duplex, > - bool tx_pause, bool rx_pause) > -{ > -} > - > -static const struct phylink_mac_ops mxl862xx_phylink_mac_ops = { > - .mac_config = mxl862xx_phylink_mac_config, > - .mac_link_down = mxl862xx_phylink_mac_link_down, > - .mac_link_up = mxl862xx_phylink_mac_link_up, > -}; > - > static int mxl862xx_probe(struct mdio_device *mdiodev) > { > struct device *dev = &mdiodev->dev;