]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: sfp: handle cases where neither BR, min nor BR, max is given
authorAntoine Tenart <antoine.tenart@bootlin.com>
Fri, 4 May 2018 15:21:03 +0000 (17:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 May 2018 00:14:27 +0000 (20:14 -0400)
commitce29c548c5e3cceb517d57c8b0bef39ec6a2fb99
treea369534f52328b890e90f02b05d2aea6a337427e
parent3c636582e0bc012acef5f1be5f77b129ea7e9814
net: phy: sfp: handle cases where neither BR, min nor BR, max is given

When computing the bitrate using values read from an SFP module EEPROM,
we use the nominal BR plus BR,min and BR,max to determine the
boundaries. But in some cases BR,min and BR,max aren't provided, which
led the SFP code to end up having the nominal value for both the minimum
and maximum bitrate values. When using a passive cable, the nominal
value should be used as the maximum one, and there is no minimum one
so we should use 0.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/sfp-bus.c