@@ -83,8 +83,8 @@ def get_transceiver_bulk_status(self):
83
83
return None
84
84
85
85
bulk_status = {
86
- "rx_los" : all (rx_los ),
87
- "tx_fault" : all (tx_fault ),
86
+ "rx_los" : all (rx_los ) if self . get_rx_los_support () else 'N/A' ,
87
+ "tx_fault" : all (tx_fault ) if self . get_tx_fault_support () else 'N/A' ,
88
88
"tx_disable" : all (tx_disable ),
89
89
"tx_disabled_channel" : tx_disabled_channel ,
90
90
"temperature" : temp ,
@@ -111,10 +111,10 @@ def get_transceiver_threshold_info(self):
111
111
'txbiaslowalarm' , 'txbiaslowwarning'
112
112
]
113
113
threshold_info_dict = dict .fromkeys (threshold_info_keys , 'N/A' )
114
- flat_mem = self .is_flat_memory ()
115
- if flat_mem is None :
114
+ thresh_support = self .get_transceiver_thresholds_support ()
115
+ if thresh_support is None :
116
116
return None
117
- if flat_mem :
117
+ if not thresh_support :
118
118
return threshold_info_dict
119
119
120
120
temp_thresholds = self .xcvr_eeprom .read (consts .TEMP_THRESHOLDS_FIELD )
@@ -161,18 +161,33 @@ def get_rx_los(self):
161
161
return [bool (rx_los & (1 << i )) for i in range (self .NUM_CHANNELS )]
162
162
163
163
def get_tx_fault (self ):
164
+ tx_fault_support = self .get_tx_fault_support ()
165
+ if tx_fault_support is None :
166
+ return None
167
+ if not tx_fault_support :
168
+ return ["N/A" for _ in range (self .NUM_CHANNELS )]
164
169
tx_fault = self .xcvr_eeprom .read (consts .TX_FAULT_FIELD )
165
170
if tx_fault is None :
166
171
return None
167
172
return [bool (tx_fault & (1 << i )) for i in range (self .NUM_CHANNELS )]
168
173
169
174
def get_tx_disable (self ):
175
+ tx_disable_support = self .get_tx_disable_support ()
176
+ if tx_disable_support is None :
177
+ return None
178
+ if not tx_disable_support :
179
+ return ["N/A" for _ in range (self .NUM_CHANNELS )]
170
180
tx_disable = self .xcvr_eeprom .read (consts .TX_DISABLE_FIELD )
171
181
if tx_disable is None :
172
182
return None
173
183
return [bool (tx_disable & (1 << i )) for i in range (self .NUM_CHANNELS )]
174
184
175
185
def get_tx_disable_channel (self ):
186
+ tx_disable_support = self .get_tx_disable_support ()
187
+ if tx_disable_support is None :
188
+ return None
189
+ if not tx_disable_support :
190
+ return 'N/A'
176
191
return self .xcvr_eeprom .read (consts .TX_DISABLE_FIELD )
177
192
178
193
def get_module_temperature (self ):
@@ -208,7 +223,7 @@ def tx_disable(self, tx_disable):
208
223
209
224
def tx_disable_channel (self , channel , disable ):
210
225
channel_state = self .get_tx_disable_channel ()
211
- if channel_state is None :
226
+ if channel_state is None or channel_state == "N/A" :
212
227
return False
213
228
214
229
for i in range (self .NUM_CHANNELS ):
@@ -225,18 +240,24 @@ def tx_disable_channel(self, channel, disable):
225
240
def get_power_override (self ):
226
241
return self .xcvr_eeprom .read (consts .POWER_OVERRIDE_FIELD )
227
242
243
+ def get_power_set (self ):
244
+ return self .xcvr_eeprom .read (consts .POWER_SET_FIELD )
245
+
228
246
def set_power_override (self , power_override , power_set ):
229
247
ret = self .xcvr_eeprom .write (consts .POWER_OVERRIDE_FIELD , power_override )
230
248
if power_override :
231
249
ret &= self .xcvr_eeprom .write (consts .POWER_SET_FIELD , power_set )
232
- return ret
250
+ return ret
233
251
234
252
def is_flat_memory (self ):
235
253
return self .xcvr_eeprom .read (consts .FLAT_MEM_FIELD )
236
254
237
255
def get_tx_power_support (self ):
238
256
return False
239
257
258
+ def get_rx_power_support (self ):
259
+ return True
260
+
240
261
def is_copper (self ):
241
262
eth_compliance = self .xcvr_eeprom .read (consts .ETHERNET_10_40G_COMPLIANCE_FIELD )
242
263
if eth_compliance is None :
@@ -248,3 +269,27 @@ def get_temperature_support(self):
248
269
249
270
def get_voltage_support (self ):
250
271
return True
272
+
273
+ def get_rx_los_support (self ):
274
+ return True
275
+
276
+ def get_tx_bias_support (self ):
277
+ return True
278
+
279
+ def get_tx_fault_support (self ):
280
+ return self .xcvr_eeprom .read (consts .TX_FAULT_SUPPORT_FIELD )
281
+
282
+ def get_tx_disable_support (self ):
283
+ return self .xcvr_eeprom .read (consts .TX_DISABLE_SUPPORT_FIELD )
284
+
285
+ def get_transceiver_thresholds_support (self ):
286
+ return not self .is_flat_memory ()
287
+
288
+ def get_lpmode_support (self ):
289
+ power_class = self .xcvr_eeprom .read (consts .POWER_CLASS_FIELD )
290
+ if power_class is None :
291
+ return False
292
+ return "Power Class 1" not in power_class
293
+
294
+ def get_power_override_support (self ):
295
+ return not self .is_copper ()
0 commit comments