tdl-xoa-driver 1.5.0b2__py3-none-any.whl → 1.6.0__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.5.0b2.dist-info → tdl_xoa_driver-1.6.0.dist-info}/METADATA +8 -8
- {tdl_xoa_driver-1.5.0b2.dist-info → tdl_xoa_driver-1.6.0.dist-info}/RECORD +91 -89
- xoa_driver/__init__.py +2 -2
- xoa_driver/enums.py +10 -10
- xoa_driver/functions/anlt.py +60 -78
- xoa_driver/functions/cli/__init__.py +5 -5
- xoa_driver/functions/cli/port_config.py +16 -7
- xoa_driver/functions/cli/{test_case_config.py → testbed_config.py} +53 -46
- xoa_driver/functions/cmis/_replies.py +4 -4
- xoa_driver/functions/mgmt.py +206 -250
- xoa_driver/functions/tools.py +11 -6
- xoa_driver/internals/commands/c_commands.py +59 -0
- xoa_driver/internals/commands/enums.py +101 -90
- xoa_driver/internals/commands/m4_commands.py +25 -0
- xoa_driver/internals/commands/m4e_commands.py +6 -0
- xoa_driver/internals/commands/m_commands.py +51 -1
- xoa_driver/internals/commands/p4_commands.py +63 -1
- xoa_driver/internals/commands/p4e_commands.py +9 -0
- xoa_driver/internals/commands/p4g_commands.py +139 -0
- xoa_driver/internals/commands/p_commands.py +493 -63
- xoa_driver/internals/commands/pc_commands.py +9 -0
- xoa_driver/internals/commands/pd_commands.py +11 -0
- xoa_driver/internals/commands/pe_commands.py +27 -0
- xoa_driver/internals/commands/pec_commands.py +9 -0
- xoa_driver/internals/commands/ped_commands.py +23 -0
- xoa_driver/internals/commands/pef_commands.py +43 -0
- xoa_driver/internals/commands/pf_commands.py +11 -0
- xoa_driver/internals/commands/pl1_commands.py +442 -118
- xoa_driver/internals/commands/pl_commands.py +8 -0
- xoa_driver/internals/commands/pm_commands.py +11 -0
- xoa_driver/internals/commands/pp_commands.py +128 -82
- xoa_driver/internals/commands/pr_commands.py +25 -0
- xoa_driver/internals/commands/ps_commands.py +47 -1
- xoa_driver/internals/commands/pt_commands.py +15 -0
- xoa_driver/internals/commands/px_commands.py +180 -136
- xoa_driver/internals/commands/subtypes.py +4 -3
- xoa_driver/internals/core/transporter/protocol/payload/base_struct.py +1 -1
- xoa_driver/internals/hli/indices/macsecscs/base_macsecsc.py +41 -3
- xoa_driver/internals/hli/modules/modules_l23/family_combi.py +0 -64
- xoa_driver/internals/hli/modules/modules_l23/family_edun.py +0 -2
- xoa_driver/internals/hli/modules/modules_l23/{family_g.py → family_loki.py} +29 -1
- xoa_driver/internals/hli/modules/modules_l23/family_odin.py +412 -0
- xoa_driver/internals/hli/modules/modules_l23/{family_l.py → family_thor.py} +44 -0
- xoa_driver/internals/hli/ports/port_l23/chimera/port_chimera.py +3 -3
- xoa_driver/internals/hli/ports/port_l23/family_edun.py +9 -44
- xoa_driver/internals/hli/ports/port_l23/{family_l1.py → family_freya.py} +10 -45
- xoa_driver/internals/hli/ports/port_l23/{family_g.py → family_loki.py} +33 -32
- xoa_driver/internals/hli/ports/port_l23/family_odin.py +225 -0
- xoa_driver/internals/hli/ports/port_l23/family_thor.py +67 -0
- xoa_driver/internals/hli/ports/port_l23/layer1/anlt.py +512 -0
- xoa_driver/internals/hli/ports/port_l23/layer1/brr.py +26 -0
- xoa_driver/internals/hli/ports/port_l23/layer1/eye_diagram.py +71 -0
- xoa_driver/internals/hli/ports/port_l23/{pcs_pma_ijkl_chimera.py → layer1/impair.py} +7 -7
- xoa_driver/internals/hli/ports/port_l23/layer1/laser_power.py +28 -0
- xoa_driver/internals/hli/ports/port_l23/{family_e.py → layer1/lower_power.py} +1 -51
- xoa_driver/internals/hli/ports/port_l23/{freya_l1.py → layer1/medium.py} +38 -358
- xoa_driver/internals/hli/ports/port_l23/layer1/pcs_fec.py +219 -0
- xoa_driver/internals/hli/ports/port_l23/layer1/pma.py +43 -0
- xoa_driver/internals/hli/ports/port_l23/layer1/prbs.py +39 -0
- xoa_driver/internals/hli/ports/port_l23/layer1/preamble.py +25 -0
- xoa_driver/internals/hli/ports/port_l23/{fault_jkl.py → layer1/rs_fault.py} +2 -2
- xoa_driver/internals/hli/ports/port_l23/layer1/siv.py +69 -0
- xoa_driver/internals/hli/ports/port_l23/layer1_edun.py +103 -0
- xoa_driver/internals/hli/ports/port_l23/layer1_freya.py +103 -0
- xoa_driver/internals/hli/ports/port_l23/layer1_loki.py +74 -0
- xoa_driver/internals/hli/ports/port_l23/layer1_thor.py +70 -0
- xoa_driver/internals/hli/ports/port_l23/port_l23ve.py +4 -4
- xoa_driver/internals/hli/ports/port_l23/sec/__init__.py +0 -0
- xoa_driver/internals/hli/ports/port_l23/sec/macsec.py +108 -0
- xoa_driver/internals/hli/ports/port_l23/tcvr/__init__.py +0 -0
- xoa_driver/internals/hli/ports/port_l23/{bases/port_transceiver.py → tcvr/cmis.py} +4 -118
- xoa_driver/internals/hli/ports/port_l23/tcvr/transceiver.py +124 -0
- xoa_driver/internals/hli/ports/port_l23/trafficgen/__init__.py +0 -0
- xoa_driver/internals/hli/ports/port_l23/{bases → trafficgen}/port_l23.py +1 -1
- xoa_driver/internals/hli/ports/port_l23/{bases → trafficgen}/port_l23_genuine.py +5 -45
- xoa_driver/internals/hli/ports/port_l23/{bases/port_reception_statistics.py → trafficgen/port_rx_stats.py} +0 -21
- xoa_driver/internals/hli/ports/port_l23/{bases/port_transmission_statistics.py → trafficgen/port_tx_stats.py} +2 -22
- xoa_driver/internals/hli/ports/port_l23/trafficgen/runt.py +32 -0
- xoa_driver/internals/hli/testers/l23_tester.py +1 -3
- xoa_driver/internals/utils/indices/_interfaces.py +18 -6
- xoa_driver/internals/utils/indices/index_manager.py +8 -2
- xoa_driver/internals/utils/managers/ports_manager.py +5 -2
- xoa_driver/misc.py +6 -6
- xoa_driver/modules.py +31 -47
- xoa_driver/ports.py +10 -29
- xoa_driver/internals/hli/modules/modules_l23/family_d.py +0 -75
- xoa_driver/internals/hli/modules/modules_l23/family_e.py +0 -85
- xoa_driver/internals/hli/modules/modules_l23/family_f.py +0 -145
- xoa_driver/internals/hli/modules/modules_l23/family_h.py +0 -40
- xoa_driver/internals/hli/modules/modules_l23/family_i.py +0 -25
- xoa_driver/internals/hli/modules/modules_l23/family_j.py +0 -25
- xoa_driver/internals/hli/modules/modules_l23/family_k.py +0 -39
- xoa_driver/internals/hli/modules/modules_l23/family_m.py +0 -25
- xoa_driver/internals/hli/modules/modules_l23/family_n.py +0 -40
- xoa_driver/internals/hli/ports/port_l23/family_combi.py +0 -37
- xoa_driver/internals/hli/ports/port_l23/family_d.py +0 -51
- xoa_driver/internals/hli/ports/port_l23/family_f.py +0 -151
- xoa_driver/internals/hli/ports/port_l23/family_h.py +0 -67
- xoa_driver/internals/hli/ports/port_l23/family_i.py +0 -84
- xoa_driver/internals/hli/ports/port_l23/family_j.py +0 -68
- xoa_driver/internals/hli/ports/port_l23/family_k.py +0 -73
- xoa_driver/internals/hli/ports/port_l23/family_l.py +0 -82
- xoa_driver/internals/hli/ports/port_l23/family_m.py +0 -29
- xoa_driver/internals/hli/ports/port_l23/pcs_pma_ghijkl.py +0 -369
- xoa_driver/internals/hli/ports/port_l23/pcs_pma_l.py +0 -78
- {tdl_xoa_driver-1.5.0b2.dist-info → tdl_xoa_driver-1.6.0.dist-info}/WHEEL +0 -0
- {tdl_xoa_driver-1.5.0b2.dist-info → tdl_xoa_driver-1.6.0.dist-info}/licenses/LICENSE +0 -0
- {tdl_xoa_driver-1.5.0b2.dist-info → tdl_xoa_driver-1.6.0.dist-info}/top_level.txt +0 -0
- /xoa_driver/internals/hli/modules/modules_l23/{family_l1.py → family_freya.py} +0 -0
- /xoa_driver/internals/hli/ports/port_l23/{bases → layer1}/__init__.py +0 -0
- /xoa_driver/internals/hli/ports/port_l23/{bases → trafficgen}/port_capture.py +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from typing import (
|
|
2
|
+
TYPE_CHECKING,
|
|
3
|
+
Tuple,
|
|
4
|
+
Self,
|
|
5
|
+
)
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
8
|
+
from xoa_driver.internals.hli.ports.port_l23.family_thor import FamilyThor
|
|
9
|
+
from xoa_driver.internals.commands import (
|
|
10
|
+
PP_PRBSTYPE,
|
|
11
|
+
PP_LINKTRAINSTATUS,
|
|
12
|
+
)
|
|
13
|
+
from .layer1.prbs import Prbs
|
|
14
|
+
from .layer1.pcs_fec import PcsLayer
|
|
15
|
+
from .layer1.impair import Impair
|
|
16
|
+
from .layer1.medium import BasicMedium
|
|
17
|
+
from .layer1.rs_fault import RsFault
|
|
18
|
+
from .layer1.anlt import AnltBasic
|
|
19
|
+
from .tcvr.transceiver import Transceiver
|
|
20
|
+
|
|
21
|
+
class SerDesThor:
|
|
22
|
+
"""L23 high-speed port SerDes configuration and status."""
|
|
23
|
+
|
|
24
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, serdes_xindex: int) -> None:
|
|
25
|
+
|
|
26
|
+
self.prbs = Prbs(conn, module_id, port_id, serdes_xindex)
|
|
27
|
+
"""PRBS
|
|
28
|
+
|
|
29
|
+
:type: Prbs
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
self.medium = BasicMedium(conn, module_id, port_id, serdes_xindex)
|
|
33
|
+
"""Basic medium
|
|
34
|
+
|
|
35
|
+
:type: BasicMedium
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
self.lt_status = PP_LINKTRAINSTATUS(conn, module_id, port_id, serdes_xindex)
|
|
39
|
+
"""LT status for Edun
|
|
40
|
+
:type: PP_LINKTRAINSTATUS
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
class Layer1:
|
|
44
|
+
def __init__(self, conn: "itf.IConnection", port: "FamilyThor") -> None:
|
|
45
|
+
module_id, port_id = port.kind
|
|
46
|
+
self.serdes: Tuple[SerDesThor, ...] = tuple(
|
|
47
|
+
SerDesThor(conn, module_id, port_id, serdes_xindex=idx)
|
|
48
|
+
for idx in range(port.info.capabilities.serdes_count)
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
self.impairment = Impair(conn, module_id, port_id)
|
|
52
|
+
"""Impairment functions"""
|
|
53
|
+
|
|
54
|
+
self.rs_fault = RsFault(conn, module_id, port_id)
|
|
55
|
+
"""RS Fault Management"""
|
|
56
|
+
|
|
57
|
+
self.pcs_fec = PcsLayer(conn, port)
|
|
58
|
+
"""PCS/FEC layer"""
|
|
59
|
+
|
|
60
|
+
self.prbs_config = PP_PRBSTYPE(conn, module_id, port_id)
|
|
61
|
+
"""PRBS configuration, including PRBS polynomial, invert mode, and statistic collection mode (for RX).
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
self.anlt = AnltBasic(conn, module_id, port_id)
|
|
65
|
+
"""Thor ANLT settings
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
self.transceiver = Transceiver(conn, module_id, port_id)
|
|
69
|
+
"""Thor Transceiver configuration and status
|
|
70
|
+
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import TYPE_CHECKING
|
|
2
|
-
from .
|
|
3
|
-
from .
|
|
4
|
-
from .
|
|
2
|
+
from .trafficgen.port_l23 import BasePortL23
|
|
3
|
+
from .trafficgen.port_rx_stats import PortReceptionStatistics
|
|
4
|
+
from .trafficgen.port_tx_stats import PortTxStats
|
|
5
5
|
|
|
6
6
|
from xoa_driver.internals.commands import (
|
|
7
7
|
P_MDIXMODE,
|
|
@@ -36,7 +36,7 @@ class L23VEPortStatistics:
|
|
|
36
36
|
:type: PortReceptionStatistics
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
|
-
self.tx =
|
|
39
|
+
self.tx = PortTxStats(conn, module_id, port_id)
|
|
40
40
|
"""L23 VE port's TX statistics.
|
|
41
41
|
|
|
42
42
|
:type: PortTransmissionStatistics
|
|
File without changes
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
from typing import TYPE_CHECKING
|
|
3
|
+
if TYPE_CHECKING:
|
|
4
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
5
|
+
from xoa_driver.internals.commands import (
|
|
6
|
+
P_MACSEC_RX_ENABLE,
|
|
7
|
+
P_MACSEC_TX_STATS,
|
|
8
|
+
P_MACSEC_TX_CLEAR,
|
|
9
|
+
P_MACSEC_RX_STATS,
|
|
10
|
+
P_MACSEC_RX_CLEAR,
|
|
11
|
+
)
|
|
12
|
+
from xoa_driver.internals.utils import attributes as utils
|
|
13
|
+
from xoa_driver.internals.utils.indices import index_manager as idx_mgr
|
|
14
|
+
from xoa_driver.internals.hli.indices.macsecscs.genuine_macsecsc import GenuineMacSecTxScIdx, GenuineMacSecRxScIdx
|
|
15
|
+
|
|
16
|
+
MacSecTxScIndices = idx_mgr.IndexManager[GenuineMacSecTxScIdx]
|
|
17
|
+
MacSecRxScIndices = idx_mgr.IndexManager[GenuineMacSecRxScIdx]
|
|
18
|
+
|
|
19
|
+
class MACSecTxStats:
|
|
20
|
+
"""MACSec TX SC Statistics"""
|
|
21
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
22
|
+
|
|
23
|
+
self.total = P_MACSEC_TX_STATS(conn, module_id, port_id)
|
|
24
|
+
"""Port's total MACsec TX statistics
|
|
25
|
+
|
|
26
|
+
:type: P_MACSEC_TX_STATS
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
self.clear = P_MACSEC_TX_CLEAR(conn, module_id, port_id)
|
|
30
|
+
"""Clear Port's MACsec TX statistics
|
|
31
|
+
|
|
32
|
+
:type: P_MACSEC_TX_CLEAR
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
class MACSecRxStats:
|
|
36
|
+
"""MACSec RX SC Statistics"""
|
|
37
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
38
|
+
|
|
39
|
+
self.total = P_MACSEC_RX_STATS(conn, module_id, port_id)
|
|
40
|
+
"""Port's total MACsec RX statistics
|
|
41
|
+
|
|
42
|
+
:type: P_MACSEC_RX_STATS
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
self.clear = P_MACSEC_RX_CLEAR(conn, module_id, port_id)
|
|
46
|
+
"""Clear Port's MACsec RX statistics
|
|
47
|
+
|
|
48
|
+
:type: P_MACSEC_RX_CLEAR
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
class MacSecPortStats:
|
|
52
|
+
"""MACSec Port Statistics"""
|
|
53
|
+
|
|
54
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
55
|
+
self.tx = MACSecTxStats(conn, module_id, port_id)
|
|
56
|
+
"""L23 port's MACsec TX statistics.
|
|
57
|
+
|
|
58
|
+
:type: MACSecTxStats
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
self.rx = MACSecRxStats(conn, module_id, port_id)
|
|
62
|
+
"""L23 port's MACsec RX statistics.
|
|
63
|
+
|
|
64
|
+
:type: MACSecRxStats
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class MacSec:
|
|
69
|
+
"""MACsec configuration and status."""
|
|
70
|
+
|
|
71
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
72
|
+
self.txscs: MacSecTxScIndices = idx_mgr.IndexManager(
|
|
73
|
+
conn,
|
|
74
|
+
GenuineMacSecTxScIdx,
|
|
75
|
+
module_id,
|
|
76
|
+
port_id
|
|
77
|
+
)
|
|
78
|
+
"""MACSec TX SC index manager.
|
|
79
|
+
|
|
80
|
+
:type: MacSecTxScIndices
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
self.rxscs: MacSecRxScIndices = idx_mgr.IndexManager(
|
|
84
|
+
conn,
|
|
85
|
+
GenuineMacSecRxScIdx,
|
|
86
|
+
module_id,
|
|
87
|
+
port_id
|
|
88
|
+
)
|
|
89
|
+
"""MACSec RX SC index manager.
|
|
90
|
+
|
|
91
|
+
:type: MacSecRxScIndices
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
self.decode = P_MACSEC_RX_ENABLE(conn, module_id, port_id)
|
|
95
|
+
"""L23 port MACSec RX enable.
|
|
96
|
+
|
|
97
|
+
:type: P_MACSEC_RX_ENABLE
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
self.statistics = MacSecPortStats(conn, module_id, port_id)
|
|
101
|
+
"""L23 port MACSec statistics.
|
|
102
|
+
|
|
103
|
+
:type: MacSecPortStats
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
on_macsec_rx_enable_change = functools.partialmethod(utils.on_event, P_MACSEC_RX_ENABLE)
|
|
107
|
+
"""Register a callback to the event that the port MACsec RX enable status changes."""
|
|
108
|
+
|
|
File without changes
|
|
@@ -2,12 +2,6 @@ from typing import TYPE_CHECKING
|
|
|
2
2
|
if TYPE_CHECKING:
|
|
3
3
|
from xoa_driver.internals.core import interfaces as itf
|
|
4
4
|
from xoa_driver.internals.commands import (
|
|
5
|
-
PX_RW,
|
|
6
|
-
PX_MII,
|
|
7
|
-
PX_TEMPERATURE,
|
|
8
|
-
PX_RW_SEQ,
|
|
9
|
-
PX_I2C_CONFIG,
|
|
10
|
-
PX_RW_SEQ_BANK,
|
|
11
5
|
PX_CDB_SUPPORT,
|
|
12
6
|
PX_CDB_ABORT_PROCESSING,
|
|
13
7
|
PX_CDB_CHANGE_PASSWORD,
|
|
@@ -33,115 +27,7 @@ from xoa_driver.internals.commands import (
|
|
|
33
27
|
PX_CUST_CMD,
|
|
34
28
|
)
|
|
35
29
|
|
|
36
|
-
|
|
37
|
-
class PortTransceiver:
|
|
38
|
-
"""Transceiver access class."""
|
|
39
|
-
|
|
40
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
41
|
-
self.__conn = conn
|
|
42
|
-
self.__module_id = module_id
|
|
43
|
-
self.__port_id = port_id
|
|
44
|
-
|
|
45
|
-
self.i2c_config = PX_I2C_CONFIG(conn, module_id, port_id)
|
|
46
|
-
"""
|
|
47
|
-
Access speed on a transceiver I2C access in the unit of KHz. Default to 100.
|
|
48
|
-
|
|
49
|
-
When the transceiver is plugged out and in again, the speed will be reset to the default value 100. The speed has a minimum and a maximum, which can be obtained from port.capabilities().
|
|
50
|
-
|
|
51
|
-
The I2C speed configuration will not be included in the port configuration file (.xpc). When you load a port configuration to a port, the transceiver I2C access speed will be reset to default.
|
|
52
|
-
"""
|
|
53
|
-
|
|
54
|
-
self.temperature = PX_TEMPERATURE(conn, module_id, port_id)
|
|
55
|
-
"""Transceiver temperature in Celsius.
|
|
56
|
-
|
|
57
|
-
Temperature value before the decimal digit, and 1/256th of a degree Celsius after the decimal digit.
|
|
58
|
-
"""
|
|
59
|
-
|
|
60
|
-
self.cmis = CMIS(conn, module_id, port_id)
|
|
61
|
-
"""
|
|
62
|
-
Access CMIS interface.
|
|
63
|
-
"""
|
|
64
|
-
|
|
65
|
-
def access_rw(self, page_address: int, register_address: int) -> "PX_RW":
|
|
66
|
-
"""Access to register interface by the transceiver.
|
|
67
|
-
|
|
68
|
-
:param page_address: page address
|
|
69
|
-
:type page_address: int
|
|
70
|
-
:param register_address: register address
|
|
71
|
-
:type register_address: int
|
|
72
|
-
:return: transceiver register values
|
|
73
|
-
:rtype: PX_RW
|
|
74
|
-
"""
|
|
75
|
-
|
|
76
|
-
return PX_RW(
|
|
77
|
-
self.__conn,
|
|
78
|
-
self.__module_id,
|
|
79
|
-
self.__port_id,
|
|
80
|
-
page_address,
|
|
81
|
-
register_address
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
def access_mii(self, register_address: int) -> "PX_MII":
|
|
85
|
-
"""Access to the register interface supported by the media-independent interface (MII) transceiver.
|
|
86
|
-
|
|
87
|
-
:param register_address: register address
|
|
88
|
-
:type register_address: int
|
|
89
|
-
:return: register values
|
|
90
|
-
:rtype: PX_MII
|
|
91
|
-
"""
|
|
92
|
-
return PX_MII(
|
|
93
|
-
self.__conn,
|
|
94
|
-
self.__module_id,
|
|
95
|
-
self.__port_id,
|
|
96
|
-
register_address
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
def access_rw_seq(self, page_address: int, register_address: int, byte_count: int) -> "PX_RW_SEQ":
|
|
100
|
-
"""Sequential read/write a number of bytes to the register interface supported by the media-independent interface (MII) transceiver.
|
|
101
|
-
|
|
102
|
-
:param page_address: page address (0-255)
|
|
103
|
-
:type page_address: int
|
|
104
|
-
:param register_address: register address (0-255)
|
|
105
|
-
:type register_address: int
|
|
106
|
-
:param byte_count: the number of bytes to read/write
|
|
107
|
-
:type byte_count: int
|
|
108
|
-
:return: transceiver register values
|
|
109
|
-
:rtype: PX_RW_SEQ
|
|
110
|
-
"""
|
|
111
|
-
return PX_RW_SEQ(
|
|
112
|
-
self.__conn,
|
|
113
|
-
self.__module_id,
|
|
114
|
-
self.__port_id,
|
|
115
|
-
page_address,
|
|
116
|
-
register_address,
|
|
117
|
-
byte_count
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
def access_rw_seq_bank(self, bank_address: int, page_address: int, register_address: int, byte_count: int) -> "PX_RW_SEQ_BANK":
|
|
121
|
-
"""Sequential read/write a number of bytes to the register interface supported by the media-independent interface (MII) transceiver.
|
|
122
|
-
|
|
123
|
-
:param bank_address: bank address (0-255)
|
|
124
|
-
:type bank_address: int
|
|
125
|
-
:param page_address: page address (0-255)
|
|
126
|
-
:type page_address: int
|
|
127
|
-
:param register_address: register address (0-255)
|
|
128
|
-
:type register_address: int
|
|
129
|
-
:param byte_count: the number of bytes to read/write
|
|
130
|
-
:type byte_count: int
|
|
131
|
-
:return: transceiver register values
|
|
132
|
-
:rtype: PX_RW_SEQ_BANK
|
|
133
|
-
"""
|
|
134
|
-
return PX_RW_SEQ_BANK(
|
|
135
|
-
self.__conn,
|
|
136
|
-
self.__module_id,
|
|
137
|
-
self.__port_id,
|
|
138
|
-
bank_address,
|
|
139
|
-
page_address,
|
|
140
|
-
register_address,
|
|
141
|
-
byte_count
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
class CMIS():
|
|
30
|
+
class Cmis():
|
|
145
31
|
"""CMIS access class.
|
|
146
32
|
"""
|
|
147
33
|
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
@@ -153,16 +39,16 @@ class CMIS():
|
|
|
153
39
|
"""Return the number of supported CDB instances.
|
|
154
40
|
"""
|
|
155
41
|
|
|
156
|
-
def cdb(self, cdb_instance_id: int) -> "
|
|
42
|
+
def cdb(self, cdb_instance_id: int) -> "Cbd":
|
|
157
43
|
"""Access CMIS CDB command interface.
|
|
158
44
|
|
|
159
45
|
:param cdb_instance_id: 0 for CDB Instance 1, 1 for CDB Instance 2
|
|
160
46
|
:type cdb_instance_id: int
|
|
161
47
|
"""
|
|
162
|
-
return
|
|
48
|
+
return Cbd(self.__conn, self.__module_id, self.__port_id, cdb_instance_id)
|
|
163
49
|
|
|
164
50
|
|
|
165
|
-
class
|
|
51
|
+
class Cbd():
|
|
166
52
|
"""CMIS CDB command access class.
|
|
167
53
|
"""
|
|
168
54
|
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, cdb_instance_id: int) -> None:
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING
|
|
2
|
+
if TYPE_CHECKING:
|
|
3
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
4
|
+
from xoa_driver.internals.commands import (
|
|
5
|
+
PX_RW,
|
|
6
|
+
PX_MII,
|
|
7
|
+
PX_TEMPERATURE,
|
|
8
|
+
PX_RW_SEQ,
|
|
9
|
+
PX_I2C_CONFIG,
|
|
10
|
+
PX_RW_SEQ_BANK,
|
|
11
|
+
)
|
|
12
|
+
from xoa_driver.internals.hli.ports.port_l23.layer1.laser_power import LaserPower
|
|
13
|
+
from xoa_driver.internals.hli.ports.port_l23.tcvr.cmis import Cmis
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Transceiver:
|
|
17
|
+
"""Transceiver access class."""
|
|
18
|
+
|
|
19
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
20
|
+
self.__conn = conn
|
|
21
|
+
self.__module_id = module_id
|
|
22
|
+
self.__port_id = port_id
|
|
23
|
+
|
|
24
|
+
self.i2c_config = PX_I2C_CONFIG(conn, module_id, port_id)
|
|
25
|
+
"""
|
|
26
|
+
Access speed on a transceiver I2C access in the unit of KHz. Default to 100.
|
|
27
|
+
|
|
28
|
+
When the transceiver is plugged out and in again, the speed will be reset to the default value 100. The speed has a minimum and a maximum, which can be obtained from port.capabilities().
|
|
29
|
+
|
|
30
|
+
The I2C speed configuration will not be included in the port configuration file (.xpc). When you load a port configuration to a port, the transceiver I2C access speed will be reset to default.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
self.temperature = PX_TEMPERATURE(conn, module_id, port_id)
|
|
34
|
+
"""Transceiver temperature in Celsius.
|
|
35
|
+
|
|
36
|
+
Temperature value before the decimal digit, and 1/256th of a degree Celsius after the decimal digit.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
self.laser_power = LaserPower(conn, module_id, port_id)
|
|
40
|
+
"""Laser power status.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
self.cmis = Cmis(conn, module_id, port_id)
|
|
44
|
+
"""CMIS transceiver configuration and status
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
def access_rw(self, page_address: int, register_address: int) -> "PX_RW":
|
|
48
|
+
"""Access to register interface by the transceiver.
|
|
49
|
+
|
|
50
|
+
:param page_address: page address
|
|
51
|
+
:type page_address: int
|
|
52
|
+
:param register_address: register address
|
|
53
|
+
:type register_address: int
|
|
54
|
+
:return: transceiver register values
|
|
55
|
+
:rtype: PX_RW
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
return PX_RW(
|
|
59
|
+
self.__conn,
|
|
60
|
+
self.__module_id,
|
|
61
|
+
self.__port_id,
|
|
62
|
+
page_address,
|
|
63
|
+
register_address
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
def access_mii(self, register_address: int) -> "PX_MII":
|
|
67
|
+
"""Access to the register interface supported by the media-independent interface (MII) transceiver.
|
|
68
|
+
|
|
69
|
+
:param register_address: register address
|
|
70
|
+
:type register_address: int
|
|
71
|
+
:return: register values
|
|
72
|
+
:rtype: PX_MII
|
|
73
|
+
"""
|
|
74
|
+
return PX_MII(
|
|
75
|
+
self.__conn,
|
|
76
|
+
self.__module_id,
|
|
77
|
+
self.__port_id,
|
|
78
|
+
register_address
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
def access_rw_seq(self, page_address: int, register_address: int, byte_count: int) -> "PX_RW_SEQ":
|
|
82
|
+
"""Sequential read/write a number of bytes to the register interface supported by the media-independent interface (MII) transceiver.
|
|
83
|
+
|
|
84
|
+
:param page_address: page address (0-255)
|
|
85
|
+
:type page_address: int
|
|
86
|
+
:param register_address: register address (0-255)
|
|
87
|
+
:type register_address: int
|
|
88
|
+
:param byte_count: the number of bytes to read/write
|
|
89
|
+
:type byte_count: int
|
|
90
|
+
:return: transceiver register values
|
|
91
|
+
:rtype: PX_RW_SEQ
|
|
92
|
+
"""
|
|
93
|
+
return PX_RW_SEQ(
|
|
94
|
+
self.__conn,
|
|
95
|
+
self.__module_id,
|
|
96
|
+
self.__port_id,
|
|
97
|
+
page_address,
|
|
98
|
+
register_address,
|
|
99
|
+
byte_count
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
def access_rw_seq_bank(self, bank_address: int, page_address: int, register_address: int, byte_count: int) -> "PX_RW_SEQ_BANK":
|
|
103
|
+
"""Sequential read/write a number of bytes to the register interface supported by the media-independent interface (MII) transceiver.
|
|
104
|
+
|
|
105
|
+
:param bank_address: bank address (0-255)
|
|
106
|
+
:type bank_address: int
|
|
107
|
+
:param page_address: page address (0-255)
|
|
108
|
+
:type page_address: int
|
|
109
|
+
:param register_address: register address (0-255)
|
|
110
|
+
:type register_address: int
|
|
111
|
+
:param byte_count: the number of bytes to read/write
|
|
112
|
+
:type byte_count: int
|
|
113
|
+
:return: transceiver register values
|
|
114
|
+
:rtype: PX_RW_SEQ_BANK
|
|
115
|
+
"""
|
|
116
|
+
return PX_RW_SEQ_BANK(
|
|
117
|
+
self.__conn,
|
|
118
|
+
self.__module_id,
|
|
119
|
+
self.__port_id,
|
|
120
|
+
bank_address,
|
|
121
|
+
page_address,
|
|
122
|
+
register_address,
|
|
123
|
+
byte_count
|
|
124
|
+
)
|
|
File without changes
|
|
@@ -337,7 +337,7 @@ class BasePortL23(base_port.BasePort[ports_state.PortL23LocalState]):
|
|
|
337
337
|
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
338
338
|
super().__init__(conn, module_id, port_id)
|
|
339
339
|
self.capabilities = P_CAPABILITIES(conn, module_id, port_id)
|
|
340
|
-
"""L23
|
|
340
|
+
"""L23 Port capabilities
|
|
341
341
|
|
|
342
342
|
:type: P_CAPABILITIES
|
|
343
343
|
"""
|
|
@@ -12,7 +12,6 @@ from xoa_driver.internals.commands import (
|
|
|
12
12
|
P_TCVRSTATUS,
|
|
13
13
|
P_LOADMODE,
|
|
14
14
|
PP_FECMODE,
|
|
15
|
-
P_MACSEC_RX_ENABLE
|
|
16
15
|
)
|
|
17
16
|
from xoa_driver.internals.utils import attributes as utils
|
|
18
17
|
from xoa_driver.internals.utils.indices import index_manager as idx_mgr
|
|
@@ -20,7 +19,6 @@ from xoa_driver.internals.hli.indices.streams.genuine_stream import GenuineStrea
|
|
|
20
19
|
from xoa_driver.internals.hli.indices.filter.genuine_filter import GenuineFilterIdx
|
|
21
20
|
from xoa_driver.internals.hli.indices.port_dataset import PortDatasetIdx
|
|
22
21
|
from xoa_driver.internals.state_storage import ports_state
|
|
23
|
-
from xoa_driver.internals.hli.indices.macsecscs.genuine_macsecsc import GenuineMacSecTxScIdx, GenuineMacSecRxScIdx
|
|
24
22
|
|
|
25
23
|
from .port_l23 import (
|
|
26
24
|
BasePortL23,
|
|
@@ -28,15 +26,13 @@ from .port_l23 import (
|
|
|
28
26
|
# TxConfiguration,
|
|
29
27
|
)
|
|
30
28
|
|
|
31
|
-
from .
|
|
32
|
-
from .
|
|
33
|
-
from .
|
|
29
|
+
from ..tcvr.transceiver import Transceiver
|
|
30
|
+
from .port_rx_stats import GenuinePortReceptionStatistics
|
|
31
|
+
from .port_tx_stats import GenuinePortTransmissionStatistics
|
|
34
32
|
|
|
35
33
|
StreamIndices = idx_mgr.IndexManager[GenuineStreamIdx]
|
|
36
34
|
FilterIndices = idx_mgr.IndexManager[GenuineFilterIdx]
|
|
37
35
|
PortDatasetIndices = idx_mgr.IndexManager[PortDatasetIdx]
|
|
38
|
-
MacSecTxScIndices = idx_mgr.IndexManager[GenuineMacSecTxScIdx]
|
|
39
|
-
MacSecRxScIndices = idx_mgr.IndexManager[GenuineMacSecRxScIdx]
|
|
40
36
|
|
|
41
37
|
class SpeedMode:
|
|
42
38
|
"""L23 port's speed mode"""
|
|
@@ -122,12 +118,6 @@ class BasePortL23Genuine(BasePortL23):
|
|
|
122
118
|
:type: P_TCVRSTATUS
|
|
123
119
|
"""
|
|
124
120
|
|
|
125
|
-
self.fec_mode = PP_FECMODE(conn, module_id, port_id)
|
|
126
|
-
"""L23 port FEC mode.
|
|
127
|
-
|
|
128
|
-
:type: PP_FECMODE
|
|
129
|
-
"""
|
|
130
|
-
|
|
131
121
|
self.speed = GenuineSpeed(conn, module_id, port_id)
|
|
132
122
|
"""L23 port speed configuration.
|
|
133
123
|
|
|
@@ -140,7 +130,7 @@ class BasePortL23Genuine(BasePortL23):
|
|
|
140
130
|
:type: UnAvailableTime
|
|
141
131
|
"""
|
|
142
132
|
|
|
143
|
-
self.transceiver =
|
|
133
|
+
self.transceiver = Transceiver(conn, module_id, port_id)
|
|
144
134
|
"""L23 port transceiver configuration.
|
|
145
135
|
|
|
146
136
|
:type: PortTransceiver
|
|
@@ -152,12 +142,6 @@ class BasePortL23Genuine(BasePortL23):
|
|
|
152
142
|
:type: PortStatistics
|
|
153
143
|
"""
|
|
154
144
|
|
|
155
|
-
self.macsec_rx = P_MACSEC_RX_ENABLE(conn, module_id, port_id)
|
|
156
|
-
"""L23 port MACSec RX enable.
|
|
157
|
-
|
|
158
|
-
:type: P_MACSEC_RX_ENABLE
|
|
159
|
-
"""
|
|
160
|
-
|
|
161
145
|
self.streams: StreamIndices = idx_mgr.IndexManager(
|
|
162
146
|
conn,
|
|
163
147
|
GenuineStreamIdx,
|
|
@@ -191,27 +175,6 @@ class BasePortL23Genuine(BasePortL23):
|
|
|
191
175
|
:type: PortDatasetIndices
|
|
192
176
|
"""
|
|
193
177
|
|
|
194
|
-
self.macsec_txscs: MacSecTxScIndices = idx_mgr.IndexManager(
|
|
195
|
-
conn,
|
|
196
|
-
GenuineMacSecTxScIdx,
|
|
197
|
-
module_id,
|
|
198
|
-
port_id
|
|
199
|
-
)
|
|
200
|
-
"""L23 port MACSec TX SC index manager.
|
|
201
|
-
|
|
202
|
-
:type: MacSecTxScIndices
|
|
203
|
-
"""
|
|
204
|
-
|
|
205
|
-
self.macsec_rxscs: MacSecRxScIndices = idx_mgr.IndexManager(
|
|
206
|
-
conn,
|
|
207
|
-
GenuineMacSecRxScIdx,
|
|
208
|
-
module_id,
|
|
209
|
-
port_id
|
|
210
|
-
)
|
|
211
|
-
"""L23 port MACSec RX SC index manager.
|
|
212
|
-
|
|
213
|
-
:type: MacSecRxScIndices
|
|
214
|
-
"""
|
|
215
178
|
|
|
216
179
|
@property
|
|
217
180
|
def info(self) -> ports_state.PortL23GenuineLocalState:
|
|
@@ -223,7 +186,4 @@ class BasePortL23Genuine(BasePortL23):
|
|
|
223
186
|
return self
|
|
224
187
|
|
|
225
188
|
on_speed_selection_change = functools.partialmethod(utils.on_event, P_SPEEDSELECTION)
|
|
226
|
-
"""Register a callback to the event that the port's speed mode changes."""
|
|
227
|
-
|
|
228
|
-
on_macsec_rx_enable_change = functools.partialmethod(utils.on_event, P_MACSEC_RX_ENABLE)
|
|
229
|
-
"""Register a callback to the event that the port MACsec RX enable status changes."""
|
|
189
|
+
"""Register a callback to the event that the port's speed mode changes."""
|
|
@@ -25,8 +25,6 @@ from xoa_driver.internals.commands import (
|
|
|
25
25
|
PR_CALIBRATE,
|
|
26
26
|
PR_UAT_STATUS,
|
|
27
27
|
PR_UAT_TIME,
|
|
28
|
-
P_MACSEC_RX_STATS,
|
|
29
|
-
P_MACSEC_RX_CLEAR
|
|
30
28
|
|
|
31
29
|
)
|
|
32
30
|
|
|
@@ -190,22 +188,6 @@ class GPrsUat():
|
|
|
190
188
|
"""
|
|
191
189
|
|
|
192
190
|
|
|
193
|
-
class MACSecRxStats:
|
|
194
|
-
"""MACSec RX SC Statistics"""
|
|
195
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
196
|
-
|
|
197
|
-
self.total = P_MACSEC_RX_STATS(conn, module_id, port_id)
|
|
198
|
-
"""Port's total MACsec RX statistics
|
|
199
|
-
|
|
200
|
-
:type: P_MACSEC_RX_STATS
|
|
201
|
-
"""
|
|
202
|
-
|
|
203
|
-
self.clear = P_MACSEC_RX_CLEAR(conn, module_id, port_id)
|
|
204
|
-
"""Clear Port's MACsec RX statistics
|
|
205
|
-
|
|
206
|
-
:type: P_MACSEC_RX_CLEAR
|
|
207
|
-
"""
|
|
208
|
-
|
|
209
191
|
|
|
210
192
|
class GenuinePortReceptionStatistics(PortReceptionStatistics):
|
|
211
193
|
"""L23 port RX statistics."""
|
|
@@ -224,8 +206,5 @@ class GenuinePortReceptionStatistics(PortReceptionStatistics):
|
|
|
224
206
|
:type: GPrsUat
|
|
225
207
|
"""
|
|
226
208
|
|
|
227
|
-
self.macsec = MACSecRxStats(conn, module_id, port_id)
|
|
228
|
-
"""L23 port's MACsec RX statistics.
|
|
229
|
-
"""
|
|
230
209
|
|
|
231
210
|
# endregion
|
|
@@ -14,13 +14,11 @@ from xoa_driver.internals.commands import (
|
|
|
14
14
|
PT_TOTALEXT,
|
|
15
15
|
PT_NOTPLDEXT,
|
|
16
16
|
PT_STREAMEXT,
|
|
17
|
-
P_MACSEC_TX_STATS,
|
|
18
|
-
P_MACSEC_TX_CLEAR,
|
|
19
17
|
)
|
|
20
18
|
|
|
21
19
|
# region All Ports
|
|
22
20
|
|
|
23
|
-
class
|
|
21
|
+
class PortTxStats:
|
|
24
22
|
"""L23 port TX statistics"""
|
|
25
23
|
|
|
26
24
|
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
@@ -101,31 +99,13 @@ class PortTransmissionStatistics:
|
|
|
101
99
|
|
|
102
100
|
# region Genuine Ports
|
|
103
101
|
|
|
104
|
-
class MACSecTxStats:
|
|
105
|
-
"""MACSec TX SC Statistics"""
|
|
106
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
107
|
-
|
|
108
|
-
self.total = P_MACSEC_TX_STATS(conn, module_id, port_id)
|
|
109
|
-
"""Port's total MACsec TX statistics
|
|
110
|
-
|
|
111
|
-
:type: P_MACSEC_TX_STATS
|
|
112
|
-
"""
|
|
113
102
|
|
|
114
|
-
self.clear = P_MACSEC_TX_CLEAR(conn, module_id, port_id)
|
|
115
|
-
"""Clear Port's MACsec TX statistics
|
|
116
103
|
|
|
117
|
-
|
|
118
|
-
"""
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
class GenuinePortTransmissionStatistics(PortTransmissionStatistics):
|
|
104
|
+
class GenuinePortTransmissionStatistics(PortTxStats):
|
|
122
105
|
"""L23 port RX statistics."""
|
|
123
106
|
|
|
124
107
|
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
125
108
|
super().__init__(conn, module_id, port_id)
|
|
126
109
|
|
|
127
|
-
self.macsec = MACSecTxStats(conn, module_id, port_id)
|
|
128
|
-
"""L23 port's MACsec TX statistics.
|
|
129
|
-
"""
|
|
130
110
|
|
|
131
111
|
# endregion
|