Skip to content

Commit

Permalink
Add support for tx power threshold warning/alarm and FlatMem (sonic-n…
Browse files Browse the repository at this point in the history
…et#66)

* [sff8436.py]Add support for txpower warning/alarm and FlatMem
* also update sfputil.QSFP_CHANNL_THRESHOLD_WIDTH to 24
  • Loading branch information
stephenxs authored and jleveque committed Nov 19, 2019
1 parent 9bae794 commit d22f0a0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
30 changes: 29 additions & 1 deletion sonic_platform_base/sonic_sfp/sff8436.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,14 @@ def calc_rx_power(self, eeprom_data, offset, size):
'DataNotReady':
{'offset': 0,
'bit': 0,
'type': 'bitvalue'},
'IntL':
{'offset': 0,
'bit': 1,
'type': 'bitvalue'},
'FlatMem':
{'offset': 0,
'bit': 2,
'type': 'bitvalue'}}

dom_channel_status = {
Expand Down Expand Up @@ -1333,7 +1341,27 @@ def calc_rx_power(self, eeprom_data, offset, size):
{'offset':14,
'size':2,
'type': 'func',
'decode': { 'func':calc_bias}}}
'decode': { 'func':calc_bias}},
'TxPowerHighAlarm':
{'offset':16,
'size':2,
'type': 'func',
'decode': { 'func':calc_rx_power}},
'TxPowerLowAlarm':
{'offset':18,
'size':2,
'type': 'func',
'decode': { 'func':calc_rx_power}},
'TxPowerHighWarning':
{'offset':20,
'size':2,
'type': 'func',
'decode': { 'func':calc_rx_power}},
'TxPowerLowWarning':
{'offset':22,
'size':2,
'type': 'func',
'decode': { 'func':calc_rx_power}}}

dom_channel_monitor_masks = {
'Rx1PowerHighAlarm':
Expand Down
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_sfp/sfputilbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
QSFP_MODULE_THRESHOLD_OFFSET = 128
QSFP_MODULE_THRESHOLD_WIDTH = 24
QSFP_CHANNL_THRESHOLD_OFFSET = 176
QSFP_CHANNL_THRESHOLD_WIDTH = 16
QSFP_CHANNL_THRESHOLD_WIDTH = 24
QSFP_CHANNL_MON_MASK_OFFSET = 242
QSFP_CHANNL_MON_MASK_WIDTH = 4

Expand Down

0 comments on commit d22f0a0

Please sign in to comment.