@@ -94,10 +94,10 @@ def get_laser_tuning_summary(self):
94
94
95
95
def get_supported_freq_config (self ):
96
96
'''
97
- This function returns the supported freq grid, low and high supported channel in 75GHz grid,
97
+ This function returns the supported freq grid, low and high supported channel in 75/100GHz grid,
98
98
and low and high frequency supported in GHz.
99
- allowed channel number bound in 75 GHz grid
100
- allowed frequency bound in 75 GHz grid
99
+ allowed channel number bound in 75/100 GHz grid
100
+ allowed frequency bound in 75/100 GHz grid
101
101
'''
102
102
grid_supported = self .xcvr_eeprom .read (consts .SUPPORT_GRID )
103
103
low_ch_num = self .xcvr_eeprom .read (consts .LOW_CHANNEL )
@@ -106,20 +106,28 @@ def get_supported_freq_config(self):
106
106
high_freq_supported = 193100 + hi_ch_num * 25
107
107
return grid_supported , low_ch_num , hi_ch_num , low_freq_supported , high_freq_supported
108
108
109
- def set_laser_freq (self , freq ):
109
+ def set_laser_freq (self , freq , grid ):
110
110
'''
111
111
This function sets the laser frequency. Unit in GHz
112
112
ZR application will not support fine tuning of the laser
113
- SONiC will only support 75 GHz frequency grid
113
+ SONiC will only support 75 GHz and 100GHz frequency grids
114
114
Return True if the provision succeeds, False if it fails
115
115
'''
116
116
grid_supported , low_ch_num , hi_ch_num , _ , _ = self .get_supported_freq_config ()
117
117
grid_supported_75GHz = (grid_supported >> 7 ) & 0x1
118
- assert grid_supported_75GHz
119
- freq_grid = 0x70
118
+ grid_supported_100GHz = (grid_supported >> 5 ) & 0x1
119
+ if grid == 75 :
120
+ assert grid_supported_75GHz
121
+ freq_grid = 0x70
122
+ channel_number = int (round ((freq - 193100 )/ 25 ))
123
+ assert channel_number % 3 == 0
124
+ elif grid == 100 :
125
+ assert grid_supported_100GHz
126
+ freq_grid = 0x50
127
+ channel_number = int (round ((freq - 193100 )/ 100 ))
128
+ else :
129
+ return False
120
130
self .xcvr_eeprom .write (consts .GRID_SPACING , freq_grid )
121
- channel_number = int (round ((freq - 193100 )/ 25 ))
122
- assert channel_number % 3 == 0
123
131
if channel_number > hi_ch_num or channel_number < low_ch_num :
124
132
raise ValueError ('Provisioned frequency out of range. Max Freq: 196100; Min Freq: 191300 GHz.' )
125
133
status = self .xcvr_eeprom .write (consts .LASER_CONFIG_CHANNEL , channel_number )
0 commit comments