Skip to content

Commit 52c5cd1

Browse files
atenartdavem330
authored andcommitted
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: 9962acf ("sfp: add support for 1000Base-PX and 1000Base-BX10") Signed-off-by: Antoine Tenart <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1422492 commit 52c5cd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/phy/sfp-bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
125125
if (id->base.br_nominal) {
126126
if (id->base.br_nominal != 255) {
127127
br_nom = id->base.br_nominal * 100;
128-
br_min = br_nom + id->base.br_nominal * id->ext.br_min;
128+
br_min = br_nom - id->base.br_nominal * id->ext.br_min;
129129
br_max = br_nom + id->base.br_nominal * id->ext.br_max;
130130
} else if (id->ext.br_max) {
131131
br_nom = 250 * id->ext.br_max;

0 commit comments

Comments
 (0)