Commit d62d3d6 1 parent f918125 commit d62d3d6 Copy full SHA for d62d3d6
File tree 4 files changed +73
-244
lines changed
sonic_platform_base/sonic_xcvr
4 files changed +73
-244
lines changed Original file line number Diff line number Diff line change 46
46
47
47
- script : |
48
48
set -xe
49
- sudo pip2 install swsssdk-2.0.1-py2-none-any.whl
50
- sudo pip2 install sonic_py_common-1.0-py2-none-any.whl
51
- sudo pip2 install sonic_config_engine-1.0-py2-none-any.whl
52
49
sudo pip3 install swsssdk-2.0.1-py3-none-any.whl
53
50
sudo pip3 install sonic_py_common-1.0-py3-none-any.whl
54
51
sudo pip3 install sonic_yang_mgmt-1.0-py3-none-any.whl
@@ -66,31 +63,6 @@ steps:
66
63
sudo apt-get install -y dotnet-sdk-5.0
67
64
displayName : " Install .NET CORE"
68
65
69
- # Python 2
70
- - script : |
71
- python2 setup.py test
72
- displayName : ' Test Python 2'
73
-
74
- - task : PublishTestResults@2
75
- inputs :
76
- testResultsFiles : ' $(System.DefaultWorkingDirectory)/test-results.xml'
77
- testRunTitle : Python 2
78
- failTaskOnFailedTests : true
79
- condition : succeededOrFailed()
80
- displayName : ' Publish Python 2 test results'
81
-
82
- - task : PublishCodeCoverageResults@1
83
- inputs :
84
- codeCoverageTool : Cobertura
85
- summaryFileLocation : ' $(System.DefaultWorkingDirectory)/coverage.xml'
86
- reportDirectory : ' $(System.DefaultWorkingDirectory)/htmlcov/'
87
- displayName : ' Publish Python 2 test coverage'
88
-
89
- - script : |
90
- set -e
91
- python2 setup.py bdist_wheel
92
- displayName : ' Build Python 2 wheel'
93
-
94
66
# Python 3
95
67
- script : |
96
68
python3 setup.py test
Original file line number Diff line number Diff line change 22
22
23
23
class CmisApi (XcvrApi ):
24
24
NUM_CHANNELS = 8
25
+ LowPwrRequestSW = 4
26
+ LowPwrAllowRequestHW = 6
25
27
26
28
def __init__ (self , xcvr_eeprom ):
27
29
super (CmisApi , self ).__init__ (xcvr_eeprom )
@@ -930,19 +932,20 @@ def set_lpmode(self, lpmode):
930
932
lpmode_val = self .xcvr_eeprom .read (consts .MODULE_LEVEL_CONTROL )
931
933
if lpmode_val is not None :
932
934
if lpmode is True :
933
- lpmode_val = lpmode_val | (1 << 4 )
935
+ # Force module transition to LowPwr under SW control
936
+ lpmode_val = lpmode_val | (1 << CmisApi .LowPwrRequestSW )
934
937
self .xcvr_eeprom .write (consts .MODULE_LEVEL_CONTROL , lpmode_val )
935
938
time .sleep (0.1 )
936
939
return self .get_lpmode ()
937
940
else :
938
- lpmode_val = lpmode_val & ~ (1 << 4 )
941
+ # Force transition from LowPwr to HighPower state under SW control.
942
+ # This will transition LowPwrS signal to False. (see Table 6-12 CMIS v5.0)
943
+ lpmode_val = lpmode_val & ~ (1 << CmisApi .LowPwrRequestSW )
944
+ lpmode_val = lpmode_val & ~ (1 << CmisApi .LowPwrAllowRequestHW )
939
945
self .xcvr_eeprom .write (consts .MODULE_LEVEL_CONTROL , lpmode_val )
940
946
time .sleep (1 )
941
- lpmode = self .xcvr_eeprom .read (consts .TRANS_MODULE_STATUS_FIELD )
942
- if lpmode is not None :
943
- if lpmode .get ('ModuleState' ) == 'ModuleReady' :
944
- return True
945
- return False
947
+ mstate = self .get_module_state ()
948
+ return True if mstate == 'ModuleReady' else False
946
949
return False
947
950
948
951
def get_loopback_capability (self ):
You can’t perform that action at this time.
0 commit comments