On Fri, May 24, 2024 at 10:08:54PM +0000, Piergiorgio Beruto wrote: > > Having a GPIO driver within the MAC driver is O.K. For hardware diagnostics you should be using devlink, which many MAC drivers have. So i don't see a need for the PHY driver to access MMS 12. > But the MAC driver might need to access MMS-es for vendor specific > stuff. In our case, there is a model specific register we need to > access during probe. Which is fine, and currently supported. Look at the Microchip driver, it access some registers at startup. The framwork just provides the core of moving packets around, and MDIO access. The rest is up to MAC driver. > Fair enough, let's keep it for "hacks" then. Still, I think there > are features that -initially- are kind of vendor specific, but in > the long run they turn into standards or de-facto standards. > I assume we want to help this happening (step-wise), don't we? Maybe, but maybe not. We have been developing MAC drivers for over 25 years. There are a number of mechanisms for exporting things to user space. We have to see if your features fit one of them. > For example, one big feature I think at some point we should > understand how to deal with, is topology discovery for multi-drop. > Maybe you've heard about it already, but in short it is a feature > that allows one PHY to measure the distance (or rather, the > propagation delay) to another node on the same multi-drop segment. > Knowing the cable Tpd (~5ns/m), this allows you to get also the physical distance. We already have something very similar to this. Cable testing results which make use of Time Domain Reflectromitery. I would look at re-using the API as much as possible. > In my view, we should probably create some PHY extensions in the > kernel to activate the physical layer part, leaving the "protocol" > to the userland. May I ask your opinion? Please look at how cable testing works. Andrew