Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EEPROM "application advertisement" cannot display customized information #480

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions sonic_platform_base/sonic_xcvr/api/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2033,7 +2033,7 @@ def get_application_advertisement(self):

key = "{}_{}".format(consts.HOST_ELECTRICAL_INTERFACE, app)
val = dic.get(key)
if val in [None, 'Unknown', 'Undefined']:
if val in [None, 'End', 'Undefined']:
continue
buf['host_electrical_interface_id'] = val

Expand All @@ -2042,7 +2042,7 @@ def get_application_advertisement(self):
continue
key = "{}_{}".format(prefix, app)
val = dic.get(key)
if val in [None, 'Unknown']:
if val in [None]:
continue
buf['module_media_interface_id'] = val

Expand Down
22 changes: 21 additions & 1 deletion sonic_platform_base/sonic_xcvr/codes/public/sff8024.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,13 @@ class Sff8024(XcvrCodes):
80: '400GAUI-4-L C2M (Annex 120G)',
81: '800G S C2M (placeholder)',
82: '800G L C2M (placeholder)',
83: 'OTL4.2'
83: 'OTL4.2',
255: 'End'
}

for i in range(192,255):
HOST_ELECTRICAL_INTERFACE[i] = 'Vendor specific: {}'.format(i)

# MMF media interface IDs
NM_850_MEDIA_INTERFACE = {
0: 'Undefined',
Expand Down Expand Up @@ -307,6 +311,9 @@ class Sff8024(XcvrCodes):
32: '800G-VR8 (Placeholder)'
}

for i in range(192,256):
NM_850_MEDIA_INTERFACE[i] = 'Vendor specific: {}'.format(i)

# SMF media interface IDs
SM_MEDIA_INTERFACE = {
0: 'Undefined',
Expand Down Expand Up @@ -390,13 +397,20 @@ class Sff8024(XcvrCodes):
87: '800GBASE-DR8-2 (placeholder)'
}

for i in range(192,256):
SM_MEDIA_INTERFACE[i] = 'Vendor specific: {}'.format(i)

# Passive and Linear Active Copper Cable and Passive Loopback media interface codes
PASSIVE_COPPER_MEDIA_INTERFACE = {
0: 'Undefined',
1: 'Copper cable',
2: 'Passive Loopback module',
191: 'Passive Loopback module'
}

for i in range(192,256):
PASSIVE_COPPER_MEDIA_INTERFACE[i] = 'Vendor specific: {}'.format(i)

# Limiting and Retimed Active Cable assembly and Active Loopback media interface codes
ACTIVE_CABLE_MEDIA_INTERFACE = {
0: 'Undefined',
Expand All @@ -407,6 +421,9 @@ class Sff8024(XcvrCodes):
191: 'Active Loopback module'
}

for i in range(192,256):
ACTIVE_CABLE_MEDIA_INTERFACE[i] = 'Vendor specific: {}'.format(i)

# BASE-T media interface codes
BASE_T_MEDIA_INTERFACE = {
0: 'Undefined',
Expand All @@ -419,4 +436,7 @@ class Sff8024(XcvrCodes):
7: '50GBASE-T (Placeholder)'
}

for i in range(192,256):
BASE_T_MEDIA_INTERFACE[i] = 'Vendor specific: {}'.format(i)

# TODO: Add other codes
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_xcvr/fields/xcvr_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def decode(self, raw_data, **decoded_deps):
if mask is not None:
code &= mask
code >>= self.start_bitpos
return self.code_dict.get(code, "Unknown")
return self.code_dict.get(code, "Unknown: {}".format(code))

class HexRegField(RegField):
"""
Expand Down
Loading