]> asedeno.scripts.mit.edu Git - linux.git/commit
net: phy: sfp: fix the BR,min computation
authorAntoine Tenart <antoine.tenart@bootlin.com>
Fri, 4 May 2018 15:10:54 +0000 (17:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 May 2018 17:30:10 +0000 (13:30 -0400)
commit52c5cd1bf0cecf4b146ca07dc513cbe2f4583bb5
tree2c0c03eaafcefaa24f619bf56eda9fbde96d37f8
parent14224923c3600bae2ac4dcae3bf0c3d4dc2812be
net: phy: sfp: fix the BR,min computation

In an SFP EEPROM values can be read to get information about a given SFP
module. One of those is the bitrate, which can be determined using a
nominal bitrate in addition with min and max values (in %). The SFP code
currently compute both BR,min and BR,max values thanks to this nominal
and min,max values.

This patch fixes the BR,min computation as the min value should be
subtracted to the nominal one, not added.

Fixes: 9962acf7fb8c ("sfp: add support for 1000Base-PX and 1000Base-BX10")
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/sfp-bus.c