Re: [RFC PATCH net-next v3 01/13] net: phy: Introduce ethernet link topology representation

From: Andrew Lunn
Date: Mon Dec 11 2023 - 09:21:40 EST


> > > @@ -10832,6 +10833,8 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
> > > #ifdef CONFIG_NET_SCHED
> > > hash_init(dev->qdisc_hash);
> > > #endif
> > > + phy_link_topo_init(&dev->link_topo);
> > > +
> >
> > I don't think this can work unless PHYLIB is compiled as a built-in.
>
> Inded, I need to better clarify and document the dependency with
> PHYLIB.

It is getting harder and harder to make the phylib core a module :-(

How much work does phy_link_topo_init() do? Could it be an inline
function? Are there other dependencies?

Also look at ethtool_phy_ops and e.g. how plca_get_cfg_prepare_data()
uses it.

Andrew