Re: [PATCH net-next v4 05/15] net: phy: Create a phy_port for PHY-driven SFPs
From: Maxime Chevallier
Date: Mon Feb 17 2025 - 09:29:03 EST
Hi Andrew,
On Mon, 17 Feb 2025 14:43:00 +0100
Andrew Lunn <andrew@xxxxxxx> wrote:
> > One way to avoid that would be to extract out of phylink/phylib all the
> > functions for linkmode handling that aren't tied to phylink/phylib
> > directly, but are about managing the capabilities of each interface,
> > linkmode, speed, duplex, etc. For phylink, that would be :
> >
> > phylink_merge_link_mode
> > phylink_get_capabilities
> > phylink_cap_from_speed_duplex
> > phylink_limit_mac_speed
> > phylink_caps_to_linkmodes
> > phylink_interface_max_speed
> > phylink_interface_signal_rate
> > phylink_is_empty_linkmode
> > phylink_an_mode_str
> > phylink_set_port_modes
>
> ...
>
> > These would go into linkmode.c/h for example, and we'd have a shared set
> > of helpers that we can use in phylink, phylib and phy_port.
>
> Please be careful with the scope of these. Heiner is going through
> phylib and trying to reduce the scope of some of the functions we
> exporting in include/linux/phy.h to just being available in
> drivers/net/phy. That will help stop MAC drivers abuse them. We should
> do the same here, limit what can actually use these helpers to stop
> abuse.
Can we consider having an header file sitting in drivers/net/phy
directly for this kind of things ?
Maxime