Re: [PATCH net-next v1] r8169: implement get_module functions for rtl8127atf
From: Andrew Lunn
Date: Tue Apr 07 2026 - 19:50:40 EST
> > Yes, that would be best. Call i2c_add_adapter() to add it to the I2C
> > core. The SFP code in drivers/net/phy can then make use of it.
>
> Hey Andrew, thanks for the pointers, I was able to instantiate the dw
> i2c controller, same as txgbe/txgbe_phy.c really.
Cool.
> For some reasons I had to revert 560072246088, was getting a "spurious
> STOP detected" but I'll follow up on that separately.
I2C transfers need to be multiples of 2 bytes, in order for the HWMON
to work correctly. You need to read the 16 bits in a single
operation. If they get chopped up into multiple transfers they become
unreliable. So it would be good to get to the bottom of this.
> Anyway I was able to make detection and los work, so I have some code
> with gpio, i2c and the sfp module detect and showing up in hwmon, and
> sitting in waitdev state.
Nice.
> >
> > And you will need a PCS driver.
> >
> > But first step is probably to work with the existing Base-T devices
> > and convert the driver to phylink.
>
> Ok I was going to ask how to connect the one above with the ethtool
> handlers, so you are saying that first the whole driver needs to be
> converted to use phylink/pcs and then that should work automatically-ish
> right?
Yes, once phylink is coordinating all the parts, accessing the module
via ethtool should just start working.
> Can I send the current code I have as an RFC in the meantime to get some
> early feedback?
Sure.
> It's a pretty substantial amount of boilerplate code so I suspect Heiner
> may want to refactor things about it, feels like it could live in its
> own file.
How much is identical to the txgbe? I wounder if it makes sense to add
some helpers which can be shared by both drivers?
Andrew