Skip to content

Commit

Permalink
Fix cmis cable length issue (sonic-net#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
andywongarista committed Oct 27, 2021
1 parent 671927d commit 26c8346
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions sonic_platform_base/sonic_xcvr/fields/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

class CableLenField(NumberRegField):
def __init__(self, name, offset, *fields, **kwargs):
kwargs["deps"] = [consts.LEN_MULT_FIELD]
super(CableLenField, self).__init__(name, offset, *fields, **kwargs)

def decode(self, raw_data, **decoded_deps):
Expand Down
4 changes: 2 additions & 2 deletions sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def __init__(self, codes):
*(RegBitField("%s_%d" % (consts.LEN_MULT_FIELD, bit), bit) for bit in range (6, 8))
),
CableLenField(consts.LENGTH_ASSEMBLY_FIELD, self.get_addr(0x0, 202),
*(RegBitField("%s_%d" % (consts.LENGTH_ASSEMBLY_FIELD, bit), bit) for bit in range(0, 6)),
deps=[consts.LEN_MULT_FIELD]
*(RegBitField("%s_%d" % (consts.LENGTH_ASSEMBLY_FIELD, bit), bit) for bit in range(0, 6))
),
CodeRegField(consts.CONNECTOR_FIELD, self.get_addr(0x0, 203), self.codes.CONNECTORS),
deps=[consts.LEN_MULT_FIELD]
)

self.MODULE_LEVEL_MONITORS = RegGroupField(consts.MODULE_MONITORS_FIELD,
Expand Down

0 comments on commit 26c8346

Please sign in to comment.