]> git.baikalelectronics.ru Git - kernel.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)
commit18a6fe0cbf775875350266e3ede6009c831c5f8c
tree2c0c03eaafcefaa24f619bf56eda9fbde96d37f8
parent0d5a6a4fdf1db9d252e4668a82874f16c4c3a433
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: f18dd76ae9b3 ("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