ramips: phy: at803x: Select SFP interface mode that both sides supports.
authorRené van Dorst <opensource@vdorst.com>
Fri, 13 Nov 2020 15:45:54 +0000 (16:45 +0100)
committerPetr Štetiar <ynezz@true.cz>
Mon, 23 Nov 2020 21:53:15 +0000 (22:53 +0100)
commit6e1a4496f58c0eb69280dca7e0ba692bef41fbda
tree7db24b88c8d69c2b1ee774dd0252c88b583e7b27
parent991e6f8cccbff4d1f1a2ffb4504d2a8b5bf45388
ramips: phy: at803x: Select SFP interface mode that both sides supports.

Currently sfp_select_interface() return the fastest interface that
the sfp modules supports even if the phy don't support that mode.

For example an GPON module that support both 2500basex and 1000basex.
Currently sfp_select_interface() picks 2500basex instead of 1000basex.

So limit the interfaces which both sides supports before calling
sfp_select_interface() or return an error if we don't have match.

Reviewed-by: John Thomson <git@johnthomson.fastmail.com.au>
Tested-by: Braihan Cantera <bcanterac@gmail.com> [MikroTik RB760iGS + Nokia G-010S-A 3FE46541AA SFP]
Tested-by: John Thomson <git@johnthomson.fastmail.com.au> [Mikrotik rb760igs + SFP SM/LC, SFP base1000T, SFP+ passive DAC]
Signed-off-by: René van Dorst <opensource@vdorst.com>
target/linux/ramips/patches-5.4/991-at803x.patch