Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[202012] Fix issue: sff8436 does not support decoding power class 5~7 #317

Merged
merged 2 commits into from
Oct 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 41 additions & 5 deletions sonic_platform_base/sonic_sfp/sff8436.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,43 @@ class sff8436InterfaceId(sffbase):
'd0': 'Power Class 4(3.5W max), CLEI present',
'd4': 'Power Class 4(3.5W max), CLEI present, CDR present in Rx',
'd8': 'Power Class 4(3.5W max), CLEI present, CDR present in Tx',
'dc': 'Power Class 4(3.5W max), CLEI present, CDR present in Rx Tx'
'dc': 'Power Class 4(3.5W max), CLEI present, CDR present in Rx Tx',

'c1': 'Power Class 5(4.0W max)',
'c5': 'Power Class 5(4.0W max), CDR present in Rx',
'c9': 'Power Class 5(4.0W max), CDR present in Tx',
'cd': 'Power Class 5(4.0W max), CDR present in Rx Tx',
'd1': 'Power Class 5(4.0W max), CLEI present',
'd5': 'Power Class 5(4.0W max), CLEI present, CDR present in Rx',
'd9': 'Power Class 5(4.0W max), CLEI present, CDR present in Tx',
'dd': 'Power Class 5(4.0W max), CLEI present, CDR present in Rx Tx',

'c2': 'Power Class 6(4.5W max)',
'c6': 'Power Class 6(4.5W max), CDR present in Rx',
'ca': 'Power Class 6(4.5W max), CDR present in Tx',
'ce': 'Power Class 6(4.5W max), CDR present in Rx Tx',
'd2': 'Power Class 6(4.5W max), CLEI present',
'd6': 'Power Class 6(4.5W max), CLEI present, CDR present in Rx',
'da': 'Power Class 6(4.5W max), CLEI present, CDR present in Tx',
'de': 'Power Class 6(4.5W max), CLEI present, CDR present in Rx Tx',

'c3': 'Power Class 7(5.0W max)',
'c7': 'Power Class 7(5.0W max), CDR present in Rx',
'cb': 'Power Class 7(5.0W max), CDR present in Tx',
'cf': 'Power Class 7(5.0W max), CDR present in Rx Tx',
'd3': 'Power Class 7(5.0W max), CLEI present',
'd7': 'Power Class 7(5.0W max), CLEI present, CDR present in Rx',
'db': 'Power Class 7(5.0W max), CLEI present, CDR present in Tx',
'df': 'Power Class 7(5.0W max), CLEI present, CDR present in Rx Tx',

'20': 'Power Class 8',
'24': 'Power Class 8, CDR present in Rx',
'28': 'Power Class 8, CDR present in Tx',
'2c': 'Power Class 8, CDR present in Rx Tx',
'30': 'Power Class 8, CLEI present',
'34': 'Power Class 8, CLEI present, CDR present in Rx',
'38': 'Power Class 8, CLEI present, CDR present in Tx',
'3c': 'Power Class 8, CLEI present, CDR present in Rx Tx',
}

connector = {
Expand Down Expand Up @@ -346,7 +382,7 @@ class sff8436InterfaceId(sffbase):
'size' : 1,
'type' : 'bitmap',
'decode': {}}}

sfp_info_bulk = {'type':
{'offset':0,
'size':1,
Expand Down Expand Up @@ -406,7 +442,7 @@ class sff8436InterfaceId(sffbase):
'size':1,
'type':'int'}
}

vendor_name = {
'Vendor Name':
{'offset': 0,
Expand Down Expand Up @@ -441,7 +477,7 @@ class sff8436InterfaceId(sffbase):
'size':3,
'type' : 'hex'}
}

vendor_date = {
'VendorDataCode(YYYY-MM-DD Lot)':
{'offset':0,
Expand Down Expand Up @@ -1066,7 +1102,7 @@ def calc_rx_power(self, eeprom_data, offset, size):
'size':2,
'type': 'func',
'decode': { 'func':calc_temperature}},
'Vcc':
'Vcc':
{'offset':26,
'size':2,
'type': 'func',
Expand Down