Skip to content
This repository was archived by the owner on Feb 27, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions xoa_driver/internals/commands/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,10 +1192,27 @@ class MulticastHeaderFormat(IntEnum):


class PFCMode(IntEnum):
"""Priority Flow Control (PFC) Mode"""

"""The PFC CoS value of the stream"""
ZERO = 0
"""the PFC CoS value = 0"""
ONE = 1
"""the PFC CoS value = 1"""
TWO = 2
"""the PFC CoS value = 2"""
THREE = 3
"""the PFC CoS value = 3"""
FOUR = 4
"""the PFC CoS value = 4"""
FIVE = 5
"""the PFC CoS value = 5"""
SIX = 6
"""the PFC CoS value = 6"""
SEVEN = 7
"""the PFC CoS value = 7"""
VLAN_PCP = 128
"""VLAN PCP"""
"""PFC CoS value is automatically using the outer VLAN PCP value of the stream. If the VLAN field is missing, the stream won't have a PFC CoS."""
OFF = 129
"""Remove PFC CoS value of the stream."""


class PRBSOnOff(IntEnum):
Expand Down
24 changes: 12 additions & 12 deletions xoa_driver/internals/commands/ps_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,7 @@ def set(self, hex_data: Hex) -> Token[None]:
@dataclass
class PS_PFCPRIORITY:
"""
Set and get the Priority Flow Control (PFC) mode.
Set and get the Priority Flow Control (PFC) Cos value of a stream.
"""

code: typing.ClassVar[int] = 219
Expand All @@ -2090,27 +2090,27 @@ class PS_PFCPRIORITY:
_stream_xindex: int

class GetDataAttr(ResponseBodyStruct):
pcp: PFCMode = field(XmpByte())
"""coded byte, Priority Flow Control mode."""
cos: PFCMode = field(XmpByte())
"""coded byte, the Priority Flow Control (PFC) Cos value of a stream."""

class SetDataAttr(RequestBodyStruct):
pcp: PFCMode = field(XmpByte())
"""coded byte, Priority Flow Control mode."""
cos: PFCMode = field(XmpByte())
"""coded byte, the Priority Flow Control (PFC) Cos value of a stream."""

def get(self) -> Token[GetDataAttr]:
"""Get the Priority Flow Control (PFC) mode of a stream.
"""Get the the Priority Flow Control (PFC) Cos value of a stream.

:return: the Priority Flow Control mode of the stream
:return: the Priority Flow Control (PFC) Cos value of a stream.
:rtype: PS_PFCPRIORITY.GetDataAttr
"""

return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))

def set(self, pcp: PFCMode) -> Token[None]:
"""Set the Priority Flow Control (PFC) mode of a stream.
def set(self, cos: PFCMode) -> Token[None]:
"""Set the Priority Flow Control (PFC) Cos value of a stream.

:param pcp: the Priority Flow Control mode of the stream
:type pcp: str
:param cos: the Priority Flow Control (PFC) Cos value of a stream.
:type cos: PFCMode
"""

return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], pcp=pcp))
return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], cos=cos))