diff options
author | Antoine Tenart <antoine.tenart@bootlin.com> | 2018-05-04 17:10:54 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-04 19:30:10 +0200 |
commit | 52c5cd1bf0cecf4b146ca07dc513cbe2f4583bb5 (patch) | |
tree | 2c0c03eaafcefaa24f619bf56eda9fbde96d37f8 /drivers/net/phy/sfp-bus.c | |
parent | net: ethernet: sun: niu set correct packet size in skb (diff) | |
download | linux-52c5cd1bf0cecf4b146ca07dc513cbe2f4583bb5.tar.xz linux-52c5cd1bf0cecf4b146ca07dc513cbe2f4583bb5.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/phy/sfp-bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c index 0381da78d228..fd6c23f69c2f 100644 --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c @@ -125,7 +125,7 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id, if (id->base.br_nominal) { if (id->base.br_nominal != 255) { br_nom = id->base.br_nominal * 100; - br_min = br_nom + id->base.br_nominal * id->ext.br_min; + br_min = br_nom - id->base.br_nominal * id->ext.br_min; br_max = br_nom + id->base.br_nominal * id->ext.br_max; } else if (id->ext.br_max) { br_nom = 250 * id->ext.br_max; |