On 10.06.2020 22:05, Andrew Lunn wrote:
>> Not sure it makes sense to build ETHTOOL_NETLINK as a module, but at
>> least ensuring that ETHTOOL_NETLINK is built into the kernel if PHYLIB=y
>> or PHYLIB=m would make sense, or, better we find a way to decouple the
>> two by using function pointers from the phy_driver directly that way
>> there is no symbol dependency (but reference counting has to work).
> 
> Hi Florian
> 
> It is not so easy to make PHYLIB=m work. ethtool netlink needs to call
> into the phylib core in order to trigger a cable test, not just PHY
> drivers.
> 
> Ideas welcome.
> 
When looking at functions like phy_start_cable_test() we could do the
following: Most of it doesn't need phylib and could be moved to
ethtool/cabletest.c. Or maybe into a separate ethtool phylib glue
code source file. The phylib calls (phy_link_down, phy_trigger_machine)
then would have to be moved into the cable_test_start callback.
I see that each callback implementation then would have some
boilerplate code. But maybe we could facilitate this with few helpers,
so that a cable test callback would look like:

phy_cable_test_boiler_start()
actual_cable_test()
phy_cable_test_boiler_end()

>       Andrew
> 
Heiner

Reply via email to