Skip to content

Commit fb7ba41

Browse files
authored
code fix for copper cable modules with flat memory (sonic-net#235)
1 parent c2aac75 commit fb7ba41

File tree

7 files changed

+852
-319
lines changed

7 files changed

+852
-319
lines changed

sonic_platform_base/sonic_xcvr/api/public/cmis.py

+190-167
Large diffs are not rendered by default.

sonic_platform_base/sonic_xcvr/codes/public/sff8024.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -345,26 +345,26 @@ class Sff8024(XcvrCodes):
345345
}
346346

347347
PASSIVE_COPPER_MEDIA_INTERFACE = {
348-
'00': 'Undefined',
349-
'01': 'Copper cable',
350-
'02': 'Passive Loopback module'
348+
0: 'Undefined',
349+
1: 'Copper cable',
350+
2: 'Passive Loopback module'
351351
}
352352

353353
ACTIVE_CABLE_MEDIA_INTERFACE = {
354-
'00': 'Undefined',
355-
'01': 'Active Cable assembly with BER < 10^-12',
356-
'02': 'Active Cable assembly with BER < 5x10^-5',
357-
'03': 'Active Cable assembly with BER < 2.6x10^-4',
358-
'04': 'Active Cable assembly with BER < 10^-6',
359-
'bf': 'Active Loopback module'
354+
0: 'Undefined',
355+
1: 'Active Cable assembly with BER < 10^-12',
356+
2: 'Active Cable assembly with BER < 5x10^-5',
357+
3: 'Active Cable assembly with BER < 2.6x10^-4',
358+
4: 'Active Cable assembly with BER < 10^-6',
359+
191: 'Active Loopback module'
360360
}
361361

362362
BASE_T_MEDIA_INTERFACE = {
363-
'00': 'Undefined',
364-
'01': '1000BASE-T (Clause 40)',
365-
'02': '2.5GBASE-T (Clause 126)',
366-
'03': '5GBASE-T (Clause 126)',
367-
'04': '10GBASE-T (Clause 55)'
363+
0: 'Undefined',
364+
1: '1000BASE-T (Clause 40)',
365+
2: '2.5GBASE-T (Clause 126)',
366+
3: '5GBASE-T (Clause 126)',
367+
4: '10GBASE-T (Clause 55)'
368368
}
369369

370370
# TODO: Add other codes

sonic_platform_base/sonic_xcvr/fields/consts.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
MODULE_MONITORS_FIELD = "Module Monitors"
2424

2525
RX_LOS_FIELD = "RxLOS"
26+
RX_LOS_SUPPORT = "RxLOSSupported"
2627
RX_POWER_FIELD = "RxPower"
28+
RX_POWER_SUPPORT_FIELD = "RxPowerSupported"
2729
RX_POWER_THRESHOLDS_FIELD = "RxPowerThresholds"
2830
RX_POWER_HIGH_ALARM_FIELD = "RxPowerHighAlarm"
2931
RX_POWER_LOW_ALARM_FIELD = "RxPowerLowAlarm"
@@ -41,6 +43,8 @@
4143
THRESHOLDS_FIELD = "Thresholds"
4244

4345
TX_BIAS_FIELD = "TxBias"
46+
TX_BIAS_SUPPORT_FIELD = "TxBiasSupported"
47+
TX_BIAS_SCALE = "TxBiasScalingFactor"
4448
TX_BIAS_THRESHOLDS_FIELD = "TxBiasThresholds"
4549
TX_BIAS_HIGH_ALARM_FIELD = "TxHighAlarm"
4650
TX_BIAS_LOW_ALARM_FIELD = "TxLowAlarm"
@@ -238,7 +242,9 @@
238242
TX_OUTPUT_STATUS = "TxOutputStatus"
239243
RX_OUTPUT_STATUS = "RxOutputStatus"
240244
TX_LOS_FIELD = "TxLOS"
245+
TX_LOS_SUPPORT_FIELD = "TxLOSSupported"
241246
TX_CDR_LOL = "TxCDRLOL"
247+
TX_CDR_LOL_SUPPORT_FIELD = "TxCDRLOLSupported"
242248
TX_POWER_HIGH_ALARM_FLAG = "TxPowerHighAlarmFlag"
243249
TX_POWER_LOW_ALARM_FLAG = "TxPowerLowAlarmFlag"
244250
TX_POWER_HIGH_WARN_FLAG = "TxPowerHighWarnFlag"
@@ -253,6 +259,7 @@
253259
RX_POWER_LOW_WARN_FLAG = "RxPowerLowWarnFlag"
254260

255261
RX_CDR_LOL = "RxCDRLOL"
262+
RX_CDR_LOL_SUPPORT_FIELD = "RxCDRLOLSupported"
256263
CONFIG_LANE_STATUS = "ConfigStatusLane"
257264
DPINIT_PENDING = "DPInitPending"
258265
TUNING_IN_PROGRESS = "TxTuningInProgress"
@@ -265,7 +272,10 @@
265272

266273
CTRLS_ADVT_FIELD = "Supported Controls Advertisement"
267274
FLAGS_ADVT_FIELD = "Supported Flags Advertisement"
268-
275+
PAGE_SUPPORT_ADVT_FIELD = "Supported Pages Advertisement"
276+
TX_FLAGS_ADVT_FIELD = "Supported TX Flags Advertisement"
277+
RX_FLAGS_ADVT_FIELD = "Supported RX Flags Advertisement"
278+
LANE_MON_ADVT_FIELD = "Supported Lane Monitor Advertisement"
269279
LANE_DATAPATH_CTRL_FIELD = "Lane Control and Data Path Control"
270280
LANE_DATAPATH_STATUS_FIELD = "Lane Status and Data Path Status"
271281
LEN_MULT_FIELD = "LengthMultiplier"
@@ -289,6 +299,7 @@
289299
## Media Lane Link Performance Monitoring
290300
# PM
291301
TRANS_PM_FIELD = "TransceiverPm"
302+
VDM_SUPPORTED = "VdmSupported"
292303
VDM_SUPPORTED_PAGE = "VdmSupportedPage"
293304
VDM_CONTROL = "VdmControl"
294305
MEDIA_LANE_FEC_PM = "Media Lane FEC Performance Monitoring"

sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py

+19-3
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,30 @@ def __init__(self, codes):
108108
)
109109

110110
self.MODULE_CHAR_ADVT = RegGroupField(consts.MODULE_CHAR_ADVT_FIELD,
111+
NumberRegField(consts.PAGE_SUPPORT_ADVT_FIELD, self.getaddr(0x1, 142),
112+
RegBitField(consts.VDM_SUPPORTED, 6),
113+
),
111114
NumberRegField(consts.CTRLS_ADVT_FIELD, self.getaddr(0x1, 155),
112115
RegBitField(consts.TX_DISABLE_SUPPORT_FIELD, 1),
113116
size=2, format="<H"
114117
),
115-
NumberRegField(consts.FLAGS_ADVT_FIELD, self.getaddr(0x1, 157),
118+
NumberRegField(consts.TX_FLAGS_ADVT_FIELD, self.getaddr(0x1, 157),
116119
RegBitField(consts.TX_FAULT_SUPPORT_FIELD, 0),
117-
size=2, format="<H"
118-
)
120+
RegBitField(consts.TX_LOS_SUPPORT_FIELD, 1),
121+
RegBitField(consts.TX_CDR_LOL_SUPPORT_FIELD, 2),
122+
),
123+
NumberRegField(consts.RX_FLAGS_ADVT_FIELD, self.getaddr(0x1, 158),
124+
RegBitField(consts.RX_LOS_SUPPORT, 1),
125+
RegBitField(consts.RX_CDR_LOL_SUPPORT_FIELD, 2),
126+
),
127+
NumberRegField(consts.LANE_MON_ADVT_FIELD, self.getaddr(0x1, 160),
128+
RegBitField(consts.RX_POWER_SUPPORT_FIELD, 2),
129+
RegBitField(consts.TX_POWER_SUPPORT_FIELD, 1),
130+
RegBitField(consts.TX_BIAS_SUPPORT_FIELD, 0),
131+
),
132+
NumberRegField(consts.TX_BIAS_SCALE, self.getaddr(0x1, 160),
133+
*(RegBitField("Bit%d" % (bit), bit) for bit in range (3, 5))
134+
),
119135
)
120136

121137
self.THRESHOLDS = RegGroupField(consts.THRESHOLDS_FIELD,

sonic_platform_base/sonic_xcvr/sfp_optoe_base.py

+16
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@ def get_transceiver_threshold_info(self):
3131
api = self.get_xcvr_api()
3232
return api.get_transceiver_threshold_info() if api is not None else None
3333

34+
def get_transceiver_status(self):
35+
api = self.get_xcvr_api()
36+
return api.get_transceiver_status() if api is not None else None
37+
38+
def get_transceiver_loopback(self):
39+
api = self.get_xcvr_api()
40+
return api.get_transceiver_loopback() if api is not None else None
41+
42+
def is_coherent_module(self):
43+
api = self.get_xcvr_api()
44+
return api.is_coherent_module() if api is not None else None
45+
46+
def get_transceiver_pm(self):
47+
api = self.get_xcvr_api()
48+
return api.get_transceiver_pm() if api is not None else None
49+
3450
def get_rx_los(self):
3551
api = self.get_xcvr_api()
3652
if api is not None:

0 commit comments

Comments
 (0)