tdl-xoa-driver 1.0.0b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tdl_xoa_driver-1.0.0b1.dist-info/LICENSE +202 -0
- tdl_xoa_driver-1.0.0b1.dist-info/METADATA +177 -0
- tdl_xoa_driver-1.0.0b1.dist-info/RECORD +325 -0
- tdl_xoa_driver-1.0.0b1.dist-info/WHEEL +5 -0
- tdl_xoa_driver-1.0.0b1.dist-info/top_level.txt +1 -0
- xoa_driver/__init__.py +2 -0
- xoa_driver/enums.py +399 -0
- xoa_driver/exceptions.py +77 -0
- xoa_driver/functions/__init__.py +0 -0
- xoa_driver/functions/anlt.py +744 -0
- xoa_driver/functions/anlt_ll_debug.py +429 -0
- xoa_driver/functions/cli.py +581 -0
- xoa_driver/functions/exceptions.py +72 -0
- xoa_driver/functions/headers.py +608 -0
- xoa_driver/functions/mgmt.py +515 -0
- xoa_driver/functions/tools.py +256 -0
- xoa_driver/hlfuncs.py +18 -0
- xoa_driver/internals/__init__.py +0 -0
- xoa_driver/internals/commands/__init__.py +31 -0
- xoa_driver/internals/commands/c_commands.py +2041 -0
- xoa_driver/internals/commands/enums.py +3289 -0
- xoa_driver/internals/commands/m4_commands.py +700 -0
- xoa_driver/internals/commands/m4e_commands.py +107 -0
- xoa_driver/internals/commands/m_commands.py +1875 -0
- xoa_driver/internals/commands/p4_commands.py +2221 -0
- xoa_driver/internals/commands/p4e_commands.py +160 -0
- xoa_driver/internals/commands/p4g_commands.py +7253 -0
- xoa_driver/internals/commands/p_commands.py +6000 -0
- xoa_driver/internals/commands/pc_commands.py +335 -0
- xoa_driver/internals/commands/pd_commands.py +355 -0
- xoa_driver/internals/commands/pe_commands.py +1018 -0
- xoa_driver/internals/commands/pec_commands.py +265 -0
- xoa_driver/internals/commands/ped_commands.py +1034 -0
- xoa_driver/internals/commands/pef_commands.py +2216 -0
- xoa_driver/internals/commands/pf_commands.py +379 -0
- xoa_driver/internals/commands/pl1_commands.py +1588 -0
- xoa_driver/internals/commands/pl_commands.py +178 -0
- xoa_driver/internals/commands/pm_commands.py +256 -0
- xoa_driver/internals/commands/pp_commands.py +2341 -0
- xoa_driver/internals/commands/pr_commands.py +812 -0
- xoa_driver/internals/commands/ps_commands.py +2311 -0
- xoa_driver/internals/commands/pt_commands.py +370 -0
- xoa_driver/internals/commands/px_commands.py +303 -0
- xoa_driver/internals/commands/subtypes.py +86 -0
- xoa_driver/internals/core/__init__.py +0 -0
- xoa_driver/internals/core/builders.py +39 -0
- xoa_driver/internals/core/exceptions.py +69 -0
- xoa_driver/internals/core/funcs.py +81 -0
- xoa_driver/internals/core/funcs.pyi +1072 -0
- xoa_driver/internals/core/interfaces.py +47 -0
- xoa_driver/internals/core/token.py +44 -0
- xoa_driver/internals/core/transporter/__init__.py +0 -0
- xoa_driver/internals/core/transporter/_processor.py +83 -0
- xoa_driver/internals/core/transporter/_publisher.py +101 -0
- xoa_driver/internals/core/transporter/_request_id_counter.py +28 -0
- xoa_driver/internals/core/transporter/_stream.py +99 -0
- xoa_driver/internals/core/transporter/_typings.py +43 -0
- xoa_driver/internals/core/transporter/exceptions.py +44 -0
- xoa_driver/internals/core/transporter/handler.py +127 -0
- xoa_driver/internals/core/transporter/logger/__init__.py +10 -0
- xoa_driver/internals/core/transporter/logger/__logger.py +94 -0
- xoa_driver/internals/core/transporter/logger/__state_off.py +32 -0
- xoa_driver/internals/core/transporter/logger/__state_on_default.py +70 -0
- xoa_driver/internals/core/transporter/logger/__state_on_loguru.py +51 -0
- xoa_driver/internals/core/transporter/logger/__state_on_user.py +48 -0
- xoa_driver/internals/core/transporter/protocol/__init__.py +0 -0
- xoa_driver/internals/core/transporter/protocol/_constants.py +77 -0
- xoa_driver/internals/core/transporter/protocol/_utils.py +59 -0
- xoa_driver/internals/core/transporter/protocol/exceptions.py +271 -0
- xoa_driver/internals/core/transporter/protocol/payload/__init__.py +70 -0
- xoa_driver/internals/core/transporter/protocol/payload/base_struct.py +283 -0
- xoa_driver/internals/core/transporter/protocol/payload/descriptor.py +119 -0
- xoa_driver/internals/core/transporter/protocol/payload/exceptions.py +20 -0
- xoa_driver/internals/core/transporter/protocol/payload/field.py +296 -0
- xoa_driver/internals/core/transporter/protocol/payload/types.py +173 -0
- xoa_driver/internals/core/transporter/protocol/payload/utils.py +53 -0
- xoa_driver/internals/core/transporter/protocol/struct_header.py +123 -0
- xoa_driver/internals/core/transporter/protocol/struct_request.py +65 -0
- xoa_driver/internals/core/transporter/protocol/struct_response.py +89 -0
- xoa_driver/internals/core/transporter/registry.py +43 -0
- xoa_driver/internals/exceptions/__init__.py +9 -0
- xoa_driver/internals/exceptions/modules.py +13 -0
- xoa_driver/internals/exceptions/testers.py +21 -0
- xoa_driver/internals/hli_v1/__init__.py +0 -0
- xoa_driver/internals/hli_v1/indices/__init__.py +0 -0
- xoa_driver/internals/hli_v1/indices/base_index.py +39 -0
- xoa_driver/internals/hli_v1/indices/connection_group/__init__.py +0 -0
- xoa_driver/internals/hli_v1/indices/connection_group/cg.py +186 -0
- xoa_driver/internals/hli_v1/indices/connection_group/histogram.py +78 -0
- xoa_driver/internals/hli_v1/indices/connection_group/l2.py +94 -0
- xoa_driver/internals/hli_v1/indices/connection_group/l3.py +130 -0
- xoa_driver/internals/hli_v1/indices/connection_group/raw.py +200 -0
- xoa_driver/internals/hli_v1/indices/connection_group/replay.py +109 -0
- xoa_driver/internals/hli_v1/indices/connection_group/tcp.py +314 -0
- xoa_driver/internals/hli_v1/indices/connection_group/tls.py +198 -0
- xoa_driver/internals/hli_v1/indices/connection_group/udp.py +133 -0
- xoa_driver/internals/hli_v1/indices/connection_group/user_state.py +28 -0
- xoa_driver/internals/hli_v1/indices/filter/__init__.py +0 -0
- xoa_driver/internals/hli_v1/indices/filter/base_filter.py +65 -0
- xoa_driver/internals/hli_v1/indices/filter/genuine_filter.py +20 -0
- xoa_driver/internals/hli_v1/indices/length_term.py +49 -0
- xoa_driver/internals/hli_v1/indices/macsecscs/__init__.py +0 -0
- xoa_driver/internals/hli_v1/indices/macsecscs/base_macsecsc.py +224 -0
- xoa_driver/internals/hli_v1/indices/macsecscs/genuine_macsecsc.py +72 -0
- xoa_driver/internals/hli_v1/indices/match_term.py +64 -0
- xoa_driver/internals/hli_v1/indices/port_dataset.py +72 -0
- xoa_driver/internals/hli_v1/indices/streams/__init__.py +0 -0
- xoa_driver/internals/hli_v1/indices/streams/base_stream.py +405 -0
- xoa_driver/internals/hli_v1/indices/streams/genuine_stream.py +64 -0
- xoa_driver/internals/hli_v1/modules/__init__.py +0 -0
- xoa_driver/internals/hli_v1/modules/__interfaces.py +21 -0
- xoa_driver/internals/hli_v1/modules/base_module.py +138 -0
- xoa_driver/internals/hli_v1/modules/module_chimera.py +366 -0
- xoa_driver/internals/hli_v1/modules/module_l23ve.py +73 -0
- xoa_driver/internals/hli_v1/modules/module_l47.py +397 -0
- xoa_driver/internals/hli_v1/modules/module_l47ve.py +9 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/__init__.py +0 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_combi.py +83 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_d.py +75 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_e.py +85 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_f.py +145 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_g.py +84 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_h.py +40 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_i.py +25 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_j.py +25 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_k.py +39 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_l.py +55 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_l1.py +800 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_m.py +25 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_n.py +40 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/module_l23_base.py +383 -0
- xoa_driver/internals/hli_v1/ports/__init__.py +0 -0
- xoa_driver/internals/hli_v1/ports/base_port.py +125 -0
- xoa_driver/internals/hli_v1/ports/port_l23/__init__.py +0 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/__init__.py +0 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_capture.py +70 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_l23.py +527 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_l23_genuine.py +229 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_reception_statistics.py +231 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_transceiver.py +117 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_transmission_statistics.py +131 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/__init__.py +0 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/__init__.py +0 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/_utils.py +15 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/general.py +396 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/shadow.py +104 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/working.py +36 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/pe_custom_distribution.py +125 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/pe_distribution.py +174 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/port_chimera.py +119 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/port_emulation.py +244 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/reception_statistics.py +24 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/transmission_statistics.py +24 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_combi.py +37 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_d.py +51 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_e.py +107 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_f.py +151 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_g.py +77 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_h.py +67 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_i.py +84 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_j.py +68 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_k.py +73 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_l.py +82 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_l1.py +166 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_m.py +29 -0
- xoa_driver/internals/hli_v1/ports/port_l23/fault_jkl.py +24 -0
- xoa_driver/internals/hli_v1/ports/port_l23/freya_l1.py +722 -0
- xoa_driver/internals/hli_v1/ports/port_l23/pcs_pma_ghijkl.py +369 -0
- xoa_driver/internals/hli_v1/ports/port_l23/pcs_pma_ijkl_chimera.py +60 -0
- xoa_driver/internals/hli_v1/ports/port_l23/pcs_pma_l.py +78 -0
- xoa_driver/internals/hli_v1/ports/port_l23/port_l23ve.py +101 -0
- xoa_driver/internals/hli_v1/ports/port_l47/__init__.py +0 -0
- xoa_driver/internals/hli_v1/ports/port_l47/counters.py +174 -0
- xoa_driver/internals/hli_v1/ports/port_l47/main.py +228 -0
- xoa_driver/internals/hli_v1/ports/port_l47/packet_engine.py +31 -0
- xoa_driver/internals/hli_v1/revisions.py +11 -0
- xoa_driver/internals/hli_v1/testers/__init__.py +0 -0
- xoa_driver/internals/hli_v1/testers/_base_tester.py +259 -0
- xoa_driver/internals/hli_v1/testers/genuine/__init__.py +0 -0
- xoa_driver/internals/hli_v1/testers/genuine/l_23/__init__.py +0 -0
- xoa_driver/internals/hli_v1/testers/genuine/l_23/health.py +16 -0
- xoa_driver/internals/hli_v1/testers/genuine/l_23/rest_api.py +38 -0
- xoa_driver/internals/hli_v1/testers/genuine/l_23/time_keeper.py +57 -0
- xoa_driver/internals/hli_v1/testers/genuine/l_23/upload_file.py +29 -0
- xoa_driver/internals/hli_v1/testers/genuine/management_interface.py +42 -0
- xoa_driver/internals/hli_v1/testers/l23_tester.py +196 -0
- xoa_driver/internals/hli_v1/testers/l23ve_tester.py +114 -0
- xoa_driver/internals/hli_v1/testers/l47_tester.py +106 -0
- xoa_driver/internals/hli_v1/testers/l47ve_tester.py +54 -0
- xoa_driver/internals/hli_v2/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/base_index.py +39 -0
- xoa_driver/internals/hli_v2/indices/connection_group/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/connection_group/cg.py +115 -0
- xoa_driver/internals/hli_v2/indices/connection_group/histogram.py +59 -0
- xoa_driver/internals/hli_v2/indices/connection_group/l2.py +71 -0
- xoa_driver/internals/hli_v2/indices/connection_group/l3.py +96 -0
- xoa_driver/internals/hli_v2/indices/connection_group/raw.py +148 -0
- xoa_driver/internals/hli_v2/indices/connection_group/replay.py +89 -0
- xoa_driver/internals/hli_v2/indices/connection_group/tcp.py +261 -0
- xoa_driver/internals/hli_v2/indices/connection_group/tls.py +166 -0
- xoa_driver/internals/hli_v2/indices/connection_group/udp.py +112 -0
- xoa_driver/internals/hli_v2/indices/connection_group/user_state.py +25 -0
- xoa_driver/internals/hli_v2/indices/filter/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/filter/base_filter.py +50 -0
- xoa_driver/internals/hli_v2/indices/filter/genuine_filter.py +17 -0
- xoa_driver/internals/hli_v2/indices/length_term.py +44 -0
- xoa_driver/internals/hli_v2/indices/match_term.py +49 -0
- xoa_driver/internals/hli_v2/indices/port_dataset.py +53 -0
- xoa_driver/internals/hli_v2/indices/streams/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/streams/base_stream.py +234 -0
- xoa_driver/internals/hli_v2/indices/streams/genuine_stream.py +32 -0
- xoa_driver/internals/hli_v2/modules/__init__.py +0 -0
- xoa_driver/internals/hli_v2/modules/__interfaces.py +21 -0
- xoa_driver/internals/hli_v2/modules/base_module.py +125 -0
- xoa_driver/internals/hli_v2/modules/module_chimera.py +358 -0
- xoa_driver/internals/hli_v2/modules/module_l23ve.py +58 -0
- xoa_driver/internals/hli_v2/modules/module_l47.py +230 -0
- xoa_driver/internals/hli_v2/modules/module_l47ve.py +8 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/__init__.py +0 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_combi.py +73 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_d.py +75 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_e.py +85 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_f.py +144 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_g.py +84 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_h.py +40 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_i.py +25 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_j.py +25 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_k.py +39 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_l.py +55 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_l1.py +797 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_m.py +25 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_n.py +40 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/module_l23_base.py +339 -0
- xoa_driver/internals/hli_v2/ports/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/base_port.py +105 -0
- xoa_driver/internals/hli_v2/ports/port_l23/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_capture.py +64 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_l23.py +441 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_l23_genuine.py +172 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_reception_statistics.py +156 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_transceiver.py +117 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_transmission_statistics.py +59 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/_utils.py +15 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/general.py +340 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/shadow.py +99 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/working.py +36 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/pe_custom_distribution.py +116 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/pe_distribution.py +102 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/port_chimera.py +113 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/port_emulation.py +420 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/reception_statistics.py +22 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/transmission_statistics.py +22 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_combi.py +36 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_d.py +49 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_e.py +96 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_f.py +144 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_g.py +77 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_h.py +60 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_i.py +66 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_j.py +53 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_k.py +58 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_l.py +67 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_l1.py +149 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_m.py +28 -0
- xoa_driver/internals/hli_v2/ports/port_l23/fault_jkl.py +22 -0
- xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_ghijkl.py +342 -0
- xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_ijkl_chimera.py +50 -0
- xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_l.py +65 -0
- xoa_driver/internals/hli_v2/ports/port_l23/port_l23ve.py +81 -0
- xoa_driver/internals/hli_v2/ports/port_l47/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/port_l47/counters.py +146 -0
- xoa_driver/internals/hli_v2/ports/port_l47/main.py +137 -0
- xoa_driver/internals/hli_v2/ports/port_l47/packet_engine.py +20 -0
- xoa_driver/internals/hli_v2/revisions.py +11 -0
- xoa_driver/internals/hli_v2/testers/__init__.py +0 -0
- xoa_driver/internals/hli_v2/testers/_base_tester.py +207 -0
- xoa_driver/internals/hli_v2/testers/genuine/__init__.py +0 -0
- xoa_driver/internals/hli_v2/testers/genuine/l_23/__init__.py +0 -0
- xoa_driver/internals/hli_v2/testers/genuine/l_23/health.py +16 -0
- xoa_driver/internals/hli_v2/testers/genuine/l_23/rest_api.py +34 -0
- xoa_driver/internals/hli_v2/testers/genuine/l_23/time_keeper.py +50 -0
- xoa_driver/internals/hli_v2/testers/genuine/l_23/upload_file.py +26 -0
- xoa_driver/internals/hli_v2/testers/genuine/management_interface.py +38 -0
- xoa_driver/internals/hli_v2/testers/l23_tester.py +159 -0
- xoa_driver/internals/hli_v2/testers/l23ve_tester.py +98 -0
- xoa_driver/internals/hli_v2/testers/l47_tester.py +95 -0
- xoa_driver/internals/hli_v2/testers/l47ve_tester.py +50 -0
- xoa_driver/internals/state_storage/__init__.py +0 -0
- xoa_driver/internals/state_storage/_speed_detector.py +121 -0
- xoa_driver/internals/state_storage/modules_state.py +128 -0
- xoa_driver/internals/state_storage/ports_state.py +154 -0
- xoa_driver/internals/state_storage/testers_state.py +104 -0
- xoa_driver/internals/utils/__init__.py +0 -0
- xoa_driver/internals/utils/attributes.py +33 -0
- xoa_driver/internals/utils/cap_id.py +63 -0
- xoa_driver/internals/utils/con_traffic_light.py +88 -0
- xoa_driver/internals/utils/indices/__init__.py +0 -0
- xoa_driver/internals/utils/indices/_interfaces.py +26 -0
- xoa_driver/internals/utils/indices/header_modifier_manager.py +56 -0
- xoa_driver/internals/utils/indices/index_manager.py +95 -0
- xoa_driver/internals/utils/indices/observer.py +17 -0
- xoa_driver/internals/utils/kind.py +19 -0
- xoa_driver/internals/utils/managers/__init__.py +0 -0
- xoa_driver/internals/utils/managers/abc.py +44 -0
- xoa_driver/internals/utils/managers/exceptions.py +22 -0
- xoa_driver/internals/utils/managers/modules_manager.py +118 -0
- xoa_driver/internals/utils/managers/ports_manager.py +116 -0
- xoa_driver/internals/utils/rev_tool.py +21 -0
- xoa_driver/internals/utils/session.py +117 -0
- xoa_driver/internals/warn.py +32 -0
- xoa_driver/lli.py +15 -0
- xoa_driver/misc.py +57 -0
- xoa_driver/modules.py +448 -0
- xoa_driver/ports.py +332 -0
- xoa_driver/testers.py +37 -0
- xoa_driver/utils.py +12 -0
- xoa_driver/v2/__init__.py +11 -0
- xoa_driver/v2/misc.py +77 -0
- xoa_driver/v2/modules.py +308 -0
- xoa_driver/v2/ports.py +232 -0
- xoa_driver/v2/testers.py +24 -0
|
@@ -0,0 +1,744 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from dataclasses import dataclass, field
|
|
3
|
+
import typing as t
|
|
4
|
+
from xoa_driver import enums
|
|
5
|
+
from xoa_driver.utils import apply
|
|
6
|
+
from xoa_driver.internals.hli_v1.ports.port_l23.family_l import FamilyL
|
|
7
|
+
from xoa_driver.internals.hli_v1.ports.port_l23.family_l1 import FamilyFreya
|
|
8
|
+
from xoa_driver.ports import GenericL23Port
|
|
9
|
+
from xoa_driver.lli import commands
|
|
10
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
11
|
+
from xoa_driver.misc import Token
|
|
12
|
+
from .tools import (
|
|
13
|
+
get_ctx,
|
|
14
|
+
dictionize_autoneg_status,
|
|
15
|
+
dictionize_lt_status,
|
|
16
|
+
dictionize_txtap_get,
|
|
17
|
+
dictionize_anlt_status,
|
|
18
|
+
dictionize_lt_im_status,
|
|
19
|
+
dictionize_lt_algorithm_status,
|
|
20
|
+
dictionize_anlt_log_ctrl_status
|
|
21
|
+
)
|
|
22
|
+
import asyncio
|
|
23
|
+
|
|
24
|
+
PcsPmaSupported = (FamilyL, FamilyFreya)
|
|
25
|
+
AutoNegSupported = (FamilyL, FamilyFreya)
|
|
26
|
+
LinkTrainingSupported = FamilyL
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass
|
|
30
|
+
class DoAnlt:
|
|
31
|
+
port: GenericL23Port
|
|
32
|
+
"""port object"""
|
|
33
|
+
should_do_an: bool
|
|
34
|
+
"""should the port do autoneg?"""
|
|
35
|
+
should_do_lt: bool
|
|
36
|
+
"""should the port do link training?"""
|
|
37
|
+
an_allow_loopback: bool
|
|
38
|
+
"""should the autoneg allow loopback?"""
|
|
39
|
+
lt_preset0: enums.FreyaOutOfSyncPreset
|
|
40
|
+
"""out-of-sync tap values (preset 0): existing or standard"""
|
|
41
|
+
lt_initial_modulations: dict[str, enums.LinkTrainEncoding]
|
|
42
|
+
"""the initial modulations of each serdes"""
|
|
43
|
+
should_lt_interactive: bool
|
|
44
|
+
"""should perform link training manually?"""
|
|
45
|
+
lt_algorithm: dict[str, enums.LinkTrainAlgorithm]
|
|
46
|
+
"""link training algorithm should be used?"""
|
|
47
|
+
should_enable_lt_timeout: bool
|
|
48
|
+
"""should the port do link training with timeout enabled?"""
|
|
49
|
+
|
|
50
|
+
_group: tuple["itf.IConnection", int, int] = field(init=False, repr=False)
|
|
51
|
+
|
|
52
|
+
def __post_init__(self) -> None:
|
|
53
|
+
self._group = get_ctx(self.port)
|
|
54
|
+
|
|
55
|
+
# def __pp_autoneg(self, on: bool) -> Token:
|
|
56
|
+
# state = enums.FreyaAutonegMode.ENABLED if on else enums.FreyaAutonegMode.DISABLED
|
|
57
|
+
# return commands.PL1_AUTONEG_CONFIG(*self._group).set(
|
|
58
|
+
|
|
59
|
+
# )
|
|
60
|
+
# return commands.PP_AUTONEG(*self._group).set(
|
|
61
|
+
# state,
|
|
62
|
+
# enums.AutoNegTecAbility.DEFAULT_TECH_MODE,
|
|
63
|
+
# enums.AutoNegFECOption.DEFAULT_FEC,
|
|
64
|
+
# enums.AutoNegFECOption.DEFAULT_FEC,
|
|
65
|
+
# enums.PauseMode.NO_PAUSE,
|
|
66
|
+
# )
|
|
67
|
+
|
|
68
|
+
def __pl1_linktrain_config(
|
|
69
|
+
self,
|
|
70
|
+
ooo_preset: enums.FreyaOutOfSyncPreset,
|
|
71
|
+
timeout_mode: enums.TimeoutMode,
|
|
72
|
+
) -> Token:
|
|
73
|
+
return commands.PL1_LINKTRAIN_CONFIG(*self._group).set(
|
|
74
|
+
oos_preset=ooo_preset,
|
|
75
|
+
timeout_mode=timeout_mode,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
def __pl1_cfg_tmp(
|
|
79
|
+
self, serdes: int, config_type: enums.Layer1ConfigType, values: list[int]
|
|
80
|
+
) -> Token:
|
|
81
|
+
return commands.PL1_CFG_TMP(*self._group, serdes, config_type).set(
|
|
82
|
+
values=values
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
def __pl1_anlt(
|
|
86
|
+
self,
|
|
87
|
+
an_mode: enums.FreyaAutonegMode,
|
|
88
|
+
lt_mode: enums.FreyaLinkTrainingMode,
|
|
89
|
+
) -> Token:
|
|
90
|
+
return commands.PL1_ANLT(*self._group).set(
|
|
91
|
+
an_mode=an_mode,
|
|
92
|
+
lt_mode=lt_mode,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
def __select_modes(self) -> tuple[enums.FreyaAutonegMode, enums.FreyaLinkTrainingMode, enums.TimeoutMode]:
|
|
96
|
+
if self.should_do_an == True:
|
|
97
|
+
_an_mode = enums.FreyaAutonegMode.ENABLED
|
|
98
|
+
else:
|
|
99
|
+
_an_mode = enums.FreyaAutonegMode.DISABLED
|
|
100
|
+
if self.should_do_lt == True:
|
|
101
|
+
# LT interactive must always disable LT timeout
|
|
102
|
+
if self.should_lt_interactive == True:
|
|
103
|
+
_lt_mode = enums.FreyaLinkTrainingMode.ENABLED_INTERACTIVE
|
|
104
|
+
_timeout_mode = enums.TimeoutMode.DISABLED
|
|
105
|
+
# For LT auto, you can either enable LT timeout or disable LT timeout
|
|
106
|
+
elif self.should_enable_lt_timeout == True:
|
|
107
|
+
_lt_mode = enums.FreyaLinkTrainingMode.ENABLED_AUTO
|
|
108
|
+
_timeout_mode = enums.TimeoutMode.DEFAULT
|
|
109
|
+
else:
|
|
110
|
+
_lt_mode = enums.FreyaLinkTrainingMode.ENABLED_AUTO
|
|
111
|
+
_timeout_mode = enums.TimeoutMode.DISABLED
|
|
112
|
+
else:
|
|
113
|
+
_lt_mode = enums.FreyaLinkTrainingMode.DISABLED
|
|
114
|
+
_timeout_mode = enums.TimeoutMode.DISABLED
|
|
115
|
+
|
|
116
|
+
return _an_mode, _lt_mode, _timeout_mode
|
|
117
|
+
|
|
118
|
+
def __builder__(self) -> t.Generator[Token, None, None]:
|
|
119
|
+
"""Defining commands sequence"""
|
|
120
|
+
|
|
121
|
+
# # Set autoneg timeout
|
|
122
|
+
# yield self.__pl1_linktrain_config(
|
|
123
|
+
# enums.LinkTrainingMode.DISABLED,
|
|
124
|
+
# enums.NRZPreset.NRZ_NO_PRESET,
|
|
125
|
+
# enums.TimeoutMode.DEFAULT,
|
|
126
|
+
# )
|
|
127
|
+
|
|
128
|
+
# # Set autoneg allow-loopback
|
|
129
|
+
yield self.__pl1_cfg_tmp(
|
|
130
|
+
0, enums.Layer1ConfigType.AN_LOOPBACK, [int(self.an_allow_loopback)]
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
# yield self.__pp_autoneg(self.should_do_an and not self.should_do_lt)
|
|
134
|
+
# if (not self.should_do_an) or self.should_do_lt:
|
|
135
|
+
# Disable autoneg
|
|
136
|
+
# yield self.__pp_autoneg(False)
|
|
137
|
+
|
|
138
|
+
# Set the link train algorithm
|
|
139
|
+
for serdes_str, algorithm in self.lt_algorithm.items():
|
|
140
|
+
yield self.__pl1_cfg_tmp(
|
|
141
|
+
int(serdes_str), enums.Layer1ConfigType.LT_TRAINING_ALGORITHM, [algorithm.value]
|
|
142
|
+
)
|
|
143
|
+
# Set the link train initial modulation
|
|
144
|
+
for serdes_str, im in self.lt_initial_modulations.items():
|
|
145
|
+
yield self.__pl1_cfg_tmp(
|
|
146
|
+
int(serdes_str), enums.Layer1ConfigType.LT_INITIAL_MODULATION, [im.value]
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
# Get the mode
|
|
150
|
+
_an_mode, _lt_mode, _timeout_mode = self.__select_modes()
|
|
151
|
+
|
|
152
|
+
# Set link train config
|
|
153
|
+
_ooo_preset = self.lt_preset0
|
|
154
|
+
yield self.__pl1_linktrain_config(
|
|
155
|
+
_ooo_preset, _timeout_mode
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
# Start AN/LT
|
|
159
|
+
yield self.__pl1_anlt(
|
|
160
|
+
_an_mode, _lt_mode
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
async def run(self) -> None:
|
|
165
|
+
"""Start anlt execution"""
|
|
166
|
+
await apply(*self.__builder__())
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
async def anlt_start(
|
|
170
|
+
port: GenericL23Port,
|
|
171
|
+
should_do_an: bool,
|
|
172
|
+
should_do_lt: bool,
|
|
173
|
+
an_allow_loopback: bool,
|
|
174
|
+
lt_preset0: enums.FreyaOutOfSyncPreset,
|
|
175
|
+
lt_initial_modulations: dict[str, enums.LinkTrainEncoding],
|
|
176
|
+
should_lt_interactive: bool,
|
|
177
|
+
lt_algorithm: dict[str, enums.LinkTrainAlgorithm],
|
|
178
|
+
should_enable_lt_timeout: bool,
|
|
179
|
+
) -> None:
|
|
180
|
+
"""
|
|
181
|
+
.. versionchanged:: 2.5
|
|
182
|
+
|
|
183
|
+
Start ANLT on a port
|
|
184
|
+
|
|
185
|
+
:param port: the port object
|
|
186
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
187
|
+
:param should_do_an: should the port do autoneg?
|
|
188
|
+
:type should_do_an: bool
|
|
189
|
+
:param should_do_lt: should the port do link training?
|
|
190
|
+
:type should_do_lt: bool
|
|
191
|
+
:param an_allow_loopback: should the autoneg allow loopback?
|
|
192
|
+
:type an_allow_loopback: bool
|
|
193
|
+
:param lt_preset0: out-of-sync tap values (preset 0): existing or standard
|
|
194
|
+
:type lt_preset0: enums.FreyaOutOfSyncPreset
|
|
195
|
+
:param lt_initial_modulations: the initial modulations of each serdes
|
|
196
|
+
:type lt_initial_modulations: typing.Dict[str, enums.LinkTrainEncoding]
|
|
197
|
+
:param should_lt_interactive: should perform link training manually?
|
|
198
|
+
:type should_lt_interactive: bool
|
|
199
|
+
:param lt_algorithm: Link training algorithm to use
|
|
200
|
+
:type lt_algorithm: Dict[str, enums.LinkTrainAlgorithm]
|
|
201
|
+
:param should_enable_lt_timeout: should run link training with timeout?
|
|
202
|
+
:type should_enable_lt_timeout: bool
|
|
203
|
+
"""
|
|
204
|
+
|
|
205
|
+
anlt = DoAnlt(
|
|
206
|
+
port,
|
|
207
|
+
should_do_an,
|
|
208
|
+
should_do_lt,
|
|
209
|
+
an_allow_loopback,
|
|
210
|
+
lt_preset0,
|
|
211
|
+
lt_initial_modulations,
|
|
212
|
+
should_lt_interactive,
|
|
213
|
+
lt_algorithm,
|
|
214
|
+
should_enable_lt_timeout,
|
|
215
|
+
)
|
|
216
|
+
await anlt.run()
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
async def autoneg_status(port: GenericL23Port) -> dict[str, t.Any]:
|
|
220
|
+
"""
|
|
221
|
+
.. versionchanged:: 2.5
|
|
222
|
+
|
|
223
|
+
Get the auto-negotiation status
|
|
224
|
+
|
|
225
|
+
:param port: the port object
|
|
226
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
227
|
+
:return:
|
|
228
|
+
:rtype: typing.Dict[str, typing.Any]
|
|
229
|
+
"""
|
|
230
|
+
conn, mid, pid = get_ctx(port)
|
|
231
|
+
loopback, auto_neg_info, status = await apply(
|
|
232
|
+
commands.PL1_CFG_TMP(
|
|
233
|
+
conn, mid, pid, 0, enums.Layer1ConfigType.AN_LOOPBACK
|
|
234
|
+
).get(),
|
|
235
|
+
commands.PL1_AUTONEGINFO(conn, mid, pid, 0).get(),
|
|
236
|
+
commands.PL1_AUTONEG_STATUS(conn, mid, pid).get(),
|
|
237
|
+
)
|
|
238
|
+
return dictionize_autoneg_status(loopback, auto_neg_info, status)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
LinkTrainType = t.Union[
|
|
242
|
+
enums.LinkTrainCoeffs,
|
|
243
|
+
enums.LinkTrainPresets,
|
|
244
|
+
enums.LinkTrainEncoding,
|
|
245
|
+
enums.LinkTrainAnnounce,
|
|
246
|
+
]
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
async def __lt_coeff(
|
|
250
|
+
port: GenericL23Port,
|
|
251
|
+
serdes: int,
|
|
252
|
+
arg: LinkTrainType,
|
|
253
|
+
*,
|
|
254
|
+
cmd: enums.LinkTrainCmd,
|
|
255
|
+
) -> enums.LinkTrainCmdResults:
|
|
256
|
+
conn, mid, pid = get_ctx(port)
|
|
257
|
+
cmd_ = commands.PL1_LINKTRAIN_CMD(conn, mid, pid, serdes)
|
|
258
|
+
await cmd_.set(cmd=cmd, arg=arg.value)
|
|
259
|
+
for _ in range(1000):
|
|
260
|
+
resp = await cmd_.get()
|
|
261
|
+
status = resp.result
|
|
262
|
+
if (resp.flags & enums.LinkTrainCmdFlags.DONE.value):
|
|
263
|
+
return enums.LinkTrainCmdResults(status)
|
|
264
|
+
await asyncio.sleep(0.01)
|
|
265
|
+
return enums.LinkTrainCmdResults.UNKNOWN
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
async def lt_coeff_inc(
|
|
269
|
+
port: GenericL23Port,
|
|
270
|
+
serdes: int,
|
|
271
|
+
emphasis: enums.LinkTrainCoeffs
|
|
272
|
+
) -> enums.LinkTrainCmdResults:
|
|
273
|
+
"""
|
|
274
|
+
.. versionadded:: 1.1
|
|
275
|
+
|
|
276
|
+
Ask the remote port to increase coeff of the specified serdes.
|
|
277
|
+
|
|
278
|
+
:param port: the port object
|
|
279
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
280
|
+
:param serdes: the serdes index, starting from 0
|
|
281
|
+
:type serdes: int
|
|
282
|
+
:param emphasis: the emphasis to increase
|
|
283
|
+
:type emphasis: enums.LinkTrainCoeffs
|
|
284
|
+
:return:
|
|
285
|
+
:rtype: None
|
|
286
|
+
"""
|
|
287
|
+
return await __lt_coeff(port, serdes, emphasis, cmd=enums.LinkTrainCmd.CMD_INC)
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
async def lt_coeff_dec(
|
|
291
|
+
port: GenericL23Port,
|
|
292
|
+
serdes: int,
|
|
293
|
+
emphasis: enums.LinkTrainCoeffs
|
|
294
|
+
) -> enums.LinkTrainCmdResults:
|
|
295
|
+
"""
|
|
296
|
+
.. versionadded:: 1.1
|
|
297
|
+
|
|
298
|
+
Ask the remote port to decrease coeff of the specified serdes.
|
|
299
|
+
|
|
300
|
+
:param port: the port object
|
|
301
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
302
|
+
:param serdes: the serdes index, starting from 0
|
|
303
|
+
:type serdes: int
|
|
304
|
+
:param emphasis: the emphasis to decrease
|
|
305
|
+
:type emphasis: enums.LinkTrainCoeffs
|
|
306
|
+
:return:
|
|
307
|
+
:rtype: None
|
|
308
|
+
"""
|
|
309
|
+
return await __lt_coeff(port, serdes, emphasis, cmd=enums.LinkTrainCmd.CMD_DEC)
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
async def lt_coeff_no_eq(
|
|
313
|
+
port: GenericL23Port,
|
|
314
|
+
serdes: int,
|
|
315
|
+
emphasis: enums.LinkTrainCoeffs
|
|
316
|
+
) -> enums.LinkTrainCmdResults:
|
|
317
|
+
|
|
318
|
+
"""
|
|
319
|
+
.. versionadded:: 2.0
|
|
320
|
+
|
|
321
|
+
Ask the remote port to set the coeff to NO_EQ on the specified serdes.
|
|
322
|
+
|
|
323
|
+
:param port: the port object
|
|
324
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
325
|
+
:param serdes: the serdes index, starting from 0
|
|
326
|
+
:type serdes: int
|
|
327
|
+
:param emphasis: the emphasis to set to NO_EQ
|
|
328
|
+
:type emphasis: enums.LinkTrainCoeffs
|
|
329
|
+
:return:
|
|
330
|
+
:rtype: None
|
|
331
|
+
"""
|
|
332
|
+
return await __lt_coeff(port, serdes, emphasis, cmd=enums.LinkTrainCmd.CMD_NO_EQ)
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
async def lt_preset(
|
|
336
|
+
port: GenericL23Port,
|
|
337
|
+
serdes: int,
|
|
338
|
+
preset: enums.LinkTrainPresets
|
|
339
|
+
) -> enums.LinkTrainCmdResults:
|
|
340
|
+
"""
|
|
341
|
+
.. versionadded:: 1.1
|
|
342
|
+
|
|
343
|
+
Ask the remote port to use the preset of the specified serdes.
|
|
344
|
+
|
|
345
|
+
:param port: the port object
|
|
346
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
347
|
+
:param serdes: the serdes index, starting from 0
|
|
348
|
+
:type serdes: int
|
|
349
|
+
:param preset: preset index to select for the serdes, 0,1,2,3,4,
|
|
350
|
+
:type preset: enums.LinkTrainPresets
|
|
351
|
+
:return:
|
|
352
|
+
:rtype: None
|
|
353
|
+
"""
|
|
354
|
+
return await __lt_coeff(port, serdes, preset, cmd=enums.LinkTrainCmd.CMD_PRESET)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
async def lt_encoding(
|
|
358
|
+
port: GenericL23Port,
|
|
359
|
+
serdes: int,
|
|
360
|
+
encoding: enums.LinkTrainEncoding
|
|
361
|
+
) -> enums.LinkTrainCmdResults:
|
|
362
|
+
"""
|
|
363
|
+
.. versionadded:: 1.1
|
|
364
|
+
|
|
365
|
+
Ask the remote port to use the encoding of the specified serdes.
|
|
366
|
+
|
|
367
|
+
:param port: the port object
|
|
368
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
369
|
+
:param serdes: the serdes index, starting from 0
|
|
370
|
+
:type serdes: int
|
|
371
|
+
:param encoding: link training encoding
|
|
372
|
+
:type encoding: enums.LinkTrainCoeffs
|
|
373
|
+
:return:
|
|
374
|
+
:rtype: None
|
|
375
|
+
"""
|
|
376
|
+
return await __lt_coeff(port, serdes, encoding, cmd=enums.LinkTrainCmd.CMD_ENCODING)
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
async def lt_trained(port: GenericL23Port, serdes: int) -> enums.LinkTrainCmdResults:
|
|
380
|
+
"""
|
|
381
|
+
.. versionadded:: 1.1
|
|
382
|
+
|
|
383
|
+
Tell the remote port that the current serdes is trained.
|
|
384
|
+
|
|
385
|
+
:param port: the port object
|
|
386
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
387
|
+
:param serdes: the serdes index, starting from 0
|
|
388
|
+
:type serdes: int
|
|
389
|
+
:return:
|
|
390
|
+
:rtype: None
|
|
391
|
+
"""
|
|
392
|
+
return await __lt_coeff(
|
|
393
|
+
port,
|
|
394
|
+
serdes,
|
|
395
|
+
arg=enums.LinkTrainAnnounce.TRAINED,
|
|
396
|
+
cmd=enums.LinkTrainCmd.CMD_LOCAL_TRAINED,
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
async def lt_status(port: GenericL23Port, serdes: int) -> dict[str, t.Any]:
|
|
401
|
+
"""
|
|
402
|
+
.. versionchanged:: 2.5
|
|
403
|
+
|
|
404
|
+
Show the link training status.
|
|
405
|
+
|
|
406
|
+
:param port: the port object
|
|
407
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
408
|
+
:param serdes: the serdes index, starting from 0
|
|
409
|
+
:type serdes: int
|
|
410
|
+
:return: LT status of the serdes
|
|
411
|
+
:rtype: typing.Dict[str, typing.Any]
|
|
412
|
+
"""
|
|
413
|
+
conn, mid, pid = get_ctx(port)
|
|
414
|
+
status, info, ltconf, cfg = await apply(
|
|
415
|
+
commands.PL1_LINKTRAIN_STATUS(conn, mid, pid, serdes).get(),
|
|
416
|
+
commands.PL1_LINKTRAININFO(conn, mid, pid, serdes, 0).get(),
|
|
417
|
+
commands.PL1_LINKTRAIN_CONFIG(conn, mid, pid).get(),
|
|
418
|
+
commands.PL1_CFG_TMP(
|
|
419
|
+
conn, mid, pid, serdes, enums.Layer1ConfigType.LT_INITIAL_MODULATION
|
|
420
|
+
).get(),
|
|
421
|
+
)
|
|
422
|
+
total_bit_count = (info.prbs_total_bits_high << 32) + info.prbs_total_bits_low
|
|
423
|
+
total_error_bit_count = (
|
|
424
|
+
info.prbs_total_error_bits_high << 32
|
|
425
|
+
) + info.prbs_total_error_bits_low
|
|
426
|
+
ber = total_error_bit_count / total_bit_count if total_bit_count > 0 else float("nan")
|
|
427
|
+
return dictionize_lt_status(
|
|
428
|
+
status, info, ltconf, cfg, ber, total_bit_count, total_error_bit_count
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
async def txtap_get(port: GenericL23Port, serdes: int) -> dict[str, int]:
|
|
433
|
+
"""
|
|
434
|
+
.. versionadded:: 1.1
|
|
435
|
+
|
|
436
|
+
Get the tap value of the local TX tap.
|
|
437
|
+
|
|
438
|
+
:param port: the port object
|
|
439
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
440
|
+
:param serdes: the serdes index, starting from 0
|
|
441
|
+
:type serdes: int
|
|
442
|
+
:return: tap values of the serdes
|
|
443
|
+
:rtype: typing.Dict[str, int]
|
|
444
|
+
"""
|
|
445
|
+
conn, mid, pid = get_ctx(port)
|
|
446
|
+
r = await commands.PP_PHYTXEQ(conn, mid, pid, serdes).get()
|
|
447
|
+
return dictionize_txtap_get(r)
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
async def txtap_set(
|
|
451
|
+
port: GenericL23Port,
|
|
452
|
+
serdes: int,
|
|
453
|
+
pre3: int,
|
|
454
|
+
pre2: int,
|
|
455
|
+
pre: int,
|
|
456
|
+
main: int,
|
|
457
|
+
post1: int,
|
|
458
|
+
) -> None:
|
|
459
|
+
"""
|
|
460
|
+
.. versionadded:: 1.1
|
|
461
|
+
|
|
462
|
+
Set the tap value of the local TX tap.
|
|
463
|
+
|
|
464
|
+
:param port: the port object
|
|
465
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
466
|
+
:param serdes: the serdes index, starting from 0
|
|
467
|
+
:type serdes: int
|
|
468
|
+
:param pre3: pre3 value
|
|
469
|
+
:type pre3: int
|
|
470
|
+
:param pre2: pre2 value
|
|
471
|
+
:type pre2: int
|
|
472
|
+
:param pre: pre value
|
|
473
|
+
:type pre: int
|
|
474
|
+
:param main: main value
|
|
475
|
+
:type main: int
|
|
476
|
+
:param post1: post1 value
|
|
477
|
+
:type post1: int
|
|
478
|
+
:return:
|
|
479
|
+
:rtype: None
|
|
480
|
+
"""
|
|
481
|
+
conn, mid, pid = get_ctx(port)
|
|
482
|
+
cmd_ = commands.PP_PHYTXEQ(conn, mid, pid, serdes)
|
|
483
|
+
await cmd_.set(
|
|
484
|
+
pre=pre,
|
|
485
|
+
main=main,
|
|
486
|
+
post=post1,
|
|
487
|
+
pre2=pre2,
|
|
488
|
+
pre3_post2=pre3,
|
|
489
|
+
post3=0,
|
|
490
|
+
)
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
async def anlt_link_recovery(port: GenericL23Port, restart_link_down: bool, restart_lt_failure: bool) -> None:
|
|
494
|
+
"""
|
|
495
|
+
This command manages the auto-restart features.
|
|
496
|
+
|
|
497
|
+
:param port: the port object
|
|
498
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
499
|
+
:param restart_link_down: enable AN+LT auto-restart when a link down condition is detected. A "link down" state signifies the loss of a valid input signal, which can occur due to events such as cable unplugging and re-plugging, TX disable, or link flap on the link partner's end. The auto-restart process will continue until the link is re-established. Please note that this setting is only effective when AN and/or LT are enabled.
|
|
500
|
+
:type restart_link_down: bool
|
|
501
|
+
:param restart_lt_failure: if LT is enabled and experiences a failure on either side, the port will initiate the AN+LT restart process repeatedly until LT succeeds. This functionality is only applicable when LT is enabled.
|
|
502
|
+
:type restart_lt_failure: bool
|
|
503
|
+
:return:
|
|
504
|
+
:rtype: None
|
|
505
|
+
"""
|
|
506
|
+
conn, mid, pid = get_ctx(port)
|
|
507
|
+
param = 0
|
|
508
|
+
if restart_link_down == True:
|
|
509
|
+
param += 1
|
|
510
|
+
if restart_lt_failure == True:
|
|
511
|
+
param += 2
|
|
512
|
+
cmd_ = commands.PL1_CFG_TMP(
|
|
513
|
+
conn, mid, pid, 0, enums.Layer1ConfigType.AUTO_LINK_RECOVERY
|
|
514
|
+
)
|
|
515
|
+
await cmd_.set(values=[param])
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
async def anlt_status(port: GenericL23Port) -> dict[str, t.Any]:
|
|
519
|
+
"""
|
|
520
|
+
.. versionchanged:: 2.5
|
|
521
|
+
|
|
522
|
+
Get the overview of ANLT status
|
|
523
|
+
|
|
524
|
+
:param port: the port object
|
|
525
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
526
|
+
:return: AN/LT status of the port
|
|
527
|
+
:rtype: typing.Dict[str, typing.Any]
|
|
528
|
+
"""
|
|
529
|
+
|
|
530
|
+
# if not isinstance(port, LinkTrainingSupported):
|
|
531
|
+
# raise NotSupportLinkTrainError(port)
|
|
532
|
+
conn, mid, pid = get_ctx(port)
|
|
533
|
+
_link_recovery, _anlt_op, _linktrain_cfg, _capabilities, _allow_loopback = await apply(
|
|
534
|
+
commands.PL1_CFG_TMP(
|
|
535
|
+
conn, mid, pid, 0, enums.Layer1ConfigType.AUTO_LINK_RECOVERY
|
|
536
|
+
).get(),
|
|
537
|
+
commands.PL1_ANLT(conn, mid, pid).get(),
|
|
538
|
+
commands.PL1_LINKTRAIN_CONFIG(conn, mid, pid).get(),
|
|
539
|
+
commands.P_CAPABILITIES(conn, mid, pid).get(),
|
|
540
|
+
commands.PL1_CFG_TMP(conn, mid, pid, 0, enums.Layer1ConfigType.AN_LOOPBACK).get(),
|
|
541
|
+
)
|
|
542
|
+
|
|
543
|
+
return dictionize_anlt_status(_link_recovery, _anlt_op, _linktrain_cfg, _capabilities, _allow_loopback)
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
async def anlt_log(port: GenericL23Port) -> str:
|
|
547
|
+
"""
|
|
548
|
+
.. versionadded:: 1.1
|
|
549
|
+
|
|
550
|
+
Get the anlt log messages
|
|
551
|
+
|
|
552
|
+
:param port: the port object
|
|
553
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
554
|
+
:return: AN/LT protocol log traces of the port
|
|
555
|
+
:rtype: str
|
|
556
|
+
"""
|
|
557
|
+
conn, mid, pid = get_ctx(port)
|
|
558
|
+
log = await commands.PL1_LOG(conn, mid, pid).get()
|
|
559
|
+
return log.log_string
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
async def anlt_stop(port: GenericL23Port) -> None:
|
|
563
|
+
"""
|
|
564
|
+
.. versionchanged:: 2.5
|
|
565
|
+
|
|
566
|
+
Stop AN & LT
|
|
567
|
+
|
|
568
|
+
:param port: the port object
|
|
569
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
570
|
+
"""
|
|
571
|
+
conn, mid, pid = get_ctx(port)
|
|
572
|
+
|
|
573
|
+
await commands.PL1_ANLT(conn, mid, pid).set(
|
|
574
|
+
an_mode=enums.FreyaAutonegMode.DISABLED,
|
|
575
|
+
lt_mode=enums.FreyaLinkTrainingMode.DISABLED
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
async def txtap_autotune(port: GenericL23Port, serdes: int) -> None:
|
|
580
|
+
"""
|
|
581
|
+
.. versionadded:: 1.3
|
|
582
|
+
|
|
583
|
+
Auto tune the tap value of the local TX tap.
|
|
584
|
+
|
|
585
|
+
:param port: the port object
|
|
586
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
587
|
+
:param serdes: the serdes index, starting from 0
|
|
588
|
+
:type serdes: int
|
|
589
|
+
:return:
|
|
590
|
+
:rtype: None
|
|
591
|
+
"""
|
|
592
|
+
conn, mid, pid = get_ctx(port)
|
|
593
|
+
phy_autotune = commands.PP_PHYAUTOTUNE(conn, mid, pid, serdes)
|
|
594
|
+
await phy_autotune.set(on_off=enums.OnOff.OFF)
|
|
595
|
+
await phy_autotune.set(on_off=enums.OnOff.ON)
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
async def lt_im_status(port: GenericL23Port) -> dict[str, t.Any]:
|
|
599
|
+
"""
|
|
600
|
+
.. versionadded:: 1.3
|
|
601
|
+
|
|
602
|
+
Get LT initial modulation config
|
|
603
|
+
|
|
604
|
+
:param port: the port object
|
|
605
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
606
|
+
:return: LT initial modulation configuration of the port
|
|
607
|
+
:rtype: typing.Dict[str, typing.Any]
|
|
608
|
+
"""
|
|
609
|
+
|
|
610
|
+
# if not isinstance(port, LinkTrainingSupported):
|
|
611
|
+
# raise NotSupportLinkTrainError(port)
|
|
612
|
+
conn, mid, pid = get_ctx(port)
|
|
613
|
+
capabilities = await commands.P_CAPABILITIES(conn, mid, pid).get()
|
|
614
|
+
initial_mods = {}
|
|
615
|
+
for i in range(0, capabilities.serdes_count):
|
|
616
|
+
im = await commands.PL1_CFG_TMP(conn, mid, pid, i, enums.Layer1ConfigType.LT_INITIAL_MODULATION).get()
|
|
617
|
+
initial_mods[str(i)] = enums.LinkTrainEncoding(im.values[0]).name
|
|
618
|
+
|
|
619
|
+
return dictionize_lt_im_status(capabilities, initial_mods)
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
async def lt_algorithm_status(port: GenericL23Port) -> dict[str, t.Any]:
|
|
623
|
+
"""
|
|
624
|
+
.. versionadded:: 1.3
|
|
625
|
+
|
|
626
|
+
Get LT initial modulation config
|
|
627
|
+
|
|
628
|
+
:param port: the port object
|
|
629
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
630
|
+
:return: LT initial modulation configuration of the port
|
|
631
|
+
:rtype: typing.Dict[str, typing.Any]
|
|
632
|
+
"""
|
|
633
|
+
|
|
634
|
+
# if not isinstance(port, LinkTrainingSupported):
|
|
635
|
+
# raise NotSupportLinkTrainError(port)
|
|
636
|
+
conn, mid, pid = get_ctx(port)
|
|
637
|
+
capabilities = await commands.P_CAPABILITIES(conn, mid, pid).get()
|
|
638
|
+
algorithms = {}
|
|
639
|
+
for i in range(0, capabilities.serdes_count):
|
|
640
|
+
alg = await commands.PL1_CFG_TMP(conn, mid, pid, i, enums.Layer1ConfigType.LT_TRAINING_ALGORITHM).get()
|
|
641
|
+
algorithms[str(i)] = enums.LinkTrainAlgorithm(alg.values[0]).name
|
|
642
|
+
|
|
643
|
+
return dictionize_lt_algorithm_status(capabilities, algorithms)
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
async def anlt_strict(port: GenericL23Port, enable: bool) -> None:
|
|
647
|
+
"""
|
|
648
|
+
.. versionadded:: 1.3
|
|
649
|
+
|
|
650
|
+
Should ANLT strict mode be enabled
|
|
651
|
+
|
|
652
|
+
:param port: the port object
|
|
653
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
654
|
+
:param enable: should ANLT strict mode be enabled
|
|
655
|
+
:type enable: bool
|
|
656
|
+
:return:
|
|
657
|
+
:rtype: None
|
|
658
|
+
"""
|
|
659
|
+
conn, mid, pid = get_ctx(port)
|
|
660
|
+
capabilities = await commands.P_CAPABILITIES(conn, mid, pid).get()
|
|
661
|
+
param = int(enable)
|
|
662
|
+
for i in range(0, capabilities.serdes_count):
|
|
663
|
+
await commands.PL1_CFG_TMP(
|
|
664
|
+
conn,
|
|
665
|
+
mid,
|
|
666
|
+
pid,
|
|
667
|
+
i,
|
|
668
|
+
enums.Layer1ConfigType.ANLT_STRICT_MODE
|
|
669
|
+
).set(values=[param])
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
async def anlt_log_control(port: GenericL23Port, types: t.List[enums.AnLtLogControl]) -> None:
|
|
673
|
+
"""
|
|
674
|
+
.. versionadded:: 1.3
|
|
675
|
+
|
|
676
|
+
Control what should be logged for ANLT by xenaserver
|
|
677
|
+
|
|
678
|
+
:param port: the port object
|
|
679
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
680
|
+
:param types: control what should be logged for ANLT by xenaserver
|
|
681
|
+
:type types: t.List[enums.AnLtLogControl]
|
|
682
|
+
:return:
|
|
683
|
+
:rtype: None
|
|
684
|
+
"""
|
|
685
|
+
conn, mid, pid = get_ctx(port)
|
|
686
|
+
capabilities = await commands.P_CAPABILITIES(conn, mid, pid).get()
|
|
687
|
+
type_ = 0
|
|
688
|
+
for _t in types:
|
|
689
|
+
type_ |= _t.value
|
|
690
|
+
param = int(type_)
|
|
691
|
+
for i in range(0, capabilities.serdes_count):
|
|
692
|
+
await commands.PL1_CFG_TMP(
|
|
693
|
+
conn,
|
|
694
|
+
mid,
|
|
695
|
+
pid,
|
|
696
|
+
i,
|
|
697
|
+
enums.Layer1ConfigType.ANLT_LOG_CONTROL
|
|
698
|
+
).set(values=[param])
|
|
699
|
+
|
|
700
|
+
async def anlt_log_control_get(port: GenericL23Port) -> dict[str, bool]:
|
|
701
|
+
"""
|
|
702
|
+
.. versionadded:: 2.7
|
|
703
|
+
|
|
704
|
+
Get ANLT log control config
|
|
705
|
+
|
|
706
|
+
:param port: the port object
|
|
707
|
+
:type port: :class:`~xoa_driver.ports.GenericL23Port`
|
|
708
|
+
:return: dict of log control status
|
|
709
|
+
:rtype: dict[str, bool]
|
|
710
|
+
"""
|
|
711
|
+
conn, mid, pid = get_ctx(port)
|
|
712
|
+
resp = await commands.PL1_CFG_TMP(
|
|
713
|
+
conn,
|
|
714
|
+
mid,
|
|
715
|
+
pid,
|
|
716
|
+
0,
|
|
717
|
+
enums.Layer1ConfigType.ANLT_LOG_CONTROL
|
|
718
|
+
).get()
|
|
719
|
+
|
|
720
|
+
return dictionize_anlt_log_ctrl_status(resp.values)
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
__all__ = (
|
|
724
|
+
"anlt_link_recovery",
|
|
725
|
+
"anlt_log",
|
|
726
|
+
"anlt_start",
|
|
727
|
+
"anlt_status",
|
|
728
|
+
"anlt_stop",
|
|
729
|
+
"autoneg_status",
|
|
730
|
+
"lt_coeff_inc",
|
|
731
|
+
"lt_coeff_dec",
|
|
732
|
+
"lt_encoding",
|
|
733
|
+
"lt_preset",
|
|
734
|
+
"lt_status",
|
|
735
|
+
"lt_trained",
|
|
736
|
+
"txtap_get",
|
|
737
|
+
"txtap_set",
|
|
738
|
+
"txtap_autotune",
|
|
739
|
+
"lt_im_status",
|
|
740
|
+
"lt_algorithm_status",
|
|
741
|
+
"anlt_strict",
|
|
742
|
+
"anlt_log_control",
|
|
743
|
+
"anlt_log_control_get",
|
|
744
|
+
)
|