From 51bfb128fd790b4f694a37c7bf0786532fcc5735 Mon Sep 17 00:00:00 2001 From: Leonard Yu Date: Tue, 24 Oct 2023 21:57:31 +0200 Subject: [PATCH 1/2] Add more param to p_capabilities --- xoa_driver/internals/commands/enums.py | 105 ++++++++++++++ xoa_driver/internals/commands/p_commands.py | 149 ++++++++++++++++++++ 2 files changed, 254 insertions(+) diff --git a/xoa_driver/internals/commands/enums.py b/xoa_driver/internals/commands/enums.py index 58033896..869e62f5 100644 --- a/xoa_driver/internals/commands/enums.py +++ b/xoa_driver/internals/commands/enums.py @@ -2490,6 +2490,111 @@ class RxEqExtCap(IntEnum): CTLE_HIGH = 1 """CTLE high frequency.""" + AGC = 2 + """Automatic Gain Control""" + + OC = 3 + """Offset Cancellation""" + + CDR = 4 + """Clock and Data Recovery""" + + PRE_FFE_1 = 5 + """Pre Feed-Forward Equalizer #1""" + + PRE_FFE_2 = 6 + """Pre Feed-Forward Equalizer #2""" + + PRE_FFE_3 = 7 + """Pre Feed-Forward Equalizer #3""" + + PRE_FFE_4 = 8 + """Pre Feed-Forward Equalizer #4""" + + PRE_FFE_5 = 9 + """Pre Feed-Forward Equalizer #5""" + + PRE_FFE_6 = 10 + """Pre Feed-Forward Equalizer #6""" + + PRE_FFE_7 = 11 + """Pre Feed-Forward Equalizer #7""" + + PRE_FFE_8 = 12 + """Pre Feed-Forward Equalizer #8""" + + DFE = 13 + """Decision Feedback Equalization""" + + POST_FFE_1 = 14 + """Post Feed-Forward Equalizer #1""" + + POST_FFE_2 = 15 + """Post Feed-Forward Equalizer #2""" + + POST_FFE_3 = 16 + """Post Feed-Forward Equalizer #3""" + + POST_FFE_4 = 17 + """Post Feed-Forward Equalizer #4""" + + POST_FFE_5 = 18 + """Post Feed-Forward Equalizer #5""" + + POST_FFE_6 = 19 + """Post Feed-Forward Equalizer #6""" + + POST_FFE_7 = 20 + """Post Feed-Forward Equalizer #7""" + + POST_FFE_8 = 21 + """Post Feed-Forward Equalizer #8""" + + POST_FFE_9 = 22 + """Post Feed-Forward Equalizer #9""" + + POST_FFE_10 = 23 + """Post Feed-Forward Equalizer #10""" + + POST_FFE_11 = 24 + """Post Feed-Forward Equalizer #11""" + + POST_FFE_12 = 25 + """Post Feed-Forward Equalizer #12""" + + POST_FFE_13 = 26 + """Post Feed-Forward Equalizer #13""" + + POST_FFE_14 = 27 + """Post Feed-Forward Equalizer #14""" + + POST_FFE_15 = 28 + """Post Feed-Forward Equalizer #15""" + + POST_FFE_16 = 29 + """Post Feed-Forward Equalizer #16""" + + POST_FFE_17 = 30 + """Post Feed-Forward Equalizer #17""" + + POST_FFE_18 = 31 + """Post Feed-Forward Equalizer #18""" + + POST_FFE_19 = 32 + """Post Feed-Forward Equalizer #19""" + + POST_FFE_20 = 33 + """Post Feed-Forward Equalizer #20""" + + POST_FFE_21 = 34 + """Post Feed-Forward Equalizer #21""" + + POST_FFE_22 = 35 + """Post Feed-Forward Equalizer #22""" + + POST_FFE_23 = 36 + """Post Feed-Forward Equalizer #23""" + class RxEqExtCapMode(IntEnum): """Status for Rx Equalizer Advanced Capability.""" diff --git a/xoa_driver/internals/commands/p_commands.py b/xoa_driver/internals/commands/p_commands.py index d46a7b0a..cd6c9aa7 100644 --- a/xoa_driver/internals/commands/p_commands.py +++ b/xoa_driver/internals/commands/p_commands.py @@ -370,6 +370,155 @@ class GetDataAttr(ResponseBodyStruct): """integer, max match term position in bytes""" stream_misc: int = field(XmpInt(), min_version=457) """integer, bit pattern, what streams on this port can do. [0]: Whether the port supports streams with DEC8/INC16/DEC16 payload. [1]: Whether the port supports INCPLDFROM0 stream option (refer to the PS_OPTIONS command).""" + rxeq_cap_ctle_low_min: int = field(XmpInt(), min_version=457) + """min value of CTLE LOW.""" + rxeq_cap_ctle_high_min: int = field(XmpInt(), min_version=457) + """min value of CTLE HIGH.""" + rxeq_cap_agc_min: int = field(XmpInt(), min_version=457) + """min value of Automatic Gain Control.""" + rxeq_cap_oc_min: int = field(XmpInt(), min_version=457) + """min value of Offset Cancellation.""" + rxeq_cap_ffe_pre1_min: int = field(XmpInt(), min_version=457) + """min value of FFE Pre 1.""" + rxeq_cap_ffe_pre2_min: int = field(XmpInt(), min_version=457) + """min value of FFE Pre 2.""" + rxeq_cap_ffe_pre3_min: int = field(XmpInt(), min_version=457) + """min value of FFE Pre 3.""" + rxeq_cap_ffe_pre4_min: int = field(XmpInt(), min_version=457) + """min value of FFE Pre 4.""" + rxeq_cap_ffe_pre5_min: int = field(XmpInt(), min_version=457) + """min value of FFE Pre 5.""" + rxeq_cap_ffe_pre6_min: int = field(XmpInt(), min_version=457) + """min value of FFE Pre 6.""" + rxeq_cap_ffe_pre7_min: int = field(XmpInt(), min_version=457) + """min value of FFE Pre 7.""" + rxeq_cap_ffe_pre8_min: int = field(XmpInt(), min_version=457) + """min value of FFE Pre 8.""" + rxeq_cap_ffe_post1_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 1.""" + rxeq_cap_ffe_post2_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 2.""" + rxeq_cap_ffe_post3_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 3.""" + rxeq_cap_ffe_post4_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 4.""" + rxeq_cap_ffe_post5_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 5.""" + rxeq_cap_ffe_post6_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 6.""" + rxeq_cap_ffe_post7_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 7.""" + rxeq_cap_ffe_post8_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 8.""" + rxeq_cap_ffe_post9_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 9.""" + rxeq_cap_ffe_post10_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 10.""" + rxeq_cap_ffe_post11_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 11.""" + rxeq_cap_ffe_post12_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 12.""" + rxeq_cap_ffe_post13_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 13.""" + rxeq_cap_ffe_post14_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 14.""" + rxeq_cap_ffe_post15_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 15.""" + rxeq_cap_ffe_post16_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 16.""" + rxeq_cap_ffe_post17_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 17.""" + rxeq_cap_ffe_post18_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 18.""" + rxeq_cap_ffe_post19_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 19.""" + rxeq_cap_ffe_post20_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 20.""" + rxeq_cap_ffe_post21_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 21.""" + rxeq_cap_ffe_post22_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 22.""" + rxeq_cap_ffe_post23_min: int = field(XmpInt(), min_version=457) + """min value of FFE Post 23.""" + rxeq_cap_ctle_low_max: int = field(XmpInt(), min_version=457) + """max value of CTLE LOW.""" + rxeq_cap_ctle_high_max: int = field(XmpInt(), min_version=457) + """max value of CTLE HIGH.""" + rxeq_cap_agc_max: int = field(XmpInt(), min_version=457) + """max value of Automatic Gain Control.""" + rxeq_cap_oc_max: int = field(XmpInt(), min_version=457) + """max value of Offset Cancellation.""" + rxeq_cap_ffe_pre1_max: int = field(XmpInt(), min_version=457) + """max value of FFE Pre 1.""" + rxeq_cap_ffe_pre2_max: int = field(XmpInt(), min_version=457) + """max value of FFE Pre 2.""" + rxeq_cap_ffe_pre3_max: int = field(XmpInt(), min_version=457) + """max value of FFE Pre 3.""" + rxeq_cap_ffe_pre4_max: int = field(XmpInt(), min_version=457) + """max value of FFE Pre 4.""" + rxeq_cap_ffe_pre5_max: int = field(XmpInt(), min_version=457) + """max value of FFE Pre 5.""" + rxeq_cap_ffe_pre6_max: int = field(XmpInt(), min_version=457) + """max value of FFE Pre 6.""" + rxeq_cap_ffe_pre7_max: int = field(XmpInt(), min_version=457) + """max value of FFE Pre 7.""" + rxeq_cap_ffe_pre8_max: int = field(XmpInt(), min_version=457) + """max value of FFE Pre 8.""" + rxeq_cap_ffe_post1_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 1.""" + rxeq_cap_ffe_post2_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 2.""" + rxeq_cap_ffe_post3_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 3.""" + rxeq_cap_ffe_post4_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 4.""" + rxeq_cap_ffe_post5_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 5.""" + rxeq_cap_ffe_post6_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 6.""" + rxeq_cap_ffe_post7_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 7.""" + rxeq_cap_ffe_post8_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 8.""" + rxeq_cap_ffe_post9_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 9.""" + rxeq_cap_ffe_post10_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 10.""" + rxeq_cap_ffe_post11_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 11.""" + rxeq_cap_ffe_post12_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 12.""" + rxeq_cap_ffe_post13_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 13.""" + rxeq_cap_ffe_post14_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 14.""" + rxeq_cap_ffe_post15_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 15.""" + rxeq_cap_ffe_post16_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 16.""" + rxeq_cap_ffe_post17_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 17.""" + rxeq_cap_ffe_post18_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 18.""" + rxeq_cap_ffe_post19_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 19.""" + rxeq_cap_ffe_post20_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 20.""" + rxeq_cap_ffe_post21_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 21.""" + rxeq_cap_ffe_post22_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 22.""" + rxeq_cap_ffe_post23_max: int = field(XmpInt(), min_version=457) + """max value of FFE Post 23.""" + length_histogram_step_max: int = field(XmpInt(), min_version=457) + """minimum step size for length histograms.""" + length_histogram_step_max: int = field(XmpInt(), min_version=457) + """maximum step size for length histograms.""" + latency_histogram_step_max: int = field(XmpInt(), min_version=457) + """minimum step size for latency histograms.""" + latency_histogram_step_max: int = field(XmpInt(), min_version=457) + """maximum step size for latency histograms.""" + def get(self) -> Token[GetDataAttr]: """Get the internal limits, aka. capabilities, of the port. From 2240a4453af10ad60829a12569cc5e061c153b3a Mon Sep 17 00:00:00 2001 From: Leonard Yu Date: Tue, 24 Oct 2023 21:58:02 +0200 Subject: [PATCH 2/2] Add PP_PHYRXEQSTATUS_EXT and PP_PRECODINGSTATUS --- xoa_driver/internals/commands/pp_commands.py | 85 +++++++++++++++++--- 1 file changed, 75 insertions(+), 10 deletions(-) diff --git a/xoa_driver/internals/commands/pp_commands.py b/xoa_driver/internals/commands/pp_commands.py index 4be34408..bc064308 100644 --- a/xoa_driver/internals/commands/pp_commands.py +++ b/xoa_driver/internals/commands/pp_commands.py @@ -1908,6 +1908,40 @@ def set(self, mode: RxEqExtCapMode, value: int) -> Token[None]: return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex, self._capability_type], mode=mode, value=value)) +@register_command +@dataclass +class PP_PHYRXEQSTATUS_EXT: + """ + Get RX EQ advanced parameter values. (Only for Freya modules) + """ + + code: typing.ClassVar[int] = 398 + pushed: typing.ClassVar[bool] = True + + _connection: 'interfaces.IConnection' + _module: int + _port: int + _serdes_xindex: int + _capability_type: RxEqExtCap + + class GetDataAttr(ResponseBodyStruct): + value1: int = field(XmpInt()) + """the 1st value for the capability""" + value2: int = field(XmpInt()) + """the 2nd value for the capability""" + + + def get(self) -> Token[GetDataAttr]: + """Get RX EQ Advanced parameters. + + :return: mode Auto/Manual/Freeze, value. + :rtype: PP_PHYRXEQ_EXT.GetDataAttr + """ + + return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex, self._capability_type])) + + + @register_command @dataclass class PP_AUTONEG: @@ -2030,8 +2064,7 @@ def get(self) -> Token[GetDataAttr]: @dataclass class PP_LINKTRAIN: """ - Link training settings - for Thor-400G-7S-1P rev.B. The PP_LINKTRAIN command is - per port. + Link training settings - for Thor-400G-7S-1P and Freya modules """ code: typing.ClassVar[int] = 383 @@ -2115,8 +2148,7 @@ def set( @dataclass class PP_LINKTRAINSTATUS: """ - Per lane Link training status - for Thor-400G-7S-1P rev.B. The PP_LINKTRAINSTATUS command - is per lane. + Per lane Link training status - for Thor-400G-7S-1P and Freya modules """ code: typing.ClassVar[int] = 384 @@ -2148,7 +2180,7 @@ def get(self) -> Token[GetDataAttr]: @dataclass class PP_PRECODING: """ - GET/SET Pre-Coding Configurations. + GET/SET Pre-Coding Configurations. (only for Freya) """ code: typing.ClassVar[int] = 420 @@ -2201,14 +2233,13 @@ def set(self, rx_mode: PreCodingMode, rx_endianness: Endianness, tx_mode: PreCod :type endianness: Endianness """ - return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex], - rx_mode=rx_mode, rx_endianness=rx_endianness, tx_mode=tx_mode, tx_endianness=tx_endianness)) + return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex], rx_mode=rx_mode, rx_endianness=rx_endianness, tx_mode=tx_mode, tx_endianness=tx_endianness)) @register_command @dataclass class PP_GRAYCODING: """ - GET/SET Gray-Coding Configurations. + GET/SET Gray-Coding Configurations. (only for Freya) """ code: typing.ClassVar[int] = 421 @@ -2261,5 +2292,39 @@ def set(self, rx_mode: GrayCodingMode, rx_endianness: Endianness, tx_mode: GrayC :type endianness: Endianness """ - return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex], - rx_mode=rx_mode, rx_endianness=rx_endianness, tx_mode=tx_mode, tx_endianness=tx_endianness)) + return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex], rx_mode=rx_mode, rx_endianness=rx_endianness, tx_mode=tx_mode, tx_endianness=tx_endianness)) + + +@register_command +@dataclass +class PP_PRECODINGSTATUS: + """ + GET Pre-Coding status (only for Freya) + """ + + code: typing.ClassVar[int] = 422 + pushed: typing.ClassVar[bool] = True + + _connection: 'interfaces.IConnection' + _module: int + _port: int + _serdes_xindex: int + + class GetDataAttr(ResponseBodyStruct): + rx_mode: OnOff = field(XmpInt()) + """RX Mode Off/On""" + rx_endianness: Endianness = field(XmpInt()) + """RX Endianness Normal/Reverted(BigEndian/LittleEndian)) """ + tx_mode: OnOff = field(XmpInt()) + """TX Mode Off/On""" + tx_endianness: Endianness = field(XmpInt()) + """TX Endianness Normal/Reverted(BigEndian/LittleEndian)) """ + + def get(self) -> Token[GetDataAttr]: + """Get the Pre-Coding Configurations. + + :return: Pre-Coding configurations including rx_mode, rx_endianness, tx_mode, and tx_endianness. + :rtype: PP_PRECODING.GetDataAttr + """ + + return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex]))